Solve equation system with ode45

1 visualización (últimos 30 días)
Laura Artiles
Laura Artiles el 26 de Mayo de 2022
Editada: Sam Chak el 27 de Mayo de 2022
Hello, I was wondering if you could help me.
I'm trying to solve the following equation system using ode45.
I'd need to create the function and plot it using ode45 in the interval [0,300]
This is the function:
This are the initial conditions
g=9.83;
L=67;
Omega= 2*pi/86400
phi = 49/180*pi
x = L /100;
y =0;
x' =0;
y' =0;
I don't know how to apply ode45 for this equation.
I'd gladly accept any help.
Thank you very much.

Respuestas (1)

Sam Chak
Sam Chak el 27 de Mayo de 2022
Editada: Sam Chak el 27 de Mayo de 2022
Hi Laura
First thing first, there are 4 state variables which can be defined (on a piece of paper) by
x(t) = z(1)
x'(t) = z(2)
y(t) = z(3)
y'(t) = z(4)
And then type out the 4 first-order differential equations in terms of z(1), z(2), z(3), z(4) on the RHS in MATLAB:
dzdt(1) = z(2); % this is x'
dzdt(2) = ... ; % this is x"
dzdt(3) = z(4); % this is y'
dzdt(4) = ... ; % this is y"
If you have known about the existence of ode45 solver, can you follow the examples to type out the basic code for us to run it so that you learn along the way as we troubleshoot your code?
86400 seconds is 1 day. The object in length l is making a revolution in a day on Earth (because there is g). And ϕ = 49° implies that the object is revolving at a fixed relative orientation.

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by