Documente Academic
Documente Profesional
Documente Cultură
ec1 = a x ^ 2 + b x + c 0
c + b x + a x2 0
ec2 = x ^ 2 - x + 1 0
1 - x + x2 0
Sisteme de ecuatii
Sistem de ecuatii = ansamblu (lista) de ecuatii
Exemple:
1. lista de ecuatii: {ec1, ec2, ..., ecn}
2. egalitate a doua liste: {ms1,ms2,...,msn}=={md1,md2,...,mdn}
3. expresie relationala compusa: ec1 && ec2 && ... && ecn
3 x2 + y 2
Fie sistemul :
4x +5x y1
slides_csoft3a.nb
sistem1 = 83 x ^ 2 + y 2, 4 x + 5 x y 1<
93 x2 + y 2, 4 x + 5 x y 1=
sistem2 = 83 x ^ 2 + y, 4 x + 5 x y< 82, 1<
93 x2 + y, 4 x + 5 x y= 82, 1<
sistem3 = 3 x ^ 2 + y 2 && 4 x + 5 x y 1
3 x2 + y 2 && 4 x + 5 x y 1
Observatie: sistemele liniare pot fi specificate prin: A.X==B
A = 88a, b<, 8c, d<<; B = 8e, f<; X = 8x, y<;
sistem4 = A.X B
8a x + b y, c x + d y< 8e, f<
slides_csoft3a.nb
-b -
b2 - 4 a c
2a
>, :x
-b +
b2 - 4 a c
2a
>>
-b -
b2 - 4 a c
-b +
b2 - 4 a c
,
2a
2a
>
H* verificarea
radacinilor: se aplica regulile de transformare asupra ecuatiei *L
slides_csoft3a.nb
ec1 . sol1
2
:c +
b -b -
b2 - 4 a c
-b -
b2 - 4 a c
0,
2a
4a
2
b -b +
b2 - 4 a c
c+
-b +
b2 - 4 a c
+
2a
0>
4a
Simplify@ec1 . sol1D
8True, True<
H*
sol2 = Solve@ec2, xD
99x H-1L13 =, 9x -H-1L23 ==
99x H-1L13 =, 9x -H-1L23 ==
N@%D
sol2b = NSolve@ec2, xD
H* determinarea directa a valorilor aproximative *L
88x 0.5 - 0.866025 <, 8x 0.5 + 0.866025 <<
Ecuatii transcendente
Solve@Log@x ^ 2D 4, xD
99x 2 ==
slides_csoft3a.nb
Solve@Sin@x ^ 2D == 0.5, xD
Solve::ifun :
Inverse functions are being used by Solve, so some solutions may not
be found; use Reduce for complete solution information.
88x -0.723601<, 8x 0.723601<<
N@%D
88x
8x
8x
8x
8x
-1.<, 8x -0.604405<,
-0.948402 - 0.927994 <, 8x -0.948402 + 0.927994 <,
0.333717 - 0.547602 <, 8x 0.333717 + 0.547602 <,
0.339644 - 1.31575 <, 8x 0.339644 + 1.31575 <,
1.07724 - 0.277579 <, 8x 1.07724 + 0.277579 <<
Observatie. Root permite identificarea succesiva a radacinilor a unei ecuatii polinomiale folosind metode numerice
de izolare a radacinilor (functioneaza pentru polinoame de orice grad)
N@Root@ ^ 8 + ^ 5 + 1 &, 3DD
-0.314537 - 0.844821
slides_csoft3a.nb
N@Roots@x ^ 8 + x ^ 5 + 1 0, xDD
x -1.00377 - 0.270225 x -1.00377 + 0.270225
x -0.314537 - 0.844821 x -0.314537 + 0.844821
x 0.490558 - 1.02215 x 0.490558 + 1.02215
x 0.827745 - 0.448046 x 0.827745 + 0.448046
Reduce permite identificarea tuturor seturilor de parametri care conduc la solutii:
Reduce@a x ^ 2 + b x + c 0, xD
a 0 && x
-b -
b2 - 4 a c
2a
a 0 && b 0 && x -
-b +
b2 - 4 a c
2a
Hc 0 && b 0 && a 0L
c
b
Sisteme de ecuatii
:
3 x2 + y 2
4x +5xy 1
Solve@sistem1, 8x, y<D
1
10
J7 -
33
5
10
165 N, x
,x
2
1
30
J15 +
1
30
J15 -
165 N>,
165 N>>
1
10
J7 -
33
5
10
165 N, x
,x
2
1
30
J15 +
1
30
J15 -
165 N>>
165 N>,
slides_csoft3a.nb
1
10
J7 -
33
5
10
165 N, x
,x
2
1
30
J15 +
1
30
J15 -
165 N>,
165 N>>
Solve@sistem4, XD
::x -
-d e + b f
-b c + a d
,y-
-c e + a f
bc-ad
>>
slides_csoft3a.nb
LinearSolve@A, BD
:
de-bf
-b c + a d
ce-af
bc-ad
>
de-bf
-b c + a d
ce-af
bc-ad
>
Alte functii:
Eliminate: permite eliminarea prin substitutie a unei necunoscute din toate ecuatiile sistemului
Eliminate@sistem1, xD
-64 y - 10 y2 + 25 y3 29
Exemplul 1
f@x_D := Exp@xD - Sin@x ^ 2D
slides_csoft3a.nb
50
40
30
20
10
-4
-2
NSolve@f@xD 0, xD
Solve::tdep :
The equations appear to involve the variables to be solved
for in an essentially non-algebraic way.
NSolveAx - SinAx2 E 0, xE
FindRoot@f@xD 0, 8x, 0, 1<D
8x -0.714969<
FindRoot@f@xD 0, 8x, -1<D
8x -0.714969<
FindRoot@f@xD 0, 8x, -2<D
8x -1.72097<
Exemplul 2:
g@x_D := Exp@Abs@xDD - 2
slides_csoft3a.nb
10
-2
-1
-1
FindRoot@g@xD 0, 8x, 1<D
8x 0.693147<
Observatie: metoda lui Newton poate fi aplicata si pentru sisteme de ecuatii, insa apar dificultati daca jacobianul nu
poate fi calculat simbolic. In acest caz se poate folosi metoda secantei (trebuie specificate doua valori pentru aproximatia initiala).
FindRoot@g@xD 0, 8x, 0, 1<D
8x 0.693147<
FindRoot@g@xD 0, 8x, -5, -3<D
8x -0.693147<
slides_csoft3a.nb
11
slides_csoft3a.nb
12
Exemple
sd1 = DSolve@ecdif1, y@xD, xD
88y@xD a x C@1D<<
sd1 = DSolve@ecdif1, y, xD
88y Function@8x<, a x C@1DD<<
H* Reprezentarea grafica a familiei de solutii pentru valori
ale constantei de integrare cuprinse intre 0 si 10 *L
slides_csoft3a.nb
13
40
30
20
10
-2
-1
1
2
y FunctionA8t<, 1 + -t C@2DE>>
Simplify@x@tD . sd2 . 8C@1D -1, C@2D 1<D
:
1
2
- 2 -2 t + -t >
1
2
slides_csoft3a.nb
14
x@tD . sd3 . t 1
:
-1 + 2
2 2
>
1
2
-1 + 2
2 2
>
DSolve permite si rezolvarea ecuatiilor de ordin superior (exemplu: ecuatia oscilatorului armonic liniar):
ecdif2 = 8x ''@tD + ^ 2 x@tD 0, x@0D 0, x '@0D v0<
92 x@tD + x @tD 0, x@0D 0, x @0D v0=
sd5 = DSolve@ecdif2, x, tD
::x FunctionB8t<,
v0 Sin@t D
F>>
slides_csoft3a.nb
15
0.4
0.2
10
-0.2
-0.4
t + InverseFunctionAExpIntegralEiH-1L , 1, 1E@-1DEE==
slides_csoft3a.nb
16
1.35
1.30
1.25
1.20
1.15
1.10
1.05
0.02
0.04
0.06
0.08
0.10
x@0.2D . sol
InterpolatingFunction::dmval :
Input value 80.2< lies outside the range of data in the
interpolating function. Extrapolation will be used.
82.33439<