Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Oichi  
#1 Posted : 03 February 2023 01:41:33(UTC)
Oichi


Rank: Advanced Member

Groups: Registered
Joined: 27/01/2023(UTC)
Posts: 30
Woman
Viet Nam

Was thanked: 3 time(s) in 3 post(s)
I saw someone here doing simulations of pendulum and other nonlinear dynamic models, I wonder how can I do that on SMath given that solutions of the ODEs is known, thanks in advance

Edited by user 05 February 2023 00:19:19(UTC)  | Reason: Not specified

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 03 February 2023 04:19:19(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Oichi Go to Quoted Post
I saw someone here doing simulations of pendulum and other nonlinear dynamic models, I wonder how can I do that on SMath given that solutions of the ODEs is known, thanks in advance

Number of ODE's have symbolic solution.
If your DE has either of these tree forms,
Smath will spits scalar solutions wrt parameters/IC ...
One of my old baby in Mathsoft Collaboratory.
Cheers ... Jean.

Laplace 123.PNG
thanks 1 user thanked Jean Giraud for this useful post.
on 03/02/2023(UTC)
Offline Oichi  
#3 Posted : 03 February 2023 10:20:26(UTC)
Oichi


Rank: Advanced Member

Groups: Registered
Joined: 27/01/2023(UTC)
Posts: 30
Woman
Viet Nam

Was thanked: 3 time(s) in 3 post(s)
Thanks, But what I meant is how to simulate the pendulum motion itself seeing the bob and how it swings. See this link
https://en.smath.com/for...endulum-on-a-spring.aspx

Edited by user 03 February 2023 10:26:01(UTC)  | Reason: Not specified

Offline mkraska  
#4 Posted : 03 February 2023 11:28:39(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
In the handbook section 8.2.6 (google for kraska smath handbuch) there is an example for such animations.

The idea is to parametrize your graphics expressions with the variable t and provide a vector of values for t via context menu of the graphic area. This only works for the built-in graphics region, not for x-y plot plugin and neither for maxima.
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 03/02/2023(UTC)
Offline Oichi  
#5 Posted : 03 February 2023 11:32:26(UTC)
Oichi


Rank: Advanced Member

Groups: Registered
Joined: 27/01/2023(UTC)
Posts: 30
Woman
Viet Nam

Was thanked: 3 time(s) in 3 post(s)
Originally Posted by: mkraska Go to Quoted Post
In the handbook section 8.2.6 (google for kraska smath handbuch) there is an example for such animations.

The idea is to parametrize your graphics expressions with the variable t and provide a vector of values for t via context menu of the graphic area. This only works for the built-in graphics region, not for x-y plot plugin and neither for maxima.


Do you have a version that is in English?
Offline alyles  
#6 Posted : 03 February 2023 14:58:41(UTC)
alyles


Rank: Advanced Member

Groups: Registered
Joined: 23/03/2016(UTC)
Posts: 276
United States

Was thanked: 91 time(s) in 57 post(s)
Originally Posted by: Oichi Go to Quoted Post
Do you have a version that is in English?


Google translate is your friend..
https://translate.google...p;op=translate&hl=en
Feel free to join the SMath Studio Users Discord Channel: https://discord.gg/PayZpJW
Offline mkraska  
#7 Posted : 03 February 2023 15:02:31(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,986
Germany

Was thanked: 1124 time(s) in 721 post(s)
Originally Posted by: Oichi Go to Quoted Post


Do you have a version that is in English?


No, but online translators nowadays are quite powerful.

Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
Offline Jean Giraud  
#8 Posted : 03 February 2023 15:20:45(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Oichi Go to Quoted Post
Thanks, But what I meant is how to simulate the pendulum motion itself seeing the bob and how it swings. See this link

Ber7 demos are 6 years before I joined Smath Community.
In the mean time, you can solve the homogeneous pendulum.
Cheers ... Jean.

ODE Pendulum Copy.sm (64kb) downloaded 5 time(s).

thanks 1 user thanked Jean Giraud for this useful post.
on 03/02/2023(UTC)
Offline Oichi  
#9 Posted : 03 February 2023 20:12:17(UTC)
Oichi


Rank: Advanced Member

Groups: Registered
Joined: 27/01/2023(UTC)
Posts: 30
Woman
Viet Nam

Was thanked: 3 time(s) in 3 post(s)
Originally Posted by: mkraska Go to Quoted Post
In the handbook section 8.2.6 (google for kraska smath handbuch) there is an example for such animations.

The idea is to parametrize your graphics expressions with the variable t and provide a vector of values for t via context menu of the graphic area. This only works for the built-in graphics region, not for x-y plot plugin and neither for maxima.


Finally, I did some animations, But I find some problems with the exported gifs. It acts like there are some missing frames while it's totally smooth inside the sheet.
Vibrating Pendulum.sm (16kb) downloaded 14 time(s).
Offline Razonar  
#10 Posted : 03 February 2023 21:04:54(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Oichi Go to Quoted Post
...
Finally, I did some animations, But I find some problems with the exported gifs. It acts like there are some missing frames while it's totally smooth inside the sheet.
Vibrating Pendulum.sm (16kb) downloaded 14 time(s).


Hi. This is a workaround for that bug: https://en.smath.com/for...ot-region.aspx#post75052

However, notice that since the values of phi are numbers and not expressions, you cannot compute the derivatives of its components the way you do in D. You can check this by substituting zero for its values, and you get the same numerical solutions.

Clipboard01.png

Clipboard02.png

For diff(el(φ,3),t) you can use el(φ,4), and for diff(el(φ,4),t) you should use some kind of numerical estimate.

Best regards.
Alvaro.

Edited by user 03 February 2023 21:06:27(UTC)  | Reason: Not specified

thanks 1 user thanked Razonar for this useful post.
on 03/02/2023(UTC)
Offline Oichi  
#11 Posted : 04 February 2023 00:13:12(UTC)
Oichi


Rank: Advanced Member

Groups: Registered
Joined: 27/01/2023(UTC)
Posts: 30
Woman
Viet Nam

Was thanked: 3 time(s) in 3 post(s)
Originally Posted by: Razonar Go to Quoted Post
Originally Posted by: Oichi Go to Quoted Post
...
Finally, I did some animations, But I find some problems with the exported gifs. It acts like there are some missing frames while it's totally smooth inside the sheet.
Vibrating Pendulum.sm (16kb) downloaded 14 time(s).


Hi. This is a workaround for that bug: https://en.smath.com/for...ot-region.aspx#post75052

However, notice that since the values of phi are numbers and not expressions, you cannot compute the derivatives of its components the way you do in D. You can check this by substituting zero for its values, and you get the same numerical solutions.

Clipboard01.png

Clipboard02.png

For diff(el(φ,3),t) you can use el(φ,4), and for diff(el(φ,4),t) you should use some kind of numerical estimate.

Best regards.
Alvaro.


I tried it, but still same bug exist maybe it got lowered but its still there and thanks for making me notice that mistake, does that mean we cannot solve numerically such type of DEs without assumptions?

Edited by user 04 February 2023 00:15:03(UTC)  | Reason: Not specified

Offline Razonar  
#12 Posted : 04 February 2023 00:40:30(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Originally Posted by: Oichi Go to Quoted Post
... does that mean we cannot solve numerically such type of DEs without assumptions?


Hi Oichi. Not. Remember that given F(x,x',x'',...,t) = 0 then for using numerical DEs solvers you must to find the system D(t,x) = [x', x'', ... ] with an appropriate change of variables. Which is your original analytic expression of your differential equation to be solved? This is, the one or two equations involving both all derivatives of all "x" variables, F(x,x',x'',...,t) = 0.

Best regards.
Alvaro.

Edited by user 04 February 2023 00:45:13(UTC)  | Reason: Not specified

Offline Jean Giraud  
#13 Posted : 04 February 2023 16:45:29(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
This version is doctored for SS versions as low as SS 6179.
To make it compatible with ODE universal plugins.
Can you update my invented vector 'phi' in red
So that the system makes sense for all visitors.
Cheers ... Jean.

Vibrating Pendulum (1).sm (25kb) downloaded 6 time(s).
Offline Oichi  
#14 Posted : 04 February 2023 17:27:01(UTC)
Oichi


Rank: Advanced Member

Groups: Registered
Joined: 27/01/2023(UTC)
Posts: 30
Woman
Viet Nam

Was thanked: 3 time(s) in 3 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
This version is doctored for SS versions as low as SS 6179.
To make it compatible with ODE universal plugins.
Can you update my invented vector 'phi' in red
So that the system makes sense for all visitors.
Cheers ... Jean.

Vibrating Pendulum (1).sm (25kb) downloaded 6 time(s).


This example is for a pendulum that it's upper end is attached to a spring, The displacement of this upper end is Phi(1) "u" and the angular displacement of the pendulum is Phi(2) "theta". Phi(3) "u_dot" and Phi(4) "theta_dot" are the first derivatives of the upper end vertical motion and the angular displacement of the pendulum respectively.
Vibrating Pendulum.PNG

Edited by user 04 February 2023 17:32:52(UTC)  | Reason: Not specified

Offline Oichi  
#15 Posted : 04 February 2023 21:11:46(UTC)
Oichi


Rank: Advanced Member

Groups: Registered
Joined: 27/01/2023(UTC)
Posts: 30
Woman
Viet Nam

Was thanked: 3 time(s) in 3 post(s)
I did a trick and removed the d/dt terms.. but now I got a new problem. The Adams function telling me "Cannot calculate"
Vibrating Pendulum 2.sm (108kb) downloaded 6 time(s).
Offline Jean Giraud  
#16 Posted : 04 February 2023 21:21:26(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

Was thanked: 981 time(s) in 809 post(s)
Originally Posted by: Oichi Go to Quoted Post
This example is for a pendulum that it's upper end is attached to a spring, The displacement of this upper end is Phi(1) "u" and the angular displacement of the pendulum is Phi(2) "theta". Phi(3) "u_dot" and Phi(4) "theta_dot" are the first derivatives of the upper end vertical motion and the angular displacement of the pendulum respectively.

Thanks for explaining your advanced project.
Up until now, I can only manage the homogeneous Pendulum.
Cheers ... Jean.


Pendulum.gif (898kb) downloaded 5 time(s).
thanks 1 user thanked Jean Giraud for this useful post.
on 04/02/2023(UTC)
Offline Razonar  
#17 Posted : 04 February 2023 23:06:12(UTC)
Razonar


Rank: Advanced Member

Groups: Registered
Joined: 28/08/2014(UTC)
Posts: 1,356
Uruguay

Was thanked: 815 time(s) in 516 post(s)
Hi. The attached file uses the techniques shown here and here. You can also obtain the equations of motion using the lagrangian with what is shown here.

Vibrating Pendulum.sm (117kb) downloaded 13 time(s).
Vibrating Pendulum.pdf (184kb) downloaded 12 time(s).

Best regards.
Alvaro.

Edited by user 04 February 2023 23:18:07(UTC)  | Reason: Not specified

thanks 1 user thanked Razonar for this useful post.
on 04/02/2023(UTC)
Offline Oichi  
#18 Posted : 04 February 2023 23:28:59(UTC)
Oichi


Rank: Advanced Member

Groups: Registered
Joined: 27/01/2023(UTC)
Posts: 30
Woman
Viet Nam

Was thanked: 3 time(s) in 3 post(s)
Originally Posted by: Razonar Go to Quoted Post
Hi. The attached file uses the techniques shown here and here. You can also obtain the equations of motion using the lagrangian with what is shown here.

Vibrating Pendulum.sm (117kb) downloaded 13 time(s).
Vibrating Pendulum.pdf (184kb) downloaded 12 time(s).

Best regards.
Alvaro.

Thank you so much ^^, ODEs were already obtained using Lagrangians and Hamiltonians but I did them on a paper
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.