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.

Slides:



Advertisements
Similar presentations
Recursion Prog #include <stdio.h> #include<conio.h> main()
Advertisements

1 A Simple C Program /* Take a number multiply it by 10 and display it */ #include main() { int number, result; printf("Type in a number \n"); scanf("%d",
DS:Lab-1 Prepared by: Shipra Shukla Assistant Professor Kaziranga University.
Sort the given string, without using string handling functions.
Lab 8 User Defined Function.
ECE Application Programming
1 Parts of a Loop (reminder) Every loop will always contain three main elements: –Priming: initialize your variables. –Testing: test against some known.
Introduction to Computers and Programming for Loops  2000 Prentice Hall, Inc. All rights reserved. Modified for use with this course. Introduction to.
1 Modularity In “C”. 2 General Syntax data_type function_Name (parameter list) { … return expression; // return output } Body of the function is a compound.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 6P. 1Winter Quarter I/O in C Lecture 6.
Chapter 8 Multidimensional Arrays C Programming for Scientists & Engineers with Applications by Reddy & Ziegler.
 Introduction Introduction  Types of Function Types of Function  Library function Library function  User defined function User defined function 
CECS 121 EXAM 1. /* C Programming for the Absolute Beginner */ // by Michael Vine #include main() { printf(“\nC you later\n”); system(“pause”); }
Reading the data from the input devices and displaying the results on the screen are the two main tasks of any program. To perform these tasks user friendly.
Arrays- Part 2 Spring 2013Programming and Data Structure1.
 An instruction or group of instructions.  Computer executes program repeatedly for specified number of times. Or until some terminating conditions are.
How to start Visual Studio 2008 or 2010 (command-line program)
C STRUCTURES. A FIRST C PROGRAM  #include  void main ( void )  { float height, width, area, wood_length ;  scanf ( "%f", &height ) ;  scanf ( "%f",
Constants Numeric Constants Integer Constants Floating Point Constants Character Constants Expressions Arithmetic Operators Assignment Operators Relational.
Nested LOOPS.
Structure of a C program Preprocessor directive (header file) Program statement } Preprocessor directive Global variable declaration Comments Local variable.
CECS 121 Test 1. Functions allow you to group program statements under one name C and C++ are case-sensitive so main(), MAIN(), and Main() are all different.
Loop.  While Loop  Do-while Loop  For Loop Continue Statement Conclusion Loop Loop.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
Dennis Ritchie 1972 AT & T Bell laboratories (American Telephone and Telegraph) USA 1www.gowreeswar.com.
Lecture 4: Calculating by Iterating. The while Repetition Statement Repetition structure Programmer specifies an action to be repeated while some condition.
Class Opener:. Identifying Matrices Student Check:
Scope When we create variables and functions, they are limited in where they are visible and where they can be referenced For the most part, the identifiers.
ENG College of Engineering Engineering Education Innovation Center 1 Array Accessing and Strings in MATLAB Topics Covered: 1.Array addressing. 2.
Composite Transformation: Composite objects are several objects and scripts bundled together exposed to the application as a single object. There are number.
Agenda Basic Logic Purpose if statement if / else statement
CECS 130 EXAM 1. To declare a constant (read only) value: const int x = 20; const float PI = 3.14; Can we do this? const int x;
Khalid Rasheed Shaikh Computer Programming Theory 1.
Computer Programming Lecture 8 Arrays. 2 switch-statement Example (3) If use press left arrowIf use press right arrow If use press up arrow If use press.
CSCI 3133 Programming with C Instructor: Bindra Shrestha University of Houston – Clear Lake.
Functions: Part 2 of /11/10: Lecture 16 CMSC 104, Section 0101 John Y. Park 1.
Structuring Data: Arrays ANSI-C. Representing multiple homogenous data Problem: Input: Desired output:
Exercise 1 #include int main() { printf(“Hello C Programming!\n”); return 0; } 1.Run your Visual Studio 2008 or Create a new “project” and add.
CS 161 Introduction to Programming and Problem Solving Chapter 17 Nested Loops Herbert G. Mayer, PSU Status 9/8/2014 Initial content copied verbatim from.
NOTE: C programs consist of functions one of which must be main. C programs consist of functions one of which must be main. Every C program begins executing.
EXAMPLE. Dr. Soha S. Zaghloul2 Write a complete program that searches for all the elements that are multiple of 7 in array X of type int and size 100.
Lecture #15 ARRAYS By Shahid Naseem (Lecturer). 2 ARRAYS DEFINITION An array is a sequence of objects of same data type. The objects in an array are also.
Computer Skills2 / Scientific Colleges 1 Arrays Topics to cover: Arrays Data Types One-dimensional Arrays Two-dimensional Arrays.
1 2-d Arrays. 2 Two Dimensional Arrays We have seen that an array variable can store a list of values Many applications require us to store a table of.
Week 3.  TO PRINT NUMBERS FROM 1 TO 20  TO PRINT EVEN NUMBERS FROM 1 TO 20 2.
Looping I (while statement). CSCE 1062 Outline  Looping/repetition construct  while statement (section 5.1)
Lesson #5 Repetition and Loops.
Java for Beginners University Greenwich Computing At School DASCO
INC 161 , CPE 100 Computer Programming
CHP-2 ARRAYS.
Lecture 7: Repeating a Known Number of Times
Lesson #5 Repetition and Loops.
REPETITION STATEMENTS
Review If you want to display a floating-point number in a particular format use The DecimalFormat Class printf A loop is… a control structure that causes.
Lesson #5 Repetition and Loops.
Point Question Point Question Point Question Point Question
2-d Arrays.
Govt. Polytechnic,Dhangar
Multidimensional array
ECE 103 Engineering Programming Chapter 19 Nested Loops
IPC144 Introduction to Programming Using C Week 4 – Lesson 1
C ( Programming Language ) PSK Technologies By: Arti Sontakke An ISO 9001:2015 (QMS) Certified IT Company Computer Education | Software Development | Computer.
More Loops Topics Counter-Controlled (Definite) Repetition
Lesson #5 Repetition and Loops.
More Loops Topics Counter-Controlled (Definite) Repetition
Data Types and Maths Programming Guides.
CSCE 206 Lab Structured Programming in C
More Loops Topics Counter-Controlled (Definite) Repetition
Getting Started With Coding
Presentation transcript:

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 b b3 b4 0 b5 b6 Here, b1 = (1- x/L) b2= x/L b3 = 1-3x 2 /L 2 +2x 3 /l 3 b4 = x-2x 2 /L+x 3 /L 2 b5 = 3x 2 /L 2 -2x 2 /L 3 b6 = -x 2 /L 2+ x 3 /L 2 x =length from one end at which shape function is to be found L= length of beam element

Flowchart: TO CALCULATE THE VALUE OF THE SHAPE FUNCTION FOR A GIVEN BEAM ELEMENT. Start Float l,x,b1,b2,b4,b5,b6,b[2][7] input l,x 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++ Output b[ i ][ j ] Stop j=1 to 6 j++ true false true false

EXPLAINTION: 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) Calculate: bending element b1,b2,b3,b4,b5,b6 Define shape function matrix Show calculated shape function End of program i is a variable used for rows of matrix, i varies from 1 to 2, in each step i varies by 1 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 true If this condition is false If this condition is true If this condition is false

Program: /*Compute the value of shape function for a given beam element*/ /*include header files*/ #include /*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; }