LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

solve diff equation

Solved!
Go to solution

Hello to all ... I wonder if I can solve a difference equation with shift registers ... I tried the kutta VI runge ... it works perfectly but I want to implement my code on FPGA ... The problem is that the runge kutta VI doesn't work on the FPGA so I want to solve these equations with shift registers to be able to implement them. 

The first code is done with Rungr Kutta. 

The second one is my attempt to solve with Euler's method (shift registers) (i want all the eterations in an array), but it doesn't work at all. 

Can someone help me?

 

ps : equation are attached to front panel 

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

At this point, you should go back to the tutorials and improve your general LabVIEW skills first.

 

altenbach_0-1650298024602.png

 

When attaching code that "works" (according to your statements), you should make sure that all controls contain typical default values (x=0 and x0="empty array" are not reasonable). What are typical values? Why are you using a chart instead of a graph?

 

 

Same code, cleaned up:

 

altenbach_1-1650298559260.png

 

 

0 Kudos
Message 2 of 15
(1,470 Views)

the x0 values are all  0.001 and the code works and the 3d graph shows the lorenz system 

21.png

the problem is in the second subvi atteched to my question

 

0 Kudos
Message 3 of 15
(1,455 Views)

You are still not telling us what the value of the x control is? (and why are you not labeling it as "time end" to keep us all sane???)

 

 

Looking at your FOR loop, it almost seems like you randomly wired things together. No resemblance to your original formulas.

0 Kudos
Message 4 of 15
(1,450 Views)

sorry  i forgot it ...the x will be a const equal to 100 

0 Kudos
Message 5 of 15
(1,439 Views)
Solution
Accepted by neo0x

Seems to work just fine once you correct all the glaring math errors in your FOR loop.

 

altenbach_0-1650302618081.png

 

0 Kudos
Message 6 of 15
(1,428 Views)

Also note that using arrays typically simplifies things dramatically (you could even use an IPE, but I doubt the compiler would notice a difference 😉 )

 

altenbach_0-1650306841852.png

 

0 Kudos
Message 7 of 15
(1,418 Views)

thinks for your help but i copied the code but the 3d graph dosen't appear i don't know why ! can you post the program so i can try it ?

0 Kudos
Message 8 of 15
(1,393 Views)

@neo0x wrote:

thinks for your help but i copied the code but the 3d graph dosen't appear i don't know why !


We don't know either because we cannot tell if you copied it correctly or made a mistake.

I posted two versions. Which one did you copy?

Show us what you did! Is the 2D array showing the correct values?

Is the blue zero really wired to the lower index of the two choices?

0 Kudos
Message 9 of 15
(1,387 Views)

this what i have copied

Download All
0 Kudos
Message 10 of 15
(1,376 Views)