Note: Solution of Assignment 1 is in Lecture 2. There is excellent solution of axial bar problem using FE and comparing with Exact Solution plot along with matlab code in here.

DSM-SOLVER is based on Direct Stiffness Method. Direct Stiffness Method is implementation of Finite Element Method. It is available in two flavors. One is octave/matlab while other is scilab script and distributed under GNU/GPL v2.0 license.

GNU Octave is free clone of matlab. It is fully compatible with matlab.

Scilab is an open source, cross-platform numerical computational package and a high-level, numerically oriented programming language. Scilab is alternative to matlab.

You can download the source-code of DSM-OCTAVE-SOLVER or DSM-SCILAB-SOLVER. To understand how this script works, read the document provided along with the source files. Consider the following example:

The above example can be solved in one of the two scripts explained as under:

For Octave/Matlab example, first define some input variables as:

MATLAB

1

2

3

4

5

6

7

8

%defineinputvariables

xy=[10075;075;2000];%joint coordinates

conn=[211;131];%connectivity matrix - i j mprop

bc=[2111;3111];%boundary conditions

mprop=[1e4101e3];%material properties

jtloads=[10-10-1000];%joint loads

memloads=[1012200012-200;2-68250-68-250];%mem end forces

To run the program, you need to update the directory to src folder, then, write following:

MATLAB

1

2

3

4

frame2d

%oryoucantryfollowingcommandfortruss

truss2d

Note that truss2d has same code as that of frame 2d. You can get pretty accurate result for trusses by considering it as frame.

For SCILAB example, the input matrices and command for making var01.bin as provided in the preproc.sce file are:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

//pre-processor for pframem.sce.

//generate the input matrices and stores in var01.bin

//input variables for pframem.sce

xy=[10075;075;2000];//joint coordinates

conn=[211;131];//connectivity matrix - i j mprop

bc=[2111;3111];

mprop=[1e4101e3];

jtloads=[10-10-1000];

memloads=[1012200012-200;2-68250-68-250];//mem end forces

//store to var01.bin

fid=mopen('var01.bin','wb');

save(fid,xy,conn,bc,mprop,jtloads,memloads);

mclose(fid);

To run the program, you need to update the directory to src folder, then, write following:

1

2

3

4

5

lines(0)// for uninterepted continuous output of calc

exec('preproc.sce',0)// preprocessor for new frame data

exec('loadftn.sce',0)// load all functions pf this program.

load('var01.bin')// load all input matrix.

exec('pframem.sce',0)// run main program and give input for asked matrix by only retyping their names.