ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 4 Programming and Software EXCEL and MathCAD.

Slides:



Advertisements
Similar presentations
Lecture 7: Software Design (Part II)
Advertisements

CS101: Introduction to Computer programming
Algorithms An algorithm is a finite sequence of instructions, logic, an explicit step-by-step procedure for solving a problem. Specific algorithms sometimes.
Chapter 3 Program Design And Branching Structures.
PROBLEM SOLVING TECHNIQUES
UNIT 2. Introduction to Computer Programming
ALGORITHMS AND FLOWCHARTS
Mathematics for Computing Lecture 4: Algorithms and flowcharts Dr Andrew Purkiss-Trew Cancer Research UK
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
LECTURE 1 CMSC 201. Overview Goal: Problem solving and algorithm development. Learn to program in Python. Algorithm - a set of unambiguous and ordered.
ITEC113 Algorithms and Programming Techniques
ECIV 201 Computational Methods for Civil Engineers Richard P. Ray, Ph.D., P.E. Modeling, Computers, and Error Analysis.
CVEN Computer Applications in Engineering and Construction Dr. Jun Zhang.
Program Design and Development
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 2 Mathematical Modeling and Engineering Problem Solving.
Lecture Notes 1/21/04 Program Design & Intro to Algorithms.
The Islamic University of Gaza Faculty of Engineering Numerical Analysis ECIV 3306 Introduction.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 3 Programming and Software.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Bracketing Methods Chapter 5 The Islamic University of Gaza
The Islamic University of Gaza Faculty of Engineering Civil Engineering Department Numerical Analysis ECIV 3306 Chapter 1 Mathematical Modeling.
Chapter 3 Planning Your Solution
Adapted from slides by Marie desJardins
CIS Computer Programming Logic
Computer Concepts 2014 Chapter 12 Computer Programming.
Numerical Methods in Scientific Computation Lecture 2 Programming and Software Introduction to error analysis Numerical Methods, Lecture 2 1 Prof. Jinbo.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 2.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Mathematical Modeling and Engineering Problem Solving
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Software Life Cycle What Requirements Gathering, Problem definition
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Chapter 12 Computer Programming. Chapter Contents Chapter 12: Computer Programming 2  Section A: Programming Basics  Section B: Procedural Programming.
Lecture 2 Numerical Methods for Engineering MECN 3500 Department of Mechanical Engineering Inter American University of Puerto Rico Bayamon Campus Dr.
Cs413_design04.ppt Design and Software Development Design : to create a functional interface that has high usability Development : an organized approach.
1 Program Planning and Design Important stages before actual program is written.
Newton’s Method, Root Finding with MATLAB and Excel
Part 1 Chapter 1 Mathematical Modeling, Numerical Methods, and Problem Solving PowerPoints organized by Dr. Michael R. Gustafson II, Duke University and.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
ALGORITHMS AND FLOWCHARTS. Why Algorithm is needed? 2 Computer Program ? Set of instructions to perform some specific task Is Program itself a Software.
STEP 3- DEVELOP AN ALGORITHM At this stage we break down the problem into simple manageable steps so that they can be handled easily.
Part 1 Chapter 1 Mathematical Modeling, Numerical Methods, and Problem Solving PowerPoints organized by Dr. Michael R. Gustafson II, Duke University and.
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.
Lecture 3 Computer Programming -1-. The main steps of program development to solve the problem: 1- problem definition : The problem must be defined into.
Se-Woong Chung, Chungbuk National University 1 환경수치해석 Numerical Method for Environmental Engineers Se-Woong Chung Department of Environmental Engineering.
Program design Program Design Process has 2 phases:
ALGORITHMS AND FLOWCHARTS
INTRODUCTION TO PROBLEM SOLVING
Unit 3: ALGORITHMS AND FLOWCHARTS
1-1 Logic and Syntax A computer program is a solution to a problem.
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
ALGORITHMS AND FLOWCHARTS
COVERED BASICS ABOUT ALGORITHMS AND FLOWCHARTS
CS111 Computer Programming
Algorithms and Flowcharts
Introduction To Flowcharting
Introduction to Computer Programming
Computer Programming.
Visual Basic 6 Programming.
ALGORITHMS AND FLOWCHARTS
Programming Right from the Start with Visual Basic .NET 1/e
Chapter 2- Visual Basic Schneider
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
A programming language
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Chapter 2: Input, Processing, and Output
Basic Concepts of Algorithm
Presentation transcript:

ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 4 Programming and Software EXCEL and MathCAD

Last Time Software Packages Users StandardPower Limited to standard software capabilities Write your own macros and/or software

Last Time Computer Implementation Algorithm Flowchart Pseudocode Computer Program

Last Time Algorithms & Flowcharts Algorithm The step by step procedure that describes the implementation of a solution strategy. Flowchart The visual representation of an algorithm.

Last Time Pseudocode and Computer Code Computer Code Set of Instructions in a computer language that direct the computer to perform a certain task. Pseudocode Set of code-like instructions that express the flowchart in a narrative form

Last Time Programming Topics Simple Information Specification –Constants, variables, type declarations Advanced Information Representation –Arrays, data structures, records Mathematical Formulas –Operators, priority rules, intrinsic functions Input/Output Logical Representation –Sequence, selection and repetition Modular Programming –Functions and Subroutines

Last Time Logical Representation Sequence Computer code is to be implemented one instruction at a time Analytic Solution Enter g,m,c Enter time t Evaluate v Print t,v

Last Time Logical Representation Selection Computer code flow is split into branches based on a logical decision. Enter g,m,c Check if m=0 Print Error Message OK to continue

Last Time Logical Representation Repetition Implement instructions repeatedly

Last Time Modular Programming Module is a self contained and independent code segment Modules are designed to perform a specific, well designed task Functions return a single result Subroutines return several results

Example Consider Quadratic Equation With closed form solution

Example If a,b,c are given Compute x 1 and x 2 What Do I Need?

Example Ask user to input a,b,c Check if a=0 –Linear equation, this solution does not apply Check if a=0 and b=0 –Trivial Solution Check if b 2 -4ac=0 –Double Real Root

A Simple Model FuFu FDFD FiFi

Analytic vs Numerical Solution Start from Governing Equation Derivative = Slope

Analytic vs Numerical Solution Use Finite Difference to Approximate Derivative vivi titi t i+1 v i+1 True Slope Approximate Slope

Analytic vs Numerical Solution

Numerical Solution Slope New Value Old ValueStep Size Euler Method

Analytic vs Numerical Solution Algorithm 1.Input a sequence of time nodes i.e. Start Time, End Time, Time Step 2. Input model parameters i.e. m, c 4. Input initial velocity i.e. v(t=0) 3. Input forcing function i.e. g

Algorithm 5. Check if m=0 avoid division by 0 6. For each time node evaluate 7. Other secondary checks…

Excel and MathCAD EXCEL MathCAD-IMathCAD-II

Project # 1 – DUE 9/12/03 This is a group project. You form your own teams. Each team should consist of UP TO THREE students. Consider the parachutist problem. Write an Excel Spreadsheet solution using Visual Basic macros to calculate terminal velocities numerically for each of the following cases: Mass in the range of Kg with step 10 For each mass vary the drag coefficient c in the range 0 to 20 with step 2 Plot the terminal velocity as a function of drag coefficient for each mass