solve quadratic equation with matrix input variable
3 views (last 30 days)
Show older comments
I am trying to solve a 4th order quadratic equation with the input variable in matrix form, as follows:
N =2000:-50:0;
eqn=((((1.3+(((17.5).*P)./(P+N./20))).^2)+((0.036.*P).^2)).^0.5)-18.5 ==0;
P =double(vpasolve(eqn,2));
This error message is coming:
Undefined function 'vpasolve' for input arguments of type 'double'.
Error in code (line 24)
P =double (vpasolve(eqn,2));
0 Comments
Accepted Answer
Torsten
on 29 Jun 2022
syms P
N =2000:-50:50;
guess = 2;
for i=1:numel(N)
n = N(i);
eqn=((((1.3+(((17.5).*P)./(P+n./20))).^2)+((0.036.*P).^2)).^0.5)-18.5 ==0;
sol = vpasolve(eqn,guess);
p(i) =double(sol);
guess = p(i);
end
p
More Answers (0)
See Also
Categories
Find more on Quadratic Programming and Cone Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!