フィルターのクリア

Return a specific solution vpasolve

2 ビュー (過去 30 日間)
Brian Robinson
Brian Robinson 2020 年 5 月 1 日
編集済み: Ameer Hamza 2020 年 5 月 1 日
Hello there,
For the following code:
Q = 4.3; s_0 = 0.003; n = 0.025; L = 30; k_e = 0.5; C_D = 0.65; H = 3.6; g = 9.81;
syms D deltaH
A = pi*D^2/4;
V = Q/A
R_H = D/4;
eqn1 = deltaH == H - D + L*s_0
eqn2 = deltaH == (k_e + (2*g*n^2*L)/(R_H^(4/3)) + 1)*((Q^2)/(2*g*A^2))
[deltaH, D] = vpasolve(eqn1 == eqn2, [deltaH, D],3.5)
Solving this gives the wrong solution. When we graph the two equations, we can see that there are two solutions. I want to return the first solution and hence I have used the initial guess of 3.5, however vpasolve still gives the other solution.
How can I get the first solution i.e. 1<D<1.5 ?
Thanks,
Brian

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 5 月 1 日
編集済み: Ameer Hamza 2020 年 5 月 1 日
Try this
sol = vpasolve([eqn1, eqn2], [deltaH, D], [0 1.25]) % give two values for initial guess, for [delhaH D]
%^ use comma. Using == in this context is incorrect.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by