MATLAB: Warning: Cannot solve symbolically. Returning a numeric approximation instead.

warning: cannot solve symbolically. returning a numeric approximation instead

Hello, I was trying to solve equations with solve, The code is attached. I was trying to find out the values of x
clear; clc;
syms x, l1=0.5; l2=0.5;
A=(cosh(x*l1)-cos(x*l1))/(sinh(x*l1)-sin(x*l1)); B=(0.5)*(cosh(x*l1)+ cos(x*l1)-A*(sinh(x*l1)+sin(x*l1))); C=((-1+cosh(x*l2)*cos(x*l2)-sinh(x*l2)*sin(x*l2))/(sinh(x*l2)*cos(x*l2)-cosh(x*l2)*sin(x*l2)))*B; D=((1-cos(x*l2)*cosh(x*l2)-sinh(x*l2)*sin(x*l2))/(sin(x*l2)*cosh(x*l2)-cos(x*l2)*sinh(x*l2)))*B;
SS = solve(C+D+sinh(x*l1)+sin(x*l1)-A*cosh(x*l1)+A*cos(x*l1)==0,x);

Best Answer

So, what does the warning message say? It is not an error. Merely a statement of fact.
Surely there are some equations that have no analytical solution. It is easy to write one. In fact, you did exactly that. Instead, MATLAB realized that it was still possible to find a solution using a numerical root finder (so solve then calls vpasolve). Therefore, it did so, telling you what it did. This is because a root finder will find only ONE solution. And the solution it does find may not always be the solution (if multiple solutions exist) that you want. You can control that by use of the starting value that vpasolve uses.
So go back and look at your equation. Come on. Look carefully. Do you really, honestly think an analytical solution exists? Thus, something with square roots and exponents in it, etc? Nope. Not gonna happen.