Solve equation system with ode45

1 次查看(过去 30 天)
Laura Artiles
Laura Artiles 2022-5-26
编辑: Sam Chak 2022-5-27
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.

回答(1 个)

Sam Chak
Sam Chak 2022-5-27
编辑:Sam Chak 2022-5-27
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.

类别

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