Skip to content
Advertisement

Tag: numerical-methods

Orbit of the Earth – leapfrog Python

I am trying to do this homework exercise: Orbit of the Earth My plot does not show the whole trajectory. I don’t know if it is something wrong with my equations or if it is a plotting matter. Cheers! Earth trajectory Plot Answer Okay, so there’s a pretty funny typo: That’s 16 times larger than what you most likely wanted

Implementing composite Gauss quadrature in Python

I want to implement the composite Gaussian quadrature in Python to evaluate the integral ∫01 ex2 dx. Evaluting this using Python’s quad command, I get ∫01 ex2 dx ≈ 1.46 Below is my attempt at implementing this in Python. What I expect is that as n gets larger, the closer the quadrature gets to the ‘real’ integral. However, as I

Advertisement