python calculus

OKAY… our goal:

we want to write a python function that will take in the parameters given (the angle above the horizontal in degrees, the initial velocity of the projectile right after being fired in meters per second and the y component of acceleration in meters per second squared) and will return the distance the projectile has gone in meters.

First

a(t) = < 0, 0.36, -9.8 >
∫a(t) = v(t) = < 0, 0.36t, -9.8t > + 𝘾
<300cos(30), 0, 300sin(30)>
simplifies to => <150√(30), 0, 150>, this is 𝘾!
<150√(30), 0, 150> + < 0, 0.36t, -9.8t >Our Velocity function => v(t) = <150√(30), 0.36t, -9.8t + 150 >
∫v(t) = r(t) = <150√(30)t, 0.18t², -4.9t² + 150t> + 𝘾
Position function => r(t) = <150√(30)t, 0.18t², -4.9t² + 150t>
-4.9t² + 150t = 0
4.9t² = 150t
4.9t = 150
t = 150/4.9 <= this, in seconds, is when our projectile hits the ground!
t = 150/4.9r(t) = <150√(30)t, 0.18t², -4.9t² + 150t>r(150/4.9) = <150√(30)(150/4.9), 0.18(150/4.9)²>solving both components:Xdistance ≈ 7953.294525
Ydistance ≈ 168.6797168
totalDistance = √(7953.294525)² + (168.6797168)²totalDistance ≈ 7955.08307m 

NOW LETS WRITE IT IN PYTHON:

180° = 𝜋
=> 1°= 𝜋/180
We were given 30° so:
30°𝜋/180
simplifies to => 𝜋/6
from sympy.vector import CoordSys3D
from sympy import *
N = CoordSys3D('N')myVector = N.i + 10*N.kmyVector is a Vector pointing from the origin to the point (1,0,10)
(N.i means i)
myFunction = integrate(Function, x) 
"integrate the function called "function" with respect to x"

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store