3/6/2024 0 Comments Integral e x2![]() ![]() I basically need to apply the function f as e^-(x^2) and I need to alter the trapezium coding such that it gives me a good approximate for the integral - so I'm guessing I take some -100 to 100 as my 'a' and 'b' values. Note sure if I have the indentation right 'n' is the number of trapeziums or widths I take, delta is just a small number I specify. Print " Cannot reach requested accuracy with", \ While ( fabs(inew - iold)>delta * fabs( inew )): Here is my coding for the trapezium rule: def trap1 (f,a,b,delta, maxtraps=512): Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. I need to approximate the integral using the trapezium rule, which I have coding for but I just don't know how to apply it to the function. The second deriva- tive of f ex2 is (4x2 -2)ex2, and it is not hard to see that on 0, 1, (4x2 -2)ex2 2. ![]() I need to integrate e^-(x^2) between negative infinity and positive infinity, now the function vanishes to a minute value much before negative and positive infinity.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |