Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Jupyter notebook Fricción Fernando González Bravo.ipynb

7 views
Kernel: Python 2
import numpy as np import pylab as p print "angulo" t=input() mk = .5 t=np.linspace(0,p.pi/2,100) a = 9.81*((np.sin(t)))-(mk*np.cos(t)) a
angulo 45
array([-0.5 , -0.34429196, -0.18849724, -0.03265508, 0.12319531, 0.27901469, 0.43476382, 0.59040351, 0.74589456, 0.90119784, 1.05627425, 1.21108475, 1.36559036, 1.51975219, 1.67353143, 1.82688937, 1.9797874 , 2.13218703, 2.2840499 , 2.43533776, 2.58601254, 2.73603631, 2.8853713 , 3.0339799 , 3.18182472, 3.32886854, 3.47507432, 3.62040528, 3.76482482, 3.90829658, 4.05078445, 4.19225256, 4.33266529, 4.4719873 , 4.6101835 , 4.74721912, 4.88305965, 5.0176709 , 5.15101897, 5.28307031, 5.41379166, 5.54315011, 5.67111311, 5.79764843, 5.92272423, 6.04630901, 6.16837167, 6.28888147, 6.40780808, 6.52512156, 6.64079238, 6.75479141, 6.86708996, 6.97765975, 7.08647296, 7.19350218, 7.29872048, 7.40210137, 7.50361881, 7.60324726, 7.70096163, 7.79673733, 7.89055024, 7.98237675, 8.07219373, 8.15997859, 8.24570921, 8.32936402, 8.41092196, 8.49036249, 8.56766562, 8.64281188, 8.71578237, 8.7865587 , 8.85512306, 8.9214582 , 8.9855474 , 9.04737454, 9.10692405, 9.16418094, 9.2191308 , 9.27175979, 9.32205467, 9.37000277, 9.41559202, 9.45881094, 9.49964866, 9.5380949 , 9.57413997, 9.6077748 , 9.63899093, 9.66778049, 9.69413624, 9.71805154, 9.73952037, 9.75853734, 9.77509764, 9.78919711, 9.80083221, 9.81 ])
%matplotlib inline
import matplotlib.pyplot as plt t=np.linspace(0,p.pi/2,100) fig = plt.figure() axes=fig.add_axes([5,5,1,1]) axes.plot(t, a, 'r') axes.set_xlabel(r'\t[rads]') axes.set_ylabel('a[m/s]') axes.set_title("Friccion"); axes.grid(True)
Image in a Jupyter notebook
from scipy.optimize import fsolve fun = lambda t:9.81*((np.sin(t)))-(mk*np.cos(t)) root=fsolve(fun,0)
root
array([ 0.05092433])
v=input() theta=input() h=(.5*(v**2)*((np.sin(theta))**2))/9.81 t=np.sqrt((2*h/9.81)) x=v*np.cos(theta)*t y=v*np.sin(theta)*t-(.5*9.81*t**2) p=[] p.append(x) p.append(y) p
25 45
[28.478486990333778, 23.064373345584382]
import matplotlib.pyplot as plt t=np.linspace(0,10) x=v*np.cos(theta)*t y=v*np.sin(theta)*t-(.5*9.81*t**2) fig = plt.figure() axes=fig.add_axes([5,5,1,1]) axes.plot(x, y, 'r') axes.set_xlabel(r'\X') axes.set_ylabel('Y') axes.set_title("Tiro parabolico"); axes.grid(True)
Image in a Jupyter notebook
from scipy.optimize import fsolve fun = lambda x:v*np.cos(theta)*t root=fsolve(fun,0)
root
array([ 0.])