Académique Documents
Professionnel Documents
Culture Documents
1)
corresponding to a decrease in value in a range from to .
Answer:
() = sin 2 , 1st order derivative at (1) = ?
Exact solution is () = 0
1 st order derivative:
(+)()
= ( = 101 , 102 , . . 108 )
2nd order derivative:
(+)()
= ( = 101 , 102 , . . 108 )
2
From calculation:
(1 st (2nd
order) order)
0.1 -1.23E-01 -5.55E-18
0.01 -1.23E-02 0
0.001 -1.23E-03 0
0.0001 -1.23E-04 0
0.00001 -1.23E-05 0
0.000001 -1.23E-06 0
0.0000001 -1.23E-07 0
Figure 1. Change in corresponding to increase in .
0.00000001 -1.11E-08 0
0.000000001 0.00E+00 0
Observation: It was observed that for the 1st order differentiation the value approaches to zero
when the value approaches in an order of 10-9. However for the 2nd order differentiation,
the value approaches to zero, when the value approaches in an order of 10-1.
Source code:
%Code written in Matlab V15
clear variables
close all
clc
%%Known information
theta0 = [pi/2]
delx = [0.1 0.01 0.001 0.0001 0.00001 0.000001 0.0000001 0.00000001
0.000000001];
t = 1;
n = length (delx)
%%
y = zeros(n,1);
z = zeros(n,1);
for i =1:n
end
%%
hold on;
box on;
plot (delx,y,'r', 'LineWidth',2)
plot (delx,z,'g', 'LineWidth',2)