LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ODE Solver

Solved!
Go to solution

Hi everyone,

 

I am trying to simulate the set of ODE in LabVIEW using ODE solver VI. I am not getting the correct results for some unknown reason. 

I have attached my VI with equations saved as a default value. However the curve should look like the one attached. 

 

The ODE are correct and same set of equations are tested on other tools which produces the correct results (see the graphical image attached).

 

Please let me know what could be the possible issues.

 

Thank you.

 

Regards

HB

Download All
0 Kudos
Message 1 of 15
(4,895 Views)

You are missing your VI "ODE Substitute Parameters.vi". Please attach to your document...

 

You can try to reduce the sampling time or change the solver from RK1 to RK 4 or RK 23. This sometimes helps...

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 2 of 15
(4,849 Views)

Hi Barp,

 

Thanks for your reply. I tried but it didn't help. Please find missing VI attached in this post. Sorry for the inconvenience. 

 

Regards

Hasan

0 Kudos
Message 3 of 15
(4,844 Views)

Your problem is with your simulation parameters cluster. The order of the controls in your cluster is different than the typedef cluster input control to ODE Solver.vi. Try creating a fresh copy of this control and repopulate with your specific parameters.

-Jim

0 Kudos
Message 4 of 15
(4,835 Views)

Hi Jim,

 

Thanks for your reply. 
Only the arrangement of controls are different else the order is same for all the controls in a cluster and the Cluster typedef input control to Simulation Parameters.

 

To verify, I tried to create a control by deleting the current one and creating a new cluster control by right clicking at the "Simulation Parameters" input port of ODE Solver.vi. This creates the default typedef cluster control, but that didn't change the results.

 

Please let me know if I miss something. 

 

Thank you.

Regards

Hasan

0 Kudos
Message 5 of 15
(4,822 Views)

What version of LabVIEW are you using?

0 Kudos
Message 6 of 15
(4,789 Views)

LabVIEW Professional Development System 2014

 

Regards

Hasan

0 Kudos
Message 7 of 15
(4,786 Views)

Here is your original cluster with the 'reorder controls in cluster' interface showing the cluster order.

original cluster order.png

 

I disconnected the control from the ODESolver.vi, right click->create control. Then open the typedef and show the cluster order.

 

typedef cluster order.png

 

If I reproduce your cluster settings in the default cluster and run the VI, then the graphs seem to show valid results. Running with your cluster causes ODE Solver.vi to report an error.

Attached is your VI with these changes.

 

-Jim

 

0 Kudos
Message 8 of 15
(4,767 Views)

Hi Jim, 

 

Thanks for your reply.

 

Unfortunately the VI you have given me is not producing any results "on my system" with the control you connected to ODE Solver.vi. However, it is working fine with the previous control. It generates an error -2329 Simulation Parameters: Step Size.

 

Could you please comment on what could be the problem? Why is it not producing any results on my system while it works fine on yours? 

 

The screen shots are also attached.

 

Regards

Hasan

0 Kudos
Message 9 of 15
(4,759 Views)

Not really sure what the difference is. I checked versions back to Labview 2009, but the cluster is the same as the one I have for each version.

Is your cluster a typedef?

 

That aside, could you share the code that produced the graph in your original post? What environment/package did you use? I am producing the same graph you are, even after changing the solver to a variable step size. That indicates to me that the ODE is well conditioned.

 

-Jim

0 Kudos
Message 10 of 15
(4,719 Views)