solve quadratic equation with matrix input variable
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Torsten
2022-6-29
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Quadratic Programming and Cone Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!