solve quadratic equation with matrix input variable

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 日

0 投票

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

1 件のコメント

priya
priya 2022 年 6 月 30 日
Thanks.. This is working.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangePhysics についてさらに検索

質問済み:

2022 年 6 月 29 日

コメント済み:

2022 年 6 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by