how can I use parameter instead of equation in dsolve
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
frank
am 27 Apr. 2012
Kommentiert: Luan Trinh
am 26 Nov. 2014
Hi
I want to solve an ordinary differential symbolic equation with dsolve. But I want to save my equation in a parameter and use this parameter in dsolve. My codes are coming below:
clear all
syms a x
l=a*x;
dsolve('Dx=l')
these codes don't work. What should I do?
Thanks a lot
0 Kommentare
Akzeptierte Antwort
Kai Gehrs
am 27 Apr. 2012
Hi Frank,
you can try something like
clear all; syms a x; l=a*x; dsolve(['Dx= ' char(l)])
The point is that variables/parameters inside a string cannot be "evaluated". But as the example suggests you can use the command CHAR to convert a symbolic expression to a character string and use the brackets to concatenate strings appropriately.
Hope this helps and best regards,
-- Kai
Weitere Antworten (1)
Walter Roberson
am 27 Apr. 2012
dsolve( subs(sym('Dx=l')) )
4 Kommentare
Luan Trinh
am 26 Nov. 2014
Hi everyone,
I want to know how to solve some ODEs like this: clear all; syms a x; l=a*x; dsolve(['D2x*' char(l)+ 'Dx*x' == 0])
Could you help me?
Siehe auch
Kategorien
Mehr zu Equation Solving finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!