How to solve simultaneous Ordinary Differential Equation

조회 수: 7 (최근 30일)
Dan Mathotaarchchi
Dan Mathotaarchchi 2017년 7월 28일
답변: Torsten 2017년 7월 28일
Hi all. Can anyone help me to generate code to solve this problem. this is simultaneous first order ODE with codes . Assumptions can be made wherever necessary Thanks

채택된 답변

Torsten
Torsten 2017년 7월 28일
k1 = ...; % set constant k1
k2 = ...; % set constant k2
k3 = ...; % set constant k3
f = @(t,y)[9-k1*y(2)^2*y(1)+k2*y(1)^2 ; k3*y(2)^2+y(1)*y(2)]; % define differential equations
tspan = [0 20]; % set interval of integration
u0 = ...; % set initial condition for u
omega0 = ...; % set initial condition for Omega
y0 = [u0 ; omega0]; % set vector of initial values
[T Y] = ode45(f,tspan,y0); % call integrator
plot(t,y(:,1),'-o',t,y(:,2),'-o') % plot results
Best wishes
Torsten.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by