#Problem 1 t = var('t') f = vector([2*sin(t), exp(-2*t), 2*t]) v = diff(f, t) print "v =", v a = diff(v, t) print "a =", a vn = v.norm() print "Geschwindigkeit= ", vn an = a.norm() print "Beschleunigung = ", an g = Graphics() t0 = 0 t1 = t0 + 1 p = parametric_plot3d(f, (0, 3), thickness=3, aspect_ratio=[1,1,1]) g+= p g+= point(f(t=t0), rgbcolor=(1,0,0), size = 9, aspect_ratio=[1,1,1]) g+= plot(v(t=t0), start=f(t=t0), rgbcolor=(0,2,0), thickness=4, aspect_ratio=[1,1,1]) g+= point(f(t=t1), rgbcolor=(1,0,0), size = 9, aspect_ratio=[1,1,1]) g+= plot(v(t=t1), start=f(t=t1), thickness=4, aspect_ratio=[1,1,1]) g+= plot((v(t=t1)-v(t=t0)), start=f(t0), aspect_ratio=[1,1,1]) g+= plot(v(t=t0), start=f(t=t1),rgbcolor=(0,2,0), aspect_ratio=[1,1,1]) g+= plot(v(t=t1)-v(t=t0), start=(f(t=t1)+v(t=t0)), aspect_ratio=[1,1,1]) g+= plot(a(t=t0), start=f(t=t0), rgbcolor=(0,0,1), aspect_ratio=[1,1,1]) g.show() #Problem 2 t = var('t') f = vector([sin(t), cos(t), t]) v = diff(f, t) print "v =", v a = diff(v, t) print "a =", a vn = v.norm() print "Geschwindigkeit= ", vn an = a.norm() print "Beschleunigung = ", a T = (v/vn).simplify_full() print "Einheitstangente = ", T #K = ||dT/ds|| = ||dT/dt||/||df/dt|| Krümmung dT = diff(T, t).simplify_full() print "dT=", dT dTnorm = dT.norm().simplify_full() K = dTnorm/vn print "K=", K #N = 1/K*dT/ds = 1/K*(dT/dt)/||df/dt|| Hauptnormale N = (1/K*dT/vn).simplify_full() print "N = ", N #Binormale = T x N B = T.cross_product(N) print "B = ", B.simplify_full() #Torsion #dB/ds = dB/dt/||df/dt|| dB = diff(B,t) Bs = dB/vn #Bs ist dB/ds print "dB/ds =", Bs.simplify_full() #Bestimmung Torsion tau = -Bs.dot_product(N) # - <(dB/ds),N> print "tau =", tau.simplify_full() g = Graphics() t0 = 1 t1 = t0 + 1/vn(t=t0) #wir legen 1 längeneinheit in 1/vn(t=t0) zeiteinheiten zurück. p = parametric_plot3d(f, (-3, 3), thickness=3, aspect_ratio=[1,1,1]) g+= p g+= point(f(t=t0), rgbcolor=(1,0,0), size = 9, aspect_ratio=[1,1,1]) g+= plot(T(t=t0), start=f(t0), rgbcolor=(0,2,0), thickness=4, aspect_ratio=[1,1,1]) g+= point(f(t=t1), rgbcolor=(1,0,0), size = 9, aspect_ratio=[1,1,1]) g+= plot(T(t=t1), start=f(t=t1), thickness=4, aspect_ratio=[1,1,1]) g+= plot(T(t=t1)-T(t=t0), start=f(t=t1), aspect_ratio=[1,1,1]) g+= plot(T(t=t0), start=f(t=t1),rgbcolor=(0,2,0), aspect_ratio=[1,1,1]) g+= plot(T(t=t1)-T(t=t0), start=(f(t=t1)+T(t=t0)), aspect_ratio=[1,1,1]) dTg = (T(t=t1)-T(t=t0)) #dT/ds #nur für Bild Kg = (T(t=t1)-T(t=t0)).norm() #nur für Bild Ng = dTg/Kg g+= plot(Ng, start=(f(t=t1)), rgbcolor=(0,2,5), thickness = 2, aspect_ratio=[1,1,1]) #Hauptnormale g+= plot(N(t=t0), start=f(t0), rgbcolor=(0,2,5), thickness = 2, aspect_ratio=[1,1,1]) #Hauptnormale g+= plot(B(t=t0), start=f(t0), rgbcolor=(5,0,0), thickness =8, aspect_ratio=[1,1,1]) #Binormale im Punkt t0 g+= plot(B(t=t1), start=f(t1), rgbcolor=(5,0,0), thickness =8, aspect_ratio=[1,1,1]) #Binormale im Punkt t1 g+= plot(B(t=t0), start=f(t1), rgbcolor=(5,0,0), thickness =8, aspect_ratio=[1,1,1]) g+= plot(B(t=t1)-B(t=t0), start=f(t1)+B(t=t0), rgbcolor=(5,0,0), thickness = 4, aspect_ratio=[1,1,1]) g.show()