LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

piecewise lienar function- urgently

Solved!
Go to solution

Hi,

 

i want to solve the diffrential equations with piecewise linear function. I attached a photo and VI that ı coded. In formulanode, r value hasn't changed when ı run the program but in the program a value is changing at any time while r value which is depended on a value is not changing. Thus I cant take any true output graphs. I dont know how to solve this problem. Please help me urgently.

 

Adsız.png

0 Kudos
Message 1 of 4
(3,158 Views)

Formula node uses 'dot' as decimal separator, not 'comma'. So make all numbers something like "1.5E-4' instead of '1,5e-4'.

 

Also, don't use the 'wait' function inside the Control and Simulation node. As it is, the function will called in every minor timestep, which will make the simulation literally take forever. If you need to control time, you can place that node inside a subVI and use the "SubVI Node Setup" option to obtain to define the period of calls.

 

Also, depending of the equation you have, you will have to modify the solver used. I am not sure if RK23 will be enough to solve this equation.

 

Hope this helps, 

 

 

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

Use of a comma as a number separator suggests that the Poster might be in Europe.  The interesting "foreign" characters shown on the Block Diagram's lower left corner supports this idea.

 

BS

0 Kudos
Message 3 of 4
(3,088 Views)
Solution
Accepted by topic author pasazade

Yeah... my "Google Translation" is pointing to be 'Turkish' ?!? and it has to do with Windows... 🙂

 

Anyway, it can be confusing since LV is showing the numbers as 'comma' separator, but the Formula Node requires you to use 'decimal' separator, independent of the 'decimal separator' setup on the OS.

 

Hopefully this would help him to fix this problem. 

Barp - Control, Simulation, RTT and HIL - National Instruments
0 Kudos
Message 4 of 4
(3,045 Views)