| > |
| > | COMPARISONS OF ASYMPTOTIC APPROXIMATIONS WITH
NUMERICAL QUADRATURE RESULTS |
| > | restart:
approx:=x->evalf(exp(x^2)/(2*x)); |
| > | num:=x->evalf(Int(exp(t^2),t=0..x)); |
| > | test:=proc(x)
local a,n,rel_err; a:=approx(x); n:=num(x); rel_err:=(a-n)/n; return [a,n,rel_err]; end proc: test(1); test(5); test(10); test(20); |
| > |
| > |
| > | restart:
approx:=lambda->evalf((sqrt(Pi))*( exp(lambda)/sqrt(lambda))); |
| > | num:=lambda->evalf(Int(cos(t/2)*exp(lambda*sin(t)),t=0..Pi)); |
| > | p:=lambda->plot(cos(t/2)*exp(lambda*sin(t)),t=0..Pi);
p(50); test:=proc(lambda) local a,n,rel_err; a:=approx(lambda); n:=num(lambda); rel_err:=(a-n)/n; return [a,n,rel_err]; end proc: test(1); test(10); test(20); test(50); |
![[Plot]](images/exam3_checks_10.gif)
| > |