数学模型之微分方程及其MATLAB求解.docx

上传人:牧羊曲112 文档编号:3559654 上传时间:2023-03-13 格式:DOCX 页数:2 大小:36.69KB
返回 下载 相关 举报
数学模型之微分方程及其MATLAB求解.docx_第1页
第1页 / 共2页
数学模型之微分方程及其MATLAB求解.docx_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《数学模型之微分方程及其MATLAB求解.docx》由会员分享,可在线阅读,更多相关《数学模型之微分方程及其MATLAB求解.docx(2页珍藏版)》请在三一办公上搜索。

1、数学模型之微分方程及其MATLAB求解数学模型之微分方程及其MATLAB求解 -卫星轨迹等经典例题求解分析 1. 考虑初值问题画图 y 3y y y = 0 y(0) = 0 y (0) =1 y (0) = 1 2、 3、 1. M -文件建立m函数文件 function y=f(t,x) y=x(2);x(3);9*x(3)2+x(1)*x(2); 求解微分方程,命令如下: x0=0;1;-1; t,y=ode45(mm,0,2.5,x0); plot(y(:,1),y(:,2); figure(2); plot3(y(:,1),y(:,2),y(:,3) 2、M -文件建立m函数文件 f

2、unction dx=appollo(t,x) mu=1/82.45; mustar=1-mu; r1=sqrt(x(1)+mu)2+x(3)2); r2=sqrt(x(1)-mustar)2+x(3)2); dx=x(2) 2*x(4)+x(1)-mustar*(x(1)+mu)/r13-mu*(x(1)-mustar)/r23 x(4) -2*x(2)+x(3)-mustar*x(3)/r13-mu*x(3)/r23; 求解微分方程,命令如下: x0=1.2;0;0;-1.04935751; options=odeset(reltol,1e-8); t,y=ode45(appollo,0,

3、20,x0,options); plot(y(:,1),y(:,3) title(Appollo卫星运动轨迹) xlabel(x) ylabel(y) 3、M -文件建立m函数文件 functiondy=odefun(t,x) fun=(dxy)dxy(1)*sin(x(4)+dxy(2)2+2*x(1)*x(3)-x(1)*dxy(1)*x(4) x(1)*dxy(1)*dxy(2)+cos(dxy(2)-3*x(3)*x(2); options=optimset(display,off); y=fsolve(fun,x(1,3),options);%使用fsolve求解出x和y dy=x(2);y(1);x(4);y(2);%状态变量一阶微分值 求解微分方程,命令如下: t,y=ode45(odefun,0 3,1 0 0 1); plot(t,y) legend(x,x,y,y)

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号