Solving symbolic Matlab equation in term of two variables (x/Va)

11 views (last 30 days)
Guys/Girls any input will be great. I'm so stuck been spinning my wheels for hours. so.. here is what I got
All i want to do is solve this equation symbolically, for x/va. (the transfer function) so I want matlab to spit out the answer x/Va = blah blah blah. but I'll I get is weird matrices or errors. Honestly any help is appreciated. Thanks again.

Accepted Answer

Walter Roberson
Walter Roberson on 8 Oct 2017
Edited: Walter Roberson on 8 Oct 2017
syms s J B x K kt Va ke Ra La
La = 0;
eqn = (J*(s^2)*x)+ (B*s*x)+ (K*x)== kt*((Va)-(ke*s*x)/(Ra+(La*s)));
syms F
eqn1 = subs(eqn, x, F*Va);
x/Va == simplify( solve(eqn1, F) )
  6 Comments
Walter Roberson
Walter Roberson on 8 Oct 2017
You want F = x/Va . Multiply through by Va, to get F*Va = x. Substitute that F*Va for x in the formula, which gets rid of all of the x in the formula and puts in the new variable F instead, where we know that F = x/Va because that is how we built F. Solve for the variable F, to get something that is implicitly of the form F = SomeSolution. Now expand back F on the left side because that is what you expect to see, so now you have x/Va = SomeSolution
MATLAB cannot solve() for expressions, only for variables, so this is a very common mathematical trick, to take an existing variable that is involved with the formula you want to solve with respect to, and substitute for that variable an expression in a new variable that is the inverse. It is a "change of variables"
Mitch Ott
Mitch Ott on 8 Oct 2017
Walter, John, thank you so much. I appreciate you taking the time to help.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!