A Tutorial on Finite Element Programming in MATLAB

Last printed 31/01/2006 13:05:00 5 Dr N.A.Alexander line (bar element). Matlab num2str(a) function converts the data a into a string. This is required by the text function. Example4.m 1 2 3 4 5 6 clc; clear all; ElemNum=3; U=[0,0,2,3], x=U([1,3]), z=U([2,4]) plot(x,z,’-bo’,'lineWidth’,3); title(‘Element plot’); xlabel(‘x [m]‘); ylabel(‘z [m]‘); text(mean(x),mean(z),num2str(ElemNum)); 6. Suggested data structures for defining a truss framework In order to develop a general FE program it is important to organise the way …
Last printed 31/01/2006 13:05:00 3 Dr N.A.Alexander in B that are defined by vector f. Thus Matlab’s advanced matrix subscript notation can be used to abstract submatrices from a larger matrix and assign submatrices within a larger matrix (as is the case here). Example3.m 1 2 3 4 5 6 7 8 9 10 clc; clear all; A=[1,2,3,4; 2,4,5,6; 5,4,2,5; 7,8,9,1]; B1=[2;6]; C2=[0.1; 0.2]; f=[2,3], g=1:4, g(f)=[] A11=A(f,f), A12=A(f,g) A21=A(g,f), A22=A(g,g) C1=A11\(B1-A12*C2) B2=A21*C1+A22*C2 B=zeros(4,1); B(f)=B1, B(g)=B2 C=zeros(4,1); C(f)=C1, C(g)=C2 B-A*C % solution consistency check Question (1) Create a Matlab program that is able to solve system (4) for the unknowns when [ ]T 5 , 4 , 3 , 2 = F . Code a consistency check. ? = KU F ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? = ? ? ? ? ? ? ? ? ? ? ? ? 4 3 2 1 4 3 2 1 12 2 0 1 2 7 2 0 0 2 6 1 1 0 1 5 u u u u f f f f (4) Question (2) Create a Matlab program that is able to solve system (4) for the unknowns when [ ] T f f 5 , 4 , , 2 1 = F and []T u u 4 3 , , 2 . 0 , 1 . 0 = U . Code a consistency check. Question (3) Create a Matlab program that is able to solve system (4) for the unknowns when [ ]T f f 4 2 , 4 , , 1 = F and []T u u 2 , , 2 . 0 , 3 1 = U . Code a consistency check. 4. Matlab Functions Matlab functions can be stored in separate Matlab m-files, however in these notes it is suggested that all the code is contained in one m-file. Matlab requires a principle function (like in the case of VB) which is conventionally named main in these notes but can be given any name (starting with a letter). Example4.m
Download A Tutorial on Finite Element Programming in MATLAB.Pdf
need to simulate a three phase induction motor speed control drive for an ev