Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Sathya Narayanan

Posts: 2
Registered: 7/8/12
intermediate derivative values for ode15s
Posted: Jul 8, 2012 3:05 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.
My code reads as below:

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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2013. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.