Using solve and saving answers to use again
Afficher commentaires plus anciens
Hi again, Im trying to solve a quartic equation, and save the answers in a way that i can use the variables again. So far ive got :
clear
g=9.81;
h=10;
u=1.5;
syms a b c d
a=u./sqrt(g.*h)
h=10;
d=0.5;
c=0.5;
b=solve(((a^(2)*b^4)/2)+2*c*a^(2)*b^(3)-(2-2*d+a^(2))*b^(2)-(4*c+2*c*a^(2)-4)*b+((a^(2)/2)+4*c-2*c^(2)*d-2),b,'MaxDegree',3)
Which yeilds me the response:
a =
0.1514
b =
7.1555540396380393239417370831804
1.993753283660616260599428304438
0.12926899451597696747749296398951
-11.278576317814632552018658351608
Great - however i want to save these answers as something i can use after for more calculations, im only interested in answers where b>1. This is the equation i want to use these variables in next:
e=(2(b+c)-((b-1)^3/(d*b(b-c))))/(4+(b^2-1)/(c*b))
Thanks
Réponses (1)
Star Strider
le 3 Mar 2014
Modifié(e) : Star Strider
le 3 Mar 2014
I also suggest you vectorise your equation to:
e=(2*(b+c)-((b-1).^3./(d.*b.*(b-c))))./(4+(b.^2-1)./(c.*b))
Catégories
En savoir plus sur Mathematics dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!