{"id":1,"date":"2018-09-08T08:47:21","date_gmt":"2018-09-08T08:47:21","guid":{"rendered":"http:\/\/people.utm.my\/arazin\/?p=1"},"modified":"2019-07-12T14:31:40","modified_gmt":"2019-07-12T14:31:40","slug":"bar_1","status":"publish","type":"post","link":"https:\/\/people.utm.my\/arazin\/2018\/09\/08\/bar_1\/","title":{"rendered":"FEM &#8211; Bar Problem 1"},"content":{"rendered":"<p><span style=\"color: #000000\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-291 size-medium\" src=\"https:\/\/people.utm.my\/arazin\/wp-content\/uploads\/sites\/595\/2018\/09\/BAR1-300x74.png\" alt=\"\" width=\"300\" height=\"74\" \/><\/span><\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;color: #000000\">This program is to demonstrate the calculation of bar element in FEM.<\/span><\/p>\n<p><span style=\"font-family: helvetica, arial, sans-serif;color: #000000\">.<\/span><\/p>\n<table style=\"height: 62px;width: 370px;background-color: #c9bdbd\">\n<tbody>\n<tr>\n<td style=\"width: 360px\">\n<pre><span style=\"color: #000000\">% Clear previous data and graph\r\nclc; clear all; cla\r\n\r\n%Input\r\nE=200e6; % Young's modulus (kN\/m)\r\nA=0.04; % Area (m^2)\r\nL1=2.5; % Length 1st Element (m)\r\nL2=2.5; % Length 1st Element (m)\r\nP=10; % Point Load (kN)\r\nq=2; % Uniform load (kN\/m)<\/span><\/pre>\n<pre><span style=\"color: #000000\">%Create local stifness n forces\r\nklocal1=[(A*E)\/L1 -(A*E)\/L1;\r\n-(A*E)\/L1 (A*E)\/L1];\r\n\r\nklocal2=[(A*E)\/L2 -(A*E)\/L2;\r\n-(A*E)\/L2 (A*E)\/L2];\r\n\r\nflocal1=[q*L1\/2;q*L1\/2];\r\nflocal2=[q*L2\/2;q*L2\/2];\r\n\r\n%Assemble\r\nKglobal=zeros(3,3);\r\nKglobal(1:2,1:2)=Kglobal(1:2,1:2)+klocal1;\r\nKglobal(2:3,2:3)=Kglobal(2:3,2:3)+klocal2;\r\n\r\nFglobal=zeros(3,1);\r\nFglobal(1:2,1)=Fglobal(1:2,1)+flocal1;\r\nFglobal(2:3,1)=Fglobal(2:3,1)+flocal2;\r\nFG=Fglobal;\r\nFglobal(3,1) =Fglobal(3,1)+P; % Point Load\r\n\r\nKG=Kglobal;\r\n\r\n%Impose BC\r\nKglobal(1,:)=[];\r\nKglobal(:,1)=[];\r\n\r\nFglobal(1,:)=[];\r\n\r\n%Solve for global displacement\r\nU=Kglobal\\Fglobal;\r\n\r\n% local result Element 1\r\nU1=[0;U(1,1)];\r\nf1=(klocal1*U1)-flocal1;\r\nstress1=f1\/A;\r\n\r\n% local result Element 2\r\nU2=[U(1,1);U(2,1)];\r\nf2=(klocal2*U2)-flocal2;\r\nstress2=f2\/A;\r\n\r\n% Reacttion\r\nUU=[0;U(1,1);U(2,1)];\r\nR=KG*UU-FG;\r\n\r\n% Plot Result\r\nL = L1 + L2;\r\nX = 0:L\/20:L;\r\nUexact = -q\/(E*A) * X.^2\/2 + (P+q*L)\/(E*A)*X; % Exact\r\n\r\nFEM2Nodex = [0;L1;L];\r\nFEM2Nodey = [0;U(1,1);U(2,1)];\r\nhold on\r\nplot(FEM2Nodex,FEM2Nodey,'--*b')\r\nplot(X,Uexact,'-k')\r\nhold on\r\n\r\ntitle('Displacements u(x) over the distance, x');\r\nxlabel('x');\r\nylabel('u (x) ');\r\nlegend('Ulinear ','Uexact')<\/span><\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><span style=\"color: #000000\">.\r\n\r\n<\/span><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This program is to demonstrate the calculation of bar element in FEM. . % Clear previous data and graph clc; clear all; cla %Input E=200e6; % Young&#8217;s modulus (kN\/m) A=0.04; % Area (m^2) L1=2.5; % Length 1st Element (m) L2=2.5; % Length 1st Element (m) P=10; % Point Load (kN) q=2; % Uniform load (kN\/m) [&hellip;]<\/p>\n","protected":false},"author":6455,"featured_media":291,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[6,7],"tags":[],"class_list":["post-1","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-fem","category-matlab"],"_links":{"self":[{"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/users\/6455"}],"replies":[{"embeddable":true,"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":8,"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":580,"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/posts\/1\/revisions\/580"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/media\/291"}],"wp:attachment":[{"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/people.utm.my\/arazin\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}