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));

采纳的回答

Torsten
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
p = 1×40
315.8861 313.7674 311.5960 309.3695 307.0851 304.7401 302.3313 299.8554 297.3087 294.6875 291.9873 289.2036 286.3311 283.3644 280.2971 277.1225 273.8330 270.4200 266.8740 263.1844 259.3391 255.3241 251.1237 246.7196 242.0905 237.2113 232.0523 226.5779 220.7445 214.4985

更多回答(0 个)

类别

Help CenterFile 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!

Translated by