Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: Numerik Üb 5
Views: 49
#5.3.c print "Funktion aus A 5.3" f=(x^3*e^x)/(sqrt(1-(2*x-5)^2)) plot(f,2,3) print "exakter Integralwert" I23=integral(f, x, 2, 3) show(I23) print "Wert der Gewichtsfunktion auf [0,2]" I=integral(1/sqrt((1-x^2)), x, -1, 1) show(I) a=2 b=3 #Transformationsfunktion t=(b-a)/2*x+(b+a)/2 #k=1 k=1 i=0 x0=t(cos((2*i+1)/(2*(k+1))*pi)) print "x0 Stützstelle" x0.numerical_approx() y0=f(x0) print "g(x0)" y0.numerical_approx() i=1 x0=t(cos((2*i+1)/(2*(k+1))*pi)) print "x1 Stützstelle" x1.numerical_approx() y1=f(x1) print "g(x1)" y1.numerical_approx() #Integralwert auf [2,3] QI=(b-a)/2*pi*(1/2*y0+1/2*y1) print "Quadratur Ergebnis" QI.numerical_approx() print "Analytischer Integralwert" I23.numerical_approx() print "Unterschied" r=I23-QI r.numerical_approx() #k=2 print "Nun k=2 Stützstelle" x0=t(cos((2*0+1)/(2*(2+1))*pi)) print "x0 Stützstelle" x0.numerical_approx() y0=f(x0) print "g(x0)" y0.numerical_approx() x1=t(cos((2*1+1)/(2*(2+1))*pi)) print "x1 Stützstelle" x1.numerical_approx() y1=f(x1) print "g(x1)" y1.numerical_approx() x2=t(cos((2*2+1)/(2*(2+1))*pi)) print "x2 Stützstelle" x2.numerical_approx() y2=f(x2) print "g(x2)" y2.numerical_approx() #Integralwert auf [2,3] mit k =2 QI2=(b-a)/2*pi*(1/3*y0+1/3*y1+1/3*y2) print "Quadratur Ergebnis" QI2.numerical_approx() print "Analytischer Integralwert" I23.numerical_approx() print "Unterschied" r=I23-QI2 r.numerical_approx()
Funktion aus A 5.3
exakter Integralwert
23x3ex(2x5)2+1dx\displaystyle \int_{2}^{3} \frac{x^{3} e^{x}}{\sqrt{-{\left(2 \, x - 5\right)}^{2} + 1}}\,{d x}
Wert der Gewichtsfunktion auf [0,2]
π\displaystyle \pi
x0 Stützstelle 2.85355339059327 g(x0) 570.105849817738 x1 Stützstelle 2.50000000000000 g(x1) 190.351468135992 Quadratur Ergebnis 597.261780863008 Analytischer Integralwert 384.36764355124916 Unterschied -212.894137311759 Nun k=2 Stützstelle x0 Stützstelle 2.93301270189222 g(x0) 947.901168760411 x1 Stützstelle 2.50000000000000 g(x1) 190.351468135992 x2 Stützstelle 2.06698729810778 g(x2) 139.548315009572 Quadratur Ergebnis 669.055013876309 Analytischer Integralwert 384.36764355124916 Unterschied -284.687370325060