function trussdriver
% Driver function for truss simulator
% First example: simple chevron truss with four joints and five links

% define truss
jointpos = [0 1 0.75 1.5;0 0 1 1.25];
links = [1 3;1 2;2 3;3 4;2 4];
supports = [1 4];
suppplanes = [0 1;0 0];
forces = [0 0 0.5 0;0 0 0.5 0];

% call simulator
disp('Simulation: simple truss from Section 3.8.2 of course');
trusssimulator(jointpos,links,supports,suppplanes,forces);

clear all;

% static ideal truss model, see Sayir/Dual/Kaufmann "Ingenieurmechanik I",
% Vieweg/Teubner 2008, Fig 11.6
h = 0.5*sqrt(3);
jointpos = [ 0 0;3 0; 1.5 h; 0.5 h; 1 0; 2 0; 2.5 h]';
links = [1 5; 1 4; 4 5; 3 4; 3 5; 3 6;3 7; 6 7; 2 6; 2 7];
supports = [1 2];
suppplanes = [0 0;0 0]';
forces = [0 0;0 0;0 0;0 -1;0 0; 0 0;-sqrt(3) 0]';

% call simulator
disp('Truss from Figure 11.6 of book "Ingenieurmechanik I"');
trusssimulator(jointpos,links,supports,suppplanes,forces);
