Numerical Integration

Numerical Integration Numerical Integration

files.vlsi.uwindsor.ca
from files.vlsi.uwindsor.ca More from this publisher
22.04.2015 Views

Simpson’s 1/3 Code (p.3) double Integration::Simpsons13(int n) { double h=(xn-x0)/n; double sum=0.0; double x=x0; double I; for(int i=1; i

Simpson’s 1/3 Code (p.4) double FUN(double x) // User supplied function { return 0.2 + 25*x - 200*x*x * + 675*x*x*x * * - 900*x*x*x*x* * * + 400*x*x*x*x*x; } int main() { Integration I(FUN,0,0.8); int i; for(i=2;i

Simpson’s 1/3 Code (p.4)<br />

double FUN(double x) // User supplied function {<br />

return 0.2 + 25*x - 200*x*x * + 675*x*x*x * * - 900*x*x*x*x* * *<br />

+ 400*x*x*x*x*x; }<br />

int main() {<br />

<strong>Integration</strong> I(FUN,0,0.8);<br />

int i;<br />

for(i=2;i

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!