LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control Design and simulation

Hi,

 

What Im trying to do is create a complex mathematical model in LAbview. In order to do this I have integrate a certain equation twice to get theta_dot and theta. To use the integrator VI I need to place it in a simulation loop ?

 

Let;s say I have a second order differential equation "theta_doubledot = torque + a + b"

First I need to do some calculations to obtain torque. Then I will substitue this value in to the second order diff equation to obtain theta_double_dot. Then I need to integrate to get theta_dot and theta.

Once I obtain these two values, I need to substitue these values once again and do the same calculations to obtain new torque. Then the new torque is to be substitutes in to the equation to obtain new theta_doubledot, theta_dot and theta.

 

I have tried this by creating a while loop. But I am confused over the simulation loop. Once I give in the value for theta_doubledot, i want to use the integral to obtain theta_dot and theta. Once that is obtained, I want to start the 2nd iteration of the while loop to obtain the new set of data.

 

I have attached my code here.

 

Kindly help me with this.

My objective is to do some calculations to get values equation for instance : theta_doubledot = 2*theta +torque; Once I obtained this equation, I need

0 Kudos
Message 1 of 5
(2,710 Views)
Is there anyway I could use the runge kutta method ?
0 Kudos
Message 2 of 5
(2,698 Views)

Hi Chathuri,

 

I have problems understanding your VI, but let me try my best to assist you.

 

The Integral function that you have on the block diagram takes in an array of values to be integrated. This array should be a sampled signal representing your 2nd order differential equation.

 

I see that you are looping 7 times before you get the Tot. Musc. Torque value for the calculation before the integration function. However you are only passing the last value out of the FOR loop. Is this your intention? Or do you mean to get all 7 values instead? If you mean to get all 7 values, then you should create an indexed tunnel instead.

 

If instead you mean to do a pt-by-pt integration, then you should use the Pt-by-Pt functions under the Signal Processing palette instead.

 

In order to better understand your application, perhaps you can scribble down your equations and attached a scanned copy here?

 

Regards,

Boon Chen

NI Applications Engineer

Message 3 of 5
(2,647 Views)
Download All
0 Kudos
Message 4 of 5
(2,351 Views)

can anyone help me out in running this above vi???

0 Kudos
Message 5 of 5
(2,342 Views)