Help with non linear equations.
조회 수: 9 (최근 30일)
이전 댓글 표시

Can someone please help me solve these equations?
I tried to use fsolver but the estimates are very bad. I expect \mu to be 8, \sigma = 4 and \alpha =2.
I will be very glad if someone helps me out on how to better my estimates and improve the results.
Thank you!
댓글 수: 0
채택된 답변
Torsten
2022년 12월 7일
fun = @(x)[8.07-(x(1)-x(2)+x(2)*0.9^(-1/x(3)));11.82-(x(1)-x(2)+x(2)*0.5^(-1/x(3)));284.23-(x(1)-x(2)+x(2)*0.1^(-1/x(3)))];
x = fsolve(fun,[156 45 0.8])
fun(x)
추가 답변 (2개)
Bora Eryilmaz
2022년 12월 7일
편집: Bora Eryilmaz
2022년 12월 7일
fsolve actually finds a correct solution:
x = fsolve(@(x) fcn(x),[1;1;1])
You can see that the solution satisfies the equations (within a tolarance):
fcn(x)
Actually, your suggested values are not a solution for these equations:
fcn([8;4;2])
function F = fcn(x)
m = x(1);
s = x(2);
a = x(3);
F = [ ...
8.07 - m + s - s*(1-0.1)^(-1/a) ...
11.82 - m + s - s*(1-0.5)^(-1/a) ...
284.23 - m + s - s*(1-0.9)^(-1/a) ...
];
end
John D'Errico
2022년 12월 7일
편집: John D'Errico
2022년 12월 7일
syms mu sigma alpha
eq(1) = 8.07 == mu - sigma + sigma*(1-0.1)^(-1/alpha)
eq(2) = 11.82 == mu - sigma + sigma*(1-0.5)^(-1/alpha)
eq(3) = 284.23 == mu - sigma + sigma*(1-0.9)^(-1/alpha)
First, make the problem simpler, subtract equations 1 and 2, then 1 and 3.
eqhat(1) = eq(3) - eq(2)
eqhat(2) = eq(3) - eq(1)
And replace alpha by a, where a = -1/alpha
syms a
eqhat = subs(eqhat,alpha,-1/a)
Next, factor out sigma from each equation. We can use that to eliminate sigma also.
sig1 = solve(eqhat(1),sigma)
eqa = subs(eqhat(2),sigma,sig1)
That yields one equation, involving only a. It seems to have only one solution, but no analytical solution seems to drop out.
a = vpasolve(eqa)
and therefore we have alpha.
-1/a
which gives us sigma. At this point, mu and sigma are linear parameters.
solve(subs(eq(1),alpha,-1/a),subs(eq(2),alpha,-1/a))
Direct enough. However, the solutions you expected are not even close to what comes out. Not my fault. The mathematics won't lie.
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!






