1## -*- texinfo -*-
2## @deftypefn {Function File} {} ocframe_ex2()
3## Example of a beam.
4##
5## @end deftypefn
6function [P,D,MemF]=ocframe_ex2()
7	joints=[0,0,1,1,0;
8	4,0,0,1,0;
9	8,0,0,1,0];
10	%Each 4 meter a node => 0,0 and 4,0 and 8,0 are the coordinates.
11	%The first node is a hinge and thus supported in the x and y direction => 1,1,0 for the constraints
12	%The following nodes are just rollers and thus supported in the y direction => 0,1,0 for the constraints
13
14	EIA=[200e6,200e6*(10^-3)^4,6000*(10^-3)^2];
15	%EIA as a single vector to be used afterwards
16
17	members=[1,2,EIA;2,3,EIA];
18	%2 members, connection node 1 to node 2 and node 2 to node 3
19
20	nodeloads=[];
21	%there aren't nodal nodes in this example
22
23	dist=[1,0,-4e3,0,-4e3,0,0,1;
24	2,0,-4e3,0,-4e3,0,0,1];
25	%both members have a distributed load which takes the full length of the member. Notice the - sign caused
26	%by the axes conventions
27	%as we are working with newtons and meters the load is -4e3 N and not -4 kN
28
29
30	[P,D,MemF]=SolveFrame(joints,members,nodeloads,dist,[])
31	%solve the frame with
32	% P: reactions
33	% D: displacements
34	% MemF: the member end forces
35
36end