File:Sim-free-fall-drag-plot-matplotlib.svg

Summary

Description
English: Simulated free fall of a styrofoam ball (r = 10cm; ρ = 20kg/m³) with air resistance
Date
Source Own work
Author MikeRun
SVG development
InfoField
Source code
InfoField

Python code

Python matplotlib code
# Simulation: Freier Fall einer Styroporkugel (d = 10cm; ρ = 20kg/m³) mit Luftwiderstand

## Konstanten:
g =	       9.81 # m/s²  (Fallbeschleunigung Erde)
m =        0.08	# kg    (Masse des Körpers)
c_w =	   0.45	#       (Luftwiderstandsbeiwert)
A =        0.03 # m²    (Fläche des Körpers normal zur Bewegungsrichtung)
rho =      1.29 # kg/m³ (Dichte des Mediums)

## Anfangsbedingungen:
s_0 =    100    # m     (Anfangshöhe)
v_0 =      0    # m/s   (Anfangsgeschwindigkeit)

## Genauigkeit:
dt =       0.2  # s     (Zeitschritt)

## Simulation:
list_t = []
list_s = []
s = s_0
v = v_0
t = 0
while s > 0:
    list_t.append(t)
    list_s.append(s)
    F = (-m*g) + (-0.5*c_w*A*rho*abs(v)*v)
    a = F/m
    s += v * dt
    v += a * dt
    t += dt

## Textausgabe:
print("Falldauer: ", round(t,3), " s")
print("Endgeschwindigkeit:", round(v,3), "m/s")

## Diagramm:
import matplotlib.pyplot as plt
plt.plot(list_t, list_s, 'ro')
plt.ylabel('Höhe (m)')
plt.xlabel('Zeit (s)')
plt.title('Simulation: Freier Fall einer Styroporkugel mit Luftwiderstand aus '+str(s_0)+'m')
plt.show()

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Category:CC-BY-SA-4.0#Sim-free-fall-drag-plot-matplotlib.svg
Category:Self-published work Category:Python (programming language) Category:Free fall Category:Simulation
Category:CC-BY-SA-4.0 Category:Free fall Category:Python (programming language) Category:Self-published work Category:Simulation Category:Valid SVG created with Python code