MATLAB求解微分方程模型

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiaohen123456/article/details/80311189

1.实验目的

了解MATLAB求解微分方程的符号解;

2.实验内容

求解非齐次线性微分方程组的初值问题

X’=*X+,X(0)=

 3.实验过程记录部分

1.定义变量x,y;

2.分别输入求解矩阵;

3.求解不定积分;

4.再求定积分,加快运行速度;

4.实验结果分析及总结

x =                                                  

      -exp(t)*(sin(2*t) - cos(2*t) + (t*sin(2*t))/2)

 (exp(t)*(4*cos(2*t) + 5*sin(2*t) + 2*t*cos(2*t)))/4

 

 

  +-                                                 -+

  |                         0                         |

  |                                                   |

  |            /                       t sin(2 t) \   |

  |   - exp(t) | sin(2 t) - cos(2 t) + ---------- |   |

  |            \                           2      /   |

  |                                                   |

  |  exp(t) (4 cos(2 t) + 5 sin(2 t) + 2 t cos(2 t))  |

  |  -----------------------------------------------  |

  |                         4                         |

  +-                                                 -+

附录

clc,clear

syms t s

a=[1,0,0;2,1,-2;3,2,1];fs=[0;0;exp(s)*cos(2*s)];

x0=[0;1;1];

tx=int(expm(a*(t-s))*fs,s);  %ÏÈÇ󲻶¨»ý·Ö

xstar=subs(tx,s,t)-subs(tx,s,0); %ÔÙÇ󶨻ý·Ö£¬ÕâÑùÔËÐÐËٶȿì

x=expm(a*t)*x0+xstar;

x=simple(x), pretty(x)


猜你喜欢

转载自blog.csdn.net/xiaohen123456/article/details/80311189