Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pylab as pl
- import matplotlib.pyplot as plt
- #Selve fysikkdelen
- g = 9.81 # m/s^2
- r = 1 # M
- def GetVelocity(g_1,r_1,DegAlpha):
- v = (3*g_1*r_1*pl.sin(pl.deg2rad(DegAlpha)) + 2*g_1*r_1)**(1/2)
- return v/(pl.pi * 2)
- #Plotting:
- fig, ax = plt.subplots()
- WaterColor = "dodgerblue"
- Degrees = [0,15,30,45,60,75,90]
- Velocities = []
- ArrowHeadSize = 0.07 * r
- #Lager lister som skal plottes
- N = 400
- X = pl.linspace(0,90,N)
- Y = GetVelocity(g,r,X)
- for n in range(0,6):
- Velocities.append(Y[0] + ((Y[-1]-Y[0])/5) * n)
- ax.plot(Y,X,WaterColor) #Flipper disse fordi jeg ønsker
- ax.set_yticks(Degrees)
- ax.set_xticks(Velocities)
- ax.xaxis.set_major_formatter(plt.FormatStrFormatter('%.2f'))
- ax.axvline(Y[-1],c="black",linestyle='--')
- print(Y[-1])
- #Innstillinger for plot
- ax.set_xlabel("Rotasjoner per sekund")
- ax.set_ylabel("Grader nådd")
- ax.set_title(f"Antall grader nådd ved forskjellige \nantall rotasjoner per sekund (r = {r}m)")
- rotasjoner per sekund (r = {r}m)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement