Sie sind auf Seite 1von 11

1.

Output:
b.
Please enter your equation Give an equation in x: (4*x-3)^3

Enter the N value ranging from 1 to 4 for Newton-Cotes methods

1: Trapezoidal Method

2: Simpson 1/3

3: Simpson 3/8

4: Richardson Extrapolation

5: Romberg Integration

Mode selection: 1

Enter lower range of integration: -3

Enter upper range of integration: 5

Enter number of intervals for integration: 1

True value of the integral is: 2056.0

h =

Int_sum_1 =

6152

ea =

199.6833976833976833976833976834

c.
a. for no. of intervals = 2
Enter number of intervals for integration: 2

True value of the integral is: 2056.0

h =

Int_sum_1 =

3080

ea =

49.420849420849420849420849420849

b. for no. of intervals = 4


Enter number of intervals for integration: 4

True value of the integral is: 2056

h =

Int_sum_1 =

2312

ea =

12.355212355212355212355212355212

d.
a. Simpson’s 1/3 rule
Enter lower range of integration: -3

Enter upper range of integration: 5

Enter number of intervals for integration: 1

True value of the integral is: 2056.0

h =

Int_sum_1 =

4.101292320000001e+03

ea =

98.453613899613917133085201332583

b. Simpson’s 3/8 rule


Enter number of intervals for integration: 1

True value of the integral is: 2056

h =

Int_sum_1 =

4614

ea =

124.26254826254826254826254826255
2. Output:
3. Output:

Please enter your equation Give an equation in x: (2*x + 3/x).^2

y =

(2*x + 3/x)^2

Enter the N value ranging from 1 to 4 for Newton-Cotes methods

1: Trapezoidal Method
2: Simpson 1/3
3: Simpson 3/8
4: Richardson Extrapolation
5: Romberg Integration

Mode selection: 5

Enter lower range of integration: 1


Enter upper range of integration: 2
Enter number of intervals for integration: 16

True value of the integral is: 25.83333

h =

0.062500000000000

Order of integration: 4

I_val =

0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0

ea =

100 100 100 100


100 100 100 100
100 100 100 100
100 100 100 100

I_val =

26.312500000000000 25.837091836734697 0 0
25.955943877551022 0 0 0
25.864187652937026 0 0 0
25.841060031142970 0 0 0

ea =

0.018400219586222038570255676859233

I_val =

26.312500000000000 25.837091836734697 0 0
25.955943877551022 -8.612363945578233 0 0
25.864187652937026 0 0 0
25.841060031142970 0 0 0

ea =

4.0138001646896661611663148505613
I_val =

26.312500000000000 25.837091836734697 0 0
25.955943877551022 -8.612363945578233 0 0
25.864187652937026 0 0 0
25.841060031142970 0 0 0

ea =

Inf

I_val =

26.312500000000000 25.837091836734697 25.858070571296093 0


25.955943877551022 -8.612363945578233 0 0
25.864187652937026 0 0 0
25.841060031142970 0 0 0

ea =

0.00081130316755665700650251848102812

I_val =

26.312500000000000 25.837091836734697 25.858070571296093 0


25.955943877551022 -8.612363945578233 0.574157596371882 0
25.864187652937026 0 0 0
25.841060031142970 0 0 0

ea =

16.0

I_val =

26.312500000000000 25.837091836734697 25.858070571296093 25.840692926035128


25.955943877551022 -8.612363945578233 0.574157596371882 0
25.864187652937026 0 0 0
25.841060031142970 0 0 0

ea =

0.00057249145797696515802072125822519

4. Output

a. 2 points
Enter lower range of integration: 1
Enter upper range of integration: 2

True value of the integral is: 25.83333

dx =

0.500000000000000
val =

c0 c1 x0 x1 I
___ ___ ________ ________ ________________

0.5 0.5 1.211325 1.788675 25.8067053337074

b. 3 points

Enter lower range of integration: 1


Enter upper range of integration: 2

True value of the integral is: 25.83333

dx =

0.500000000000000

val =

x0 x1 x2 I
________ ___ ________ ________________

1.112702 1.5 1.887298 25.8321980049116

c. 4 points
En ter lower range of integration: 1

Enter upper range of integration: 2

True value of the integral is: 25.83333

dx =

0.500000000000000

val =

x0 x1 x2 x3 I

________ _________ _________ ________ _______________

1.069432 1.3300095 1.6699905 1.930568 25.833262463319


5. Output
6. Output
7. Output

Das könnte Ihnen auch gefallen