I'm trying to solve this nonlinear ODE
- where q is a nonlinear function, solution of ODE;
- represents the velocity and it is equal to: ;
- tis the time:
- the over dot denotes the derivative with respect to time;
- the initial condition is
λ is a degradation parameter of function q and it is equal to:
The integral depends to the solution of ODE.
So I have written this code, but the solution is bad because there isn't degradation of q function
clcclearclose alltspan = [0 pi*5];q0 = 0;x=@(t)t.*sin(t);xdot=@(t)t.*cos(t)+sin(t);lambda = @(t,q) 1+0.01*integral(@(t)q*xdot(t),0,t,'ArrayValued',true);qdot = @(t,q) xdot(t)*(1-(abs(q)*lambda(t,q)*(0.5+0.5*sign(xdot(t)*q))));[t,q] = ode45(qdot, tspan, q0);plot(x(t),q,'LineWidth',2)
Best Answer