POV-Ray : Newsgroups : povray.unofficial.patches : Simulation in MegaPov Server Time26 Jul 2021 19:34:06 EDT (-0400)
 Simulation in MegaPov (Message 1 to 6 of 6)
 From: H  Karsten Subject: Simulation in MegaPov Date: 18 Aug 2011 23:15:00 Message:
```Hi

Does anybody have an idea, how to do a simulation in MegaPov, like this?

1st gear is fixed
connection is fixed on one point in movement, not in rotation
2nd gear if fixed to another point to the connection in movement, but not in
rotation

2nd gear is rotating because of the friction with gear one.

Is this possible in MegaPov?

Best rgds,
Holger

here the animation:
http://news.povray.org/*/attachment/%3Cweb.4e4dd2f7848745aba3bfeb720%40news.povray.org%3E/simul.gif
```
 From: Le Forgeron Subject: Re: Simulation in MegaPov Date: 19 Aug 2011 01:44:43 Message: <4e4df84b\$1@news.povray.org>
```Le 19/08/2011 05:11, H. Karsten a écrit :
> Hi
>
> Does anybody have an idea, how to do a simulation in MegaPov, like this?
>
> 1st gear is fixed
> connection is fixed on one point in movement, not in rotation
> 2nd gear if fixed to another point to the connection in movement, but not in
> rotation
>
> 2nd gear is rotating because of the friction with gear one.
>
> Is this possible in MegaPov?

It is even possible on chalkboard.

The main question for the simulation: do you want iterative steps or
time-based function ?

Iterative steps means storing position and speed of each object
(presently: center of gear 2, rotating speed of gear 2) and using physic
equations (and physical pieces of data, like mass, weight, friction,
cinetic energy... ) to compute the next position and speed (for a small
elapsed time for which you use linear algebra on the acceleration to
Pro: 1. it's easy, once you get the basic equations.
Con: 1. you cannot go to time X without computing (rendering ?) all the
previous steps
2. The actual speed of the simulation is not controled by the clock
value of the command line.

time-based function: same as iterative, but you perform the integration
before hand and get directly the position & speed with time as a parameter.
Pro: 1. You have an accurate simulation, which can be slowed down or
sped up as you want (in number of frame per second)
Con: 1. The integration is not always obvious and sometime it is even
impossible (if you consider a pendulum of 4 or more parts: one central
core with 3 children pendulum of different size & weight, it can turn
2. You often need to push in the solution the initial position &
speed (so as to simplify the equation and being able to integrate),
which means any changes implies you have to start again from the very start.

How to store data from one frame from to another with povray ?

Also, notice: gears are not using friction. Interaction of Ideal gears
in fact would have a resulting strength (for action/reaction) which
would be perpendicular to the line of axis, and no friction would occurs
at the contact of teeth (in ideal gear, the teeth roll on each other,
without slipping)

--
Software is like dirt - it costs time and money to change it and move it
around.

Just because you can't see it, it doesn't weigh anything,
and you can't drill a hole in it and stick a rivet into it doesn't mean
it's free.
```
 From: clipka Subject: Re: Simulation in MegaPov Date: 19 Aug 2011 10:37:08 Message: <4e4e7514\$1@news.povray.org>
```Am 19.08.2011 05:11, schrieb H. Karsten:
> Hi
>
> Does anybody have an idea, how to do a simulation in MegaPov, like this?
>
> 1st gear is fixed
> connection is fixed on one point in movement, not in rotation
> 2nd gear if fixed to another point to the connection in movement, but not in
> rotation
>
> 2nd gear is rotating because of the friction with gear one.
>
> Is this possible in MegaPov?

It's even possible in regular POV-Ray. It's actually a quite simple
system - you don't need complex particle simulation for it.

Essentially you have a pendulum here. The fact that the swinging mass
also rotates while moving means that it will probably be slower (haven't
checked the math yet), as the free gear's inertia with respect to the
swinging motion is not only determined by its mass, but also by its
moment of inertia. That aside however, the equations will be pretty much
the same as with an ideal pendulum.
```
 From: H  Karsten Subject: Re: Simulation in MegaPov Date: 25 Aug 2011 15:40:00 Message:
```clipka <ano### [at] anonymousorg> wrote:

> It's even possible in regular POV-Ray. It's actually a quite simple
> system - you don't need complex particle simulation for it.
>
> Essentially you have a pendulum here. The fact that the swinging mass
> also rotates while moving means that it will probably be slower (haven't
> checked the math yet), as the free gear's inertia with respect to the
> swinging motion is not only determined by its mass, but also by its
> moment of inertia. That aside however, the equations will be pretty much
> the same as with an ideal pendulum.

In the case, I'm gonna use PovRay instead of Megapov, I would need to code the
simulation-process on my own.
Or do you see any other option?
```
 From: clipka Subject: Re: Simulation in MegaPov Date: 25 Aug 2011 16:02:37 Message: <4e56aa5d\$1@news.povray.org>
```Am 25.08.2011 21:38, schrieb H. Karsten:

> In the case, I'm gonna use PovRay instead of Megapov, I would need to code the
> simulation-process on my own.
> Or do you see any other option?

It's actually much less work than trying to get Megapov's physics
simulation do the job for you.

I guess the formula will boil down to something like:

RelativeLoss = const[0..1)
AbsoluteLoss = const[0..1)
Frequency = const
MaxAmplitude = const

Energy[t] = max(0, (1-RelativeLoss)^t - AbsoluteLoss*t)
Amplitude[t] = Energy[t] * MaxAmplitude * sin(t*Frequency)
```
 From: H  Karsten Subject: Re: Simulation in MegaPov Date: 26 Aug 2011 17:25:01 Message:
```clipka <ano### [at] anonymousorg> wrote:
> Am 25.08.2011 21:38, schrieb H. Karsten:
>
> > In the case, I'm gonna use PovRay instead of Megapov, I would need to code the
> > simulation-process on my own.
> > Or do you see any other option?
>
> It's actually much less work than trying to get Megapov's physics
> simulation do the job for you.
>
> I guess the formula will boil down to something like:
>
>      RelativeLoss = const[0..1)
>      AbsoluteLoss = const[0..1)
>      Frequency = const
>      MaxAmplitude = const
>
>      Energy[t] = max(0, (1-RelativeLoss)^t - AbsoluteLoss*t)
>      Amplitude[t] = Energy[t] * MaxAmplitude * sin(t*Frequency)

Ok, I'll give it a try :)
Tanx a lot!

Best rgds,
Holger
```