% EXAMPLE SCRIPT % This example simulates the mass and inertia of a wrench attached to a leafspring clc clear %% NODE POSITIONS % x y z nodes = [ 0 0 0; %node 1 0 0.1 0; %node 2 0.055 0.1 0.003]; %node 3 %% ELEMENT CONNECTIVITY % p q elements = [ 1 2; %element 1 2 3]; %element 2 %% NODE PROPERTIES %node 1 nprops(1).fix = true; %Fix node 1 nprops(3).mass = 0.074; %0.074 kg at the center of mass nprops(3).mominertia = [0.00000398 0.00000252 0.0000000 0.00013376 0.00000000 0.00013739]; %Inertia at the center of mass %% ELEMENT PROPERTIES %Property set 1 eprops(1).elems = 1; %Add this set of properties to elements 1 and 3 eprops(1).emod = 210e9; %E-modulus [Pa] eprops(1).smod = 70e9; %G-modulus [Pa] eprops(1).dens = 7800; %Density [kg/m^3] eprops(1).cshape = 'rect'; %Rectangular cross-section eprops(1).dim = [30e-3 0.3e-3]; %Width: 50 mm, thickness: 0.2 mm eprops(1).orien = [0 0 1]; %Orientation of the cross-section as a vector pointing along "width-direction" eprops(1).nbeams = 1; %4 beam elements for simulating these elements eprops(1).flex = 1:6; %Consider all deformation modes (1 to 6) as flexible eprops(1).color = 'grey'; eprops(1).opacity = 0.7; %Property set 2 eprops(2).elems = 2; %Add this set of properties to element 2 eprops(2).orien = [0 0 1]; %Orientation of the cross-section as a vector pointing along "width-direction" eprops(2).hide = true; %Hide element (in visualization only) %% SIMULATION out = spacarlight(nodes, elements, nprops, eprops);