2. I. INTRODUCTION
At the laboratory hour of ME 372 the task given was to investigate some
characteristics of a single degree-of-freedom system. While doing the
investigation, concepts such as Euler’s method, finding the exact solution and
taking derivatives were used. In order to solve the problem in a modular and
flexible way, operations, which were dealing with ordinary differential equations
and initial value problems, stated in the report were made. Throughout the report
detailed information about the process will be given via diagrams and MATLAB
codes.
II. RESULTS AND DISCUSSION
Functions exact.m and derive.m given during the laboratory hour were
changed into the forms stated below.
function [yexact] = exact(t, y0)
m=0.6297;
c=0.05;
I=0.7176E-2;
g=9.81;
lg=0.8446E-2;
T=c/(2*I*wn);
wn=sqrt((m*g*lg)/I);
w=wn*sqrt(1-(T^2));
c1=y0(1);
c2=-(T*wn*c1)/w;
yexact=exp(-T*wn*t))*(c1*cos(w*t)+c2*sin(w*t);
end
function f = deriv(tk, yk)
c=0.01;
lg=0.8446E-2
m=0.6297;
I=0.7176E-2;
c=0.01;
g=9.81;
f = [yk(2);(-c/I)*yk(2)-((m*g*lg)/I)*yk(1)];
After changing some parts of the function lab1_main.m, following diagrams
were drawn via MATLAB. In order to understand the affects of the c and h
variables, different values for them were used.
2
3. Figure 2: Diagram drawn when h=0.05
Figure 3: Diagram drawn when h=0.1
3
4. Figure 4: Diagram drawn when h=0.2
Figure 5: Diagram drawn when h=0.1 and c=0
Figure 6: Diagram drawn when h=0.1 and c=0.005
Figure 7: Diagram drawn when h=0.1 and c=0.02
4
5. Figure 8: Diagram drawn when h=0.1 and c=0.05
Throughout the trials, it can be commented that changes in c cause changes
approximate function and the changes in h affects the exact function. When
observed, it can be recognized that, using greater values for c and h have negative
effects on performance of the methods such as lack of accuracy and stability.
When c= 0.005 and h=0.1, the results are in harmony. They match accurately. The
optimum values for c can be considered between 0.005 and 0.05 and for h between
0.05 and 0.1.
III. CONCLUSION
After conducting numerous trials, it can be concluded great values for c and h
makes the function unstable and not accurate. While choosing the values for that
kind of an operation, this fact should be taken into account. One of the finest
results were observed for c= 0.005 and h=0.1. To have optimum results, h can be
taken between 0.05 and 0.1 and c between 0.005 and 0.05.
5
6. Figure 8: Diagram drawn when h=0.1 and c=0.05
Throughout the trials, it can be commented that changes in c cause changes
approximate function and the changes in h affects the exact function. When
observed, it can be recognized that, using greater values for c and h have negative
effects on performance of the methods such as lack of accuracy and stability.
When c= 0.005 and h=0.1, the results are in harmony. They match accurately. The
optimum values for c can be considered between 0.005 and 0.05 and for h between
0.05 and 0.1.
III. CONCLUSION
After conducting numerous trials, it can be concluded great values for c and h
makes the function unstable and not accurate. While choosing the values for that
kind of an operation, this fact should be taken into account. One of the finest
results were observed for c= 0.005 and h=0.1. To have optimum results, h can be
taken between 0.05 and 0.1 and c between 0.005 and 0.05.
5