# runge kutta method for differantial equations systems

1 visualizzazione (ultimi 30 giorni)
Beyza Taka il 9 Feb 2021
Modificato: Jan il 9 Feb 2021
How can I solve following differential equations systems and display the charts for the variables y1 and y2 as a function of time for t between 0 to 0.1 s? (with runge kutta method)
dy1/dt = (10sin(314t)-5y1-y2) / 0.01
dy2/dt = 1000y1
dp:the initial conditions are written yi(0)
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposta accettata

Jan il 9 Feb 2021
Modificato: Jan il 9 Feb 2021
y0 = [1, 2];
[T, Y] = ode45(@OdeFcn, [0, 0.1], y0);
plot(T, Y);
function dy = OdeFcn(t,y)
dy = [(10 * sin(314 * t) - 5 * y(1) - y(2)) / 0.01; ...
1000 * y(1)];
end
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Categorie

Scopri di più su Runge Kutta Methods in Help Center e File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by