System of Second-Order Differential Equations Part 2

asked 2023-06-14 03:31:57 +0100

Jack Zuffante gravatar image

This is one way I know of to solve a system of differential equations.

T = ode_solver()
f = lambda t, y: [y[2], y[3], -y[1] - 1, -y[0]]
T.function = f
T.ode_solve(y_0=[1, 1, 0, 0], t_span=[0, 20], num_points=1000)

Just one thing: if the -y[1]-1 and y[0] are replaced with much larger functions of y[0], y[1]. y[2], and y[3], how can I declare those functions before defining T?

edit retag flag offensive close merge delete


Actually I think I figured it out, but people can answer if they wish.

Jack Zuffante gravatar imageJack Zuffante ( 2023-06-14 06:00:23 +0100 )edit

You can post your solution as an answer.

slelievre gravatar imageslelievre ( 2023-06-14 09:14:55 +0100 )edit