You are on page 1of 5

RJEŠAVANJE SUSTAVA JEDNADŽBI

Mathcad Help - Solving - Solve Block


Matrično
Solve Block u Mathcadu označava cijeli skup
funkcija za rješavanje jednadžbi, sustava
Zadan je sustav linearnih jednadžbi: jednadžbi, diferencijalnih jednadžbi i problema
optimizacije
2 ⋅ x1 + 3 ⋅ x2 + 5 ⋅ x3 + 4 ⋅ x4 = 1

3 ⋅ x1 + 1 ⋅ x2 + 1 ⋅ x3 + 0 ⋅ x4 = 2 sustav od 4 linearne jednadžbe

5 ⋅ x1 + 7 ⋅ x2 + 1 ⋅ x3 + 1 ⋅ x4 = 0 Znak = iz Boolean toolbara!

0 ⋅ x1 + 1 ⋅ x2 + 8 ⋅ x3 − 1 ⋅ x4 = 1 x2 + 8 ⋅ x3 − x4 = 1

Pišemo odgovarajuću matricu koeficijenata A:

⎛⎜ 2 3 5 ⎞⎟
4

A := ⎜ ⎟ Detarminanta od matrice A:
3 1 1 0
⎜5 7 1 1 ⎟
⎜0 ⎟ A = −551
⎝ 1 8 −1 ⎠

Vektor b je vektor desne strane sustava:

⎛⎜ 1 ⎞⎟
⎛⎜ 0.8 ⎞⎟
b := ⎜ ⎟
2
⎜0 ⎟ −0.608 ⎟
x=⎜
−1
x := A ⋅b x = 0.8 x = −0.608
⎜1 ⎟ ⎜ 0.207 ⎟ 1 2
⎝ ⎠ ⎜ 0.047 ⎟
⎝ ⎠ x = 0.207 x = 0.047
3 4

Ako je determinanta matrice 0, sustav nema jedinstveno rjesenje!!!


Ili ima beskonacno mnogo rjesenja ili uopce nema.
Ako je det(A) = 0 ne postoji inverz matrice A!

Determinanta "moje" matrice nije nula, sto znaci da ce sustav imati jedinstveno rjesenje
Kako se sutav može zapisati matrično:
A⋅b = x
−1
Odavdje slijedi rješenje: x := A ⋅b

⎛⎜ 0.8 ⎞⎟
−0.608 ⎟ x je vektor nepoznanica
x=⎜
⎜ 0.207 ⎟
⎜ 0.047 ⎟
⎝ ⎠
lsolve Insert > Function > Function Category: Solving > Function Name: lsolve

Vraća vektor x rješavajući linearni sistem jednadžbi M*x = v


lSolve ( A , b) =
(u našem slučaju A*x=b)
Rješava samo sustave linearnih jednadžbi!

⎛⎜ 0.8 ⎞⎟ ⎛⎜ 0.8 ⎞⎟
−0.608 ⎟ −0.608 ⎟
lsolve ( A , b) = ⎜ Rj = ⎜
ili Rj := lsolve ( A , b)
⎜ 0.207 ⎟ ⎜ 0.207 ⎟ Rj = 0.8
1
⎜ 0.047 ⎟ ⎜ 0.047 ⎟ Rj = −0.608
⎝ ⎠ ⎝ ⎠ 2

Find

1. zadajemo početna - probna rješenja (imamo ih 4):

i := 1 .. 4 X := 1 ⎛⎜ 1 ⎞⎟
i
X=⎜ ⎟
1
2. pišemo "Given": ⎜1 ⎟
⎜1 ⎟
⎝ ⎠
Given

3. zadajemo sustav jednadžbi i to u matričnom ili klasično u obliku jednakosti:

matrično
A⋅X = b znak = zadati kao Boolean!

4. Zadati funkciju za traženje rješenja "Find":

⎛⎜ 0.8 ⎞⎟
−0.608 ⎟
Find ( X ) = ⎜ ili Rf := Find ( X ) Rf =
⎜ 0.207 ⎟
⎜ 0.047 ⎟
⎝ ⎠ Napomena : "Given" i "Find" napisati pomoću
tipkovnice, ali kao Math Region, ne Text Region
(bez razmaka nakon teksta)
jednadžbe jednakosti

2 ⋅ x1 + 3 ⋅ x2 + 5 ⋅ x3 + 4 ⋅ x4 = 1

3 ⋅ x1 + 1 ⋅ x2 + 1 ⋅ x3 + 0 ⋅ x4 = 2

5 ⋅ x1 + 7 ⋅ x2 + 1 ⋅ x3 + 1 ⋅ x4 = 0

0 ⋅ x1 + 1 ⋅ x2 + 8 ⋅ x3 − 1 ⋅ x4 = 1
Symbolic

⎛ 2 ⋅ x1 + 3 ⋅ x2 + 5 ⋅ x3 + 4 ⋅ x4 = 1 ⎞
⎜ ⎟
⎜ 3 ⋅ x1 + 1 ⋅ x2 + 1 ⋅ x3 + 0 ⋅ x4 = 2 ⎟ solve , x 1 , x 2 , x 3 , x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