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])

采纳的回答

John D'Errico
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 个评论
czeslaw
czeslaw 2018-11-16
Hi John, thanks for it. Since I used matlab 2015, I could not use fimplicit, not sure how I get around it. Maybe I will use plot. though I got how the process went. And using vpasolve is a new thing for me as well. Thanks.
John D'Errico
John D'Errico 2018-11-16
You can also just use a contour plot, to identify that same curve.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by