フィルターのクリア

Matlab cannot find solution

3 ビュー (過去 30 日間)
Xinjie Qian
Xinjie Qian 2023 年 10 月 7 日
回答済み: Walter Roberson 2023 年 10 月 7 日
Hi everyone,
I'm trying to use matlab to solve this inequality. My goal is to express r in terms of m and n. When I run my scrip there is no error but S is empty. I wonder if it means that there is no solution or it is too complicated for matlab to solve?
syms r m n
eqn = ((2*r^4-8*r^3+24*r^2-8*r+1)/(12*r^2)) > (3/(m^2*(n-1)));
S = vpasolve(eqn,r);

回答 (2 件)

Sam Chak
Sam Chak 2023 年 10 月 7 日
If the solve() function is used, then it says "Unable to find explicit soluion."
syms r m n
eqn = ((2*r^4-8*r^3+24*r^2-8*r+1)/(12*r^2)) > (3/(m^2*(n-1)));
S = solve(eqn, r);
Warning: Unable to find explicit solution. For options, see help.

Walter Roberson
Walter Roberson 2023 年 10 月 7 日
vpasolve() can only be productively used when the number of equations is the same as the number of variables, and all of the equations are equalities.
MATLAB is weak solving inequalities, so convert them to equalities
sympref('abbreviateoutput', 0)
ans = logical
1
syms r m n
syms Delta positive
eqn = ((2*r^4-8*r^3+24*r^2-8*r+1)/(12*r^2)) == (3/(m^2*(n-1))) + Delta;
S = solve(eqn, r, 'returnconditions', true)
S = struct with fields:
r: [4×1 sym] parameters: [1×0 sym] conditions: [4×1 sym]
S.r
ans = 
S.conditions
ans = 
The solutions are quartics in the "excess" -- the amount by which the left hand side is greater than the original right hand side, here expressed as the variable Delta.
The roots of a quartic can be expressed exactly as algebraic numbers. You can add the option 'maxdegree', 4 to the solve() to get the detailed solution. However, for nearly all practical purposes, the details are unreadable by humans -- if you were to flip a random sign of a term in the output, very very few people would notice or understand the implications.
The bit about S.conditions is saying that those solutions are invalid if m == 0 or n == 1 or if the root() is exactly 0. Recall that the original equation involves a division, so it is not surprising that there might be values that correspond to division by 0 and that such values would mess up the equations.

カテゴリ

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