MATLAB Codes
sharing the knowledge…
Radial Basis Function (RBF)
Radial Basis Function (RBF)The radial basis function (RBF), also known as the Radial Point Interpolation Method (RPIM), is a meshfree method used to construct an interpolated function to fit a curve. It uses a set of radial basis functions to interpolate between nodal...
Point Interpolation Method (PIM)
The point interpolation method (PIM) is a meshfree method used for fitting a curve based on a set of nodal values at specified locations. The PIM uses polynomial interpolation to fit the curve, and the number of polynomial terms required increases with the number of...
FEM Shape Function Generator – MATLAB CODE
1D Shape Function clear, clcsyms xq = 2; %order of poly (eg. quad--> q=2)L = 1; %create ux = a1 + a2x + ...A1 = []; A0 = []; %temporary variablesux = 0;for i = 1:q+1aN = ['a' num2str(i)];syms(aN);ux = ux + aN*x^(i-1);A0 = cat(2,A0,[aN,',']);A1 =...
Library of Codes for Finite Elements
Bar | k1 = E*A/L * [1 -1 ; -1 1] r1 = [q*L/2 ; q*L/2]Beam | ka = 12*E*I/L^3 kb = 6*E*I/L^2 kc = 4*E*I/L kd = 2*E*I/L k1 = [ ka kb -ka kb; kb kc -kb kd; -ka -kb ka -kb; kb kd -kb kc] q1 = [q*L/2; q*L^2/12; q*L/2; -q*L^2/12]Truss | c = cos(B); s = sin(B);k1 = E*A/L*...
Create Q9 Elements for 2d Rectangular Domain (Octave/MATLAB)
function [node_xy,elem_node] = ElemQ9(L,H,m,n,varargin) % ====================================================% % function to create Q9 elements (2D) % % INPUT: % % > length (L) and height (H), % % > division over x (m) and division over y (n) % % > option...
Create Q4 Elements for 2d Rectangular Domain (Octave/MATLAB)
function [node_xy,elem_node] = ElemQ4(L,H,m,n,varargin) % ====================================================% % function to create Q4 elements (2D) % % INPUT: % % > length (L) and height (H), % % > division over x (m) and division over y (n) % % > option...
FB Live [MSNM group] – Numerical Methods: How it works?
In the live videos, I tried to explain how does numerical methods (in computational mechanics) work, in a general way of discussion.. Numerical methods always start 'backward' by having an assumed solution first, and some ways in the process, they try to make the...
Plotting deformation of frame structure (FEM)
This is a MATLAB code to plot a deformation of planar frame structure. Since the formulation involves transformation of local elements to a global system, plotting using a simple w(x) versus x is not possible.. We need to transform back the DOFs obtained in the global...
MATLAB VIDEO FOR BEGINNER (in Bahasa Melayu)
<<< CLICK HERE
FEM Meshing – TRUSS SYSTEM 1
This codes is to generate a set of truss structures with the arrangement as shown in the figure. . clear, clc, clf Lx = 5; Nx = 25; Ly = 0.5; Ny = 5; t = 0.1; Slimit = 1000; %CREATE NODES [X,Y]=meshgrid(0:Lx/Nx:Lx,0:Ly/Ny:Ly); X=X'; Y=Y'; nodes = [X(1:end)'...
FEM – Bar Problem 1
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'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...