How to solve "equation with fractional power" using Matlab??
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi all, I had the following code to solve an equation that has fractional power;
syms alpha mio B r
alpha=1;
mio=0.6;
B=2;
if alpha==1
if mio==0.6
if B==2
bast=(r/0.5).^(alpha*(mio-1));
mqam_part1=3*B*((sqrt(3)/2).^(alpha*mio));
mqam_part2=((0.5*sqrt(3)).^(-alpha))+((1.5*sqrt(3)).^(-alpha));
mqam_part3=3*(((r/0.5)).^(alpha*mio));
mqam_part4=((sqrt(3)-(r/0.5)).^-alpha);
mqam_part5=((2*sqrt(3))-(r/0.5)).^-alpha;
mqam_part6=mqam_part4+mqam_part5;
mqam_part7=2*((3-(r/0.5)).^-alpha);
mqam_part8=6*(((r/0.5)).^(alpha*mio));
mqam_part9=6*B*(2.^-alpha);
eqn_LHS=bast/(mqam_part1+mqam_part2)+(mqam_part3*
(mqam_part6+mqam_part7));
eqn_RHS=B/((mqam_part8*mqam_part6)+mqam_part9);
eqn1=eqn_LHS==eqn_RHS;
sol_positive = vpasolve(eqn1,r,[0 Inf]);
end
end
end
But, it does not work. So, How can I solve this equation??
1 Kommentar
Image Analyst
am 1 Feb. 2020
Original question by erman:
How to solve an equation that has fractional power using matlab??
Hi all, I had the following code to solve an equation that has fractional power;
syms alpha mio B r
alpha=1;
mio=0.6;
B=2;
if alpha==1
if mio==0.6
if B==2
bast=(r/0.5).^(alpha*(mio-1));
mqam_part1=3*B*((sqrt(3)/2).^(alpha*mio));
mqam_part2=((0.5*sqrt(3)).^(-alpha))+((1.5*sqrt(3)).^(-alpha));
mqam_part3=3*(((r/0.5)).^(alpha*mio));
mqam_part4=((sqrt(3)-(r/0.5)).^-alpha);
mqam_part5=((2*sqrt(3))-(r/0.5)).^-alpha;
mqam_part6=mqam_part4+mqam_part5;
mqam_part7=2*((3-(r/0.5)).^-alpha);
mqam_part8=6*(((r/0.5)).^(alpha*mio));
mqam_part9=6*B*(2.^-alpha);
eqn_LHS=bast/(mqam_part1+mqam_part2)+(mqam_part3*
(mqam_part6+mqam_part7));
eqn_RHS=B/((mqam_part8*mqam_part6)+mqam_part9);
eqn1=eqn_LHS==eqn_RHS;
sol_positive = vpasolve(eqn1,r,[0 Inf]);
end
end
end
But, it does not work. So, How can I solve this equation??
Akzeptierte Antwort
Star Strider
am 4 Mai 2018
You need to use the ellipsis ‘...’ continuation operator in this line:
eqn_LHS=bast/(mqam_part1+mqam_part2)+(mqam_part3* ...
(mqam_part6+mqam_part7));
that will then result in:
sol_positive =
1.1346820568166646985869986274402e225226918
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Function Creation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!