Question: Solve the system of differential equations using the Laplace Transform. { dy 1 = - 0 . 3 1 8 6 0 8 9 2

Solve the system of differential equations using the Laplace Transform. {dy1=-0.3186089264*y2+0.007133565939*y1-1.232409966; dy2=-0.3491081494*y1-0.9708343724*y2-1.020199009}
If relevant, I offer you the following information. Python code used to solve the system of equations using the Runge-Kutta method of order 4:
import numpy as np
import matplotlib.pyplot as plt
# Definition of the ODE system
def ode_system(t, y):
y1, y2= y
dy1=-0.3186089264*y2+0.007133565939*y1-1.232409966
dy2=-0.3491081494*y1-0.9708343724*y2-1.020199009
return [dy1, dy2]
# Implementation of the Runge-Kutta method of order 4
def runge_kutta_4(func, y0, t0, tf, h):
t_values = np.arange(t0, tf + h, h) n = len(t_values) y_values = np.zeros((n, len(y0))) y_values[0]= y0 for i in range(1, n): k1= h * np.array(func(t_values[i -1], y_values[i -1])) k2= h * np.array(func( t_values[i -1]+ h /2, y_values[i -1]+ k1/2)) k3= h * np.array(func(t_values[i -1]+ h /2, y_values[i -1]+ k2/2)) k4= h * np.array(func(t_values[i -1]+ h, y_values[i -1]+ k3))
y_values[i]= y_values[i -1]+(k1+2* k2+2* k3+ k4)/6
return t_values, y_values
# Initial conditions and parameters
y0=[3.75627739,1.98468425]
t0=0
tf =20
h =0.1
# Solving the system of ODEs
t, solution = runge_kutta_4(system_ode, y0, t0, tf, h)
# Displaying the results
plt.plot(t, solution[:,0], label='y1(t)')
plt.plot(t, solution[:,1], label='y2(t)')
plt.xlabel('Time (t)')
plt.ylabel('Solutions')
plt.legend()
plt.title('Solution of the Runge-Kutta ODE System of Order 4')
plt.show()
Resulting graph (image) Solucin del Sistema de EDOs con Runge-Kutta de Orden 4
Solve the system of differential equations using

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!