EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
C语言代写
您的位置: 主页 > 编程案例 > C语言代写 >
代写C语言Physics代码代写 C++Physics 307 Homework 4 pendulum - C语言代写
发布时间:2021-07-25 19:29:35浏览次数:
Due Thursday, 11 October, by 5 PMPhysics代码代写 Note: See the notes on symplectic integrators for summaries of the different solvers used in this project. Now we will graduate to second-order differential equations, and solve a DE that we can’t do with pen and paper. The equation of motion for a pendulum is ∂2θ g∂t2   = −L sin θ (1)In mechanics class you solved this by taking the small-angle approximation sin θ θ; the equation then has a solution where ω = . gθ(t) = A sin(ωt + φ) (2)giving a period T = 2π. L .  This is valid only in the limit θ → 0 This equation is very difficult to solve without making this approximation using pen and paper, but you have a computer! In this project, you will create and animate a computer simulation of a swinging pendulum, and study how its swing period depends on the angle at which it is swinging. In order to do this, you will need to be able to distinguish small effects caused by physics (a small shift in the period of your simulation caused by the change in amplitude) from small effects caused by numerical artifacts (a small shift in the period of your simulation caused by the fact that numerical solutions are always approximations). The first one is what we are interested in studying; the second one is just a distraction. Nota bene: While I’ve asked you to do a few other things, the primary purpose of this project is the last question – to examine the nonlinearities in a swinging pendulum. Your report should focus on this. The overarching question is: How does the period of a swinging pendulum depend on its amplitude, and how can  computer simulations answer this question    in a way that pen-and-paper calculations cannot? 1. Without making the small-angle approximation, write a computer program that solves Newton’s law (rotational form) to compute the oscillation of a swinging pendulum using the Euler-Cromer algorithm, which is a first-order symplectic integrator. (It is perhaps the easiest to code of all of them.) 2. Animate your pendulum using anim.3. Use your program to make graphs of θ(t) and ω(t) as a function of time for a few periods, and plot them on top of each other. Do your data make sense? As a note, familiarize yourself with the ! bypass feature of anim, which will make it easy for you to get both animation and graphical output at the same time.4. Modify your program to determine the period of the pendulum and print it out. You can determine when a period has elapsed by looking for sign changes in ω; look at the graphs you made in the last step for a reminder of how to do this.5. Does your program give you the result you expect (i.e. T ≈ 2π. L ) in the limit wherethe initial amplitude is small?6. Suppose a pendulum clock keeps accurate time when θmax = 5◦. How many seconds will it gain or lose per day if it is swinging at an angle of θmax = 20◦?7. Modify your program to use the leapfrog algorithm, which is a second-order symplectic integrator that you will use for the rest of the semester. (This should be an easy, fast modification.) Note that if you want the added precision from the use of a second-order solver, you should use the second-order interpolation mechanism for ω that you worked out in Project 2.8. Make a plot of the fractional deviation in the period, defined as ∆ = τ−τ0 . Here τ0 is the small-angle-limiting period, τ0 = 2π L. Calculate this for a range of θmax from 10−5 to 2 (radians). Make a log-log plot of ∆ vs. θmax. Your plot should cover amplitudesfrom around 10−6 to 2 radians. Here you might see deviations from the small-angleperiod from two sources: actual physical effects, and error in your numerical solution. You should take whatever steps you can to minimize the latter (using a reasonable stepsize, using interpolation to determine the period as you did in HW3, etc.), and then correctly interpret your data in light of the fact that you may still have errors related to your numerical solution.Based on what you know about the power series expansion of sin(x), comment on its appearance. Is it what you expect?最先出自315代写 物理代写 作业代写合作:315代写

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。