Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
python:programmes_de_physique_chimie_en_python:parabole [2019/10/20 15:10] – physix | python:programmes_de_physique_chimie_en_python:parabole [2020/07/24 03:31] (Version actuelle) – modification externe 127.0.0.1 | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== Parabole ====== | ====== Parabole ====== | ||
- | < | + | < |
- | especes=[" | + | #Conditions |
- | coefficients=[-1, | + | |
- | etat_init = [3., 20., 0., 0.] #quantites | + | |
- | etat_inter = etat_init[:]#on initialise l' | + | |
- | dksi = 0.0001 #pas | + | |
- | x = 0 #avancement initial | + | x = 0. |
- | while etat_inter[0]> | + | |
- | x = x + dksi | + | |
- | etat_inter[0] = etat_init[0] + coefficients[0]*x | + | |
- | etat_inter[1] = etat_init[1] + coefficients[1]*x | + | |
- | etat_inter[2] = etat_init[2] + coefficients[2]*x | + | |
- | etat_inter[3] = etat_init[3] + coefficients[3]*x | + | |
- | print(" | + | y = 2. |
- | for i in range(4): | + | |
- | print(especes[i],": {: | + | vx = 3.5 |
- | print("" | + | |
- | print(" | + | vy = 0. |
+ | |||
+ | ax = 0. | ||
+ | |||
+ | ay = -9.81 | ||
+ | |||
+ | t = 0. | ||
+ | |||
+ | #pas de temps | ||
+ | |||
+ | dt = 0.001 | ||
+ | |||
+ | # | ||
+ | |||
+ | while y> 0. : | ||
+ | |||
+ | x = x + vx * dt | ||
+ | |||
+ | y = y + vy * dt | ||
+ | |||
+ | vx = vx + ax * dt | ||
+ | |||
+ | vy = vy + ay * dt | ||
+ | |||
+ | t = t + dt | ||
+ | |||
+ | print(" | ||
</ | </ |