solve systems of symbolic nonlinear ordinary differential equations with replace the equations by parameters
조회 수: 3 (최근 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!