17. Using SciPy’s ODEINT solver

Questions and discussion for this lecture live here. Fire away by hitting Reply below :fire:

1 Like

HI, I’m Massimiliano.
My best compliments for your Courses. I find them great!

In this lesson, I have a problem with ODEINT. My problem is to understand how ODEINT manages the functions and give the solutions in the correct position in the list solution. Looking at the function passed in ODEINT through SystemEquation, how does ODEINT relate U1 to Y1, and so further? Otherwise, U1, U2, and U3 seem to be treated as constants. But the solution is made of 6 values.

I’m missing the point here. Thank you for any hint.
Thank you,
Massimiliano

Hi Massimiliano,

I’m not sure I fully understand your question. Please feel free to elaborate.

To recap, the systemEquations function simply returns the equations, recast as 6 first order ODEs rather than 3 second order ODEs. The position and velocity state variables are…

u1 = mass 1 position
y1 = mass 1 velocity
u2 = mass 2 position
y2 = mass 2 velocity 
u3 = mass 3 position
y3 = mass 3 velocity

With these defined, we can write (and return) the system equations (as first order ODEs).

I doubt I have answered your question - please feel free to follow up.

Seán

Hello Sean,

In the first scenario, you set the initial displacement of all masses to zero. Therefore, I was not expecting to see the effect of the transient response. On the other hand, in the free vibration case, you set the initial displacement of mass_i to max(U_i[2000::]) to demonstrate the transient response.

I assumed that the transient response is solely due to an initial displacement, and I’m unclear as to why it appears even when the initial displacement is zero. In other words, I thought that the initial displacement is equivalent to the initial potential energy of the system, which is gradually converted into heat energy and dissipated through damping. So, if the initial displacement is zero, I would expect the system to only respond to the excitation force, leading to a steady response.

Any help would be appreciated.

Thanks

Hey,
There is a fundamental point to clarify here; in the first scenario (forced vibration case), we will always see the combined influence of a transient and steady-state response. It is only in free vibration that we observe the transient response on its own.

I assumed that the transient response is solely due to an initial displacement

This is not so.

S