# Solve differential equation to describe the motion of simple pendulum

Posted 5 years ago
7356 Views
|
7 Replies
|
7 Total Likes
|
 Differential equation is given byy''[t]==-(g/L)*Sin[y[t]]where y is the offset angle and t is time. I used the following mathematica code to solve for yDSolve[{y''[t] ==-(g/L)*Sin[y[t]], y[0]==Pi/2,y'[0]==0},y,t]and get the following errorsSolve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>DSolve::bvfail: For some branches of the general solution, unable to solve the conditions. >>The problem seems to be Sin[y], but I don't know how to work around this. Thanks for any help.
7 Replies
Sort By:
Posted 5 years ago
 To my knowledge there is no closed analytical solution to the pendulum problem.You could try to do it numerically though:g=9.81L=0.5y=.y=First[y/.NDSolve[{y''[t]==-(g/L)*Sin[y[t]],y[0]==Pi/2,y'[0]==0},y,{t,0,10}]]Plot[y[t],{t,0,10}]This does look like a sine function but it isn't, it becomes especially clear for large exitations:g=9.81L=0.5y=.y=First[y/.NDSolve[{y''[t]==-(g/L)*Sin[y[t]],y[0]==Pi/2,y'[0]==6.25},y,{t,0,10}]]Plot[y[t],{t,0,10}]Hope this helps.
Posted 1 year ago
 Sander,I have a two questions regarding both approach and syntax. First, why can't we obtain a numerical solution to the differential equation by using only the command, 'NDSolve' ? Second, what does the syntax below accomplish (i.e., y = .)? y =. y = First[ y /. NDSolve[{y''[t] == -(g/L)*Sin[y[t]], y[0] ==Pi/2, y'[0] == 0}, y, {t, 0, 10}]] Best,-Javier
Posted 5 years ago
 Sander is right, it's better to go with numerical solution here. Closed analytic form exist in terms of elliptic functions, but the problem is finding constants of integration from initial conditions. This needs solution of a system of nonlinear equations, which is not always possible.sol = DSolve[y''[t] == -(g/l) Sin[y[t]], y, t];y /. sol // Column // TraditionalForm
Posted 5 years ago
 @Julian, if what you need is just a case with small excitation at the equilibrium, you can simply use the y instead of Sin[y]. For small y, the Taylor expansion gives you an approximation at the first order in a small neighbourhood of x=0: Series[Sin[x], {x, 0, 1}]
Posted 5 years ago
 Differential equation is given byy''[t]==-(g/L)*Sin[y[t]]where y is the offset angle and t is time. I used the following mathematica code to solve for yDSolve[{y''[t] ==-(g/L)*Sin[y[t]], y[0]==Pi/2,y'[0]==0},y,t]and get the following errorsSolve::ifun: Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information. >>DSolve::bvfail: For some branches of the general solution, unable to solve the conditions. >>The problem seems to be Sin[y], but I don't know how to work around this. Thanks for any help.