Moderne Methoden der Datenverarbeitung in der Physik I Prof. Dr. Stefan Schael / Dr. Thomas Kirn I. Physikalisches Institut MAPLE II, Krypthographie Wahrscheinlichkeit Zufallszahlen, Wahrscheinlichkeitsdichten, Zentraler Grenzwertsatz Fehlerfortpflanzung Maximum Likelihood, Stichproben, Mittelwert & Varianz DV in der Physik, WS 007, 1
Wiederholung: Gleichförmig verteilte Zufallszahlen Generator n j+1 = (a n j + c) mod m z.b. c=0, m=147483399 und a = 4069 gibt eine Periode von (m-1) 10 9 Aufwendigere Algorithmen erlauben Perioden von 10 43. Dazu werden zwei Folgen von Zufallszahlen mit je einem Generator erzeugt und durch Kombination (+,-) eine neue Zufallszahl generiert. DV in der Physik, WS 007,
Wiederholung: Gaußverteilte Zufallszahlen Ein einfacher, aber nur angenähert richtiger Zufallszahlengenerator für normalverteilte Zufallszahlen (Mittelwert 0.0, Standardabweichung 1.0) basiert auf dem Zentralen Grenzwert Satz: z i = 1 u j j =1 6 Die u j sind gleichverteilte Zufallszahlen zwischen 0 und 1. Normalverteilte Zufallszahlen mit Mittelwert µ und Standardabweichung σ erhält man aus der standardisierten, normalverteilten Zufallszahl z i durch x i = µ + σz i f(x) = DV in der Physik, WS 007, 1 πσ e (x -µ ) - σ 3
Wiederholung: Zweidimensionale Verteilungen I Die Definition der Mittelwerte und Varianzen sind nahe liegende Verallgemeinerungen des eindimensionalen Falls: x = E[ x] = xf( x, y) dxdy = xf ( x) dx y = E[ y] = yf( x, y) dxdy = yf ( y) dy V[ x] = ( x x ) f( x, y) dxdy = σ x V[ y] = ( y y ) f( x, y) dxdy = σ y Die Kovarianz zwischen x und y ist definiert als: Cxy (, ) = ( x x)( y y) f( xydxdy, ) Wir nennen zwei Variablen unkorreliert wenn C(x,y)=0 y x Zwei unkorrelierte Zufallsvariablen sind im allgemeinen nicht unabhängig! unabhängig unkorreliert aber nicht unkorreliert unabhängig DV in der Physik, WS 007, 4
Wiederholung: Kovarianz und Korrelation Es erweist sich häufig als bequem, anstelle der Kovarianz den Korrelationskoeffizienten zu benutzen: ρ( xy, ) = Cxy (, ) σ σ Der Korrelationskoefizient gibt ein Maß für die Abhängigkeit der Variablen x und y voneinander. Es gilt: -1.0 ρ(x,y) 1.0 x y a) ρ = +0.85 b) ρ = -0.90 c) ρ = 0 DV in der Physik, WS 007, 5
Messung gleichverteilter und Gaußverteilter Größen Sensor-Cassy Interface 4-fach galvanisch getrennt: Eingang A (I,U) Eingang B (U) Relais R Spannungsquelle S (0 16V) DV in der Physik, WS 007, 6
Messung gleichverteilter und Gaußverteilter Größen 5 analoge Eingänge analoge Spannungseingänge A und B: 1 Auflösung: 1 Bit ( = 4096) Messbereiche: ± 0,3/1/3/10/30/100 V Digitalisierung: ± 0,15 mv/ / 48,8mV Eingangswiderstand: 1 MΩ Abtastrate: max. 00.000 Werte/s (=100.000 Werte/s pro Eingang) Anzahl Messwerte: max. 3000 (= 16000/ Eingang) DV in der Physik, WS 007, 7
Messung gleichverteilter und Gaußverteilter Größen Eingang A: 1 analoger Stromeingang : Messbereiche: ± 0,1/0,3/1/3 A Digitalisierung: ± 0,05 ma/ / 1,5 ma Eingangswiderstand: < 0,5 Ω DV in der Physik, WS 007, 8
Messung des Luftdrucks und der Temperatur DV in der Physik, WS 007, 9
Messung des Luftdrucks 1 <x>= n σ = n i=1 σ <x> = n n i=1 i x (x - < x >) σ i n-1 < p >= V p p = 977.3hPa 7.9( hpa) σ =.8hPa DV in der Physik, WS 007, 10
Messung der Temperatur 1 <x>= n σ = n i=1 σ <x> = n n i=1 i x (x - < x >) σ i n-1 < T >= 3.05 V T T = 0.1 σ = 0.06 0 0 C C 0 C DV in der Physik, WS 007, 11
Transformation von Variablen, -dim Wahrscheinlichkeitsdichten Der Impuls eines Teilchens ist: p = m*v Gemessen seien: m = (1.50 +/- 0.05) kg und v = (4.0 +/- 0.) m/s Was wären <p> und σ p? f(x) = 1 πσ e (x-µ) - σ m σ v σ 0.05 0. = = 0.033 << = = 0.05 m 1.5 v 4 DV in der Physik, WS 007, 1
Transformation von Mittelwert und Varianz: Fehlerfortpflanzung I die Zufallsvariable x 1 mit Mittelwerte µ 1 und Varianz V 1 sei entsprechend einer Wahrscheinlichkeitsdichte f(x 1 ) verteilt. Betrachten wir zunächst eine 1-dim. Funktion y(x 1 ). Was können wir über Mittelwert und Varianz von y sagen? Dazu entwickeln wir y in einer Taylorreihe um y(µ 1 ): y yx ( ) = y( µ ) + ( x µ ) +... In erster Ordnung gilt: da E[x 1 - µ 1 ]=0 1 1 1 1 x 1 x = µ 1 1 E[y(x 1 )] = y(µ 1 ) DV in der Physik, WS 007, 13
E Fehlerfortpflanzung II Was ist die Varianz von y(x 1 )? E[( y E[y]) ] = E[y ye[y]+ E[y] ] = E[y ] E[y] + E[y] = E[y ] E[y] [ y ( x1 )] E[( x µ )] = 0 1 1 y E y( µ 1) + ( x1 µ 1) x 1 y y = y ( µ ) + y( µ ) E[( x µ )] + E ( x µ ) 1 1 1 1 1 1 x1 x x=µ 1 x=µ 1 1 1 1 y y ( µ ) V σ = 1 + 1 x1 x = µ 1 1 y y x 1 x=µ 1 1 V 1 DV in der Physik, WS 007, 14
Beispiel I: p=m*v E[ y( x 1 )] = y(µ 1 ) σ y y x 1 x 1 = µ 1 V 1 = y x 1 x 1 = µ 1 σ x1 Der Impuls eines Teilchens ist: p = m*v Gemessen seien: m = (1.50 +/- 0.05) kg und v = (4.0 +/- 0.) m/s Was wären <p> und σ p (σ m /m << σ v /v)? < p >= m <v >= 1.5 4.0 kg m = 6.0 kg m s s σ p = dp σ dv v = m σ v = 0.09 kg m s σ p = 0.3 kg m s p = (6.0 ± 0.3) kg m s DV in der Physik, WS 007, 15
Fehlerfortpflanzung III die Zufallsvariablen (x 1,x ) mit Mittelwerten (µ 1, µ ) und Varianz V seien entsprechend einer Wahrscheinlichkeitsdichte f(x 1,x ) verteilt. Betrachten wir zunächst eine 1-dim. Funktion y(x 1,x ). Was können wir über Mittelwert und Varianz von y sagen? Dazu entwickeln wir y in einer Taylorreihe um y(µ 1, µ ): y y y( x, x ) = y( µ, µ ) + ( x µ ) + ( x µ ) +... 1 1 1 1 x1 x x= µ x= µ In erster Ordnung gilt: da E[x 1 - µ 1 ]=0 und E[x - µ ]=0 E[ y(x 1, x )] = y(µ 1,µ ) DV in der Physik, WS 007, 16
Fehlerfortpflanzung IV Was ist die Varianz von y(x 1,x )? E [( y E [ y]) ] = E [ y ye[ y] + E [ y] ] = E [ y ] E [ y] + E [ y] = E [ y ] E [ y] y y E y x x E y x x [ ( 1, )] ( µ 1, µ ) + ( 1 µ 1) + ( µ ) x1 x y y = y ( µ 1, µ ) + y( µ 1, µ ) E[( x1 µ 1)] + E[( x µ )] E[ ( xi µ i)] = 0 x1 x x= µ x= µ y E ( x µ ) + 1 1 x + 1 x= µ σ y y y y E ( x µ ) E[( x1 µ 1)( x µ )] x + x1 x x= µ x= µ y y y y = V + V + V x 11 1 1 x x x x 1 x = µ = µ x= µ x= µ x= µ DV in der Physik, WS 007, 17
E[y(x 1,x )] = y(µ 1,µ ) σ y = y x 1 Beispiel II: p=m*v Der Impuls eines Teilchens ist: p = m*v Gemessen seien: m = (1.50 +/- 0.05) kg und v = (4.0 +/- 0.) m/s Was wären <p> und σ p? x=µ < p >=< m > <v >= 1.5 4.0 kg m = 6.0 kg m s s σ p = dp σ dm m + dp σ dv v = v σ m + m σ v σ p = 0.36 kg m s p = (6.00 ± 0.36) kg m s σ x1 + y x x=µ σ x + y x 1 x=µ y x x=µ σ x1 x DV in der Physik, WS 007, 18
Messung von Strom und Spannung und Bestimmung des Ohmschen Widerstandes Messbereich: I A1 = -0.1A bis 0.1 A U B1 = -10V bis 10V I U_Cassy U DV in der Physik, WS 007, 19
Messung von Strom und Spannung und Bestimmung des Ohmschen Widerstandes < U >= 5.0005V σ = 0.00187V U 1 <x>= n σ = n i=1 σ <x> = n n i=1 i x (x - < x >) σ i n-1 DV in der Physik, WS 007, < I >= I 0.049834A σ = 0.00006A 0
Messung von Strom und Spannung und Bestimmung des Ohmschen Widerstandes < U >= 5.0005V σ = 0.00187V U < I >= I 0.049834A σ = 0.00006A V < R>=< U > / < I >= 5.0005/ 0.049834 = 100.34Ω A R R 1 U R = U + I = U + I σ σ σ σ σ U I I I σ = 0.065Ω R = (100.34 ± 0.07)Ω R DV in der Physik, WS 007, 1
Mehrdimensionale Wahrscheinlichkeitsdichten DV in der Physik, WS 007,
Mehrdimensionale Wahrscheinlichkeitsdichten II DV in der Physik, WS 007, 3
Fehlerfortpflanzung I DV in der Physik, WS 007, 4
Fehlerfortpflanzung II DV in der Physik, WS 007, 5
Fehlerfortpflanzung III DV in der Physik, WS 007, 6
Verwendete Links bzw Maple-Programme und Dateien Seite 3: 1. Link (linker grüner Pfeil): http://www.mathe-online.at/galerie/wstat3.html. Link (rechter grüner Pfeil): http://statistik.wu-wien.ac.at/mathstat/hatz/vo/applets/cenlimit/cenlim.html Seite 9: Verwendetes Programm Cassy-Lab zur Datenaufzeichnung: http://www.leybold-didactic.de/software/5400de.exe Seite 10: Maple-Programme: a) Praktikum.m b) Praktikum.mws c) druck+temp.mws verwendete Datei: P_t_1b.lab und T_t_7.lab Link: http://www.klimageo.rwth-aachen.de/wtst/timecheck.php Seite 18: Maple-Programm: impuls.mws Seite 19: Verwendetes Programm Cassy-Lab zur Datenaufzeichnung: http://www.leybold-didactic.de/software/5400de.exe Maple-Programm: U_I_Mess.mws verwendete Datei: 100R_U_I_t_c.lab Seite 1: Maple-Programm: U_I_MC.mws DV in der Physik, WS 007, 7