The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to get second derivatives using ode45
Replies: 4   Last Post: Apr 30, 2013 11:15 AM

Advanced Search

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

Posts: 1,717
Registered: 11/8/10
Re: How to get second derivatives using ode45
Posted: Apr 30, 2013 10:06 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"stanley ontario" wrote in message <kloi4k$8u3$>...
> Hello!
> I am stuck in solving a problem with ode45. I would like to get the second derivatives in order to plot the acceleration and to calculate some other values.
> However I only get the velocity and position.
> It looks like this:
> options= odeset('RelTol',1e-3,'AbsTol',1e-6);
> [t_vec,Y]=ode45(@(t,y) vib_equ(t,y,c_s_f,c_s_r,v_val,F_d_val,m_c,I_g_c,l,l_f,l_r,u_f,u_f_dot,v,L,i_d),[0 t_max], zeros(1,4), options);
> z_cf= Y(:,1);
> z_cf_dot= Y(:,2);
> z_cr= Y(:,3);
> z_cr_dot= Y(:,2);
> I would like to use the function vib_equ to get both z_cf_ddot and z_cr_ddot but I cannot figure it out, maybe there is another way, much easier but I really don't know.

vib_equ returns the first and second derivative of Y(:,1) in dy(1) and dy(2) as well as the first and second derivative of Y(:,3) in dy(3) and dy(4). So what's the problem ?

Best wishes

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.