Coding a Numerical Solution to the Simple Pendulum Problem using Python

preview_player
Показать описание
Using Python to code a numerical method to solve the nonlinear equation of motion for the simple pendulum.

Рекомендации по теме
Комментарии
Автор

Great stuff! Thanks for the video. As a suggestion, Python in the title could be useful while searching.

adrpsch
Автор

At 45 deg or even more than that..wave must be flattened at the picks...so that nonlinear case would be clearly visible... check alternative numerical method

prof.onkarsalavi
Автор

why when I write def equation(t, y0), instead of def equation(y0, t) I have this error message :
theta, x = y0

TypeError: cannot unpack non-iterable float object

And for example for this code the inverse works...
def dSdx(x, S):
y1, y2 = S
return [y1 + y2**2 + 3*x,
3*y1 + y2**3 - np.cos(x)]
y1_0 = 0
y2_0 = 0
S_0 = (y1_0, y2_0)
x = np.linspace(0, 1, 100)
sol = odeint(dSdx, S_0, x, tfirst=True)

Thanks for the answer

David-bgrj
Автор

Hello, Sir. I tried implementing the same routine using the odeint function. I noticed that the resulting values for theta using the nonlinear solution do not vary, even when I try to use different time steps (0.001s, 0.01s, and 0.05s). Shouldn't there be noticeable differences in the resulting values of theta with varying time steps? Thank you.

mckenflores
Автор

Hello, very clear explanation, but what exactly happens with all the time steps? Like where are they used? Because in the function itself there in no variable "t" so then what does the program do with those values?

natorgas
Автор

may i know how to using this method but to plot angular velocity vs time and angular velocity vs angle? and may I know theta1 and theta2 are represent for what (angular acceleration or angle). thank you.

n.nailiirsya
Автор

If anyone is having errors if you do not know pip install scipy in terminal

KonradGebura
Автор

How would it be using curve_fit () function instead of odeint() ? and what differences would it have?

carlosaugustoramosjaramill
Автор

This is awesome, How do I do the phase space plot?

isaacmutie
Автор

please do more videos please please these are awesome

pranaypurohit
Автор

What is the initial vector space 'y0'?
You haven't defined it anywhere.

PrashantKumar-cqlj
Автор

What causes the difference between linear and nonlinear solutions?

furkanakal
Автор

what's the numeric method that odeint() uses for solving the equations?, can we change it? (I use Euler on Matlab)

JeXuZ
Автор

Watch the following video for the graph plotting using python language:-

pulkitmahera