You have to solve the non-linear time variant differential equation:
(cos(y)+2)*y''+atan(y)*sin(0.01*t)^2+y*sin(0.5*t)=0
with initial condition as input of the function
[y(0);y'(0)]=[a,b]
and return the time 'te' when 'y' crosses zero from the negatives values to the positive values.
te=zero_crossing(a,b)
tip: use the 'Events' option in odeset to detect the crossing, stop integration and get the time 'te'. See how to use it here : http://www.mathworks.com/help/matlab/math/ode-event-location.html?searchHighlight=ballode
Additional info:
It looks like [y;y']=[a,b] would mean y(0)=a and y'(0)=b, but a first order differential equation should have one initial condition y(t0)=y0.
Thanks Tim, yes, I did a mistake in the equation, its a 2nd order.
415 Solvers
210 Solvers
Test if a Number is a Palindrome without using any String Operations
157 Solvers
103 Solvers
How long is the longest prime diagonal?
280 Solvers