MATLAB如何解非线性微分方程组

来源:百度知道 编辑:UC知道 时间:2024/05/31 08:04:21
dx/dt=450/sqrt(1+((120-y)/(90*t-x))^2)
dy/dt=450/sqrt(1+((90*t-x)/(120-y))^2)
x(0)=0,y(0)=0

能做出来的我给他加分
运行出来的结果是什么?

function [t,x]=solv(tspan)

% argument

% tspan stands for time span

x0   =[0,0];

[t,x]=ode45(@odefun,tspan,x0);

subplot(2,1,1),plot(t,x(:,1),'-'),title('P');

subplot(2,1,2),plot(t,x(:,2),'-'),title('y');

end

function dx=odefun(t,x)

dx=zeros(2,1);

if abs(90*t-x(1))<eps

 dx(1)=0;

else

 dx(1)=450/sqrt(1+((120-x(2))/(90*t-x(1)))^2);

end

if abs(120-x(2))<eps

 dx(2)=0;

else

 dx(2)=450/sqrt(1+((90*t-x(1))/(120-x(2)))^2);

end

end 

matlab只能给出数值解,所谓数值解也就是指定有限点上的函数取值,一般没法用显式的函数表达式来描述.

将上述代码保存为solv.m,运行[t,x]=solv([0:0.01:1])便能得到[0:1]区间上函数取值.

matlab解微分方程组 如何求解常系数非线性微分方程组 matlab解复杂非线性方程组 请教用matlab解非线性方程组 MATLAB解非线性方程的问题 matlab解非线性方程组,只限定非负解 matlab解有约束的非线性优化 大虾请出手:Matlab如何解复杂的非线性方程,急!! 请问在matlab中如何进行直接非线性回归分析 非线性方程组 matlab