70 likes | 219 Views
What is shape function ? shape function is a function that will give the displacements inside an element if its displacement at all the node locations of the element are known. Shape functions for a beam element : The shape function (N) is given by_
E N D
What is shape function ? shape function is a function that will give the displacements inside an element if its displacement at all the node locations of the element are known. Shape functions for a beam element : The shape function (N) is given by_ N = b1 0 0 b2 0 0 0 b3 b4 0 b5 b6 Here, b1 = (1- x/L) b2= x/L b3 = 1-3x2/L2+2x3/l3 b4 = x-2x2/L+x3/L2 b5 = 3x2/L2-2x2/L3 b6 = -x2/L2+x3/L2 x =length from one end at which shape function is to be found L= length of beam element
Start Float l,x,b1,b2,b4,b5,b6,b[2][7] input l,x Flowchart: TO CALCULATE THE VALUE OF THE SHAPE FUNCTION FOR A GIVEN BEAM ELEMENT. b1=1.0-(x/l); b2=x/l; b3=1.0-(3.0*x*x/(l*l)+(2.0*x*x*x/(l*l*l))); b4=x-(2.0*x*x/l)+(x*x*x/(l*l)); b5=(3.0*x*x/(l*l)-(2.0*x*x*x/(l*l*l))); b6=-(x*x/(l))+(x*x*x/(l*l)); b[1][1]=b1;b[1][2]=0.0;b[1][3]=0.0;b[1][4]=b2;b[1][5]=0.0;b[1][6]=0.0; b[2][1]=0.0;b[2][2]=b3;b[2][3]=b4;b[2][4]=0.0;b[2][5]=b5;b[2][6]=b6; The shape function is as follows i=1 to 2 i++ false true j=1 to 6 j++ false true Output b[ i ][ j ] Stop
Start program Define data type enter the length of beam element l enter length from one end at which shape function is to be found(X) EXPLAINTION: Calculate: bending element b1,b2,b3,b4,b5,b6 Define shape function matrix i is a variable used for rows of matrix, i varies from 1 to 2, in each step i varies by 1 If this condition is false If this condition is true j is a variable used for columns of matrix, j varies from 1 to 6, in each step i varies by 1 If this condition is false If this condition is true Show calculated shape function End of program
Program: /*Compute the value of shape function for a given beam element*/ /*include header files*/ #include<stdio.h> #include<conio.h> #include<math.h> /*define data type of programming variables*/ float l,x,b1,b2,b4,b5,b6,b[2][7]; double b3; int i,j; /*main program starts here*/ void main() { clrscr(); /*input values*/ printf("enter the length of beam element l in cms\n"); scanf("%f",&l); printf("enter length from one end at which shape function is to be found in "); printf("centimeters\n"); scanf("%f",&x); /*calculate beam element*/ b1=1.0-(x/l); b2=x/l; b3=1.0-(3.0*x*x/(l*l)+(2.0*x*x*x/(l*l*l))); b4=x-(2.0*x*x/l)+(x*x*x/(l*l)); b5=(3.0*x*x/(l*l)-(2.0*x*x*x/(l*l*l))); b6=-(x*x/(l))+(x*x*x/(l*l));
/*matrix of beam element*/ b[1][1]=b1;b[1][2]=0.0;b[1][3]=0.0;b[1][4]=b2;b[1][5]=0.0; b[1][6]=0.0; b[2][1]=0.0;b[2][2]=b3;b[2][3]=b4;b[2][4]=0.0;b[2][5]=b5; b[2][6]=b6; printf("the shape function is as follows\n"); /*calculate shape function*/ for(i=1;i<=2;++i) { for(j=1;j<=6;++j) { printf("%10.3f",b[i][j]); } printf("\n"); } getch(); return; }