# Empty sym: 0-by-1 in solving a system of equations

26 views (last 30 days)
Mahsa Babaee on 1 Nov 2021
Commented: Mahsa Babaee on 10 Nov 2021
Hi friends
I am trying to solve the following symbolic system of equations:
While are parameters. And I want to find in terms of .
I used the code as below but I faced an error as :
ans =
Empty sym: 0-by-1
My code is:
syms N1 N2 N3 M1 M2 M3 D21 D32 S1 S2 S3
eqn=[M1==1,N1*cos(0)==0, M1*sin(S1)+N1*cos(S1)==N2*cos(0), M2*sin(S2)+N2*cos(S2)==N3*cos(0), M3*sin(S3)+N3*cos(S3)==0, M1*cos(S1)-N1*sin(S1)==M2*D21*cos(0), M2*cos(S2)-N2*sin(S2)==M3*D32*cos(0)];
A=solve(eqn,[M1 M2 M3 N1 N2 N3]);
A.M1
A.M2
A.M3
A.N1
A.N2
A.N3
Could you please guide me how can I solve the problem?

Walter Roberson on 1 Nov 2021
You have 7 equations that you want to solve for 6 unknown. That is not generally possible.
solve the first 6 equations for the 6 unknown and subs() the results into the last eqn. The result will effectively be a constraint between the 5 variables.
You can solve() the constraint for any 1 variable. Solving for either D variable gives a comparatively uncomplicated result. Solving for S1 or S2 give single results that are complicated involving log and complex numbers. Solving for S3 gives two families of complicated solutions similar to the other S ones but also having 2*pi*k as a factor for integer k (so a periodic solution)
But if the D and S are inputs then the overall system has no solution unless the 7th equation happens to hold.
Mahsa Babaee on 10 Nov 2021

### Categories

Find more on Linear Algebra in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!