

5.3 Exercise 1
For this exercise, we will compute the total amount of Energy in the Segway's fully charged batteries, in a reverse engineering manner. The Segway web site tells us that
Accounting for a variety of realworld conditions we expect you'll be able to travel about 10 miles (16 km) on a single battery charge.The values are summarized in Table
5.1 for other types of situations. We will assume normal conditions. Unfortunately, we don't know anything about how the Segway testers arrived at these results. Specifically, we don't know about the rider's weight, how fast she was riding, and even what a normal terrain looks like. For now, we will need to make assumptions, which can easily be changed through variables later on. Let's assume the following:
 the rider travelled at a constant
20 km/h, which is the maximum speed on the Segway.
 the rider has a typical body weight of
80 kg (176 pounds).
 the rider has a body height of
180 cm (6 ft).
 the terrain is a
0 degree inclined street.
We first define a series of variables, which can be changed later on to account for any misjudgements in our previous assumptions. Also, some of these variables will be reused in later exercises and assignments.

v_{const} = 20 km/h

m_{rider} = 80 kg

h_{rider} = 180 cm

m_{batteries} = 9 kg (Table 5.1)

m_{segway w/o bat} = 29 kg

m_{segway} = m_{batteries} + m_{segway w/o bat} by means of adding two defined variables

d_{wheel} = 0.48 m (Table 5.1)

A_{segway} = 0.2 m^{2} (see Segway Physics)

c_{D} = 1.5 (Table 5.2)

alpha_{} = 0

eff_{overall} = 0.5 (see Discussion on Electrical Issues)

time = 48 min (16 km travelled at 20 km/h = 4/5 of 1 hour = 48 minutes)
In order to compute the total amount of energy in the Segway's fully charged batteries, we need to first compute the mechanical power required to move the Segway and its rider at the specified speed. From equation
5.9 we know that the required force is:
F_{Total} = F_{Traction} = D = F_{Air} + F_{Roll} + F_{Slope} + F_{Accel} (Eq. 5.23)
For our purposes, we will not take into account the Force required to accelerate the vehicle; we assume that the Segway is in motion and does not stop until the Energy in the batteries is exhausted. This is not a realistic assumption, but not taking it into account will simplify our problem setup. The equation becomes:
F_{Total} = F_{Air} + F_{Roll} + F_{Slope} (Eq. 5.24)
From equation
5.14 we can now compute the total Torque exerted on the wheel with diameter d_{wheel} that is needed for force F_{Total}:
T = (d_{wheel} / 2) * F_{Total} (Eq. 5.25)
Using equation
5.15, we arrive at a measure for Power:
P_{mech} = T * Ω (Eq. 5.26)
where
Ω is measured in radians per second.
We have established in the discussion of Electric Issues, that the mechanical power experienced at the wheels is not a 100% measure of how much electrical power is drawn from the batteries. We have established that there exists some efficiency factor, by which energy is lost on the path from batteries to wheels. We have given it a quantity of 50%. Thus, any mechnical power at the wheels is due to
1 / efficiency, in our case 1/.5 times the electrical power from the batteries. In order to compute the true power from the batteries, we multiply the previously derived Power by this quantity:
P_{batteries} = P_{mech} * (1 / eff_{overall}) (Eq. 5.27)
Finally, we compute the total amount of Energy in the batteries. Mathematically, we would integrate the amount of required power over time in seconds, which is equivalent to multiplying Power by time:
E_{batteries} = P_{batteries} * time (Eq. 5.28)
5.3.1 Setup and Solution in Matlab
We begin by creating a empty mfile, in which we will define all variables, and from where we will call functions to handle the actual calculation.


Figure 5.11 Click image to enlarge, or click here to open


We now begin entering these equations into the mfile, substituting for defined variable names. We could either write out all equations for total energy, or we could call functions that compute smaller parts of the problem, which may again make use of other functions. For our purposes, we will split the problem into smaller pieces systematically. We start by defining Torque:
Torque   =   (d_{wheel} / 2) * F_{total}(A, v, c_{D}, m, alpha) 
where
(d_{wheel} / 2) is the radius of the wheel, and F_{total}(A, v, c_{D}, m, alpha) is the undefined quantity of total Force. We do know, however, what parameters are necessary to compute F_{Total}, which is why we have substituted them with dummy variable names for now.
Save this mfile under the name
exercise_batterypower.m.


Figure 5.12 Click image to enlarge, or click here to open


We now create a new mfile for the function that computes the Total Force, given the arguments
A for frontal area, v for velocity, c_{D} for the coefficient of drag, m for the total weight of the vehicle + rider, and alpha for the slope of the inclined terrain.
This function is rather simple, as it merely redistributes the parameters to each component of force:
F   =   F_{air}(A, v, c_{D}) + F_{roll}(m, v) + F_{slope}(alpha, m) 
Save this mfile under the name
F_{total}Next, we will need to define each of the component force functions,
F_{air}, F_{roll}, and F_{slope}.


Figure 5.13 Click image to enlarge, or click here to open


We create a new mfile for function
F_{air}.
From equation
5.5, we define the following:
F   =   0.5 * rho * A * (v^2) * c_{D} 
where
rho = 1.225 is the constant for density of air, A is the frontal area measured in square meters, v is the velocity measured in meters per second, and c_{D} is the coefficient of drag.
Save this mfile under the name
F_air.m


Figure 5.14 Click image to enlarge, or click here to open


Next, we create a new mfile for function
F_{roll}.
From equation
5.6 we define the following:
where
g = 9.81 is the constant for acceleration due to gravity, v is the velocity measured in meters per second, and m is the mass measured in kilograms.
Save this mfile under the name
F_roll.mSince the Rolling Resistance Coefficient is a function of velocity (Table
5.3), we will need to define the proper function.


Figure 5.15 Click image to enlarge, or click here to open


We create a new mfile for function
c_{R}.
From the first equation in Table
5.3, we define the following:
F   =   0.0136 + 0.04 * 10^{6} * (v * 3.6)^2 
where v is the velocity measured in meters per second.
Save this mfile under the name
c_R.m


Figure 5.16 Click image to enlarge, or click here to open


Next, we create a new mfile for function
F_{slope}.
From equation
5.7 we define the following:
F   =   m * g * sin((pi * alpha) / 180) 
where
g = 9.81 is the constant for acceleration due to gravity, m is the mass measured in kilograms, and alpha is the angle of the inclined terrain measured in degrees.
Note that
pi is a predefined value for 3.1415... (Matlab variable name: pi)
Similar to the function for conversion of velocity from
km/h to m/sec, we need to check the angle for negative values, in which case the required force is 0. We thus refine the function as follows:
if (t < 0) F = 0 else F = m*g*sin((pi*alpha)/180) end
Save this mfile under the name F_slope.m


Figure 5.17 Click image to enlarge, or click here to open


We now revisit the mfile for this exercise. Previously, we have defined:
Torque   =   (d_{wheel} / 2) * F_{total}(A, v, c_{D}, m, alpha) 
We now need to substitute variables for the parameters passed to
F_{total}.
Frontal surface area
A depends on the FSA of the Segway and the FSA of the rider. The FSA of the rider has been established in equation 5.12.


Figure 5.18 Click image to enlarge, or click here to open


We now create a new mfile for function
FSA.
From equations
5.12 and 5.11 we define the following:
A   =   (2 / 5) * √((h * m) / 3600) 
where
h is the height of the person measured in centimeters, and m is the weight of the person measured in kilograms.
Save this mfile under the name
FSA.m


Figure 5.19 Click image to enlarge, or click here to open


We are now ready to substitute all variables and helper functions for the parameters passed to
F_{total}. For readability, we assign the function calls to different short variable names:
A   =   FSA(h_{rider, mrider) + Asegway} 
v   =   v_{kmh2msec}(v_{const}) 
m   =   m_{segway} + m_{rider} 
Torque   =   (d_{wheel} / 2) * F_{total}(A, v, c_{D}, m, alpha) 
which gives us a complete formula for
Torque. This quantity represents the power required to move the Segway and its rider at the given speed with a given mass.


Figure 5.20 Click image to enlarge, or click here to open


We can now compute the mechanical Power at the wheel:
P_{mech effective}   =   Torque * v_{msd2rad}(v, d_{wheel}) 
Since we measure velocity in kilometers per hour, we need to convert this quantity to radians per second. We have already defined a function that converts kilometers per hour to meters per second. We thus need to write a function that converts
m/sec to rad/sec.


Figure 5.21 Click image to enlarge, or click here to open


We now create a new mfile for function
v_{msd2rad}.
Given the diameter of a wheel and the speed at which it turns in
m/sec, we can compute the circumference of the wheel and finally the number of radians per second:
v   =   (msec / (d * pi)) * (2 * pi) 
or:
where
msec is the velocity measured in meters per second and d is the diameter of the wheel measured in meters.
Save this mfile under the name
v_msd2rad.m


Figure 5.22 Click image to enlarge, or click here to open


We now compute the actual Power in the batteries, which is not the same as the Power at the wheels, due to inefficiencies:
P_{ideal batteries}   =   P_{mech effective} * (1 / eff_{overall}) 
The resulting quantity
P_{ideal batteries} is a better measure for how much power is required to move the Segway and its rider at velocity v with mass m.


Figure 5.23 Click image to enlarge, or click here to open


To finally compute the total amount of Energy in the batteries, we multiply Power by time:
E_{batteries total}   =   P_{ideal batteries} * (time * 60) 
where
time in minutes is multiplied by 60 for the right quantity in seconds.
E_{batteries total} is the final amount of energy in the batteries. With this quantity, we can now compute a variety of other scenarios.


Figure 5.24 Click image to enlarge, or click here to open


Once all mfiles are saved and in the same directory, you can run the program by merely typing the name
exercise_batterypower into the Command Window.


Figure 5.25 Click image to enlarge, or click here to open



