hexagon logo

How to compute the frequency in subroutine at each time step during the simulation ?

Dear All,
 
I am working on subroutine where I have to apply the frequency dependent force during the simulation.
 
I wonder, how can I find the frequency during simulation at each time step.
 
I thought to save the data for previous time step and then do the calculation at current time step but not able to find any solution.
 
So, is that possible to compute the frequency from displacement and velocity at each time step ?
 
Any lead towards this problem will be very helpful.
 
Thanks & Regards,
Darshan
 
 
Parents
  • Yes, you can collect and store data from previous time steps.
    Either create a new state variable using the DELAY run-time function. Then your subroutine can get the data from that variable using the SYSFNC call as long as the ID of that variable is passed as a parameter to the subroutine.
    An alternative is to use a SENSUB (or REQSUB) that collects the data and stores them in a common block (Fortran) or global variable (C). Difference is that REQSUBS are only called at output steps while SENSUBS are called at every converged integration step.
     
    But how you would get the frequency from that I don't understand. Unless you know that the motion of the force is a single, clear sine wave, without noise, disturbances, overtones you will have a hard time getting the instantaneous frequency of the excitation of the force element.
Reply
  • Yes, you can collect and store data from previous time steps.
    Either create a new state variable using the DELAY run-time function. Then your subroutine can get the data from that variable using the SYSFNC call as long as the ID of that variable is passed as a parameter to the subroutine.
    An alternative is to use a SENSUB (or REQSUB) that collects the data and stores them in a common block (Fortran) or global variable (C). Difference is that REQSUBS are only called at output steps while SENSUBS are called at every converged integration step.
     
    But how you would get the frequency from that I don't understand. Unless you know that the motion of the force is a single, clear sine wave, without noise, disturbances, overtones you will have a hard time getting the instantaneous frequency of the excitation of the force element.
Children
No Data