solve systems of symbolic nonlinear ordinary differential equations with replace the equations by parameters
2 次查看(过去 30 天)
显示 更早的评论
Hi
I have systems of symbolic nonlinear ordinary differential equations. Since my equations are too long, I have to save them in parameters and use these parameters in my differential equations. dsolve can't solve these equations. How can I solve these systems?
A simple example of my work is:
syms dq1 q2 t
dq1 = sym('dq1(t)');
q2 = sym('q2(t)');
l=[dq1+cos(q2),5*cos(q2)+3*dq1];
s=dsolve(['Ddq1= ' char(l(1,1))],['Dq2= ' char(l(1,2))],'q2(0)=0,dq1(0)=0');
0 个评论
回答(2 个)
Walter Roberson
2012-5-3
I am not sure why you need to use char() instead of subs() ?
l1 = l(1); l2 = l(2);
s = dsolve(subs(sym('Dq1=l1')), subs(sym('Dq2=l2')), sym('q2(0)'), sym('dq1(0)'));
6 个评论
Saurabh Das
2020-5-23
Hi Walter,
Nice to see that were following comments on the post after seven years!
I have been trying to solve a nonlinear differential equation symbolically. The below code is what I have been trying to execute. But, the final answer does not has 's' in it besides being a piecewise solution. It would be greatly appreciated if you could show me a way forward on this.
clear all
clc
syms u(s) s C n h t_c
Du = diff(u,s);
eqn = diff(u,s,3) == [(C/h)^2]*diff(u,s,1)*[(u/t_c)^(n-1)]*n;
cond1 = u(0) == 0;
cond2 = Du(0) == 0;
conds = [cond1, cond2];
sol(s) = dsolve(eqn,conds)
Walter Roberson
2020-5-24
编辑:Walter Roberson
2020-12-1
Mathematica cannot seem to get anywhere with this.
Maple can find a not-very-useful form for the main equation, but as soon as the first boundary condition is put in, it complains about division by 0.
I do not think you are going to be able to find a useful symbolic solution to this.
Kerem Bikmaz
2020-12-1
Hello guys. I have a similar quesiton just Frank asked. I need to use dsolve equation in my question but ı dont know how can ı do. Maybe you guys can help me to figure it out.
Consider the electrical circuit shown in figure with the values of inductance,
resistance, and capacitance set to L = 1/12 H, R = 7/12 W, and C = 1 F
The circuit is assumed to be open before t = 0, i.e. no current is initially flowing through the circuit (w’(0) = 0) . However, the capacitor has an initial charge of 5 V (w(0)=5).
Determine
a.
(i) the zero-input response wzi(t) of the system;
(ii) the zero-state response wzs(t) of the system; and
(iii) the overall response w(t),
b. Use matlab symbolic toolbox dsolve function to solve i,ii and iii.
when the input signal is given by x(t)=2e−tu(t)and the output w(t) is measured across capacitor C.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!