mirror of
https://gitlab.gwdg.de/j.hahn02/university.git
synced 2026-01-01 14:54:25 -05:00
added shiroa
This commit is contained in:
107
S2/CWR/VL/CwrVL1.typ
Normal file
107
S2/CWR/VL/CwrVL1.typ
Normal file
@@ -0,0 +1,107 @@
|
||||
= Einleitung
|
||||
|
||||
Dozent: marcus.muillr\@uni-goettingen.de
|
||||
|
||||
== Pruefungsvorleitstung
|
||||
|
||||
- 4 Testat-Aufgaben jeweils eine Woche
|
||||
- git repo $-> $ Tutor
|
||||
- Pass/Fail 1 Verbesserung pro Testat moeglich
|
||||
|
||||
== Pruefung
|
||||
|
||||
Projekt + Report eine Woche Zeit
|
||||
|
||||
ca. 10 Seiten
|
||||
|
||||
1. Periode 4-11 August
|
||||
2. Periode 6-13 Oktober
|
||||
|
||||
Programmiersprache C. Die Programme muessen lauffaehig im CIP Pool sein.
|
||||
|
||||
Graphische Auswertung in Python.
|
||||
|
||||
== Literatur
|
||||
|
||||
Numerical Recipies Cambridge University Press
|
||||
|
||||
== Ziele
|
||||
|
||||
$"Probleme"-> "Algorithmen"-> "Programme"-> "Auswertung"$
|
||||
|
||||
= Numerische Integration
|
||||
|
||||
Das Problem ist ein einfaches Integral auszurechnen
|
||||
|
||||
$
|
||||
I = integral_(a)^(b) f(x) d x.
|
||||
$
|
||||
|
||||
Dafuer kann die *Mittelpunktsregel* verwendet werden
|
||||
|
||||
$
|
||||
I = lim_(Delta x -> 0) sum_(i = 0)^(N) Delta x f(x_(i)) \
|
||||
x_0 = a, x_N = b\
|
||||
Delta x = (b-a) / (N) \
|
||||
x_i = a + i Delta x\
|
||||
"Mittelpunkt": x_(i) + (Delta x) / (2) l\
|
||||
I approx sum_(i)^(N) Delta x f(x_i + (Delta x) / (2) ) \.
|
||||
$
|
||||
|
||||
|
||||
Oder die *Trapez-Regel*
|
||||
|
||||
$
|
||||
f_("app") = f(x_i) + (f(x_(i+1) - f(x_i) ) / (Delta x) (x - x_i)\
|
||||
I_1 = integral_(x_(i+1) )^(x_i) f(x) d x approx integral_(x_(i+1) )^(x_i) f_("app")(x) d x = Delta x (f(x_(i+1) )+ f(x_(i))) / (2 ) .
|
||||
$
|
||||
|
||||
== Simpson regel
|
||||
|
||||
Quadratische Naeherung der Funktion auf dem intervall
|
||||
|
||||
$
|
||||
I_(i) = integral_(x_(i+1) )^(x_(i) ) d x f(x) approx integral_(x_(i+1) )^(x_i) d x f_("app") (x) = (Delta x) / (6) [f(x_(i)) + 4 f(x_(i)) + f(x_(i)) ].
|
||||
$
|
||||
|
||||
== Fehlerabschaetzung
|
||||
|
||||
Berechnung der Ordnungen der Fehler und Abschaetzung des Fehlers.
|
||||
|
||||
#highlight[TODO: Literatur lesen und die Kapitel ausbessern]
|
||||
|
||||
= Berechnung von Nullstellen
|
||||
|
||||
+ Intervallschachtelung
|
||||
Pruefen von Intervallen, welche durch die Bedingung $f(a)f(b) < 0$ eine Nullstelle enthalten muessen.
|
||||
Fuer den Algorithmus waelt man dann fuer die neue Intervallgrenze den Mittelpunkt zwischen $a$ und $b$, je nachdem ob die Bedingung fuer eine Nullstelle wieder erfuellt ist faehrt man dann mit dem einen oder dem anderen Intervall fort
|
||||
+ Approximation durch eine lineare Funktion ($hat(f) = f_("app") $)
|
||||
$
|
||||
hat(f)(x) = f(a) + (f(b) - f(a)) / (b-a) (hat(x)-a) = 0\
|
||||
hat(x) = a- (b-a) / (f(b) - f(a)) f(a)
|
||||
$
|
||||
|
||||
Mit der Iterationsvorschrift
|
||||
$
|
||||
x_(n+1) = x_(n-1) (f(x_(n)) - f(x_(n+1)) ) / (x_(n) -x_(n-1) ) f(x_(n-1) ),
|
||||
$
|
||||
wobei die Abbruchbedingung $abs(f(x_(n))) < epsilon$ ist.
|
||||
+ Newton-Raphson ist ein iteratives Verfahren.
|
||||
|
||||
#highlight[TODO: understand and implement this]
|
||||
|
||||
= Auswahl von Algorithmen
|
||||
|
||||
+ Rechenzeit/Effizienz
|
||||
+ Robustheit/Stabilitaet
|
||||
+ Genauigkeit
|
||||
|
||||
== Bewertung der Algorithmen
|
||||
|
||||
+ Intervallschachtelung\
|
||||
Robustheit ++\
|
||||
Effizient
|
||||
|
||||
== Uebung
|
||||
|
||||
$f(z) = z^3 -1 = 0, quad z in CC$ mit Newton.
|
||||
161
S2/CWR/VL/CwrVL2.typ
Normal file
161
S2/CWR/VL/CwrVL2.typ
Normal file
@@ -0,0 +1,161 @@
|
||||
// Diff template
|
||||
#import "../preamble.typ": *
|
||||
|
||||
#show: conf.with(num: 2)
|
||||
|
||||
= Differentialgleichungen
|
||||
|
||||
ODEs
|
||||
|
||||
Mechankik: $dot.double(x) + omega_0 ^2 x=0$ ist eine ODE der Ordnung 2
|
||||
|
||||
$m dot.double(x) = F(x, dot(x), t)$ Newtons'sche Mechanik
|
||||
|
||||
zuruck fueren auf ein System von ODEs 1. Ordnung
|
||||
|
||||
Hamilton'sche Mechanik:
|
||||
|
||||
$
|
||||
(partial HH(q, p)) / (partial d) = p/m, HH(q, p) = (p^2 ) / (2m) + V(q)\
|
||||
dot(p)=-(partial HH) / (partial q) = - (partial V) / (partial q)
|
||||
$
|
||||
|
||||
Anfangsbedingungen $q(t=0) = q_0 "und" p(t=0) = p_0 $.\
|
||||
Beispiele sind Ratengleichungen, radioaktiver Zerfall und Populationsdynamik.
|
||||
|
||||
== Pearl-Unschulat Modell
|
||||
|
||||
$n(t): "Anzahl der Individuen"$
|
||||
|
||||
$
|
||||
(dif n) / (dif t) = sqrt(n)n\
|
||||
sqrt(n)="const"\
|
||||
n(t) = n(0)exp(sqrt(t)) \
|
||||
sqrt(n)=r_0 (1-k_n ), k="const">0
|
||||
$
|
||||
|
||||
allgemeine Formulierung: $y^((n)) (t)=g (y, y', ..., y^((n+1)), t )$
|
||||
|
||||
$
|
||||
y_(n)=y^((n)) \
|
||||
y^((n+1))+y^((n)) = g(y,y_1 , ..., y_(n-1), t)\
|
||||
y'_(n-2) =y_(n-1) \
|
||||
y'=g_1
|
||||
$
|
||||
|
||||
$
|
||||
dot(arrow(y)) = arrow(g)(y_1, ..., y_(n-1) )\
|
||||
(dif y) / (dif t) = g(y, t)
|
||||
$
|
||||
|
||||
Diskretisierung der Zeit $[0, T], t_0 = 0, t_1 =Delta t, t_n =n Delta t=T$
|
||||
|
||||
$
|
||||
y (t_i ) =y(t_(i-1)) +integral_(t_i )^(t_(i-1)) d t g (y (t), t) approx^("Euler-Cauchy") y (t_(i-1))+g (y (t_(i-1) , t_(i-1) )) Delta t + O(Delta t^2 )\
|
||||
$
|
||||
|
||||
mit globalem Fehler bei Integration ueber $[Q, T]$
|
||||
|
||||
$
|
||||
E ~ (T) / (Delta t) Delta t^2 ~ T Delta t ~ O(Delta t)
|
||||
$
|
||||
|
||||
Beispiel Ratengleichung $r (n)=r- (1-k_n )$
|
||||
|
||||
$
|
||||
n (t_i ) = n (t_(i-1) )+r_0 (1-k_n / t_(i-1) )n (t_(i-1) Delta t)\
|
||||
n (t_i )=(1+Delta t r_0 )n (t_(i-1) ) (1- (Delta t r_0 k) / (1+ Delta t r_0 ) n (t_(i-1) ))
|
||||
$
|
||||
|
||||
Variable $x (t_(i-1))=(Delta t r_0 k) / (1+Delta t r_0 ) n (t_(i-1) )$
|
||||
|
||||
$
|
||||
x (t_i )=4 mu x (t_(i-1) ) (1- x (t_(i-1) )), 4 mu=1+Delta t r_0
|
||||
$
|
||||
|
||||
Zuletzt: $Delta t$ klein
|
||||
|
||||
$
|
||||
n (t)=1/k, x (t)=(Delta t r_0 ) / (1+ r_0 Delta t)=(4 mu-1) / (4 mu)
|
||||
$
|
||||
|
||||
Pointcarre Abbildung mit Bifurkation.
|
||||
|
||||
== Leapfrog Algorithmus
|
||||
|
||||
// TODO: implement nl and Delta t in tyupstar as well as +
|
||||
|
||||
$
|
||||
y'=g (y,t), y' (t_i ) (y (t_i )-y (t_(i-1) ) ) / (Delta t) + O (Delta t)\
|
||||
y' (t_i )=(y (t_(i+1)) -y (t_(i-1) )) / (Delta t) + O (Delta t)
|
||||
$
|
||||
|
||||
#highlight[TODO: Implement this algorithmus as well as the global error]
|
||||
|
||||
== Velocity-Verlet Algorithmus fuer klassische Mechanik
|
||||
|
||||
$
|
||||
dot(arrow(t))=vec(dot(x) (t),dot(v) (t))=vec(v (t),a (x_(i) t))\
|
||||
v (t_(i+1) )=x (t_(i-1) )+2v (t_i )Delta t+O (Delta t^3 )\
|
||||
v (t_(i_1) )=v (t_(i-1) )+2a (x (t_i ),t_1 )Delta t+O(Delta t^3 )
|
||||
$
|
||||
|
||||
Umschreiben der zweiten Gleichung:
|
||||
|
||||
Es wird von $t_(i-1) "nach" t_(i+1)$ gegangen.
|
||||
|
||||
$
|
||||
v (t_i )=v (t_(i-1) )+a (x (t_(i_1) ), t_(i-1) )Delta t\
|
||||
x (i_(i+1) )= x (t_(i-1) )+2v (t_i ) Delta t \
|
||||
v (t_(i+1) )=v (t_i )+a (x (t_(i+1) ),t_(i+1))Delta t
|
||||
$
|
||||
|
||||
Das ergibt
|
||||
|
||||
$
|
||||
v (t_(i+2) )=v (t_(i+1) )+a (x (t_(i+1) )t_(i+1) )Delta t
|
||||
$
|
||||
|
||||
$==>$ $v (t_(i+2) )=v (t_i )+2a (x (t_(i+1) ), t_(i+1) )Delta t$
|
||||
|
||||
$2 Delta t = delta t$
|
||||
|
||||
$
|
||||
v (t+(delta t) / (alpha) )=v (t)+a (x (t),t) (delta t) / (2) \
|
||||
x (t+delta t)=x (t)+v (t+(delta t) / (2))delta t\
|
||||
v (t+delta t)=v (t+(delta t) / (s))+a (x (t+delta t),t+delta t)(delta t) / (2) \
|
||||
$
|
||||
|
||||
== Forderungen an einen guten Integrator der klassischen Mechanik
|
||||
- Energieerhaltung
|
||||
- Zeitumkehrinvarianz
|
||||
+ der Bewegungsgleichungen sind zeitumkehrbar invariant. Jeder vernuenftige Algorithmus erfuellt dies zu der Ordnung $O(delta t^2 )$\
|
||||
$
|
||||
vec(x_0, v_0 )=vec(x (t),v (t))->^(T (Delta t)) vec(x (t+Delta t),v (t+Delta t))-> $
|
||||
+ des Algorithmus $x_0 -x_1 =0, v_0 -v_1 = 0$
|
||||
- Phasenraumerhaltung symplektisch
|
||||
|
||||
$t_(i-1) -> t_(i+1) $
|
||||
|
||||
Zeitumkehr
|
||||
$
|
||||
arrow(x)' (t_(i+1) )=arrow(x) (t_(i+1) )\
|
||||
arrow(v)' (t_(i+1) )= - arrow(v) (t_(i+1) )
|
||||
$
|
||||
|
||||
$t_(i+1) -> t_(i+3) $
|
||||
|
||||
$
|
||||
v' (t_(i+2))= v' (t_(i+1) )+a (x' (t_(i+1) ),t_(i+1) ) Delta t =-v (t_(i+1)) +a (x (t_(i-1) ))Delta t \
|
||||
x' (t_(i+1) )= x' (t_(i+1) )+2v' (t_(i+1) )Delta t\
|
||||
= x (t_(i+1) )+2 [-v (t_(i+1) )+a (x (t_(i+1) ))Delta t]Delta t \
|
||||
= x (t_(i-1) )+2 Delta t [v (t_i )-v (t_(i+1) )+a (x (t_(i+1) ))Delta t]\
|
||||
= x (t_(i-1) )
|
||||
$
|
||||
|
||||
|
||||
=== Takeways
|
||||
- Ableitung diskretisierung
|
||||
- Taylorentwicklung der Ableitung
|
||||
- Mit Euler-Cauchy kann am einfachsten nach vorne integriert werden
|
||||
|
||||
Reference in New Issue
Block a user