JacquesCarette / Drasil

Generate all the things (focusing on research software)
https://jacquescarette.github.io/Drasil
BSD 2-Clause "Simplified" License
141 stars 26 forks source link

DblPendulum Derivation Missing #2391

Closed Ant13731 closed 3 years ago

Ant13731 commented 3 years ago

Looking through the DblPendulum file, there are clear derivations for angular frequency, period of the pendulum, etc., but the derivations for the components of linear acceleration and velocity are just repeats of the equation given in GenDefs. I don't think the derivation is terribly complicated, so should I try to fill it in for the sake of completeness? On that note, is there a definition written out for velocity = angular velocity * radius? image image

smiths commented 3 years ago

@Ant13731, improving the double pendulum example is a great idea. However, you don't want to be fixing it and refactoring it at the same time. It can be difficult if you are trying to make changes to what it presents at the same time as you are changing the Drasil code on how it generates what it presents. :smile:

If you and @JacquesCarette are done with the fixes to the double pendulum example, we can look at improving the generated documentation. Are there any open issues for fixes that bring DblPendulum in-line with the previous fixes @JacquesCarette? If not, adding a derivation would be good.

The relationship between velocity and angular velocity is given by Chasles's theorom. This theorem can be found in the game physics example:

https://jacquescarette.github.io/Drasil/examples/GamePhysics/srs/GamePhysics_SRS.html#DD:chaslesThm

Ant13731 commented 3 years ago

Okay sounds good! I just finished making a rough draft for the velocity derivations, but it shouldn't break anything too much, even if we do end up changing other files. I figured that doing this would also help me get more familiar with Drasil language, so it's good practice nevertheless.

I also found that using the definition of arc length worked out decently enough for the velocity derivation, but I can always change it. (I also just pushed my work so far under the derivPendulum branch, but it's not quite done so I won't put a PR out today)

JacquesCarette commented 3 years ago

There will be more refactoring issues coming, I had not had time to put them all in. I will try to keep them all small, so that this can be done in between as well.

One of the things to keep in mind while doing this: what is generic physics, and what is specific to this example? We want to take as much generic physics out of the examples and into our code database of 'facts'.

Ant13731 commented 3 years ago

Hi @smiths, I'm a little lost in deriving the equation for acceleration (the one in the picture above). I tried looking online but I can't seem to piece it together. Is there somewhere I can find the derivation or some help starting out?

smiths commented 3 years ago

@Ant13731 the double pendulum example (which I think is currently actually only a single pendulum) is based on work that a student did in my grad class. You can find the original document here:

https://github.com/Zhang-Zhi-ZZ/CAS741Project/blob/master/Double%20Pendulum/docs/SRS/SRS.pdf

The derivations go between the Cartesian system and the polar coordinate system.

Ant13731 commented 3 years ago

Alright, I'll check it out. Thanks!