Hey guys, i want to ask if ode45 can be used to solve state equation that has a sinc function in it.
My state equation is:
function dstatesdt = midterm2(t,state)
u = - (x1*(z1/z2 + 1) + 2*z1*x1^2*sinc(x2)/z2 + x2^2 + x2);
dstatesdt = [x1dot;x2dot];
And my function to solve and plot the ODE is:
function sim_ode(dstatesdt,tspan,bx1,dx1,bx2,dx2,arg)
for x1 = bx1(1):dx1:bx1(2)
for x2 = bx2(1):dx2:bx2(2)
[to,stateo] = ode45(dstatesdt,tspan,xi);
And i run this code on main script:
title('Time Series of x_1')
sim_ode(f,[0 10],[-4.5 4.5],0.5,[-4.5 4.5],0.5,1)
at first inital point [-4.5 -4.5] the codes didn't plot anything and didn't show any error and just kept running (around 5 min) so i stop it and this showed up in command prompt:
Operation terminated by user during ode45
[to,stateo] = ode45(dstatesdt,tspan,xi);
sim_ode(f,[0 10],[-4.5 4.5],0.5,[-4.5 4.5],0.5,1)
Any help would be appriciated!
Thanks!