Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Simpsons rule in excel

  • 23-04-2017 3:08pm
    #1
    Registered Users, Registered Users 2 Posts: 5


    I have a computers assignment and have to use simpsons rule in microsoft excel to get the answer.

    a = 0
    b = 20

    Sin (pi x/100)

    n = 20

    I dont even know where to start! Any help if very much appreciated. Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 2,338 ✭✭✭Bit cynical


    Going on the information on this page:
    http://www.intmath.com/integration/6-simpsons-rule.php

    Down a bit the page shows a memory aid:

    (delta x/3)(FIRST + 4(sum of ODDs) + 2(sum of EVENS) + LAST)

    This is not a very elegant way but should work. You need to be able to enter a formula that refers to other values by pointing the cursor.

    Create columns headed FIRST, ODDs, EVENs, LAST with empty columns in between them. FIRST will just hold the single number zero and LAST will contain the single number 20. So the FIRST column will look like:

    FIRST
    0

    and the LAST column will look like
    LAST
    0

    Below the ODDs, put all the odd numbers between 0 and 20 exclusive: (1, 3,..., 19). Excel has a quick way of doing this: you put in 1 and then 3 below it. Highlight both cells and then drag the corner down. It will generate the numbers.

    Below the EVENs, likewise put all the even numbers between 0 and 20 exclusive: (2,4,...,18).

    You now have four columns with spaces between.

    Under the FIRST column you have zero. To the right hand side of this zero put the formula =SIN(PI()*x/100) but instead of x have it refer to the the zero immediately to the left. It should evaluate to zero when you have entered it.

    Now copy the cell containing the formula to all the values of the other columns so that for each value of x you have a value for the function.

    You should now have values of the function for FIRST, the ODDS, the EVENs and the LAST.

    You now need to sum up the values in each of these columns. The important sums are (sum of ODDs) and (sum of EVENSs)

    Now put in somewhere below as a formula:

    = (FIRST + 4*ODDs - 2*EVENs + LAST) / 3.

    Note that you don't type in FIRST, ODDs, EVENs and LAST. These refer to already calculated sums. You need to point to these when entering the formula.

    This should give you your integral.

    Note that we've left out the interval delta x. This is because delta x is (b - a) / n = (20 - 0)/20 = 1. This should be easy to calculate in excel.


  • Registered Users, Registered Users 2 Posts: 227 ✭✭prosaic


    OP, do you get the idea behind Simpson's rule?
    Perhaps your assignment is done and dusted by now, but thought I might ask anyway.


  • Registered Users, Registered Users 2 Posts: 5 Charlie2013


    prosaic wrote: »
    OP, do you get the idea behind Simpson's rule?
    Perhaps your assignment is done and dusted by now, but thought I might ask anyway.

    Not really. I got one of the lads to send me their one and i just made it my own. I passed anyway


Advertisement