0

I have a nonlinear-ODE of the second order with trigonometric functions such that I cannot formulate it depending of the second derivation. For example:

ay'' + b arctan(y'') + cy' + dy=0
y'(0)=0, y''(0)=0

Without existence of a term like arctan(y'') I could write my ode function like

function output=myodefunc(u,t){
  y(1)=u(2);
  y(2)=(-c*u(2)-d*u(1))/m;
  output=y';
}

Unfortunately the nonlinear term of the second order (=> b*arctan(y'') ) makes me unable to write the ode in dependence of y'' .

Is there any way to solve such a trigonometric ode numerically in Matlab?

Caniko
  • 867
  • 2
  • 11
  • 28
  • Are there any boundary conditions? Did you [consult Google](http://goo.gl/uIXkmm) regarding your problem first? – Eitan T Sep 16 '13 at 09:01
  • Yes of course I did. I could handle this problem with symbolic toolbox but even not numerically. I can not bring it in the y''(y,y') form so that I can use an ode solver. So I asked it here how to. I don't know what I did wrong to get a downvote..Please consult me – Caniko Sep 16 '13 at 11:11
  • You might find [this blog post](http://blogs.mathworks.com/loren/2013/06/10/from-symbolic-differential-equations-to-their-numeric-solution/) helpful. – horchler Sep 16 '13 at 22:00
  • I unfortunately didn't. So I edit my question and define my problem more precise. – Caniko Sep 17 '13 at 08:55

1 Answers1

0

One can evaluate the y'' with a nonlinear solver (fsolve), within the ode function:

function output=myodefunc(u,t){
  y(1)=u(2);
  x0=0;
  x=fsolve('a*x + b*atan(x) + c*u(2) + d*u(1)',x0);
  y(2)=x;
  output=y';
}
Caniko
  • 867
  • 2
  • 11
  • 28