L1 - CGN 3421 - Computer Methods Gurley CGN 3421 - Computer...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CGN 3421 - Computer Methods Gurley page 1 of 11 CGN 3421 - Computer Methods Class web site: www.ce.ufl.edu/~kgurl Class text books: Recommended as a reference Numerical Methods for Engineers ’, Chapra and Canale Fourth Edition, McGraw-Hill Class software: Required purchase from Tech Hub Mathcad 2000 (Circa labs and 200 Weil lab) Mathcad 2001 (current version available for purchase, differences from 2000 minimal for our purposes) Class Outline Learn fundamentals of programming skills in general and Mathcad in particular ~ 5 or 6 weeks Use Mathcad as a medium to investigate a variety of numerical methods of problem solving. The context will generally be civil engineering-type problems. A more detailed list of topics covered can be found in the syllabus, avaiable at the class web site: www.ce.ufl.edu/~kgurl -->classes/syllabi The Programming Process 1) Read problem statement 2) Identify given input and variable input 3) Identify required output 4) Map a path from starting point to ending point 5) Write a pseudo-code in words to describe the process 6) Solve a simple example problem by hand or calculator or spreadsheet 7) Write the Mathcad worksheet (program) 8) Test the code with the example problem from step 6, verify the result 9) Be sure to test each of the desired features of the program. Never assume the answer out is correct
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CGN 3421 - Computer Methods Gurley page 2 of 11 Example: Write a program to calculate the mass of a hollow sphere. The outer diameter is 10.2, the den- sity is 1.25, the thickness is variable (the program user decides) Apply the Programming Process : 2) given input: diameter, density variable input: thickness 3) output: mass 4) Map a path: 5) Write a pseudo-code gather all necessary input (diameter, density, thickness) calculate outer and inner radius calculate volume of the solid material multiply volume by density to get mass display result 6) Solve a simple example problem by hand or calculator or spreadsheet 7) Write the Mathcad worksheet (program) Now test the code I’ll use a calculator to run an example and compare with my results NOTE: Mathcad knows the value of , unless it has been redefined as a new variable Please enter a value for the thickness of the skin of the sphere thickness 2 := These variables will remain constant Density 1.25 := Diameter 10.2 := Calculate outer and inner radius Router Diameter 2 := Rinner Router thickness := Volume 4 3 π Router 3 Rinner 3 () := Volume 430.859 = π
Background image of page 2
CGN 3421 - Computer Methods Gurley page 3 of 11 Equal Signs There are 5 types of equalities that can be used in Mathcad, each has a specific purpose and meaning. For now we need to discuss two types : = is used to assign a variable to a number or equation. As in C: = 10. This sign is created by typing ‘:’ = is used to display the contents of a variable that has already been assigned. It’s used to display output C: = A + B calculates and assigns a value to C, C = displays the result The other 3 types are for assignments inside a function, comparison equal signs, and global equal signs.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

L1 - CGN 3421 - Computer Methods Gurley CGN 3421 - Computer...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online