cancel
Showing results for 
Search instead for 
Did you mean: 

ODE Solver

SOLVED
Hasan-Baig
Member
Solved!

ODE Solver

Message contains an attachment

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

14 REPLIES 14
Barp
Active Participant

Re: ODE Solver

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
Hasan-Baig
Member

Re: ODE Solver

Message contains an attachment

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

DSPGuy
Active Participant

Re: ODE Solver

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

Hasan-Baig
Member

Re: ODE Solver

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

DSPGuy
Active Participant

Re: ODE Solver

What version of LabVIEW are you using?

Hasan-Baig
Member

Re: ODE Solver

LabVIEW Professional Development System 2014

 

Regards

Hasan

DSPGuy
Active Participant

Re: ODE Solver

Message contains an image Message contains an attachment

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

 

Hasan-Baig
Member

Re: ODE Solver

Message contains an attachment

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

DSPGuy
Active Participant

Re: ODE Solver

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