Solve issue with Matlab 2018b version

86 Views Asked by At

I was very successfully solving an equation numerically in Matlab R2014a with the following code

syms a T
v2=-2.3750
g=1;
b=0.0001;
e2=0.5;
k=0.2;
w=-2*cos(k);
eqn = sin(3*k+a)./sin(2*k+a)==v2-w+(g.*T.^2)+(e2.*T.^2.*sin(k)^2)./(sin(2*k+a)^2+b*T.^2*sin(k).^2);
sol = solve(eqn,a,[0 pi]);
digits(5)
solutions = vpa(subs(sol),3);
xx=subs(real(solutions),T,[0:0.1:3])

Then I switched to Matlab 2018b and this code fails to give the solutions. I have to restrict a to the range $0$ to $\pi$ and $T$ is a vector T=[0:0.1:3]. It would give 6 solutions i.e., xx will be $6\times 31$. Could someone tell me why the same working code in R2014a doesn't work in R2018b and any possible workaround? Thanks.