So, I have this explicit ODE system (named Y):
(0.5*(1.95e290*cos(sin(3.0*t))^2*cos(sin(t))*sin(3.0*t) + [...
-(0.5*(8.58e290*cos(sin(3.0*t))^2*sin(sin(t))*sin(3.0*t) + [...
-(0.5*(2.13e295*cos(sin(3.0*t))^2*cos(sin(t))^2*sin(t) + [...
in which each equation of the equations systems depends of 4 variables, which are the time "t", "theta1p(t)", "theta2p(t)" and "theta3p(t)". Now, as you can see, the equations of this system are kinda long and I need to find a way to substitute the thetaXp by a y(X) so I can use this system of equation with the ODE solver function ode45. That means that in Y above, I need to substitute:
theta1p with y(1)
theta2p with y(2)
theta3p with y(3)
So that I may be able to do:
initcond=[0 ; 0 ; 0]
I already tried doing substitutions such as
[t,y45]=ode45(@(t,y) (subs(Y,[theta1p ; theta2p ; theta3p],[y(1) ; y(2) ; y(3)])),tspan,initcond)
but it doesn't seem to work. If it's of any help, I've joined my code to this post and I identified the section where I'm stuck by a series of "HERE" that are hard to miss (it's near the end of the code)