Using CALFEM with Octave under Windows
Using CALFEM with Octave under Windows
Originally writen for Matlab CALFEM package can be used without hassle with recent Octave version (at least > 4.4). This short note explains how to setup Octave to use CALFEM.
Path to packages
In order for Octave(Matlab) to find any M-file it has to be on the function search path. In Octave the two most commonly used functions for path manipulations are:
• addpath(DIR) - adds directory DIR to the function search path,
• savepath() - saves modified path, so it will be restored automatically next time .
Path management
Path can be permanently stored in .octaverc files. User can have a single .octaverc file in his home directory (for me it is C:\Users\putanowr) or it is possible to have many such files, each for a directory we keep Octave projects.
Sample procedure
Step 1
Download CALFEM package and unpack it. You can download it for instance from:
https://github.com/CALFEM/calfem-matlab.
I have unpacked CALFEM in directory P:\programming\octave\external\calfem-3.4
Step 2
Start Octave and in the command window type:
addpath(DIR)
1
substituting DIR with the string containing path to CALFEM folder. For instance I did:
addpath('P:\\programming\\octave\\external\\calfem-3.4-fem') The use of double backslahses is intentional. Then save the path in user configu- ration file:
savepath()
That is all. Now you should be able to use CALFEM functions. You can check this by calling:
help beam2e
You should see the help message explaining how to use beam2e function for building beam stiffness matrix.
2