0% found this document useful (0 votes)
39 views8 pages

Srijith M S PES1201802754: Afem Assignment

This document describes a spring-bar problem and the calculations to solve for displacement. It defines the parameters of the problem such as stiffness values, defines the global stiffness matrix, applies forces, and calculates displacement at node 2 as 3.3333. It then presents a second spring-bar problem, requests input values, defines modified parameters, builds the stiffness matrix, applies forces, inverts the matrix to solve for displacement which is printed as 0.9351 and 0.7273.

Uploaded by

Arun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views8 pages

Srijith M S PES1201802754: Afem Assignment

This document describes a spring-bar problem and the calculations to solve for displacement. It defines the parameters of the problem such as stiffness values, defines the global stiffness matrix, applies forces, and calculates displacement at node 2 as 3.3333. It then presents a second spring-bar problem, requests input values, defines modified parameters, builds the stiffness matrix, applies forces, inverts the matrix to solve for displacement which is printed as 0.9351 and 0.7273.

Uploaded by

Arun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Srijith M S

AFEM ASSIGNMENT
PES1201802754

%Basic Calculations

A1 =1;

A2 =1;

A3 =1;

l1 =1;
l2 =1;

l3 =1;

%define problem parameters

k1=l1;

k2=l2;

k3=l3;

%define global stifness martix

k = zeros(4,4);

% at node 1

ke = k1*[1 -1;-1 1];

k(1:2,1:2) = k(1:2,1:2)+ ke;

% at node 2
ke = k2*[1 -1;-1 1];

k(2:3,2:3) = k(2:3,2:3)+ ke;

% at node 3

ke = k3*[1 -1;-1 1];

k(2:2:4,2:2:4) = k(2:2:4,2:2:4)+ ke;

%define the force (p) at node

p=[0;10;0;0];

%displacement at u2

u(2,1)=p(2,1)/k(2,2)

%output

u=

3.3333

0
%Programme For Spring-Bar problem2

clc

% Input of Intial Parameter

E =input('Enter the value of E in N/mm2 =');

L1 =input('Enter the value of length L1 in mm=');


L2 =input('Enter the value of length L2 in mm=');

%Basic Calculations

A1 =200;

A2 =200;

A3 =1;

l1 =A1*E/L1;

l2 =A2*E/L2;

%define problem parameters

k1=l1;

k2=l2;

k3=2000;

%define global stifness martix


k = zeros(4,4);

% at node 1

ke = k1*[1 -1;-1 1];

k(1:2,1:2) = k(1:2,1:2)+ ke;

% at node 2

ke = k2*[1 -1;-1 1];

k(2:3,2:3) = k(2:3,2:3)+ ke;

% at node 3

ke = k3*[1 -1;-1 1];

k(3:4,3:4) = k(3:4,3:4)+ ke;

%define the force (p) at node

p=[8000;0]
%eliminating fixed ends

k2by2=k(2:3,2:3);

%displacement in mm will be

u=zeros(4,1);

kinv=inv(k2by2)

u=kinv*p

%output-

Enter the value of E in N/mm2 =70000

Enter the value of length L1 in mm=2000

Enter the value of length L2 in mm=2000

%(p in newton)

p=

8000

0
k2by2 =

14000 -7000

-7000 9000

u=

0.9351

0.7273

You might also like