summaryrefslogtreecommitdiff
path: root/3588/CH9/EX9.1/EX9_1.sce
blob: 88c37414f7bcf88c7629f7c0d22d7db6f8b2eb3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//Clearing console
clc
clear

//Intializing Variables
t = 0.2
p1x = 0
p1y = -100
p2x = 150
p2y = 0

//nodal force vector arising from the distributed loads in element 1
k11 = integrate('1-x','x',0,1)
k12 = integrate('x','x',0,1)

f1 = t*[k11 0;k12 0;0 0;0 k11;0 k12;0 0]*[p1x;p1y]

//nodal force vector arising from the distributed loads in element 2
k21 = integrate('(2-y)*y/2','y',0,2)
k22 = integrate('y*y/2','y',0,2)
k23 = integrate('(2-y)/2','y',0,2)
k24 = integrate('y/2','y',0,2)

f2 = t*[0 0;k21 0;k22 0;0 k23;0 k24;0 0]*[p2x;p2y]

//nodal force vector arising from the distributed loads
f = f1+f2

printf('\nResults\n')
printf('\nNodal force vector arising from the distributed loads for the element f(p) in (lb)')
printf('\nf1x =%flb',f(1))
printf('\nf2x =%flb',f(2))
printf('\nf3x =%flb',f(3))
printf('\nf1y =%flb',f(4))
printf('\nf2y =%flb',f(5))
printf('\nf3y =%flb',f(6))