Symbolic solution of differential equation with several variables and constants
2 views (last 30 days)
Show older comments
Hey,
I want to solve a set of differential equations by symbols, but I don't succeed. Can somebody help me out with the code? This is what I have
%1. all my variables, some of them are time variables, some are constant, Matlab 2010b gave an error -
??? Error using ==> syms at 61 Not a valid variable name.
syms h(t) l(t) rho ohm(t) A(t) Qin Cin Qout(t) Cout(t) alpha mu P(t) A(t) Rm
%2. My equations
%f1
h=f(L, rho, omega, A, Qin, Qout, Cin, Cout) + f(L,rho,ohm)*dh/dt
%f2
h=f(alpha, rho, mu, P, A, Qout, Rm)
%3. symbolic solver - I want Matlab to eliminate h from the two equations, and to write the equation in function of Qout; then I want to do the same but to solve the equation to Cout
dsolve(f1,f2,Qout) %no h in the function
or
dsolve(f1,f2,Cout) %no h in the function
I tried some things, I have the sym-toolbox but I don't advance at all? Some ideas how Matlab can do this?
Thanks a lot!
2 Comments
Walter Roberson
on 6 Aug 2012
Which MATLAB version are you using? Using syms to declare a function is quite new, only a release or two old.
Star Strider
on 6 Aug 2012
i thought ‘syms’ was fairly old. What is newer than her 2010b version is the ability to declare and use the function ‘h(t)’ etc. syntax. That is new to 2012a.
Answers (0)
See Also
Categories
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!