Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Topic: intermediate derivative values for ode15s
Replies: 3   Last Post: Jul 9, 2012 5:03 AM

 Messages: [ Previous | Next ]
 Sathya Narayanan Posts: 2 Registered: 7/8/12
intermediate derivative values for ode15s
Posted: Jul 8, 2012 3:05 AM

Hello,
I need to solve a set of differential equations and would like to get the values of the derivatives at respective timesteps along with the default integrated output.
I tried searching it in the Matlab discussion forum and found a way to use Mass matrix. I defined it as a 4x4 with zeros filling last row and column.
But i get an error saying that my index is not '1'.
Is there a workaround?
It would be really great if i could get any help.

Main:
tspan=[0:0.1:2*pi];
y0=[0 0 0];
[T,tor]=ode15s(@modified_BW_torsional,tspan,y0);
torque_2=((c_t1*(dtor(3)-dtor(2))+k_t1*(tor(3)-tor(2))+alpha_t*tor(1))/1);

where dtor is the derivative value at respective timesteps.

function dtor= modified_BW_torsional(t,tor)
k_t0=200;
tor(3)=5*sin(t);
dtor=zeros(3,1);
dtor(3)=5*cos(t);
dtor(1)=(dtor(3)-dtor(2))*(A_t-(gamma_t+beta_t*sign(dtor(3)-dtor(2))*sign(tor(1)))*abs(tor(1))^n_t);
dtor(2)=(c_t1*dtor(3)+k_t1*tor(3)-(k_t0+k_t1)*tor(2)+alpha_t*tor(1))/(c_t0+c_t1);
end

Date Subject Author
7/8/12 Sathya Narayanan
7/9/12 Torsten
7/9/12 Sathya Narayanan
7/9/12 Torsten