Skip to main content
1-Visitor
December 16, 2011
Question

Using_Odesolve_in_For_loop

  • December 16, 2011
  • 1 reply
  • 3299 views

Hello,

I have a second order Ode with an excitation term this excitation term is a matrix function so I have to solve the ode at each coordinate (i,j).

Is it possible to include the Odesolve iside a for loop (2 for loops on i and j)?

I am attaching what I wrote in mathcad

Thank you in advance

1 reply

23-Emerald I
December 16, 2011

What should the units of xd and zd be?

I'm not sure what you're trying to do. Your variable "y" looks like time. What are the matrices xd and zd (looks like position and acceleration, but why distributed?)

Odesolve(y,500) returns a function, so Y := Odesolve(y,500) can then be evaluated at any value of y as (Y(y)=.

Several files to get you started:

1-Visitor
December 17, 2011

Thank you for the a nswer but let me explain more what I am trying to do. my external force (zd) is a matrix function (as you said distributed). I am varying the period (i increment) of the sine function and the amplitude (j increment). That's why I have a matrix function of the exitation. and I need to get a solution of the ODE for each element function of the matrix.

Hope that this explains what I want to do. So I am trying to solve the ODE in a two-for-loop fashion.

Rafik

1-Visitor
December 17, 2011

Would you have an example Valery?

Thank you..