Mathcad - Integrare Numerica
Mathcad - Integrare Numerica
Mathcad - Integrare Numerica
Integrare numerica
y ( x ) :=
sin x( 2) <---------- Functia de integrat
2
x
1
a := 0.5 b := 4 <---- Intervalul de integrare
n := 20 <---Nr. de noduri
y( x)
0.5
ba
h := <--- Pasul de integrare 4 2 0 2 4
n
0.5
IntegD( y , a , b , n ) := S0
ba x
h
n Algoritmul metodei
for x a , a + h .. b h
S S + y x +
h
h
2
S
b
IntDrept := IntegD( y , a , b , n ) ValoareaExacta := y ( x ) dx <---Solutia Mathcad de integrare
a
IntDrept = 0.762 ValoareaExacta = 0.762
( IntDrept ValoareaExacta)
EroareAbsoluta := IntDrept ValoareaExacta EroareRelativa := 100
ValoareaExacta
4
EroareAbsoluta = 5.315 10 EroareRelativa = 0.07
1
Metode Numerice Lab 7 Integrare numerica
x := a , a + h .. b
y( x)
0.5 2.25 4
y( x)
ba
h :=
2m x := a , a + h .. b
y( x)
0.5 2.25 4
y( x)
2
Metode Numerice Lab 7 Integrare numerica
Aplicatie 2 .
Debitul de apa murdara evacuat intr-un canal deschis a fost masurat obtinandu-se urmatoarele date:
665
0
10 705
780
20 830
30
870
40 890
50
Debit := 870
Timp := 60
800
70 725
80 670
90
640
100 620
110
610
120
Sa se determine debitul total de apa in m 3 ce trece in intervalul timp masurat prin canal.
0 0
y := Debit x := Timp
Presupunem ca
3 2
y = a x + b x + c x + d
x3
x2
Y( x ) :=
x1
1.5
S := linfit( x , y , Y) Se determina coeficientii de functiei de regresie
8.421 10 4
S=
0.212
13.068
418.004
corr y reg( x ) , y = 0.965
yreg( z) 400
200
0 50 100
Timp , z
3
Metode Numerice Lab 7 Integrare numerica
IntegSim( y , a , b , m) := n 2m
ba
h
n
for i 0 .. n 1
m 1
s1
y ( a + 2 i h)
i= 1
m
s2
y[ a + ( 2 i 1) h]
i= 1
h
S ( y ( a) + y ( b ) + 2 s1 + 4 s2 )
3
S
a := 0 b := 120 m := 20
(
Debittotal := IntegSim y reg , a , b , m )
4
Debittotal = 9.076 10
x := a , a + 10 .. b
3
1 10
yreg( x)
700
yreg( x)
400
0 60 120
x
Aplicatie 3. In urma cercetarilor experimentale s-au obtinut urmatoarele date experimentale pentru
functia y=f(x):
x f(x)
Date :=
0 1
0 0 100
1 0.1 75
2 0.2 60.5
3 0.3 53.5
4 0.4 53
5 0.5 60
6 0.6 72.5
4
Metode Numerice Lab 7 Integrare numerica
0 1
x := Date f ( x ) := Date
100
90
80
f ( x)
70
60
50
0 0.2 0.4 0.6
x
2
Se determina functia de aproximare de forma y apr( x ) = ax + bx + c
x2
F( x ) := x
1
a a
b := linfit( x , f ( x) , F) Coeficientii := b
c c
366.667
Coeficientii = 262.857
98.976
2
y apr( x ) := F( x ) Coeficientii -------> y apr( x ) = 366.667 x 262.857 x + 98.976
corr y apr( x ) , f ( x ) = 0.999 -------> coeficientul de corelatie
IntegSim( y , a , b , m) := n 2m
ba
h
n
for i 0 .. n 1
m 1
s1
y ( a + 2 i h)
i= 1
m
s2
y[ a + ( 2 i 1) h]
i= 1
h
S ( y ( a) + y ( b ) + 2 s1 + 4 s2 )
3
S
5
Metode Numerice Lab 7 Integrare numerica
a := 0 b := 0.6
b
(
A := IntegSim y apr , a , b , m ) ValoareaExacta := y apr ( x ) dx
a
ValoareaExacta = 38.471
A = 38.471
x := a , a + 0.1 .. b
100
yapr( x)
70
yapr( x)
40
0 0.35 0.7
x