Problems in Solving 2 equations 2 unknowns
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
czeslaw
le 15 Nov 2018
Commenté : John D'Errico
le 16 Nov 2018
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 commentaires
Réponse acceptée
John D'Errico
le 15 Nov 2018
Modifié(e) : John D'Errico
le 15 Nov 2018
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Calculus dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!