Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Like this presentation? Why not share!

- CIV1900 Matlab - Plotting & Coursework by TUOS-Sam 9354 views
- Civil Engineering Skills - Introduc... by TUOS-Sam 5896 views
- Matlab L3 Program Flow by TUOS-Sam 5300 views
- Orthographic Projections by TUOS-Sam 2894 views
- Variables in matlab by TUOS-Sam 5891 views
- Digital cavity 1.1 by Nikolay Minev 110 views

No Downloads

Total views

4,698

On SlideShare

0

From Embeds

0

Number of Embeds

1,027

Shares

0

Downloads

14

Comments

0

Likes

2

No embeds

No notes for slide

- 1. Civil Engineering SkillsComputer programming CIV1900 Dr Sam Clarke Introduction
- 2. Have you programmed before?A. Yes (C++, Java) 25% 25% 25% 25%B. Yes (Html, CSS)C. Yes (Fortran, Matlab)D. No A. B. C. D.
- 3. How this fits in... There are 5 weeks of material that combine a short lecture (~ 30 mins), with a 2 hour computer class and a short quiz Today’s intro lecture & variables There will be two sessions (Wks10 & 11) that explain how to accomplish particular programming tasks The final session is more about computer graphics and introduces the programming assessment.
- 4. Assessment1. Final quiz is worth 10% (wk12) Portfolio elements (printed graphics & code) 10%2. 4 online tests (weeks 8-11) Unlimited attempts, 70% to pass. Each worth 1.25% You will not be allowed to proceed to the next Quiz without successful completion
- 5. What is ComputerProgramming?
- 6. Contents for Lecture 1 Why engineers need to program Computer modelling and its importance for engineering problems How to write an algorithm to solve an engineering task
- 7. Contents for Lecture 1 Why engineers need to program Computer modelling and its importance for engineering problems How to write an algorithm to solve an engineering task
- 8. What is an Algorithm?A. A step-by-step 25% 25% 25% 25% procedure for calculationsB. A random computer processC. The music of algaeD. The principle of how a computer works A. B. C. D.
- 9. What is an Algorithm? How a computer executes a process Order Instructions Rules
- 10. On famous physicist RichardFeynman’s blackboard at thetime of his death was thefollowing statement: “What I cannot create I do not understand.”
- 11. Hence, an ability to programor, at the very least, an abilityto understand how programswork, is today a vitalengineering skill that greatlyenhances employability.
- 12. Simple Physics We will have a look at this later…
- 13. Beam Stress
- 14. Finite Element Analysis You will learn about this in 3rd year
- 15. Fluid Dynamics You will learn about this in 3rd year
- 16. Groundwater flow
- 17. Uses Many of the examples we have just seen involve computer models of engineering structures. Modelling is a very important application of programming. Programming can be used to streamline a series of repeated tasks. (such as routine design)
- 18. UsesGeotechnics
- 19. Uses Force Resistance Angle 1 Angle 2
- 20. Uses Can you imagine how long this would take by hand!!
- 21. Uses
- 22. UsesAngle 1: 0-90° in 0.1° increments (900)Angle 2: 0-90° in 0.1° increments (900)810000 combinations...
- 23. Uses Each pixel represents a calculation Automated using computer programming
- 24. Limitations We can only formulate a model for a process if we have some understanding of the relevant physics. This will be a simplification of reality because we are unable to include all possible factors – we try to include those that our engineering judgement deem to be the most relevant. This is closure – we choose to close out some aspects of reality to focus on others.
- 25. Verification & Validation Verification is our checking to see that our model contains the relevant physics and that we solve the equations that we formulate for the processes in an appropriate way. Validation is our checking that the outputs from our model match our expectations of the behaviour of the real system.
- 26. ExampleIn order to determine the specification for a newbridge you need to estimate the probable 200year discharge on a river.The traditional method to do this involvesfinding the largest event in a year and fitting astatistical distribution to these annual maxima.The raw data that your firm have been given aredaily discharge maxima.
- 27. Data
- 28. By hand, the procedure that we would follow to construct the annual maxima is something like:(1) Scroll down through the data finding the first and last values in a particular year;(2) Sort these data in descending order of discharge and isolate the top value (the annual maximum);(3) Write this value into a column in a new file with the year in an adjacent column;(4) Move on to the next year and repeat.
- 29. ProgrammingAll programming involves is the writing of an algorithm such as that just given into a language that the computer can process and understand.The particular language we will be using is that for the Matlab software.Other computer languages tend to work in similar basic ways.
- 30. Repeating StuffKnown as loopsFor…. loopsWhile… loopsFor… loops repeat a set of statements a set number of times.While… loops keep repeating WHILE some condition holds.We will cover this more in Week 11
- 31. For our example from the dischargedataset, imagine we have 32 years of data,with either 365 or 366 days in a year.
- 32. Illustrating algorithms with flow diagrams Process Decision Data
- 33. Set Maximum to 0 Leap year data Loop through NumDays Is current No Current year a leap N value year? oYes NumDays = 365 Is this > Maximum ?NumDays = 366 Yes
- 34. Set Maximum to this new valueAll of the statementsthat we have written On completion ofare themselves the inner loop writeembedded in a For loop out Maximum forwhere the counter runs this yearfrom 1 to 32, meaningthat the annualmaximum for each yearis written out.
- 35. Over the next few weeks you will:• Be taught how to use Matlab and gain an experience in writing Matlab code.• Be given an engineering problem which you will have to solve using MatlabThus, by week 12 you should be ableto code up an algorithm yourself.
- 36. Next Week… Guest lecture on Civil Engineering designPeer Assessment period

No public clipboards found for this slide

×
### Save the most important slides with Clipping

Clipping is a handy way to collect and organize the most important slides from a presentation. You can keep your great finds in clipboards organized around topics.

Be the first to comment