Using Matlab for solving symbolic equations
3 views (last 30 days)
Show older comments
Wenzel Neumann
on 14 Apr 2021
Commented: Wenzel Neumann
on 17 Apr 2021
Hi all,
Im trying to solve the following FEM equations for a cross pivot flexure mechanism in 2D. I'm just trying to get the same result for theta for verification, to later use MATLAB for other symbolic equations.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/583086/image.jpeg)
I have written the following code, which does only return an empty symbol.
close all;
clear all;
clc;
syms theta v_A v_B theta_A theta_B L S_A N_B M_A M_B M N_B S_B d E I N_A
Eq_1 = v_A == L*theta;
Eq_2 = theta_A == theta;
Eq_3 = v_B == L*theta/2;
Eq_4 = theta_B == theta/2;
Eq_5 = S_A == N_B;
Eq_6 = N_A == -S_B;
Eq_7 = M_A == -M_B + M - N_B*d*sin(theta) - S_B *d*cos(45);
Eq_8 = v_A == S_A*L^3/(3*E*I) + M_A*L^2/(2*E*I);
Eq_9 = theta_A == S_A*L^2/(2*E*I) + M_A*L/(E*I);
Eq_10 = v_B == S_B*L^3/(3*E*I) + M_B*L^2/(2*E*I);
Eq_11 = theta_B == S_B*L^2/(2*E*I) + M_B*L/(E*I);
eqns = [Eq_1 Eq_2 Eq_3 Eq_4 Eq_5 Eq_6 Eq_7 ...
Eq_8 Eq_9 Eq_10 Eq_11];
Y = solve(eqns,theta)
Does someone know how to fix this?
Thank you in advance.
Regards,
Wenzel
0 Comments
Accepted Answer
Walter Roberson
on 14 Apr 2021
you have 11 equations in about 17 variables, and you ask to solve the equations in terms of one of the variables. When you are using equalities you need to solve for the same number of variables as you have equations, with the results being in terms of the remaining variables.
You never use E apart from I so you cannot separate the two. You should replace E*I with a single variable.
Reminder: 45 is a lot of radians .
More Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox 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!