Results 1 to 8 of 8
Thread: I need this Big Favour
02-26-2003, 01:06 AM #1brocavichGuest
I have to do this project for my school please help me out.
A well known method of numerical integration is the trapezoidal rule. According to the trapezoidal rule, the integral
is approximated by Ui , where
where ki is a positive integer assigned arbitrarily equal to the number of steps desired in the integration, and hi is the step size defined by
Usually one chooses k large enough to yield a sufficiently accurate result, but not so large as to create extensive computing times or lead to large accumulated round-off errors.
A cubic equation has the form
Write a C program to perform numeric integration of cubic equations, using the trapezoidal rule and for each integration use values of k from 10 to 1000000 in multiples of 10 (implemented with a for loop). The main function will read the values of a and b (the limits of the integration), followed by r, s, t and v (the coefficients of the cubic equation), from standard input as real values. (Do not prompt for input, as you will be using redirection from a file.) The main function will call a function named f as needed to evaluate f ( x ) . Do not write any other functions. Your output should be clearly labeled, with the cubic equation and the limits in the title and the numeric values for k and the corresponding calculated integral in columnar form (see example below). Real values should be represented to 8 places of decimals.
Use the data shown below for the run to be handed in as part c). Note that the marker may use other values in testing your program. To be judged correct, your program must work with all valid input values.
a = 1.2, b = 2.5
r = 17, s = -24, t = 0, v = 19
The output format should be as follows:
Trapezoidal Rule Integration
of 17.000000 x**3 - 24.000000 x**2 + 19.000000
from 1.200000 to 2.500000
No. of Intervals Value
02-26-2003, 02:28 AM #2DmXGuest
what is that eye means
02-26-2003, 10:17 AM #3matt2kjonesGuest
wow that looks like a tough question.
it looks more mathematical more than anything.
what you have to do exactly, work out how much U and i equals???
if you can work it out on pager then getting a c program to do it is pretty simple
02-26-2003, 11:59 AM #4brocavichGuest
the format of the output also given in the bottom of the paragraph. all the detail for the program is given in that paragraph, including the values for the letters(i.e.a=1.2,
b = 2.5,r = 17, s = -24, t = 0, v = 19). so, all i need is program that do all the calculations as expected, and return the output in the format mentioned in that para. please, help me out! cos, i only have 3 more days to finish the pro.thankz a lot.
02-26-2003, 06:54 PM #5JKSGuest
lol i know c and C++ but i don't know what that problem is lol
02-26-2003, 08:11 PM #6LogicGuest
I could figure it out for ya,.... but I don't like math... and I need money... so I'd like a payment.... Soz...
03-01-2003, 05:26 AM #7
Originally posted by Senthuran@Feb 26 2003, 04:10 PM
- Join Date
- Feb 2003
Programming Gurus Help him... :lol: ..HE is going to Cry.."Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
03-01-2003, 10:35 AM #8LogicGuest
Well, the above was just a bad excuse of mine... in all actuality, I'm not that advanced in math yet. I'm taking Geometry at the moment... And all I have had before this is Algebra I and II... so I've pooped.