solving implicit equation with 3 variables knowing 2 of them

Hi, I'm trying to solve the the equation shown in the attachment as you see it's function of three variables M,theta, and beta where lamda is 1.4, so given M and theta I would like to get the two corresponding values of beta. I have tried this:
syms beta;
M1= 5;
theta=20*pi/180;
gama=1.4;
eqn=tan(theta)==2*cot(beta)*((M1^2*sin(beta)^2-1)/M1^2*(gama+cos(2*beta)+2));
beta=solve(eqn,beta,'ReturnConditions',true);
% betadeg=beta*180/pi;
vpa(beta)
But I keep getting these errors
Error using sym>tomupad (line 1256)
Unable to convert 'struct' to 'sym'.
Error in sym (line 199)
S.s = tomupad(x);
Error in vpa (line 46)
ss = sym(s);
Error in untitled (line 8)
vpa(beta)
I would really appreciate your help. Thanks.

 Accepted Answer

Replace
vpa(beta)
with
vpa(beta.beta,3)

6 Comments

Thanks for your reply, now I get:
ans =
3.14*k - log(z1)*0.5i
I just dont understand what's z1 and k, I was expecting to get two values of beta in radians.
z1 and k are returned because you set your option in solve function as:
'ReturnConditions',true
But if I remove it this's what I get:
Warning: The solutions are parameterized by the symbols: k, z1. To include parameters and conditions in the solution, specify the 'ReturnConditions' option. > In solve>warnIfParams (line 501) In solve (line 357) In untitled (line 7) Warning: The solutions are valid under the following conditions: tan((log(z1)*1i)/2 - k*pi) ~= 0 & in(k, 'integer') & (z1 == root(z^5 + (149*z^4)/25 - z^3*(694/125 + 1639176211415221i/1125899906842624) - z^2*(694/125 - 1639176211415221i/1125899906842624) + (149*z)/25 + 1, z, 1) | z1 == root(z^5 + (149*z^4)/25 - z^3*(694/125 + 1639176211415221i/1125899906842624) - z^2*(694/125 - 1639176211415221i/1125899906842624) + (149*z)/25 + 1, z, 2) | z1 == root(z^5 + (149*z^4)/25 - z^3*(694/125 + 1639176211415221i/1125899906842624) - z^2*(694/125 - 1639176211415221i/1125899906842624) + (149*z)/25 + 1, z, 3) | z1 == root(z^5 + (149*z^4)/25 - z^3*(694/125 + 1639176211415221i/1125899906842624) - z^2*(694/125 - 1639176211415221i/1125899906842624) + (149*z)/25 + 1, z, 4) | z1 == root(z^5 + (149*z^4)/25 - z^3*(694/125 + 1639176211415221i/1125899906842624) - z^2*(694/125 - 1639176211415221i/1125899906842624) + (149*z)/25 + 1, z, 5)). To include parameters and conditions in the solution, specify the 'ReturnConditions' option. > In solve>warnIfParams (line 508) In solve (line 357) In untitled (line 7) Struct contents reference from a non-struct array object.
Error in sym/subsref (line 841) R_tilde = builtin('subsref',L_tilde,Idx);
Error in untitled (line 9) vpa(beta.beta,3)
Then your equation is too complex to be solved by Symbolic Engine.
Is there any other way you recommend to solve it ?
Try to implement it in MuPaD.

Sign in to comment.

More Answers (0)

Asked:

on 28 Mar 2018

Commented:

on 28 Mar 2018

Community Treasure Hunt

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

Start Hunting!