当前位置:网站首页>Matlab function foundation (directly abandon version)

Matlab function foundation (directly abandon version)

2022-06-26 08:32:00 Klimson

Please take the following as nonsense , What kind of rubbish matlab, The online version can only be used for money .
Differential square equation matlab
dsolve、ode A series of functions

Example code for standardization of differential equation :

function dx=odefun(t,x)
dx=zeros(2,1);
dx(1)=x(2);
dx(2)=-t*x(1)+exp(t)*x(2)+3*sin(2*t);
end
%% ode45 solve 
tspan=[3.9 4];% Solving interval 
y0=[8 2];% initial value 
[t,x]=ode45('odefun',tspan,y0);
%%  drawing 
plot(t,x(:,1),'-o',t,x(:,2),'-x')
legend('y','y''')
title('y''''=-t*y+exp(t)*y''+3*sin(2*t)')
xlabel('t')
ylabel('y')

原网站

版权声明
本文为[Klimson]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202170556240000.html