Problems in Solving 2 equations 2 unknowns
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi all,
I have this problem when trying to solve simultaneous equation below.
The error was: Warning: Cannot find explicit solution.
I try to approximate the equations using taylor, but they could not be approximated. Is there any way I could get the answers without having complex numbers in it? Or there are no solutions in it.
Thank you.
syms x y
eq1=(1+(x*100)^y)^((1-y)/y)
eq2=(1+(x*1000)^y)^((1-y)/y)
[x y]=solve(eq1==0.022,...
eq2==0.42, [x y])
댓글 수: 0
채택된 답변
John D'Errico
2018년 11월 15일
편집: John D'Errico
2018년 11월 15일
Sorry, but I have to laugh. Surely you cannot expect an analytical solution to this? Of course solve gives up.
Does any solution exist? That is not at all obvious at first sight. SO PLOT IT!
fimplicit(eq1-0.022)
hold on
fimplicit(eq2-0.42)
The solution will be where the green and blue curves cross.
Yeah, I know, I don't see any solution either. Maybe there is something for very small x, and negative y.
fimplicit(eq1-0.022,[0 .1 -10 0])
hold on
fimplicit(eq2-0.42,[0 .1 -10 0])
Ok, it looks like something may work, so if Itighten up the limits on xand y, we see this:
fimplicit(eq1-0.022,[0 .01 -2 0])
hold on
fimplicit(eq2-0.42,[0 .01 -2 0])
grid on
Now given a set of quite good starting values, we can push this into vpasolve and have half a chance.
Sol = vpasolve(eq1-0.022,eq2-0.42,x,y,[0.002 -1])
Sol =
struct with fields:
x: [1×1 sym]
y: [1×1 sym]
Sol.x
ans =
0.0017756858548836667192558390739205
Sol.y
ans =
-1.030913284117245909755343678601
Whether a solution with negative y makes any physical sense, only you know that.
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!