LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a circle revolution?

"Hello! If you want to represent Kepler's laws and illustrate the elliptical orbit of the Earth around the Sun using LabVIEW, 

0 Kudos
Message 1 of 9
(1,103 Views)

You would do it exactly the same as in any other programming language.

 

Just calculate the curve and display it in an xy graph. How far did you get?

0 Kudos
Message 2 of 9
(1,087 Views)

"I have already created a program that draws a circle. Now, I want to modify it to draw an ellipse, and I want the ellipse to move at a speed satisfying Kepler's laws. Additionally, I would like to represent the Sun.

0 Kudos
Message 3 of 9
(1,076 Views)

Christian:

 

His code looks very familiar, no?

 

https://forums.ni.com/t5/LabVIEW/Graphing-a-Customizable-Circle/td-p/3752271

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 4 of 9
(1,064 Views)

Hmm, that code looks very familiar... 😄 Do you fully understand what it does?

 

Since you obviously did NOT write the code you attached, it would be polite to provide a link! If you don't give a reference, people might think you wrote it and assume you are a seasoned programmer, which is obviously not true. 😮

 

So you have a 1D array of complex numbers where RE=X and IM=Y. You can calculate an array of  points for any other curve. Right?

 

All you probably need to do is replace the fixed radius with a 1D array (same # of points) calculated according to the polar form of an ellipse. Seems trivial to do, right? You already have an array of angles!

0 Kudos
Message 5 of 9
(1,063 Views)

Though the code is not 1:1, when I saw the coding style I thought of a very neat postage stamp style coder...

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 6 of 9
(1,046 Views)

It actually is 1:1, exactly what I attached in my linked message back in 2018. 😄

 

Here's a modification to draw an ellipse based on eccentricity and minor axis. (Intentionally no code attached!).

 

altenbach_0-1702658397367.png

 

 

Note that this is not the solution for the planetary motion! It is left to the student to center it an one of the foci!

0 Kudos
Message 7 of 9
(1,032 Views)

Thank you! With your advice, it seems like it will be possible to resolve the issue

0 Kudos
Message 8 of 9
(948 Views)

Of course you should add a few more features:.

 

  • Use two plots. (1) to draw the ellipse. (2) to draw the earth as moving circle.
  • animate it correctly to illustrate that the linear speed depends on the position..
  • Use a while loop so the earth continues to move along the trajectory until you stop the program.
  • etc.
0 Kudos
Message 9 of 9
(860 Views)