# NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

## JDK1.0.2 simulations (1996-2001) => Dynamics => Topic started by: Fu-Kwun Hwang on January 29, 2004, 05:35:38 pm

 Title: Pendulum Post by: Fu-Kwun Hwang on January 29, 2004, 05:35:38 pm You are welcomed to check out  Force analysis of a pendulum (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1116.0)How to change parameters?Set the initial positionClick and drag the left mouse buttonThe horizontal position of the pendulum will follow the mouse Animation starts when you release the mouse buttonAdjust the length dragging the pointer (while > holding down the left button)from the support-point (red dot) to a position that sets the length you want.Animation starts when you release the mouse button Change gravity g Click near the tip of the red arrow,and drag the mouse button to change it (up-down).Change the mass of the bob Click near the buttom of the black stick,and drag the mouse button to change it (up-down).Information displayed:1. red dots: kinetic energy K = m v*v /2 of the bob 2. blue dots: potential energy U = m g hof the bobTry ro find out the relation between kinetic energy and pontential energy! 3.black dots (pair) represent the peroid T of the pendulummove the mouse to the dot :will display information for that dot in the textfieldClick show checkbox to show more informationblue arrow(1): gravity green arrows(2): components of gravity red arrow(1): velocity of the bobTry to compare velocity and the tangential component of the gravitional force!The calculation is in real time (use Runge-Kutta 4th order method). The period(T) is calculated when the velocity change direction.You can produce a period verses angle ( T - X ) curve on the screen,just started at different positions and wait for a few second.Therotically, the period of a pendulum $T=\sqrt{g/L}$.Purpose for this applet:1. The period of the pendulum mostly depends on the length of the pendulum and the gravity (which is normally a constant)2. The period of the pendulum is independent of the mass.3. The variation of the pendulum due to initial angle is very small.The equation of motion for a pendulum is $\frac{d^2\theta}{dt^2}=-\frac{g}{L}\, \sin\theta$when the angle is small $\theta << 1$ ,$\sin\theta\approx \theta$so the above equation become $\frac{d^2\theta}{dt^2}\approx-\frac{g}{L}\, \theta$which imply it is approximately a simple harmonic motion with period $T=2\pi \sqrt{\frac{L}{g}}$What is the error introduced in the above approximation?From Tayler's expansion $\sin\theta=\theta-\frac{\theta^3}{3!}+\frac{\theta^5}{5!}-\frac{\theta^7}{7!}+\frac{\theta^9}{9!}-\frac{\theta^11}{11!}+...$To get first order approximation, the error is $\frac{\theta^3}{3!}=\frac{\theta^3}{6}$So the relative error (error in percentage)= $\frac{\theta^3/6}{\theta}=\frac{\theta^2}{6}$If the angle is 5 degree, which mean $\theta=5*pi/180\approx=5/60=1/12$So the relative error is $\frac{\theta^2}{6}=1/(12^2*6)=1/(144*6)=1/864\approx 0.00116$For angle=5 degree , the relative error is less than $0.116%$For angle=10 degree , the relative error is less than $0.463%$For angle=20 degree , the relative error is less than $1.85%$So the period of the pendulum is almost independent of the initial angle (the error is relatively small unless the angle is much larger than 20 degree- for more than 2% error). Title: topic11 Post by: on January 30, 2004, 11:24:21 am Subject: Thanks Date:    Wed, 9 Dec 1998 16:07:30 -0500 From:    louise heaven To:      Fu-Kwan Hwang Thank you very much Mr Hwang, for your reply to my plea about the pendulum.  I was very pleasently surprized to find you had done so.  Thankyou again. I would also like to say that you have a very good web page and i shall look there first when i am researching physics. Joseph Heaven Title: topic11 Post by: on January 30, 2004, 04:39:57 pm From: Bill Kinsella Reply-To: "wkinsella@csi.com" To: "'hwang@phy03.phy.ntnu.edu.tw'" Subject: Java Applets Date: Sat, 6 Nov 1999 21:04:16 -0000Dear Sir,I came across your site when I was searching for material for my son who is studying science and in particular the pendulum. I was facinated by the immediacy and effficacy of the applets. Surely this must represent a major advancement in the teaching of physics as well as being great fun.Unlike you I spent most of may life as a software developer although I know nothing of Java type languages and now work as a power company nework controller an can think of many interactive applications for our intranet.I would like to see an applet developed illustrating the principles of simple roof truss design.Thanks for the enjoyment your work provided,Bill Kinsella Title: topic11 Post by: on March 22, 2004, 01:55:17 pm From what I learned in physics. The equation for the period of a simple pendulum is T=2(pi)(L/G)^1/2. Which means constant length should result in constant period. However I change the angle of release on the pendulum and the period changes!!??. Title: topic11 Post by: ratznium on February 07, 2005, 10:49:45 pm There's must be an energy leak somewhere in the system. Instead of it's simulated perpetual motion, the bob eventually increases speed so that it ends up going right around a full circle, above the top of the java applet.It's happened twice in a row now as I've left the applet running in the background while going through physics questions.Try it out yourself if you're interested. Leave the applet running for at least an hour, and it ought to go wild. Title: topic11 Post by: Fu-Kwun Hwang on February 12, 2005, 01:57:17 pm For the computer simulation, there is always some error due to calculation.Yes. it will happened when running the simulation for a long time. Title: topic11 Post by: Fu-Kwun Hwang on February 12, 2005, 02:07:43 pm [quote:0748e969ef="Anonymous"]From what I learned in physics. The equation for the period of a simple pendulum is T=2(pi)(L/G)^1/2. Which means constant length should result in constant period. However I change the angle of release on the pendulum and the period changes!!??.[/quote:0748e969ef]The period of the pendulum is almost constant if the amplitude if small (small angle vibration)However, the period will change very small amount when the angle increase.It only increase less than 2% for 20 degree (relative to vertical line). Title: topic11 Post by: rhipple on April 24, 2006, 07:18:06 am I would like to execute this applet offline. This feature appears to be disabled at the current time. This post will serve as my notification when to try again. Title: topic11 Post by: rhipple on April 25, 2006, 09:22:51 am Great! I have a local version of the applet. Now may I see the source? I would like to tinker with it. Title: Re: Pendulum Post by: maryyoung on March 09, 2007, 07:28:55 pm Hi there, I was very excited to find the pendulum simulation, but I am trying to measure differences with different lengths, then with the same length and different masses at the end of the pendulum and I cant seem to change the mass without it disappearing off the end of my screen! I am obviously doing something wrong.  I would like to simulate a length of 30cm with masses of 100,200,300,400,500 grams, is this realistic?  I want the angle to be 45 degrees - would be grateful if you could help me to do this.  Thanks and regards Mary Title: Re: Pendulum Post by: Fu-Kwun Hwang on March 09, 2007, 11:31:09 pm If you want to set the length and angle of the pendulum, move your mouse to the red dot at the center on the top of the simulation, click down the mouse and drag the mouse away. The textfield on the top will display length and angle of the pendulum. When you are done just release the mouse.If you want to change mass of the object, drag the vertical line (label with mass) up and down to change  mass. Title: Re: Pendulum Post by: DKMFan on June 03, 2007, 08:12:26 pm Wow. I like. A lot. Do you mind if I use that for my coursework? It involves making a pendulum have the time period to be used for a Grandfather Clock. I'm asking in case something shows up in the mark scheme which means I'll have to eventually.Quote from:  link=topic=11.msg68#msg68 date=1079938517From what I learned in physics. The equation for the period of a simple pendulum is T=2(pi)(L/G)^1/2. Which means constant length should result in constant period. However I change the angle of release on the pendulum and the period changes!!??.And thank you for making it a lot easier to find the equation. I think I needed that for my homework. Hmmm. Title: Re: Pendulum Post by: Fu-Kwun Hwang on June 04, 2007, 10:12:53 pm You are welcomed to use it for your coursework.The equation T=2(pi)(L/G)^1/2 is good only for small angle.(The sinθ was replaced by θ when derive the equation)It will be a little different when the angle is larger.However, the difference is usually very small. So it is still a very good approximation unless you need very high resolution results. Title: Re: Pendulum Post by: green on February 25, 2008, 10:52:20 am i have download it, but i still can not find the source code. can u help me??how can i get all of your source code from this site?? Title: Re: Pendulum Post by: Fu-Kwun Hwang on February 25, 2008, 11:24:38 am EJS Source code are available for all the simulations created with EJS, i.e. Simulations under category [ Easy Java Simulations (2001- )  (http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=collapse;c=3;sa=expand#3) ]For applets created with JDK1.0.2 (I created those between 1996-2001), source code are only included with very few download ZIP files.  I did  not add source code in the ZIP files, because most of the user did not need it. And those (including pendulum applet shown in this topic) are all created with JDK1.0.2 However, I just sent the source code to your email. You might need to change some of the code if you want to compile those code with current version JDK. Title: Re: Pendulum Post by: zolja2 on May 23, 2008, 02:08:09 pm Please help me, I need with pendulum to determinate earth acceleration. Title: Re: Pendulum Post by: zolja2 on May 30, 2008, 01:23:22 pm This pendulum is great, only it won't stop. I need to measure earth acceleration with equation t=N/T and g=4*PI (2*(L/100)/t^2). Somebody please help me! Title: Re: Pendulum Post by: Fu-Kwun Hwang on May 30, 2008, 03:03:53 pm It will toggle between pause/play if you RIGHT CLICK mouse button inside the simulation region. Title: Re: Pendulum Post by: lawliet on June 26, 2008, 08:19:51 pm i just want to ask if a pendulum is made to swing in water,how is the graph look like with period (Ts) against length? and what is the difference between the time taken for this pendulum (which swings in water) to come to a complete stop and the time taken by a pendulum swinging in air? if a simple pendulum with a period of 1 second is set in motion on the moon,what is the new period of this pendulum? it will swings forever right? Title: Re: Pendulum Post by: Fu-Kwun Hwang on June 26, 2008, 09:00:30 pm Please check out Pendulum with damping (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=700.msg2526#msg2526)The applet assume the damping force is proportional to velocity of the pendulum, which is a good approximation for object moving in water. The applet also assume the mass is always under the water. You can adjust different value for b and find the best one to fit with experimental data. (Because the real damping force also depend on the geometry/area of the pendulum). Title: Re: Pendulum Post by: tanhl on July 04, 2008, 08:13:19 pm Thank you very much Mr Hwang. Whilst looking for some materials on the simple pendulum, I was really surprised at your amazing website -simulations for experiments in physics. It's an eye-opener for me. I have just downloaded the applet and hope it works! : )thanks once again for your wonderful work and contribution to the body of knowledge.tanhl Title: Re: Pendulum Post by: Phys on July 14, 2008, 07:17:27 pm Hi. İ am new in forum. İ have found very necessery documents in this forum. I need  animations like this to explain Physics to my student.I have translated Pendulum animation in Turkish for forum use.Sorry to my english :). not very well.. Title: Re: Pendulum Post by: Fu-Kwun Hwang on July 14, 2008, 10:49:33 pm That is fine. Thank you for your help to translate the message into Turkish.  You might want to check out some other Turkish version web pages (http://www.phy.ntnu.edu.tw/oldjava/turkey/) already translated by other. Title: Re: Pendulum Post by: plack on August 06, 2008, 02:11:19 am thanks very interesting this program..-*- Title: Re: Pendulum Post by: ArdTraveller on January 06, 2009, 06:28:38 pm Sir do u have an applet simulation of a collision of two objects? Title: Re: Pendulum Post by: cmnunis on May 13, 2009, 08:13:29 pm Hi there Mr. Hwang,Excellent program on pendulums. You have made physics interesting all over again.Anyway, I am doing a project for my 3rd year using SUNSpots, which will naturally be programmed in Java. Would it be alright if I requested for the source code of the program? The pendulum is one which will be very relevant to the program. Thank you. Title: Re: Pendulum Post by: Fu-Kwun Hwang on May 14, 2009, 12:06:48 am You should be able to download the source code now (as attached file)! Title: Re: Pendulum Post by: dannydesiliva on September 22, 2009, 01:09:35 pm I have never used a pendulum but would like to start.I have serached the forums and seen the postings about pendulums but still would like to know more about them. Is there a site that has kind of a pendulum 101 page or two?how do you know what you want to use for a pendulum or what crystal, etc to use?so many questions and not much info that I can find.any help out there? Title: Re: Pendulum Post by: yimseo on May 08, 2010, 09:21:13 pm Thankyou for the information. Very Good Example! Title: Re: Pendulum Post by: afrah on June 05, 2010, 08:01:11 pm hello mr. Hwang;i need the source code for pendulum as i have a small project in java applet and i believe this might help..please respond as soon as possible.thanks.. Title: Re: Pendulum Post by: ahmedelshfie on June 05, 2010, 10:51:21 pm I'm not prof Hwang but i can help still prof Hwang answer you have two ways toDownload source code of pendulum 1. choose send to my email account and press Get files for offline use and you will receive source code in your email automatic2. choose download file and press Get for offline use you will receive in your PC Direct   :) Title: Re: Pendulum Post by: Fu-Kwun Hwang on June 05, 2010, 11:33:39 pm The source code is available as attached file under the first message (Please read the topic message carefully and you should have found it). Title: Re: Pendulum Post by: TaraLaster on December 18, 2013, 10:50:39 am Quote from: Fu-Kwun Hwang on January 29, 2004, 05:35:38 pm
You are welcomed to check out  Force analysis of a pendulum (http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1116.0)
How to change parameters?
Set the initial positionClick and drag the left mouse button
The horizontal position of the pendulum will follow the mouse Animation starts when you release the mouse button
1. Adjust the length
2.  dragging the pointer (while > holding down the left button)
from the support-point (red dot) to a position that sets the length you want.
Animation starts when you release the mouse button
3. Change gravity g
4.  Click near the tip of the red arrow,
and drag the mouse button to change it (up-down).
5. Change the mass of the bob
6.  Click near the buttom of the black stick,
and drag the mouse button to change it (up-down).
Information displayed:
1. red dots: kinetic energy K = m v*v /2 of the bob 2. blue dots: potential energy U = m g hof the bobTry ro find out the relation between kinetic energy and pontential energy! 3.black dots (pair) represent the peroid T of the pendulum
move the mouse to the dot :
will display information for that dot in the textfield
Therotically, the period of a pendulum $T=\sqrt{g/L}$.Purpose for this applet:1. The period of the pendulum mostly depends on the length of the pendulum and the gravity (which is normally a constant)2. The period of the pendulum is independent of the mass.3. The variation of the pendulum due to initial angle is very small.The equation of motion for a pendulum is $\frac{d^2\theta}{dt^2}=-\frac{g}{L}\, \sin\theta$when the angle is small $\theta << 1$ ,$\sin\theta\approx \theta$so the above equation become $\frac{d^2\theta}{dt^2}\approx-\frac{g}{L}\, \theta$which imply it is approximately a simple harmonic motion with period $T=2\pi \sqrt{\frac{L}{g}}$What is the error introduced in the above approximation?From Tayler's expansion $\sin\theta=\theta-\frac{\theta^3}{3!}+\frac{\theta^5}{5!}-\frac{\theta^7}{7!}+\frac{\theta^9}{9!}-\frac{\theta^11}{11!}+...$To get first order approximation, the error is $\frac{\theta^3}{3!}=\frac{\theta^3}{6}$So the relative error (error in percentage)= $\frac{\theta^3/6}{\theta}=\frac{\theta^2}{6}$If the angle is 5 degree, which mean $\theta=5*pi/180\approx=5/60=1/12$So the relative error is $\frac{\theta^2}{6}=1/(12^2*6)=1/(144*6)=1/864\approx 0.00116$For angle=5 degree , the relative error is less than $0.116%$For angle=10 degree , the relative error is less than $0.463%$For angle=20 degree , the relative error is less than $1.85%$So the period of the pendulum is almost independent of the initial angle (the error is relatively small unless the angle is much larger than 20 degree- for more than 2% error).So sad.. still can't find resource code. :( Do you have any other way? Title: Re: Pendulum C3 point ? Post by: maciejmarosz on April 18, 2014, 05:29:27 pm (http://1.bp.blogspot.com/-lAcbXNZ7Fps/U05i6HcI7SI/AAAAAAAABug/PdaTlpQlPKA/s1600/1234.jpg)MAROSZ'S PARADOX ? /   Paradoks Marosza ?EN > http://youtu.be/-qLIjbjB0GU  PL > http://youtu.be/lmKccRTQgy4More about radial forces problem EN > http://youtu.be/XWYFIUEaOmc   PL >http://youtu.be/rs8d1zBHgrw http://2.bp.blogspot.com/-fKJMF7z908A/U0t2KnjvpxI/AAAAAAAABt0/ZhpYBUNw83M/s1600/ff.jpgFIRST ENGINE THAT I MADE :PL > http://youtu.be/YI2Vqf9TFi4 EN > http://youtu.be/iTQweoVZspc more http://3.bp.blogspot.com/-NsHHVMzdvzg/Uz7plOHAFTI/AAAAAAAABno/QCS96DgHd94/s1600/exp.JPGhttp://1.bp.blogspot.com/-JpeYrYct79g/Uz-1Zw70DrI/AAAAAAAABn8/VGpmzWH9i3Y/s1600/mt1.jpg EN > http://youtu.be/Aazwjy3n-fgPL > http://youtu.be/uk9R7EylmQUhttp://marosz-physics.blogspot.com/ Title: Re: Pendulum Post by: diinxcom on December 14, 2014, 05:51:29 pm -*-Mark it first..I am new here.. I hope can get many thinks from this forum...