matlab vpasolve function not returning correct answer
Ältere Kommentare anzeigen
hi i have follow code:
clc
clear all
syms yn
b=3;
m=1;
S=0.001;
n=0.014;
Q=28;
A=(b+m*yn)*yn;
T=b+2*m*yn;
P=b+2*yn*sqrt(1+m^2);
R=A/P;
D=A/T;
Eq=Q==(A/n)*S^(0.5)*R^(2/3);
yn=vpasolve(Eq,yn)
matlb give me "yn=- 4.2710 + 2.1157*i " as a Mixed number but the true answer is "yn=2.128"
Why does Matlab say this answer?
Akzeptierte Antwort
Weitere Antworten (1)
Torsten
am 25 Jan. 2018
Use
Eq=Q==(A/n)*S^(0.5)*(R^2)^(1/3);
instead of
Eq=Q==(A/n)*S^(0.5)*R^(2/3);
Best wishes
Torsten.
5 Kommentare
mohamad khazaeezade
am 25 Jan. 2018
mohamad khazaeezade
am 25 Jan. 2018
Torsten
am 25 Jan. 2018
And what comes out if you use the other form of the equation ?
mohamad khazaeezade
am 25 Jan. 2018
Torsten
am 25 Jan. 2018
-5.31 is a solution of your equation, but not the one you are looking for.
Setting an initial guess for the solution - like Birdman suggests - should help.
Or you could try to use
assume(yn>0)
Best wishes
Torsten.
Kategorien
Mehr zu Special Values finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!