summaryrefslogtreecommitdiff
path: root/1898/CH14/EX14.18/Ex14_18.sce
blob: 065bafbce5480c9be6c88313089143efef5c12aa (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
clear all; clc;

disp("Scilab Code Ex 14.18 : ")

//Given:
E = 200*10^6; //kN/m^2
P = 0;//N
A = 400*10^-6; //m^2

N_by_P = [0 0 -1.414 1];
L = [4 2.828 2.828 2];
N = [-100 141.4 -141.4 200];
sum = 0;


for i =1:4
    num(i) = N(i)*N_by_P(i)*L(i); 
end

for i = 1:4
    sum = sum + (num(i)/(A*E)); //By Castigliano's Second theorem.
end

del_ch = sum*1000;

//Display:
  printf('\n\nThe vertical displacement of joint C of the steel truss   = %1.1f mm',del_ch);
    
//---------------------------------------------------------------------------END------------------------------------------------------------------------------