How to solve spring-mass ODE in rotating frame (without symbolic toolbox)
2 views (last 30 days)
I am trying to solve the ODE of a spring & mass in the rotating frame.
The equations of motion are as follows:
mx'' = -kx + 2my'w + m(x + e)w^2
my'' = -ky - 2mx'w + myw^2
here the "eccentric mass" is aligned with the x axis.
Given a set of initial conditions - what tool can i use in MATLAB to solve for x(t), y(t)?
Any help would be greatly appreciated!!!
Steven Lord on 31 May 2018
Start off trying the ode45 function. Use the "Solve Nonstiff Equation" and "ODE with Time-Dependent Terms" examples on that documentation page as a model for writing your own ODE function and pass a function handle to that ODE function into ode45 as the first input argument.
If ode45 doesn't work or takes too long, try a stiffer solver from the table in the Basic Solver Selection section on this documentation page.