Moderne Physik mit Maple
PDF-Buch Moderne Physik mit Maple
Update auf Maple 10
Kapitel 4.1.3
Worksheet wirf5_10.mws
c International Thomson Publishing Bonn 1995 filename: wirf5.ms
Autor: Komma Datum: 28.3.94
Thema: Approximation durch stückw. gleichf. Bewegung, Wirkungsprinzip.
Weiterentwicklung von wirf4.ms mit procs()
| > | restart; with(plots): |
| > | Lq:=Tq-Vq(); # Vq() wird als proc formuliert, damit die Änderungen aller Parameter weitergereicht werden |
| > | clear:= proc(x) local p; |
| > | for p to n do |
| > | x[p]:=evaln(x[p]); od; end; |
| > |
| > | n:='n': dt:='dt':x[0]:='x[0]': |
| > | Tq:=m/(2*dt)*sum((x[j]-x[j+1])^2,j=0..n-1); |
| > | m:='m':g:='g':k:='k':x[0]:='x[0]': |
| > | V:=proc(x) |
| > | 1/2*k*x^2; |
| > | #m*g*x; |
| > | end; |
| > | if assigned(n) then clear(x) fi; |
| > | n:='n': dt:='dt': |
| > |
| > | Vq:=proc() dt*sum(V(x[j]),j=0..n-1); |
| > | end; |
| > | #n:=20: |
| > | #bahn(); |
| > | Lq; |
| > | bahn:=proc() local kk,j,i; global sys,sol,pkte; |
| > | if assigned(n) then clear(x) fi; |
| > |
| > | sys:=seq(diff(Lq,x[kk])=0,kk=1..n-1); |
| > | sol:=solve({sys},{seq(x[j],j=1..n-1)}): |
| > | assign(sol); |
| > | pkte:=array(1..n): |
| > | for i to n do |
| > | pkte[i]:=x[i] : |
| > | od: |
| > | end; |
| > |
Tests
| > | n:=10;bahn(); |
Etwas Computeralgebra
| > | x[3]; |
| > | collect(x[3],x[0]); |
| > | factor(x[3]); |
| > |
Parameter
Die Anzahl der Stützstellen kann noch mit t1 abgestimmt werden, insbes. für die Schwingung (z.B. n=20*t1). (Rundungsfehler?)
| > | n:=40: |
| > | m:=1: |
| > | k:=6: |
| > | #g:=50: |
| > | t1:=3: # untersuchen Sie auch größere Zeiten |
| > | dt:=t1/n: |
| > | x[0]:=1: # nicht 0 |
| > | bahn(); |
| > | x[n]:=0: |
| > |
| > | x[5]; |
| > |
| > | plota:=plot([[0,x[0]],seq([i*dt,pkte[i]],i=1..n-1),[n*dt,x[n]]]): |
| > | plota; |
| > |
| > | ITq:=evalf(Tq); IVq:=evalf(Vq()); Sq:=evalf(Lq); |
| > |
| > | soly:=proc() local F; F:=-diff(V(y),y): |
| > | rhs(dsolve({diff(y(t),t$2)=subs(y=y(t),F)/m,y(0)=x[0],y(t1)=x[n]},y(t))); end; |
| > | soly(); |
| > |
| > | plote:=plot(soly(),t=0..t1,color=black):#plote; |
| > | display({plota,plote}); |
| > |
| > | IT:=evalf(int(m/2*diff(soly(),t)^2,t=0..t1)); |
| > | IV:=evalf(int(V(soly()),t=0..t1)); |
| > | S:=IT-IV; |
| > |
Zurück zu "Parameter" ... Sie können alle ändern! Unter welchen Bedingungen wird die Näherung schlecht?
Wie läßt sich die Näherung verfeinern?
| > |
komma@oe.uni-tuebingen.de