Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should single pendulum and double pendulum include NewDEModel? #2901

Closed
cd155 opened this issue Nov 29, 2021 · 9 comments
Closed

Should single pendulum and double pendulum include NewDEModel? #2901

cd155 opened this issue Nov 29, 2021 · 9 comments
Assignees
Labels

Comments

@cd155
Copy link
Collaborator

cd155 commented Nov 29, 2021

1. Should single pendulum include NewDEModel in its IM?

It's a little bit odd to ask this question. Should the single pendulum and double pendulum example use NewDEModel in their Instance Model?

In the single pendulum example, the IM start with Newton's second law for rotational motion,
image
then eventually reduce
image
Finally, get
image

The IM has an equation that comes from an ODE, but the equation itself is not an ODE. The single pendulum doesn't have any DEs Model in its original SRS, so I was wondering whether it should fit in NewDEModel.

2. Questions about steps in single Pendulum

I also have some trouble understanding how to get from
image
to
image

I feel there are some disconnections. Here is the whole derivation

Screen Shot 2021-11-29 at 4 26 08 PM

If you don't mind, could you explain how to get the simple harmonic motion in the highlight red box?

3. Questions about double Pendulum

I was wondering what are equations in IM, should they be
Screen Shot 2021-11-29 at 4 57 29 PM
If yes, there should be two instance models in the IM, am I right?

@smiths
Copy link
Collaborator

smiths commented Nov 29, 2021

Yes, I think all of our DEs should use New DEModel (unless I'm misunderstanding your question).

@balacij
Copy link
Collaborator

balacij commented Nov 29, 2021

That's great! And once we've converted all of them to use the new version of DE Model, we should remove the old variant (which is a great contribution to #2371 😄 ).

@cd155
Copy link
Collaborator Author

cd155 commented Nov 29, 2021

@smiths My apology, I didn't update the description before. The single pendulum example doesn't have any DEs Model in its original SRS. So I was wondering if it could fit in NewDEModel. Does the simple harmonic motion is an ODE?
I also have two questions related to pendulum examples in the post.

@smiths
Copy link
Collaborator

smiths commented Dec 1, 2021

@cd155, the single pendulum does have an ODE in it, but you are correct that none of the chunks include an ODE. I just had a look through the SRS and the ODEs come up in the derivations. This seems odd to me, but I don't think you should make a change at this time. I anticipate a reorganization of all of the examples once we move to our new approach of refining theories. (I haven't had time to start the process, but this is something that I will be looking into.)

For now, the single pendulum example shouldn't include the new DE model. This will likely change in the future.

For your question about the solution for the ODE for a simple harmonic motion, I agree that not enough detail has been provided. The solution is correct, but the details are not given. An explanation for solving simple harmonic motion is provided on-line here:

http://scipp.ucsc.edu/~haber/ph5B/sho09.pdf

You'll see at the end there is a pendulum example that shows why phi (in their general solution) is zero. (This is why we don't have phi (phase shift) in our solution.

Can you please create an issue for adding the details of the derivation to the solution to the single pendulum example?

@cd155
Copy link
Collaborator Author

cd155 commented Dec 1, 2021

No problem, the new issue be created

A follow-up question about the simple harmonic motion @smiths

Sorry if I wrong, but it seems to me the following equation is not an ODE
x(t) = A cos(ωt + φ)
This equation derived from a second-order ODE
Screenshot from 2021-12-01 12-03-01

Most other examples will have an ODE equation in their Instance Model, but not the single pendulum. An ODE solver can only solve an ODE equation, but once we simplify the simple harmonic motion to x(t) = A cos(ωt + φ), it is no longer an ODE anymore. In this case, should we use its form (contained second order ODE) in its Instance Model, rather than reforming it all the way to x(t) = A cos(ωt + φ) ?

@smiths
Copy link
Collaborator

smiths commented Dec 1, 2021

You are correct that x(t) = A cos(ωt + φ) is not an ODE. It is the solution to an ODE.

As I said above, the single pendulum document does have an ODE (the ODE that is solved to get the solution for x(t)), but the ODE is part of a derivation, rather than a chunk (instance model or otherwise). In the simple pendulum example the ODE is solved in closed-form, so the ODE does not appear in an instance model. The instance models are instead directly using the solution to the ODE.

When we revise the examples to consistently use theories throughout refinement from background to final theories, my guess is that the ODE will appear in an earlier chunk, even if it doesn't appear in the IM. For now though, we don't need to add an ODE chunk to the single pendulum example.

@cd155
Copy link
Collaborator Author

cd155 commented Dec 1, 2021

Sorry for keeping asking questions, I have one last question before closing this ticket.

@smiths For the double pendulum example, it eventually gets two second-order ODEs, θ1'' and θ2''

Screen Shot 2021-11-29 at 4 57 29 PM

I think the equation of θ1'' and the equation of θ2'' belong to two Instance Models. Am I right?

@smiths
Copy link
Collaborator

smiths commented Dec 1, 2021

Sorry I missed that part of your question @cd155. In the future, if you split your issues into separate parts, it helps to prevent parts getting missed. 😄

If possible, I would prefer the two ODEs to be together because they form a system of second order ODEs. The two ODEs are coupled because the solution for one depends on the other. Solving the double pendulum example will involve turning each of the second order ODEs into two first order ODEs, for a final system of 4 first order ODEs. This problem was solved manually (outside of Drasil) by a former CAS 741 student. (I think I've pointed you to the original example in the past, but I can find it again if you need me to.) You might want to look at that previous student's work.

@cd155
Copy link
Collaborator Author

cd155 commented Dec 1, 2021

@smiths Thanks so much. I think I still have the link, and I will take a look at it. That's all my questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants