Professional Documents
Culture Documents
Anil Kutuwo Vu Le
Nepal Viet Nam
Included in this report are three essential steps that are necessary for any
mathematical modelling cycle. At first, the project was initiated by the process
of gathering data. As will be presented in the content of this report, all the
data collected are proved to be essentially fundamental, meaning that the
gliders model cannot be solved without the existences of them. To simulate the
flight path of a glider, a system of four differential equations are introduced, of
which two are derived from Newtons second law of motion while the remaining
are derived for the determination of the gliders position in space during its
flight.
Finally, validation procedure was carried out by first solving analytically the
governing equations of the gliders model and then comparison between solu-
tions obtained from two approaches was made. As a result of this, the model
was confirmed to work correctly and gave sufficiently precise solutions to the
problem. Nevertheless, it was found that the included variables, despite being
fundamentally essential, were only crudely replicate the reality. Consequently,
it was concluded that further refinement should be made and suggestions are
included in the final chapter of this report.
3
Contents
Summary 3
List of variables 7
1 Introduction 8
1.4 Limitation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3 Model simulation 16
4
3.1.2 Step size for determining precise velocity . . . . . . . . 17
3.3 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4 Model validation 22
4.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5 Conclusion 29
5.4 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6 Recommendation 32
Bibliography 33
5
B Errors between time steps of angle 37
C Glider tracjectory 40
D Phase plan 45
E MathCAD Calculation 50
6
List of variables
7
Chapter 1
Introduction
Correspondingly, the authors of this work were given the objective of inves-
tigating the behavior of a gliders trajectory and how it is influenced by the
many terms included in the gliders mathematical model.
8
Figure 1.1: Gliders trajectory problem reference frame. (TU Delft,
2017)
dV
m = CD V 2 mg sin()
dt
mV d
= CL V 2 mg cos()
dt
Consisting in the equations are four essential variables which describe the
gliders velocity, angle of orientation, lift and drag coefficients. How these four
terms influence the trajectory and flight behavior of the glider is thus the main
concern in the mathematical model.
Subsequently, much of the work done by the authors was to investigate and
analyze the effects created by these variables through which the mathematical
model can be refined and improved to better replicate the real-life problem.
In studying the equations of the gliders motion, the work was conducted
through various steps. At first, information about the glider was gathered
as required to construct the mathematical model. By choosing a typical glider
model, the gliders specification data were then provided.
As soon as all the necessary information was available, the next step was to
simulate the differential equations by implementing Eulers method. At the be-
ginning, each of the equations was studied separately with the other variables
were held constant. With this technique, not only were the authors allowed
to quickly visualize of the behavior of the gliders velocity and angle of orien-
tation as they changed through time, but also errors could be estimated from
which the authors could decide how precise would the mathematical model
be. Nevertheless, to best replicate the reality, the equations were eventually
9
considered as one system for the implementation of Eulers method to simulate
the gliders flight behavior as well as its trajectory through time.
While going through these abovementioned steps, the simulation process was
iterated several times with different values of variables to validate the accuracy
of the results obtained from the mathematical model.
1.4 Limitation
All the simulations made in this work were run using Python. As this course is
an introduction to mathematical modelling, it is apparent there are limitations
with the model used to analyze the gliders flight behavior and trajectory. By
assuming the glider as a particle, the authors would only need to consider
the all the forces acting through the gliders center of mass. Additionally,
further simplifying the model was that the equations of motion were derived
in terms of a 2D plane problem. Obviously, these assumptions only crudely
represented the problem, since the influences of various parts on gliders such
as rudders and ailerons were not taken into considerations. Nevertheless, these
limitations, despite not being able to best illustrate the actual flight trajectory,
still provided a solid foundation upon which the authors can improve in the
future.
1.5 Outline
Capturing the work done in the project, three core chapters are included in
this report to illustrate the process gone through to mathematically model the
flight of a glider. Firstly, in chapter 2, all the necessary data collected for the
glider are introduced alongside the explanation on the physical meanings of the
four essential terms consisted in the system of differential equations of motion.
Secondly, chapter 3 concentrates in the simulation process of the mathematical
model by mean of Eulers method. Each of the equations are initially solved
separately to determine the needed step sizes for accurate solutions before they
are simulated as one system. In chapter 4, analytical solutions are calculated
and will be compared against the solutions obtained from Eulers method as
well as to analyze the behavior of the model regarding its validity opposed to
the actual problem. Subsequently, a conclusion chapter will then be made and
followed by a recommendation chapter in which suggestions for refining the
models are included.
10
Chapter 2
Mathematical modelling of
glider
Having previously mentioned about the content of this chapter, all the neces-
sary information is going to be presented here as preparation for the simulation
process in chapter 3. The physical meanings of all the essential variables will
also be explained as well as the inclusion of two additional differential equa-
tions that are needed for computing the gliders trajectory through space.
Model Cirrus 75
Number of seats 1
Wing span 15 m
Wing area 10 sq m
Aspect ratio 22.5
Gross weight 390 kg
Maximum L/D 37
Typical speed 93 km/h
11
It is important to have the L/D ratio of a glider since this the optimal angle
of orientation that the glider will likely to obtain during a long unperturbed
flight.
dV
m = CD V 2 mg sin() (2.1)
dt
d
mV = CL V 2 mg cos() (2.2)
dt
Regarding the first term, since V is raised by a power of 2, its influence on the
values of both equations are going to be much more significant.
12
dV
Discussing first the equation of , when the first term is small enough with
dt
regard to the second term, the summation of two terms are dictated mainly
by the fluctuation of mg sin(). If the glider points steeply to the ground,
the total value will be positive since the first term is smaller despite being
negative. However, as V increases, the influence will gradually swift to the
first term, and instantaneous rate of change of the gliders velocity will be
negative, meaning the glider will eventually reach a terminal velocity. This
situation also remains true regardless the value of when V is too high.
d
As for the second equation , if V becomes too low, mg cos() will again
dt
determine the sign of the sum of two terms. The rate of change will be negative
3
from to and vice versa from to . Meanwhile, if the gliders speed
2 2 2 2
d dV
is too high, will have the same behavior as previously mentioned for .
dt dt
Also of interest in this project is the trajectory of the glider through space, and
therefore two additional differential equations of the position of the glider shall
be included. Given the instantaneous speed and orientation of the glider, the
changes of position in horizontal direction (x-axis) and vertical direction (y-
axis) are the products of these two variables. Given below are the differential
equations to compute the position of the glider as it changes through time.
dx
= V cos() (2.3)
dt
dy
= V sin() (2.4)
dt
Both the initial values of V and will be restricted between 10-40 m/s and -
4
The nature of lift and drag coefficients are complex and affected by various
factors during a glider flight such as the speed and density of air, the gliders
wing area and angle of attack. Since the authors do not have prior knowledge
in the field of aerodynamics, it is acceptable that these values can set constant
for ease of computing and simulating the mathematical model. The figures
below show the range of typical values of lift and drag coefficients, which was
found on Wikipedia.
13
Figure 2.2: Range of values of drag coefficient. (Drag coefficient, n.d.)
14
Figure 2.3: Range of values of lift coefficient. (Lift coefficient, n.d.)
2.4 Conclusion
Overall, there are definite additional information required for a realistic math-
ematical model of a gliders trajectory. However, the data presented in this
chapter are proved to be essentially fundamental, meaning they are needed
for a simulation to be computed at all. They provide an adequate level of
accuracy to the problem stated and from which the authors can gain valuable
knowledge as well as what to expect in the simulation process.
15
Chapter 3
Model simulation
The mathematical model and different terms related to the model were dis-
cussed in the chapter 2. Firstly, in this chapter, time step required to estimate
the precise angle and velocity of the glider will be discussed by applying Eulers
method to the corresponding differential equations 2.1 and 2.2. After that, the
same method will be applied to both equations as one system to study varia-
tions and dependency of both V and with time. Finally, the trajectory of the
gliders flight will be computed once again by Eulers method for the solutions
of four differential equations with the addition of two differential equations 2.3
and 2.4.
The differential equations for the gliders flight problem has been presented in
section 2.2. Now, the solution for the problem can be approximated with a
numerical method known as Eulers method. To apply the abovementioned
method, step size dt must be computed such that the errors in computation
is sufficiently small to obtain accurate solutions. Subsequently, the errors will
be included and presented as the difference in the values for a time t at step
sizes dt and 2dt.
From the differential equation of angle 2.2, it is apparent that the rate of
change in angle with time is directly proportional to the lift coefficient. There-
fore, for the determination of the step size, the largest value 1.74 kg/m of CL
16
is selected as it will result in maximum error in the computation of at any
time.
The velocity is assumed to be constant at the typical speed of the glider i.e.
25.8 m/s and initial angle (0) to be the optimal angle for glider as described
in section 2.1, i.e. -0.02702 radians. For the analysis, the precision of the angle
is decided to be of 0.001 radians (to check angle of the model within error of
0.57 degrees).
From the differential equation of velocity 2.1, it is obvious that the rate of
change in velocity with time is directly proportional to the drag coefficient.
Therefore, for the determination of the step size, the largest value 1.15 kg/m
of CD is selected as it will result in maximum error in the computation of V
at any time.
17
The angle is assumed to be at the optimal angle for the glider i.e. 0.02702
radians and initial velocity V (0) to be the typical speed of glider i.e. 25.8 m/s.
For the analysis, the precision of the velocity is chosen to be of 0.1 m/s.
The step size for desired precision in angle and velocity are 1/64 and 1/4 of
a second respectively. Therefore, for the further modelling simulation, the
minimum of the two step sizes should be used to get the desired precision in
both angle and velocity. As a result, further simulation of Eulers method for
the system has been conducted with a step size 1/64 of a second.
18
3.1.4 Simulation of glider system for velocity and orientation
After determining the appropriate step size for the simulation, the glider sys-
tem has been analysed with initial velocity of 30 m/s and initial angle of -0.1
radians (these values are not of the equilibrium point). In addition, with the
assumption of glider to be streamlined, the drag coefficient is assumed to be
0.04 kg/m and the corresponding lift coefficient to maintain a L/D ratio of 37
is estimated to be 1.48 kg/m.
Figure 3.3: Variations in velocity and angle with time. V (0) = 30 m/s,
(0) = -0.1, CL l = 1.48 kg/m, CD = 0.04kg/m
Figure 3.4 shows that solution function of velocity with time has a nature of
19
bounded and damping oscillation. The model oscillates at around 50.8 m/s.
Figure 3.5: Angle vs time. V (0) = 30 m/s, (0) = -0.1, CL l = 1.48 kg/m,
CD = 0.04kg/m
Figure 3.5 shows that solution function of angle with time has nature of
bounded and damping oscillation which is similar to the graph of velocity.
The model oscillates at around -0.02702 radians.
After finding the solutions for angle and velocity, Eulers method is modified
with the addition of two differential equations 2.3 and 2.4 to find the hori-
zontal and vertical position of the glider during flight. The solutions of these
equations are presented in Figure 3.6.
Figure 3.6 shows that there is oscillation in vertical position with an amplitude
of about 100 m and it minimizes with time as the system attains its equilibrium
position. Moreover, the distance traveled by the flight in horizontal direction
is about 30,000 m and drop in height of about 900 m in 600 s.
3.3 Conclusion
The mathematical model defined in section 2.2 has been simulated numerically
using Eulers method in Python programming language. The step size to get
precise velocity within 0.1 m/s and angle within 0.001 radians is computed to
be 1/64 of a second. After determining the step size, the differential equations
of the glider system are solved and it was found that the velocity and time
solutions have a bounded-and-damped oscillating nature. The system seems
20
Figure 3.6: Trajectory of glider flight. V (0) = 30 m/s, (0) = -0.1, CL l
= 1.48 kg/m, CD = 0.04kg/m, 600-second simulation
21
Chapter 4
Model validation
The preceding chapter deals with the calculation of mathematical model of the
Glider flight. In this chapter, the final section of a Mathematical modelling
cycle known as validation will be discussed. At first, the analytical solutions
of velocity and angle at equilibrium point will be presented. After that, the
oscillation period of the model will be analyzed based on the calculation for
eigenvalues of the Jacobian matrix with different drag and lift coefficients. This
analysis will yield a corresponding oscillation period of the Glider for specific
values of Cd and Cl. This step will be followed by a numerical simulation of
flight with different initial conditions. Once again, oscillation period will be
computed but numerically. The oscillation period from analytical solution and
numerical simulation with the same drag and lift coefficients will be compared
to validate the model. Finally, the phase plane will also analyzed to study
model performance and its validity.
An equilibrium point is the point where the variation is zero i.e. the first
derivative of the function is zero. For the modelling of Glider flight, velocity
and angle at the equilibrium point can be estimated analytically by solving
equations 2.1 and 2.2 when they are equal to zero. This results in the following
equations at equilibrium point:
s
mg cos()
Ve q = (4.1)
CL
CD
e q = arctan( ) (4.2)
CL
22
The Table 4.1 shows the velocity and angle at equilibrium point for different
drag and lift coefficients. The table shows only limited data since these data
are used for validation process.
Table 4.1: Velocity and angle at equilibrium point for different drag
coefficient and lift coefficient. (for detail calculation see Appendix E)
There are different methods for finding Cd and Cl. Some are as below:
Compare the expressions for Veq and eq with the values for real glider
The above four method are considered to get a solution for determining of CD
and CL value. The detail of glider model Cirrus 75 is presented in Table 2.1.
The first set of CD and CL , i.e. CD = 0.155 kg/m and CL = 5.746 kg/m,
resulting in a velocity of 25.8 m/s (93 km/h) which matches the speed the
Glider. The corresponding numerical simulation for the trajectory is presented
in Figure 4.1, which was simulated for 300 seconds. The trajectory of the flight
is satisfactory; however, according to (Lift coefficient, n.d.) that the maximum
possible value for CL is roughly 1.74 kg/m so the abovementioned values of
CD and CL are discarded.
Following Figure 2.2, the drag coefficient of a streamlined body is 0.04. Aiming
to have the optimal angle of attack as the equilibrium condition, i.e. -0.02702
1
rads (arctan( )), CL was calculated to be about 1.48 kg/m, which is ac-
37
ceptable and thus these two values were selected for further analysis. The
trajectory for this case is depicted in Figure 4.2.
23
Figure 4.1: Trajectory of glider flight. V (0) = 30 m/s, (0) = -0.1, CL l
= 5.746 kg/m, CD = 0.155 kg/m, 300-second simulation
Meanwhile, the Jacobian matrices for different cases were computed to find
their respective eigenvalues to determine their corresponding oscillation pe-
riods for comparison. The eigenvalues for the different cases showed stable
spiral points. The several periods of oscillation were computed using Math-
CAD Prime 4.0 (see Appendix E MathCAD calculation sheet). The results
are discussed in section 4.3.
Based on the present research, the most acceptable and practical possibility
values of the drag coefficient and lift coefficient, which are 0.04 kg/m and 1.48
kg/m respectively, are considered for numerical simulations of Glider flight at
the current stage. However, it is to be noted that the values shall be updated
in next cycle of mathematical modelling.
24
4.4 Flight simulation for initial condition
It is noted that the simulated values of velocity and angle of flight are matched
with the analytical solutions for the velocity and angle of flight at equilibrium
point. Moreover, the horizontal distance travel is close to the product of the
velocity at equilibrium point and time.
25
First peak: time 11.546875 s; velocity 82.9064880 m/s
Timed period between first peak and second peak is approximately 23.40625
seconds
Timed period between second peak and third peak is approximately 23.3125
seconds
Figure 4.3: Velocity vs time. V (0) = 5 m/s, (0) = -0.2, CL l = 1.48 kg/m,
CD = 0.04 kg/m, 70-second simulation, oscillating period is about 23.3
seconds
26
4.7 Phase plan
The phase plane for the system is generated considering following three initial
cases with drag coefficient of 0.04 kg/m and lift coefficient 1.48 kg/m.
The phase plane graph is shown in Figure 4.4, which illustrates that the solu-
tion of differential equations of glider system converse to around the equilib-
rium values of velocity and angle regardless of initial conditions.
27
4.8 Conclusion
28
Chapter 5
Conclusion
29
5.3 Model simulation
Moreover, the trajectory of the flight has also been computed and found that
the flight covers about 30,000 m in horizontal direction and drops by about
900 m height after 600 seconds of flight.
5.4 Validation
For the validation of the model, differential equations were solved analyti-
cally to compute angle and velocity at equilibrium point. Different methods
were considered to determine the drag and lift coefficients. Considering the
practical possibility, CD and CL were determined to be 0.04 kg/m and 1.48
kg/m respectively. Consequently, the resulted angle and velocity at equilib-
rium point were calculated to be -0.02702 rad and 50.83 m/s correspondingly.
The solutions are analytically indicated as a stable spiral point since the eval-
uated eigenvalues of the Jacobian matrix consist of an imaginary part with a
negative real part. Subsequently, the corresponding period of oscillation was
calculated to be 23.032 seconds.
Numerical simulation of the mathematical model with the same values for all
variables was computed for a duration of 2000 seconds with a step size of 1/64
of a second. Expectedly, the obtained solutions closely correlate to the analyt-
ically computed solutions. The period of oscillation from numerical simulation
was also estimated to be 23.3 seconds, which is close to the one computed ana-
lytically. Finally, phase plane confirms the accuracy of the solutions as all the
graphs converge to the equilibrium point of V = 50.83 m/s and = -0.02702
rad.
30
the same, which validate the mathematical model that was studied. However,
the trajectory of the flight shows high amplitude in fluctuations of height,
which is impractical. As a result, it is recommended that the model shall be
modified. Detail recommendations will be discussed in subsequent chapter.
31
Chapter 6
Recommendation
To revise the step size for obtaining even more precise results
32
Bibliography
33
Appendix A
@author: Ayanil
"""
import numpy as np
import matplotlib.pyplot as plt
# Constant
m = 390 # mass of glider in kg
g = 9.81 # Acceleration due to gravity in m/s^2
Cd = 1.15 # Drag Coefficient; the highest value of that
= -0.02702 # the typical angle the glider flies under on
#Boundary condition
V_init = 25.8 # initial velocity in m/s (use different valu
#time steps
34
t_init = 0 # initial time
t_end = 200 # stopping time
t_step=2 # reciprocal of time step in second for first
#Define array
t_arr = np.zeros(n_steps + 1) # create an array of zeros for t
V_arr = np.zeros(n_steps + 1) # create an array of zeros for V
Err_arr=np.zeros(t_end) # create an array of zeros for errors
Terr_arr=np.zeros(t_end) # create an array of zeros for tracing errors
t_arr[0] = t_init # add the initial t to the array
V_arr[0] = V_init # add the initial V to the array
# Eulers method
for i in range (1, n_steps + 1):
V = V_arr[i-1]
t = t_arr[i-1]
#print (t, V)
dVdt = (-Cd*V**2-m*g*np.sin())/m # calculate the derivative
V_arr[i] = V + Dt*dVdt # calculate V on the next time step
t_arr[i] = t + Dt # adding the new t-value to the list
#Define array
t_arr = np.zeros(n_steps + 1) # create an array of zeros for t
V_arr = np.zeros(n_steps + 1) # create an array of zeros for V
t_arr[0] = t_init # add the initial t to the array
V_arr[0] = V_init # add the initial V to the array
# Eulers method
for i in range (1, n_steps + 1):
V = V_arr[i-1]
t = t_arr[i-1]
#print (t, V)
dVdt = (-Cd*V**2-m*g*np.sin())/m # calculate the derivative
35
V_arr[i] = V + Dt*dVdt # calculate V on the next time step
t_arr[i] = t + Dt # adding the new t-value to the list
plt.xticks(fontsize = 10)
plt.yticks(fontsize = 10)
plt.grid(True) # show grid
plt.axis([0, 40, 0, 26]) # define the axes
plt.legend(fontsize=10) # show the legend
plt.show() # show the plot
# save the figure as .jpg
fig.savefig(Task_3.4_Solution for Velocity stepsize with error tracking.jpg, dpi=fi
36
Appendix B
@author: Ayanil
"""
import numpy as np
import matplotlib.pyplot as plt
# Constant
m = 390 # mass of glider in kg
g = 9.81 # Acceleration due to gravity in m/s^2
Cl = 1.74 # Lift Coefficient; the highest value of that
V = 25.8 # the typical velocity (in m/s) of the glider
#Boundary condition
_init = -0.02702 # initial angle in radian (use different value
#time steps
37
t_init = 0 # initial time
t_end = 200 # stopping time
t_step=32 # reciprocal of time step in second for first
#Define array
t_arr = np.zeros(n_steps + 1) # create an array of zeros for t
_arr = np.zeros(n_steps + 1) # create an array of zeros for
Err_arr=np.zeros(t_end) # create an array of zeros for errors
Terr_arr=np.zeros(t_end) # create an array of zeros for tracing errors
t_arr[0] = t_init # add the initial t to the array
_arr[0] = _init # add the initial to the array
# Eulers method
for i in range (1, n_steps + 1):
= _arr[i-1]
t = t_arr[i-1]
#print (t, )
ddt = (Cl*V**2-m*g*np.cos())/(m*V)# calculate the derivative
_arr[i] = + Dt*ddt # calculate on the next time step
t_arr[i] = t + Dt # adding the new t-value to the list
#Define array
t_arr = np.zeros(n_steps + 1) # create an array of zeros for t
_arr = np.zeros(n_steps + 1) # create an array of zeros for
t_arr[0] = t_init # add the initial t to the array
_arr[0] = _init # add the initial to the array
# Eulers method
for i in range (1, n_steps + 1):
= _arr[i-1]
t = t_arr[i-1]
#print (t, )
ddt = (Cl*V**2-m*g*np.cos())/(m*V)# calculate the derivative
38
_arr[i] = + Dt*ddt # calculate on the next time step
t_arr[i] = t + Dt # adding the new t-value to the list
plt.xticks(fontsize = 10)
plt.yticks(fontsize = 10)
plt.grid(True) # show grid
plt.axis([0, 20, -1.3, 1]) # define the axes
plt.legend(fontsize=10) # show the legend
plt.show() # show the plot
# save the figure as .jpg
fig.savefig(Task_3.3_Solution for Angle stepsize with error tracking.jpg, dpi=fig.d
39
Appendix C
Glider tracjectory
import numpy as np
import matplotlib.pyplot as plt
# Constant
m = 390 # mass of glider in kg
g = 9.81 # Acceleration due to gravity in m/s^2
Cd = 0.04 # Drag Coefficient; the highest value of that rang
Cl = 1.48 # Lift Coefficient; the highest value of the range
#time steps
t_init = 0 # initial time
t_end = 600 # stopping time
t_step = 64 #reciprocal of time step in second for first time
#Boundary condition
V_init = 30 # initial velocity of V
_init = -0.1 # initial angle of
x_init = 0 # initial angle of x
y_init = 0 # initial angle of y
40
#Define array
X = np.zeros(4) # create space for current X=[V,]^T
dXdt = np.zeros(4) # create space for current derivative
t_arr = np.zeros(n_steps + 1) # create a storage array for t
X_arr = np.zeros((4,n_steps+1)) # create a storage array for X=[V,]^T
t_arr[0] = t_init # add the initial t to the storage array
X_arr[0,0] = V_init # add the initial V to the storage array
X_arr[1,0] = _init # add the initial to the storage array
X_arr[2,0] = x_init # add the initial x to the storage array
X_arr[3,0] = y_init # add the initial y to the storage array
# Eulers method
for i in range (1, n_steps + 1):
t = t_arr[i-1] # load the time
V = X_arr[0,i-1] # load the value of V
= X_arr[1,i-1] # load the value of
x = X_arr[2,i-1] # load the value of x
y = X_arr[3,i-1] # load the value of y
X[0] = V # fill current state vector X=[V,]^T
X[1] =
X[2] = x
X[3] = y
dVdt = (-Cd*V**2 - m*g*np.sin())/m # calculate the derivative dV/dt
ddt = (Cl*V**2 - m*g*np.cos())/(m*V) # calculate the derivative d/dt
dxdt = V*np.cos() # calculate the derivative dx/dt
dydt = V*np.sin() # calculate the derivative dx/dt
dXdt[0] = dVdt # fill derivative vector dX/dt
dXdt[1] = ddt
dXdt[2] = dxdt
dXdt[3] = dydt
Xnew = X + Dt*dXdt # calculate X on next time step
X_arr[:,i] = Xnew # store Xnew
t_arr[i] = t + Dt # store new t-value
#print(t_arr[i],X_arr[:,i]) # store new t-value
41
plt.xticks(fontsize = 15) # adjust the fontsize
plt.yticks(fontsize = 15) # adjust the fontsize
plt.axis([0, t_end, min(X_arr[1,:])-2, max(X_arr[0,:])+2]) # set the ra
# save the figure as .jpg (other formats: png, pdf, svg, (ps, eps))
fig.savefig(Task_3.5_Glider Speed and Angle.jpg, dpi=fig.dpi, bbox_inches = "tight"
print (t_arr[t_end*t_step],X_arr[0,t_end*t_step])
# save the figure as .jpg (other formats: png, pdf, svg, (ps, eps))
fig1.savefig(Task_3.5_Glider Speed.jpg, dpi=fig.dpi, bbox_inches = "tight")
42
print (t_arr[t_end*t_step],X_arr[1,t_end*t_step])
# save the figure as .jpg (other formats: png, pdf, svg, (ps, eps))
fig2.savefig(Task_3.5_Glider Angle.jpg, dpi=fig.dpi, bbox_inches = "tight")
print (t_arr[t_end*t_step],X_arr[2,t_end*t_step])
# save the figure as .jpg (other formats: png, pdf, svg, (ps, eps))
fig3.savefig(Task_3.5_Glider x vs t.jpg, dpi=fig.dpi, bbox_inches = "tight")
print (t_arr[t_end*t_step],X_arr[3,t_end*t_step])
# save the figure as .jpg (other formats: png, pdf, svg, (ps, eps))
fig4.savefig(Task_3.5_Glider y vs t.jpg, dpi=fig.dpi, bbox_inches = "tight")
43
# Plot the results Trejectory
fig5 = plt.figure()
plt.plot(X_arr[2,:], X_arr[3,:], linewidth = 4) # plot y vs. x
# save the figure as .jpg (other formats: png, pdf, svg, (ps, eps))
fig5.savefig(Task_3.5_Trejectory.jpg, dpi=fig.dpi, bbox_inches = "tight")
44
Appendix D
Phase plan
import numpy as np
import matplotlib.pyplot as plt
# Constant
m = 390 # mass of glider in kg
g = 9.81 # Acceleration due to gravity in m/s^2
Cd = 0.04 # Drag Coefficient; the highest value of that rang
Cl = 1.48 # Lift Coefficient; the highest value of the range
#time steps
t_init = 0 # initial time
t_end = 250 # stopping time
t_step = 64 #reciprocal of time step in second for first time
#Boundary condition 1
V_init = 60 # initial velocity of V
_init = -1.3 # initial angle of
x_init = 0 # initial angle of x
y_init = 0 # initial angle of y
45
#Define array
X = np.zeros(4) # create space for current X=[V,]^T
dXdt = np.zeros(4) # create space for current derivative
t_arr = np.zeros(n_steps + 1) # create a storage array for t
X_arr = np.zeros((4,n_steps+1)) # create a storage array for X=[V,]^T
t_arr[0] = t_init # add the initial t to the storage array
X_arr[0,0] = V_init # add the initial V to the storage array
X_arr[1,0] = _init # add the initial to the storage array
X_arr[2,0] = x_init # add the initial x to the storage array
X_arr[3,0] = y_init # add the initial y to the storage array
# Eulers method
for i in range (1, n_steps + 1):
t = t_arr[i-1] # load the time
V = X_arr[0,i-1] # load the value of V
= X_arr[1,i-1] # load the value of
x = X_arr[2,i-1] # load the value of x
y = X_arr[3,i-1] # load the value of y
X[0] = V # fill current state vector X=[V,]^T
X[1] =
X[2] = x
X[3] = y
dVdt = (-Cd*V**2 - m*g*np.sin())/m # calculate the derivative dV/dt
ddt = (Cl*V**2 - m*g*np.cos())/(m*V) # calculate the derivative d/dt
dxdt = V*np.cos() # calculate the derivative dx/dt
dydt = V*np.sin() # calculate the derivative dx/dt
dXdt[0] = dVdt # fill derivative vector dX/dt
dXdt[1] = ddt
dXdt[2] = dxdt
dXdt[3] = dydt
Xnew = X + Dt*dXdt # calculate X on next time step
X_arr[:,i] = Xnew # store Xnew
t_arr[i] = t + Dt # store new t-value
#print(t_arr[i],X_arr[:,i]) # store new t-value
# Copy array
X1=np.copy(X_arr)
t1=np.copy(t_arr)
#Boundary condition 2
V_init = 20 # initial velocity of V
_init = 1.3 # initial angle of
x_init = 0 # initial angle of x
y_init = 0 # initial angle of y
46
#Define array
X = np.zeros(4) # create space for current X=[V,]^T
dXdt = np.zeros(4) # create space for current derivative
t_arr = np.zeros(n_steps + 1) # create a storage array for t
X_arr = np.zeros((4,n_steps+1)) # create a storage array for X=[V,]^T
t_arr[0] = t_init # add the initial t to the storage array
X_arr[0,0] = V_init # add the initial V to the storage array
X_arr[1,0] = _init # add the initial to the storage array
X_arr[2,0] = x_init # add the initial x to the storage array
X_arr[3,0] = y_init # add the initial y to the storage array
# Eulers method
for i in range (1, n_steps + 1):
t = t_arr[i-1] # load the time
V = X_arr[0,i-1] # load the value of V
= X_arr[1,i-1] # load the value of
x = X_arr[2,i-1] # load the value of x
y = X_arr[3,i-1] # load the value of y
X[0] = V # fill current state vector X=[V,]^T
X[1] =
X[2] = x
X[3] = y
dVdt = (-Cd*V**2 - m*g*np.sin())/m # calculate the derivative dV/dt
ddt = (Cl*V**2 - m*g*np.cos())/(m*V) # calculate the derivative d/dt
dxdt = V*np.cos() # calculate the derivative dx/dt
dydt = V*np.sin() # calculate the derivative dx/dt
dXdt[0] = dVdt # fill derivative vector dX/dt
dXdt[1] = ddt
dXdt[2] = dxdt
dXdt[3] = dydt
Xnew = X + Dt*dXdt # calculate X on next time step
X_arr[:,i] = Xnew # store Xnew
t_arr[i] = t + Dt # store new t-value
#print(t_arr[i],X_arr[:,i]) # store new t-value
# Copy array
X2=np.copy(X_arr)
t2=np.copy(t_arr)
#Boundary condition 3
V_init = 1 # initial velocity of V
_init = -2 # initial angle of
x_init = 0 # initial angle of x
y_init = 0 # initial angle of y
47
#Define array
X = np.zeros(4) # create space for current X=[V,]^T
dXdt = np.zeros(4) # create space for current derivative
t_arr = np.zeros(n_steps + 1) # create a storage array for t
X_arr = np.zeros((4,n_steps+1)) # create a storage array for X=[V,]^T
t_arr[0] = t_init # add the initial t to the storage array
X_arr[0,0] = V_init # add the initial V to the storage array
X_arr[1,0] = _init # add the initial to the storage array
X_arr[2,0] = x_init # add the initial x to the storage array
X_arr[3,0] = y_init # add the initial y to the storage array
# Eulers method
for i in range (1, n_steps + 1):
t = t_arr[i-1] # load the time
V = X_arr[0,i-1] # load the value of V
= X_arr[1,i-1] # load the value of
x = X_arr[2,i-1] # load the value of x
y = X_arr[3,i-1] # load the value of y
X[0] = V # fill current state vector X=[V,]^T
X[1] =
X[2] = x
X[3] = y
dVdt = (-Cd*V**2 - m*g*np.sin())/m # calculate the derivative dV/dt
ddt = (Cl*V**2 - m*g*np.cos())/(m*V) # calculate the derivative d/dt
dxdt = V*np.cos() # calculate the derivative dx/dt
dydt = V*np.sin() # calculate the derivative dx/dt
dXdt[0] = dVdt # fill derivative vector dX/dt
dXdt[1] = ddt
dXdt[2] = dxdt
dXdt[3] = dydt
Xnew = X + Dt*dXdt # calculate X on next time step
X_arr[:,i] = Xnew # store Xnew
t_arr[i] = t + Dt # store new t-value
#print(t_arr[i],X_arr[:,i]) # store new t-value
# Copy array
X3=np.copy(X_arr)
t3=np.copy(t_arr)
48
plt.plot(X3[0,:], X3[1,:], linewidth = 4,label="V(0)=1, (0)=1") # plot y vs. x
# save the figure as .jpg (other formats: png, pdf, svg, (ps, eps))
fig.savefig(T4.8_Phase plane.jpg, dpi=fig.dpi, bbox_inches = "tight")
49
Appendix E
MathCAD Calculation
50
m
w 390 kg g 9.81
s2
V0 0
kg kg
CD 0.155 CL 5.746
m m
m
V 25.8 0 rad
s
CL V 2 - w g cos (()) 0
m
25.799
( )
Find (V , ) = s
-0.027
CD 0.155 CL 5.746
w 390 g 9.81
CD
eq -atan = -0.027
CL
cos ((eq))
Veq 61.85386 = 25.799
CL
-2 CD Veq
-g cos ((eq))
w
J
CL g cos ((eq)) g
+ 2
sin ((eq))
w Veq Veq
expand , float , 5
J - J - - J J 0.03076 + 2 + 0.28917
0,0 1,1 0,1 1,0
1 -0.015380249117859692743 - 0.53752823314043435729i
2 eigenvals ((J)) -0.015380249117859692743 + 0.53752823314043435729i
||Im ((1))|| = 0.538
2
T = 11.689
( )
y ((t)) e Re (1) t ((cos ((||Im ((1))|| t)) + sin ((||Im ((1))|| t))))
1.5
1.2
0.9
0.6
0.3
0
y ((t))
-0.3
-0.6
-0.9
-1.2
-1.5
CD 0.04 CL 1.48
w 390 g 9.81
CD
eq -atan = -0.027
CL
cos ((eq))
Veq 61.85386 = 50.834
CL
-2 CD Veq
-g cos ((eq))
w
J
CL g cos ((eq)) g
+ 2
sin ((eq))
w Veq Veq
1 -0.0078206583347437412573 - 0.27280287815901961412i
2 eigenvals ((J)) -0.0078206583347437412573 + 0.27280287815901961412i
||Im ((1))|| = 0.273
2
T = 23.032
( )
y ((t)) e Re (1) t ((cos ((||Im ((1))|| t)) + sin ((||Im ((1))|| t))))
1.5
1.2
0.9
0.6
0.3
0
y ((t))
-0.3
-0.6
-0.9
-1.2
-1.5
CD 0.009 CL 0.1
w 390 g 9.81
CD
eq -atan = -0.09
CL
cos ((eq))
Veq 61.85386 = 195.205
CL
-2 CD Veq
-g cos ((eq))
w
J
CL g cos ((eq)) g
+ sin ((eq))
w Veq 2 Veq
1 -0.0067570956236706587345 - 0.070749165469117760089i
2 eigenvals ((J)) -0.0067570956236706587345 + 0.070749165469117760089i
||Im ((1))|| = 0.071
2
T = 88.809
( )
y ((t)) e Re (1) t ((cos ((||Im ((1))|| t)) + sin ((||Im ((1))|| t))))
1.5
1.25
0.75
0.5
0.25
y ((t))
0
-0.25
-0.5
-0.75
-1
CD 1.15 CL 1.74
w 390 g 9.81
CD
eq -atan = -0.584
CL
cos ((eq))
Veq 61.85386 = 42.829
CL
-2 CD Veq
-g cos ((eq))
w
J
CL g cos ((eq)) g
+ sin ((eq))
w Veq 2 Veq
1 -0.18943773365304595807 - 0.26275380565632381246i
2 eigenvals ((J)) -0.18943773365304595807 + 0.26275380565632381246i
||Im ((1))|| = 0.263
2
T = 23.913
( )
y ((t)) e Re (1) t ((cos ((||Im ((1))|| t)) + sin ((||Im ((1))|| t))))
1.1
0.9
0.8
0.7
0.6
0.5
0.4 y ((t))
0.3
0.2
0.1
-0.1
-0.2