Soran University Faculty of Science Department of Mathematics Course Book Computer Programming Second year mathematics department Academic Year: 2011-2012 Four hours per week 1 Soran University Faculty of Science Department of Mathematics Course Book Computer Programming Second year mathematics department Academic Year: 2011-2012 Four hours per week Instructor: Shirin Hamze Abdolrahman Email: zeryayjin@gmail.com Phone: 07508950173 Time: Wednesday 8:30 – 12:30 Place: College of Science Department of Mathematics Office Hours: Wednesday 12:30 – 13:30 Place: College of Science Department of Mathematics 2 Course description: Study of MATLAB windows, script files, two-dimensional and threedimensional plots, creating array, functions and function files, programming in MATLAB, applications in numerical analysis. Course objectives: The student is expected to get familiar with the instructions of MATLAB and be able to write short programming and should learn to take advantage of MATLAB in mathematical analysis, calculus, differential equations and almost all subjection mathematics. Texts: Amos G. MATLAB. 2th ed. 2004. ISBN 9780471694205. 3 Homework: Homework is some problems that should be solved by groups. Exams: There will be sevens exams at class times and a final exam. The use of calculators or notes is not permitted during the exams. External Assessor: Q): Define h and k as scalars, h = 0.9, and k = 12.5, and x, y and z as the vectors x = 1, 2, 3, 4, y = 0.9, 0.8, 0.7, 0.6, and z = 2.5, 3, 3.5, 4. Then use these variables to calculate T using element-by-element calculations for the vectors. T= xyz + (h + k)k⁄5 z (x+y) ke zh Solution: >> h = 0.9; k = 12.5; >> x = [1; 2; 3; 4]; y = [0.9; 0.8; 0.7; 0.6]; z = [2.5; 3; 3.5; 4]; >> T = (x.∗ y.∗ z./((h + k). ^k/5))+ (k ∗ exp(1). ^(z./x+ y)./ z. ^h) 𝑇= 164.1970 46.3851 26.1777 17.7798 Grading method: Homework 10% Midterm exams 30% Final exam 60% 4 Course contents: Weeks Topics Chapter one Starting with MATLAB 1 Starting MATLAB, MATLAB Windows Chapter two Creating Arrays 2 Creating Array (Vector and Matrix) 3 Using a Colon : In Addressing Array 4 Exam 1 Chapter three Mathematical Operations with Arrays 5 Addition, Subtraction, Multiplication and Division 6 Using Arrays in MATLAB Built-In Math Functions Chapter four Script Files 7 Creating, Saving and Running a Script File 8 Importing and Exporting Data 9 Exam 2 5 Weeks Topics Chapter five Two-Dimensional Plots 10 The plot and fplot Command 11 Formatting a Plot Chapter six Functions and Function Files 12 13 Creating a Function File Comparison Between Script Files and Function Files Exam 3 14 Chapter seven Programming in MATLAB 15 Relational and Logical Operators 16 The switch-case Statement, for-end Loops, while-end Loops 17 Nested Loops and Nested Conditional Statements 18 Exam 4 Chapter eight Polynomials, Curve Fitting, and Interpolation 19 Polynomials, Curve Fitting 20 Interpolation 21 Exam 5 6 Weeks Topics Chapter nine Three-Dimensional Plots 22 Line Plots, Mesh and Surface Plots, Plot with Special Graphics, The View Command Chapter ten Applications in Numerical Analysis 23 Solving an Equation with One Variable 24 Ordinary Differential Equations 25 Exam 6 Chapter eleven Symbolic Math 26 27 28 Symbolic Objects, and Symbolic Expressions Solving Algebraic Equations Numerical Calculations with Symbolic Expressions Exam 7 29 7