cancel
Showing results for 
Search instead for 
Did you mean: 

solve diff equation

SOLVED
neo0x
Member
Solved!

solve diff equation

Message contains an attachment

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 

14 REPLIES 14
altenbach
Knight of NI

Re: solve diff equation

Message contains an image

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

 

 

neo0x
Member

Re: solve diff equation

Message contains an image

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

 

altenbach
Knight of NI

Re: solve diff equation

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.

neo0x
Member

Re: solve diff equation

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

altenbach
Knight of NI
Solution

Re: solve diff equation

Message contains an image

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

 

altenbach_0-1650302618081.png

 

altenbach
Knight of NI

Re: solve diff equation

Message contains an image

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

 

neo0x
Member

Re: solve diff equation

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 ?

altenbach
Knight of NI

Re: solve diff equation


@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?

neo0x
Member

Re: solve diff equation

Message contains an attachment

this what i have copied