I am trying to solve these equation and dont have access to syms:
I want to get V from 1 and b from 2 for each value of P and rest are constants.
P = C^2(V0-V)/(V0-S(V0-V))^2 .... everything except V is known, P is an array from 0 to 100;
P = Q*b^2/3{exp[q(1-b^(-1/3))]-b^(2/3)}, same P is from 1-100, everything except b is known.
Thanks in advance

 採用された回答

Torsten
Torsten 2022 年 1 月 27 日
編集済み: Torsten 2022 年 1 月 27 日

1 投票

For the first equation:
Build the polynomial of degree 3 in V with pencil and paper, give numerical values to S,V0,C and P and use Matlab's "roots" to solve for V.
For the second equation:
Give numerical values to all parameters except b and use "fzero" or "fsolve" to solve for b.

3 件のコメント

Rajkrishna Dutta
Rajkrishna Dutta 2022 年 1 月 27 日
編集済み: Rajkrishna Dutta 2022 年 1 月 27 日
Thank you!
  1. ok
  2. Can you please help with how to setup fsolve? I am new to this.
PS: I want to solve these for every value of P.
Torsten
Torsten 2022 年 1 月 27 日
編集済み: Torsten 2022 年 1 月 28 日
P = 1:100;
q = ...;
Q = ...;
b0 = 1.0;
for i=1:numel(P)
p = P(i);
fun = @(b)p-Q*b^2*(exp(q*(1-1/b))-b^2);
b(i) = fzero(fun,b0);
b0 = b(i);
end
P = P(b>=0);
b = b(b>=0);
b = b.^3
plot(P,b)
Rajkrishna Dutta
Rajkrishna Dutta 2022 年 1 月 27 日
Thank you, will try.

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

その他の回答 (0 件)

カテゴリ

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

質問済み:

2022 年 1 月 27 日

編集済み:

2022 年 1 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by