changeset 11722:f362101a4956 octave-forge

some minor changes
author johanb88
date Tue, 28 May 2013 15:43:06 +0000
parents af09f99237db
children 0f6ebbf6d515
files main/mechanics/inst/ocframe/PlotDiagrams.m main/mechanics/inst/ocframe/ocframe_ex1.m
diffstat 2 files changed, 40 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/main/mechanics/inst/ocframe/PlotDiagrams.m	Tue May 28 15:41:54 2013 +0000
+++ b/main/mechanics/inst/ocframe/PlotDiagrams.m	Tue May 28 15:43:06 2013 +0000
@@ -35,7 +35,7 @@
 	end
 	if (diagram=="M")
 		if (nargin<8)
-			scale=2/max(max(abs(MemF(:,[3,6]))))
+			scale=2/max(max(abs(MemF(:,[3,6]))));
 		end
 		%plot frame first
 		newplot();
--- a/main/mechanics/inst/ocframe/ocframe_ex1.m	Tue May 28 15:41:54 2013 +0000
+++ b/main/mechanics/inst/ocframe/ocframe_ex1.m	Tue May 28 15:43:06 2013 +0000
@@ -5,20 +5,47 @@
 ## @end deftypefn
 function [P,D,MemF]=ocframe_ex1()
 	joints=[0,0,1,1,1;
-	4,4,0,0,0;
-	8,4,1,1,0];
-
-	EIA=[210e9,23130*(10^-2)^4,84.5*(10^-2)^2];%IPE400
+			7.416,3,0,0,0;
+			8+7.416,3,1,1,1];
+	# first cells of each row are the x and y coordinates
+	# next cells are the x, y and z constraints. 
+	# node 1 and 3 are fully fixed, node 2 is free
+	
+	# member data
+	E = 210.0e3; # N/mm^2 = MPa
+	A = 6000;# mm^2
+	I = 200.0e6;# mm^4
+	
+	# convert units to kN and m
+	E = E*10^3;
+	A = A*(10^-3)^2;
+	I = I*(10^-3)^4,
 
-	members=[1,2,EIA;2,3,EIA];
+	#connectivity data
+	members=[1,2,E,I,A;
+			2,3,E,I,A];
 
-	nodeloads=[];
-
-	dist=[1,0,-2e3,0,-2e3,0,0,0;2,0,-4e3,0,-4e3,0,0,1];
-	point=[];%1,0,-3e4,3,1
+	# point load on node 2
+	# Fx = 18.75 kN
+	# Fy = -46.35 kN
+	# Mz = 0 kNm
+	nodeloads=[2, 18.75,-46.35, 0.0];
+	
+	loc = 1;
+	glob = 0;
+	
+	# distributed load on member 2
+	# Fx = 0 kN/m 
+	# Fy = -4 kN/m
+	# same for the end of the load
+	# a = b = 0 m  load on full span
+	# local load
+	dist=[2,0,-4.0,0,-4.0,0.0,0.0,loc];
+	#no point loads on members
+	point=[];
 
 	[P,D,MemF]=SolveFrame(joints,members,nodeloads,dist,point);
-	%PlotFrame(joints,members,D,10);
-	%plot moment diagram
-	PlotDiagrams(joints,members,dist,point,MemF,"S");
+	#PlotFrame(joints,members,D,10);
+	#plot moment diagram
+	PlotDiagrams(joints,members,dist,point,MemF,"M");
 end