Using solve and saving answers to use again

4 ビュー (過去 30 日間)
Joshua
Joshua 2014 年 3 月 3 日
編集済み: Star Strider 2014 年 3 月 3 日
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

回答 (1 件)

Star Strider
Star Strider 2014 年 3 月 3 日
編集済み: Star Strider 2014 年 3 月 3 日
The save function might be what you want.
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))

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by