LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2nd Order Differential Problems

Hey I'm creating a second order differential solver and I'm using the differential solver VI's that come with the package. However, the solver won't do 2nd Order ODE's that are critically damped. Does anyone know what this problem is and how I can remedy it? I put a copy of my program here to show you the problem. For an example of a critically damped equation, input 4 in both "dy/dt" and "y". Thanks.
0 Kudos
Message 1 of 6
(3,378 Views)
Hi Jay,
The problem is that your 2nd Order ODE has multiple eigenvalues, and ODE's with multiple eigenvalues are not supported by the ODE Linear nth Order Numeric VI. This is explained briefly in the VI's help file documentation.
The reason that no results were generated by your VI is because an error was generated by the ODE Linear nth Order Numberic.VI (error -23017). You can detect the error if you put an indicator on the VI's error output. This error is generated when the VI tests for multiple polynomial solutions. Since your ODE has multiple solutions, it generated the error.
One possible work around for this problem is that you could put a false constant in place of the result of the multiple polynomial solution test. The attached bitmap shows an exa
mple of the work around. While the results of this solution are not guaranteed to be correct, it may be a viable option for your program.

Hope this helps!

Marcus G.
National Instruments
0 Kudos
Message 2 of 6
(3,378 Views)
Wow that looks ugly and I'm not quite sure what you did. I'll have some of my friends who are a bit more keen on LabView help me on it. I don't supposed that you could actually send me a copy of that program you wrote so I could input it in my code? Thanks you very much for your help though.
0 Kudos
Message 3 of 6
(3,378 Views)
Hey Jay,
The modification I made is not that complex, so I'll explain what I did step by step. Before I go through the process, I should offer a disclaimer.
When modifying ODE Linear nth Order Numeric VI, you may want to save a local copy for yourself. This will ensure that the shipping version of the VI is not altered. If you modify the shipping version, then leave it that way, you may run into errors when you try to use the VI in the future.
Also remember to verify the results of the critically damped case. Since the VI is not designed for ODE's with repeated eigenvalues, it's possible that you could be getting incorrect results after the modification. With that said, here's the procedure I used to modify the VI so that it runs even with repea
ted eigenvalues.

1. The modification I made was to the ODE Linear nth Order Numeric.vi. You can access the VI's code by simply double clicking on it from your VI.

2. The change I made is located in the red circle on the bitmap I sent you.

3. Look for the "Multiple Roots.vi", the gray one with a sigma in the upper left corner and some arrows and dots on it. The output of this VI is a boolean, and it is connected to a not gate.

4. Delete the wire from the output of the "Multiple Roots.vi" to the not gate.

5. Right click the input port of the not gate and create a constant.

6. Make sure that the boolean constant connected to the not gate is false.

This is what I did to ensure that the VI will run regardless of the eigenvalues. Please be aware of the issues I addressed above. Otherwise, good luck!

Marcus G.
National Instruments
0 Kudos
Message 4 of 6
(3,378 Views)
That's beautiful man. Thank you so much.
0 Kudos
Message 5 of 6
(3,378 Views)
Actually I found a little bit better of a solution(no offense). I added .00001 each dy/dx and y and it gives me the correct solution because it has such a small error.
0 Kudos
Message 6 of 6
(3,378 Views)