Solutions are only valid under certain conditions

조회 수: 171 (최근 30일)
Tiku
Tiku 2021년 5월 13일
댓글: Tiku 2021년 5월 14일
Hi,
I am trying to solve for g in terms of y and z and I believe the solve command should give me four roots in terms of y and z.
But the warning says
Warning: Solutions are only valid under certain conditions. To include parameters and conditions in the solution, specify the 'ReturnConditions' value as 'true'.
I tried to use 'ReturnConditions' value as 'true' but didn't work out.
Can someone please help me, shouldn't be a big issue I guess in the above problem?
My code is
%solving fourth order algebraic equation to get g
syms x n g y z
x = 0.0585;
n = 0;
solve(1/g-sqrt(1 + z.^2/((2*n+1)*pi*y + 4.4*pi*x*g).^2) == 0, g);
g

채택된 답변

Walter Roberson
Walter Roberson 2021년 5월 13일
편집: Walter Roberson 2021년 5월 13일
You can get four solutions. However, the solutions will be effectively useless, and the conditions under which they apply will be unreadable.
%solving fourth order algebraic equation to get g
syms g y z
x = 0.0585;
n = 0;
Pi = sym(pi);
eqn = 1/g-sqrt(1 + z.^2/((2*n+1)*Pi*y + 4.4*Pi*x*g).^2) == 0;
sol = solve(eqn, g, 'returnconditions', true, 'maxdegree', 4);
G = simplify(sol.g)
C = simplify(sol.conditions)
Furthermore...
solve() is for finding indefinitely precise solutions. However, your input value 0.0585 is not indefinitely precise, instead representing some value between 5845/100000 (inclusive) and 5855/100000 (exclusive). It does not make logical sense to ask for exact solutions when some of the inputs are known precisely known. There are y, z values for which this makes a difference. Quartics can be very sensitive to exact values in determining which parts are real valued or which parts are complex valued.
  댓글 수: 3
Walter Roberson
Walter Roberson 2021년 5월 13일
How does
1/g-sqrt(1 + z.^2/((2*n+1)*Pi*y + 4.4*Pi*x*g).^2) == 0;
fit in with sceq1 and sceq2 ? It uses n, but n only exists inside the symsum() .
You could potentially solve the equation over a set of four different n values, getting out x, y, z, g values, but your symsum runs to 5, and the equation cannot be consistently extended to 5 different n values.
Tiku
Tiku 2021년 5월 14일
I think I am not able to explain problem properly so I have attached pdf file detaling the process and the required equations. The equations are derived from a pubished review paper and I am trying to reproduce the plot.
Could you please have a look?
Thank you

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by