Sie sind auf Seite 1von 4

GLS.

xlsm

www.boundary-element-method.com

Boundary Element Method Open Source Software in Excel VBA


File /
Module(s)
Title
Version(Date)
and History
Description

GLS.xlsm/ GLS.xlsm
Carries out the solution of a general linear system of equations that arise in the direct boundary element method.
1. (June 2015).
This is a Excel spreadsheet for demonstration the VBA codes gls.bas and regls.bas. gls.bas solves a system of equations of the
form
(1)

= + ,
where A and B are known matrices and is a known -vector with
+ = for = 1 or + = .

(2)

where the , and are constants with and are never both zero for each i. The evaluation of vectors and is the solution
of the process. regls.bas find a new and fast solution with a different c and f , using information from gls.bas.
An alternative way of wtiting equation (2) is
+ = ,
(3)
where and are diagonal matrices with [ ] = ( ) and [ ] = ( ).

The initial test problems on the spreadsheet are the 22 system


(

1
1
4 1 1
1 1
15 (
) ( ) = (
)( ) + (
) , 0.5 2) ( ) + (0.1
3 1
2
2 3 2
2
11

1
0.4
),
5) ( ) = (
2
1

1
1
1
1
and the solution using gls is ( ) = ( ) , ( ) = ( ),
2
7
2
3
Then changing c and f to = (

1
1
28
2.7
2
5
), = (
) using regls is ( ) = ( ) , ( ) = ( ).
13
29
2
2
7
3

GLS.xlsm

www.boundary-element-method.com

and the 55 system


19 32
93
91
76
98
31 91
(91 11

92 62
17 42
5 92
94 13
89 4

(8 66

1
0.89
82
2
26
0.32
3 =
0.67
66
4
0.53
80
37) (5 )
(0.57

1
2
0 53 45) 3 + (2.5 0.3
4
(5 )

0.16
0.83
0.87
0.42
0.96

1
0.92 0.79 0.96
0.56
2
0.41 0.47 0.55
15.7
3 + 1.83 ,
0.94 0.37 0.58
4
5.38
0.73 0.46 0.12

5
0.14 0.82 0.9 ) ( ) ( 2.7 )

0.96 0.74

1
14.52
2
3.54
0) 3 = 8.64
4
0.11

( 5)
( 0.9 )

1
1
0.06
6
2

0.04
2
3
and the solution using gls is solution 3 = 0.08
and 3 = 9 .
4
4
0.03
2

( 5 ) (0.02)
( 5)
(7)
1
1
30.11
62.4
24
0.3
2
2
9.8
75.9
1.3
33
0
0
Then changing c and f to = 148.44 , =
, using regls returns 3 = 0.4
and 3 =
.
4
4
44.46
15.68
57
0.5
(134.38)
( 90 )
(5 ) ( 2 )
(5 )
(18)
Interface

The test problems above are pre-set in the spreadsheet. On sheet 22 the solution to the first test problem is demonstrated and
on sheet 55 the solution to the second test problem is demonstrated. On both sheet he middle section is for solving the initial
linear system using the module gls.bas.In the lower section, some of the information from runnin gls is stored and the vectors c
and f are changed and the solution to the new problem is found using regls.

GLS.xlsm

www.boundary-element-method.com

In both the first and second solutions, he solution cells (in blue) can be cleared using the button
The solution using gls.bas can be implemented by using the
using regls.bas can be found using the

button and the solution to the second problem


button.

The buttons on the screen can be used in order to run the test problems above. In order to set up a new test problems then the
cells coloured brown-orange need to be changed. The image below shows the top right section of the 22 sheet, but the same is
true for the 55 sheet. When the brown-orange cells are changed the cells in green are updated.

The relevant cell contents are automatically copied over to the yellow areas of the sheet, as shown below. The solutions x and y are
predetermied here, but of course are computed from the other information (in yellow) using the modules gls and regls, as
explained above.

GLS.xlsm
Web source
of code.
Web source
of this guide
Web source
of the
algorithm
Dependent
routines
Test
problems or
modules
tested
Licence
Codes that
this may be
used
alongside this
one
Similar codes
that may be
of interest
Applications
Alternative
Platforms
Author
References

www.boundary-element-method.com
www.boundary-element-method.com/Excel_VBA/GLS.xlsm
www.boundary-element-method.com/Excel_VBA/gls_xls.pdf
www.boundary-element-method.com/tutorials/Numerical Solution of a General Linear System of Equations.pdf
lufac.bas and lufbsubs.bas from the Excel file : www.numerical-methods.com/Excel_VBA/LU.xlsm
www.boundary-element-method.com/Excel_VBA/GLS.xlsm

This is open source; the software may be used and applied within other systems as long as its provenance is appropriately
acknowledged. See the GNU Licence for more information or contact webmaster@boundary-element-method.com .

A similar m-file code is available (Matlab/Freemat/Octave/Scilab) is available on


www.boundary-element-method.com/mfiles/gls.m
and a similar code in Fortran is available on
www.boundary-element-method.com/fortran/REGLS.for
Fortran-Real System GLS
Matlab/Freemat/Octave/Scilab gls
VBA/Visual Basic gls_bas.pdf
Stephen Kirkup
1. Numerical Solution of General Linear Systems of Equations
2. www.boundary-element-method.com

Das könnte Ihnen auch gefallen