How to simply rearrange a symbolic equation to get an expression for one variable in terms of others
37 views (last 30 days)
Show older comments
Commented: Bill Tubbs on 29 Jan 2023
I'm building differential equations symbolically and ran into an error when doing a simple re-arranging of an equation.
For example, I am able to rearrange an equation with a symbolic variable x:
syms x a
eqn1 = x == a + x/2;
% Re-arrange to get an expression for x
But when x(t) is time-varying, solve does something else:
syms x(t) a
eqn1 = x(t) == a + x(t)/2;
% Re-arrange to get an expression for x(t)
Warning: Unable to find explicit solution. For options, see help.
> In sym/solve (line 317)
struct with fields:
a: [0×1 sym]
t: [0×1 sym]
I'm not sure what it's trying to do. All I want is to re-arrange the expression!
Paul on 29 Jan 2023
More Answers (0)
Find more on Equation Solving 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!