Algorithms and Flowcharts for Programming CFD

Slides:



Advertisements
Similar presentations
CS101: Introduction to Computer programming
Advertisements

Algorithms An algorithm is a finite sequence of instructions, logic, an explicit step-by-step procedure for solving a problem. Specific algorithms sometimes.
PROBLEM SOLVING TECHNIQUES
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
ALGORITHMS & FLOWCHARTING II
Reference :Understanding Computers
ALGORITHMS AND FLOWCHARTS
Mathematics for Computing Lecture 4: Algorithms and flowcharts Dr Andrew Purkiss-Trew Cancer Research UK
Flowchart TA. Maram Al-Khayyal.
INTRODUCTION TO PROGRAMMING
Flow Chart.
Algorithm and Flowchart Questions
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 3P. 1Winter Quarter Structured Engineering.
Review Algorithm Analysis Problem Solving Space Complexity
8.1 Sequences and Series Essential Questions: How do we use sequence notation to write the terms of a sequence? How do we use factorial notation? How.
Flowchart IDT. What is a flowchart? Visual representation of a flow of data Outline of process or a solution to a problem Outline the basic logic behind.
Muhammad Adnan Talib Lec#4 27 th Sep,2012 Computer Science Department COMSATS Institute of Information Technology Sahiwal Introduction to Computer Programming.
Algorithm & Flow Charts
Introduction to Video Game Programming (VGP) Mr. Shultz.
Flowcharts.
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
Chapter 2: General Problem Solving Concepts
Definition of Terms Software/Programs Programs that directs the operation of a computer system Set of instructions Codes Programming Process of planning,
MAT 4725 Numerical Analysis Section 1.4 Loops with “do” statements
Basic Control Structures
Basic problem solving CSC 111.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
1 Programming Tools Flowcharts Pseudocode Hierarchy Chart Direction of Numbered NYC Streets Algorithm Class Average Algorithm.
Introduction to compilation process March 24. The following slides will show you step by step instruction how to get ready and build C language programs.
CSC 111. Solving Problems with Computers Java Programming: From Problem Analysis to Program Design, Third Edition3 Solving Problems Stages 1.Problem.
Introducing block scheme programming March 17. Algorithm / Flow chart An algorithm or a flowchart is a step-by-step procedure for solving a particular.
LESSON 1 Introduction to Programming Language. Computer  Comprised of various devices that are referred to as HARDWARE.  The computer programs that.
Concepts of Algorithms CSC-244 Unit Zero Pseudo code, Flowchart and Algorithm Master Prince Computer College Qassim University K.S.A.
Problem, Problem Solving, Algorithm & Flow Charts –Part 1 Presented By Manesh T Course:101 CS 101CS Manesh T1.
WHAT IS THIS? Clue…it’s a drink SIMPLE SEQUENCE CONTROL STRUCTURE Introduction A computer is an extremely powerful, fast machine. In less than a second,
ALGORITHMS AND FLOWCHARTS. Why Algorithm is needed? 2 Computer Program ? Set of instructions to perform some specific task Is Program itself a Software.
8.1 Sequences and Series Essential Questions: How do we use sequence notation to write the terms of a sequence? How do we use factorial notation? How.
Notes Over 10.7 Factoring Special Products Difference of Two Squares.
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
ALGORITHMS AND FLOWCHARTS. A typical programming task can be divided into two phases: Problem solving phase  produce an ordered sequence of steps that.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
Introduction to Flowcharts
Program Program is a collection of instructions that will perform some task.
© 2012 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 3: Top-Down Design with Functions Problem Solving & Program.
Lecture 2: Introduction to Programming EEE2108: 공학프로그래밍 서강대학교 전자공학과 2011 학년도 2 학기 - Algorithms and Flowcharts -
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
Computational Fluid Dynamics Lecture II Numerical Methods and Criteria for CFD Dr. Ugur GUVEN Professor of Aerospace Engineering.
Algebra 1 Section 9.1 Evaluate square roots Solve simple quadratic equations Note: 5 2 = 25 and (-5) 2 = 25 so both 5 and -5 are square roots of 25. What.
Program design Program Design Process has 2 phases:
Algorithm & Flow Charts Week 1
Unit 3: ALGORITHMS AND FLOWCHARTS
Be A programmer in Steps
Solving Quadratic Equations by the Complete the Square Method
ALGORITHMS AND FLOWCHARTS
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
CS111 Computer Programming
Algorithms and Flowcharts
ALGORITHMS & FLOWCHARTING II
PROBLEM SOLVING AND OFFICE AUTOMATION
ALGORITHMS AND FLOWCHARTS
Pseudocode & Flowcharts
Computers & Programming Languages
Zeros to Quadratic Functions
1) C program development 2) Selection structure
Introduction to Algorithms and Programming
Quadratic Equations.
Presentation transcript:

Algorithms and Flowcharts for Programming CFD Dr. Ugur GUVEN

Importance of Algorithms for Programming CFD If you want to be successful in your programming, it is essential for you to first develop an algorithm before proceeding with your program An algorithm must contain the following: 1) What data do you need inputted? 2) What is the function that you are going to evaluate? 3) Do You Have any special conditions for evaluation? If Yes Then What? 4) Calculation of the Function using the relevant numerical method and the Given Boundary Conditions of the Flow 5) Printing of the Calculated Results

Example of an Algorithm Here is an example of an algorithm of a simple program that converts Fahrenheit into Celsius

Flowcharts Flowchart is the second step after writing the algorithm. You have to use special flowchart symbols that allow you to state the necessary operations that need to be executed by the computer. Flowcharts are unbounded by the programming language used. They will depict the logical flow of the program.

Flowchart Symbols for Programs

Sample Flowchart

Sample Flowchart Sum of first 50 natural numbers

Sample Flowchart Here is the sample flowchart for the Fahrenheit to Celsius conversion program:

Sample Flowchart Here is the sample algorithm for Newton’s Method for Calculating Square Roots:

flowchart for calculation of the roots of a quadratic equation: Sample Flowchart flowchart for calculation of the roots of a quadratic equation:

Sample Flowchart Flowchart for finding out the largest of three number

Sample Flowchart Flowchart for computing factorial N

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... By definition the first two numbers are: Fibonacci(0) = 0 Fibonacci(1) = 1 Fibonacci(2) = 0 + 1 = 1 Fibonacci(3) = 1 + 1 = 2 Fibonacci(4) = 1 + 2 = 3 Fibonacci(5) = 2 + 3 = 5 Fibonacci(6) = 3 + 5 = 8 Fibonacci(7) = 5 + 8 = 13