You are on page 1of 1

Solution of equations system depending on a parameter

Original xmcdz file can be downloaded from here http://sites.google.com/site/nsutvs/eng


Let's draw solution graph of a system of two equations a*x
3
+ y
4
= 2; a*x
2
+ y
5
= 1 depending
on a parameter "a": x(a), y(a).
Given
a x
3
y
4
+ 2 =
- system of equations
"a" - parameter
a x
2
y
5
1 =
f x y , a , ( ) Find x y , ( ) := - function that returns the solution vector of the system depending on
the parameter "a".
The variables x and y are guess value of a solution.
a 1 :=
f 2 2 , a , ( )
1.16184
0.81056
|

\
|
|
.
=
x
y
|

\
|
|
.
f 2 2 , a , ( ) := a x
3
y
4
+ 2 0 =
- test
a x
2
y
5
1 0 =
Now solve the system for a range of values of "a" from a0 to a1:
N 50 := i 0 N .. := j 1 N .. := a0 3 := a1 0.255 :=
a1 a0
N
:= a
i
a0 i + :=
The system of equations can have multiple solutions. If it corresponds to some physical or chemical
phenomenon, initial guess values of unknown should be chosen so that resulting solution has a
physical meaning, that is, usually a positive real numbers.
Very often it is not possible to choose universal guess values of unknown parameters, which would
allow to "Given ... Find" block to find right solution of equations in a full range of values of
parameter "a". The way out of this situation is the selection of guess values, which give the right
solution for some certain parameter "a", for example, a
0
3 = and then use the previous solution for
a = a
j-1
as the guess values in searching the next solution at a = a
j
.
res
0
f 1 0.7 , a
0
,
( )
:= - finding the solution at a
0
3 = : res
0
( )
0
0.74926 = res
0
( )
1
0.9269 =
Now let's solve the system for the other
values of parameter a (a
1
, a
2
, ..., a
N
):
res
j
f res
j 1
( )
0
res
j 1
( )
1
, a
j
,

:= x
i
res
i
( )
0
:=
y
i
res
i
( )
1
:=
0 1 2 3
0
0.5
1
1.5
2
x
y
1
4
a

You might also like