Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.9K Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Get same numerical and analytical integral's results?

Posted 7 years ago

Good morning-Afternoon.

I was recently programing an integral and decided to check how it would work compared to a numerical aproximation. I used Simpson and trapezoid rules. However, my results are several orders of magnitude different. I have attached my code.

Can someone please give me some hindsight on what I am doing wrong?

Thank you very much.

POSTED BY: Jaime de la Mota
4 Replies

Yes, this is exactly what I was looking for. Thank you very much for your help.

POSTED BY: Jaime de la Mota
POSTED BY: Hans Dolhaine

I see. Thank you bery much for the information. I am afraid I am not fluent enough in mathematica to propperly understand your proposed aproximation, but I will try to comprehend it.

POSTED BY: Jaime de la Mota

There are a number of ways to improve on this. Most important error is to not multiply trapezoid heights by step length. The value below is pretty good for an approximation.

step*(Total[Map[gausiana, N[PuntosEnsayo[[2 ;; -2]]]]] + 
   1/2 (gausiana[PuntosEnsayo[[1]]] + gausiana[PuntosEnsayo[[-1]]]))

(* Out[192]= 0.0000718038661611 *)
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard