Professional Documents
Culture Documents
Numerical Method Introduction
Numerical Method Introduction
1
Time Commitment
Total 40 hrs
Attendance/Attitude 10%
Exercises 10%
Total 100%
Lect
Prc.
Exr.
.
1 Introduction 3 1 [1]: Chap 1-2
5 Curve fitting 1 1
https://classroom.google.com
x 3 0
x2 2x 3 0
Analytical method
x3 2 x 2 2 x 3 0
x 4 x3 2 x 2 3x 3 0
x5 x 4 x3 2 x 2 3x 3 0
an x n an 1 x n 1 ... a2 x 2 a1 x a0 0
Numerical methods
Thai Minh Quan - Numerical Methods 8
Motivation
Or…
fluid flow
Analytical methods ?
Numerical methods
Analytical methods ?
Numerical methods
Analytical methods ?
Numerical methods
Approximations and
Round-Off Errors
something
Workspace /
Current
Directory Command
Window
Command
History
Matlab comment
prompt operator
suppress
assign
command
operator Try the same line
output
without the semicolon
and comments
Thai Minh Quan - Numerical Methods 39
Variables (continued …)
View variable contents by simply typing
the variable name at the command
prompt
>> a
a=
12
>>
>> a*2
a=
24
>>
Thai Minh Quan - Numerical Methods 40
Matlab introduction
Mathematical operations
Type 2+3 after the >> prompt, followed by Enter (press the Enter key) as
indicated by <Enter>:
>> 2+3 < Enter>
Commands are only carried out when you enter them. The answer in this case
is, of course, 5. Next try
>> 3–2 < Enter>
>> 2*3 < Enter>
>> 1/2 < Enter>
>> 2ˆ3 < Enter>
>> 2\1 < Enter>
Matrix
A = [1 2 3; 4 5 6; 7 8 9]
z = zeros(2,4)
x = ones(2,3)
Create matrices A and B and try out the the matrix operators
in this slide
Thai Minh Quan - Numerical Methods 50
Visualisation - plotting data
>> figure % create new figure
>> t=0:pi/12:8*pi;
>> y=cos(t); Plot
style
>> plot(t,y,‘b.-')
Octave online:
https://rextester.com/l/octave_online_compiler
https://www.tutorialspoint.com/execute_matlab_online.php