Documente Academic
Documente Profesional
Documente Cultură
abstract
Based on WEA, the numbers of electric bike user has increase significantly. An electric
bike has become main trasportation, as its speed can reach hundred km/h. Despite of its
popularity, one of the main problem that the biker face is distance.
An electric bike mainly use SLA-Acid battery or Li-Ion battery, and on its top speed, it
drains a vast amount of energy and the battery can be emptied quickly. Based on this
problem, we decided to measure how much distance can the biker ride, based on its velocity
and batttery capacity.
Our paper focuses on making an instrument to calculate the distance length while the
biker ride. We provide information about the disctance and minutes can a biker ride while
maintaining at its current speed. The input variables that necessary for our research are
battery capacity, velocity, ampere. Those variables are calculated based on bisection method
to provide the necessary information the biker needs.
I. basic theory
1. Current
Ohm's law states that the current through a conductor between two points is directly
proportional to the potential difference across the two points. Introducing the constant of
proportionality, the resistance, one arrives at the usual mathematical equation that describes
this relationship:
I = V/R
where I is the current through the conductor in units of amperes, V is the potential difference
measured across the conductor in units of volts, and R is the resistance of the conductor in
units of ohms. More specifically, Ohm's law states that the R in this relation is constant,
independent of the current.
2. Battery capacity and discharge
A battery's capacity is the amount of electric charge it can deliver at the rated voltage. The
more electrode material contained in the cell the greater its capacity. A small cell has less
capacity than a larger cell with the same chemistry, although they develop the same opencircuit voltage. Capacity is measured in units such as amp-hour (Ah). The rated capacity of a
battery is usually expressed as the product of 20 hours multiplied by the current that a new
battery can consistently supply for 20 hours at 68 F (20 C), while remaining above a
specified terminal voltage per cell. For example, a battery rated at 100 Ah can deliver 5 A
over a 20-hour period at room temperature. The fraction of the stored charge that a battery
can deliver depends on multiple factors, including battery chemistry, the rate at which the
charge is delivered (current), the required terminal voltage, the storage period, ambient
temperature and other factors.
The higher the discharge rate, the lower the capacity. The relationship between current,
discharge time and capacity for a lead acid battery is approximated (over a typical range of
current values) by Peukert's law:
t = Qp/Ik
3. function of S(t)
S(t)=v(t)* Qp/I(t)
s(t) = range until battery run out
v(t) = speed of the bike at t
Qp = the capacity of battery when discharged at a rate of 1 amp
I(t) = current at t
II. methodology
An equation
f ( x) 0
and
and
xu
root between
between
and
if
f ( x ) f ( xu ) 0
f ( x ) f ( xu ) 0
Note that if
xu
f (x)
, where
and
xu
xu
f ( x ) f ( xu ) 0
Since the bisection method is based on finding the root between two
points, the method falls under the category of bracketing methods.
Since the root is bracketed between two points,
the mid-point,
1.
2.
x
xm
and
and
xm
xm
xu
between
, and
.
and
xu
and
xu
f (x)
x
xu
Figure 1 At least one root exists between the two points if the function is real,
continuous, and changes sign.
f (x)
xu
f (x)
f ( x) 0
f (x)
f (x)
xu
x xu
f (x)
does not change sign between two
f ( x) 0
f (x)
xu
f (x)
f ( x) 0
xm
f ( x ) f ( x m )
, and if
and
xm
or between
f ( x ) f ( x m ) 0
, otherwise, it is between
xm
and
xu
xm
and
xu
x , xu
halving the interval. As one repeats this process, the width of the interval
becomes smaller and smaller, and you can zero in to the root of the equation
f ( x) 0
The steps to apply the bisection method to find the root of the equation
are
1. Choose
and
xu
f (x)
in other words,
and
xu
f ( x) 0
f ( x ) f ( x u ) 0
, or
xu
and
xm
, of the equation
f ( x) 0
as
xm =
x xu
2
f ( x ) f ( xm ) 0
and
b) If
xu x m
xu xu
; then
xm
and
xu
; then
x x
x x m
f ( x ) f ( x m ) 0
c) If
; then the root is
4. Find the new estimate of the root
xm =
and
xm
f ( x ) f ( x m ) 0
and
xm
x xu
2
xmnew - xmold
a =
100
xmnew
where
xmnew
xmold
a
5. Compare the absolute relative approximate error
a s
f ( x) x 2 0
xu
, such
that
f ( x ) f ( xu ) 0
f (x)
d) For functions
where there is a singularity and it reverses sign at
the singularity, the bisection method may converge on the singularity
(Figure 7). An example includes
f ( x)
where
1
x
x 2 xu 3
,
f ( x ) f ( xu ) 0
However, the function is not continuous and the theorem that a root
exists is also not applicable.
f (x)
f ( x) x 2 0
x0
that cannot be
bracketed.
A singularity in a function is defined as a point where the function becomes infinite. For example, for a function
such as
1/ x
x0
as it becomes infinite.
f (x)
f x
1
0
x
hold off
%
------------------------------------------------------------------------------% Iteration 1
figure('Position',wind)
xr=(xu+xl)/2;
% This graphs the function and two lines representing the two guesses
clf
subplot(3,1,2),fplot(f,[lxrange,uxrange])
hold on
plot([xl,xl],[maxi,mini],'y','linewidth',2)
plot([xu,xu],[maxi,mini],'g','linewidth',2)
plot([xr,xr],[maxi,mini],'r','linewidth',2)
plot([lxrange,uxrange],[0,0],'k','linewidth',1)
title('Entered function on given interval with upper and lower guesses')
% This portion adds the text and math to the top part of the figure window
subplot(3,1,1), text(0,1,['Iteration 1'])
text(0.2,.8,['xr = (xu + xl)/2 = ',num2str(xr)])
text(0,.6,['Finding the value of the function at the lower and upper
guesses and the estimated root'])
text(0.2,.4,['f(xl) = ',num2str(f(xl))])
text(0.2,.2,['f(xu) = ',num2str(f(xu))])
text(0.2,0,['f(xr) = ',num2str(f(xr))])
axis off
hold off
% Check the interval between which the root lies
if f(xu)*f(xr)<0
xl=xr;
else
xu=xr;
end
% This portion adds the text and math to the bottom part of the figure
window
subplot(3,1,3), text(0,1,['Check the interval between which the root lies.
Does it lie in ( xl , xu ) or ( xr , xu )?'])
text(0,.8,[''])
text(0.2,0.6,['xu = ',num2str(xu)])
text(0.2,0.4,['xl = ',num2str(xl)])
axis off
xp=xr;
%
------------------------------------------------------------------------------% Iteration 2
figure('Position',wind)
xr=(xu+xl)/2;
% This graphs the function and two lines representing the two guesses
clf
subplot(3,1,2),fplot(f,[lxrange,uxrange])
hold on
plot([xl,xl],[maxi,mini],'y','linewidth',2)
plot([xu,xu],[maxi,mini],'g','linewidth',2)
plot([xr,xr],[maxi,mini],'r','linewidth',2)
plot([lxrange,uxrange],[0,0],'k','linewidth',1)
title('Entered function on given interval with upper and lower guesses')
% This portion adds the text and math to the top part of the figure window
subplot(3,1,1), text(0,1,['Iteration 2'])
text(0.2,.8,['xr = (xu + xl) / 2 = ',num2str(xr)])
text(0,.6,['Finding the value of the function at the lower and upper
guesses and the estimated root'])
text(0.2,.4,['f(xl) = ',num2str(f(xl))])
text(0.2,.2,['f(xu) = ',num2str(f(xu))])
text(0.2,0,['f(xr) = ',num2str(f(xr))])
axis off
hold off
% Check the interval between which the root lies
if f(xu)*f(xr)<0
xl=xr;
else
xu=xr;
end
% Calculate relative approximate error
ea=abs((xr-xp)/xr)*100;
% This portion adds the text and math to the bottom part of the figure
window
subplot(3,1,3), text(0,1,['Absolute relative approximate error'])
text(0,.8,['ea = abs((xr - xp) / xr)*100 = ',num2str(ea),'%'])
text(0,.4,['Check the interval between which the root lies. Does it lie in
( xl , xu ) or ( xr , xu )?'])
text(0.2,0.2,['xu = ',num2str(xu)])
text(0.2,0,['xl = ',num2str(xl)])
axis off
xp=xr;
%
------------------------------------------------------------------------------% Iteration 3
figure('Position',wind)
xr=(xu+xl)/2;
% This graphs the function and two lines representing the two guesses
clf
subplot(3,1,2),fplot(f,[lxrange,uxrange])
hold on
plot([xl,xl],[maxi,mini],'y','linewidth',2)
plot([xu,xu],[maxi,mini],'g','linewidth',2)
plot([xr,xr],[maxi,mini],'r','linewidth',2)
plot([lxrange,uxrange],[0,0],'k','linewidth',1)
title('Entered function on given interval with upper and lower guesses')
% This portion adds the text and math to the top part of the figure window
subplot(3,1,1), text(0,1,['Iteration 3'])
text(0.2,.8,['xr = (xu + xl) / 2 = ',num2str(xr)])
text(0,.6,['Finding the value of the function at the lower and upper
guesses and the estimated root'])
text(0.2,.4,['f(xl) = ',num2str(f(xl))])
text(0.2,.2,['f(xu) = ',num2str(f(xu))])
text(0.2,0,['f(xr) = ',num2str(f(xr))])
axis off
hold off
% Check the interval between which the root lies
if f(xu)*f(xr)<0
xl=xr;
else
xu=xr;
end
% Calculate relative approximate error
ea=abs((xr-xp)/xr)*100;
% This portion adds the text and math to the bottom part of the figure
window
subplot(3,1,3), text(0,1,['Absolute relative approximate error'])
text(0,.8,['ea = abs((xr - xp) / xr)*100 = ',num2str(ea),'%'])
text(0,.4,['Check the interval between which the root lies. Does it lie in
( xl , xu ) or ( xr , xu )?'])
text(0.2,0.2,['xu = ',num2str(xu)])
text(0.2,0,['xl = ',num2str(xl)])
axis off
xp=xr;
%
------------------------------------------------------------------------------% Iteration 4
figure('Position',wind)
xr=(xu+xl)/2;
% This graphs the function and two lines representing the two guesses
clf
subplot(3,1,2),fplot(f,[lxrange,uxrange])
hold on
plot([xl,xl],[maxi,mini],'y','linewidth',2)
plot([xu,xu],[maxi,mini],'g','linewidth',2)
plot([xr,xr],[maxi,mini],'r','linewidth',2)
plot([lxrange,uxrange],[0,0],'k','linewidth',1)
title('Entered function on given interval with upper and lower guesses')
% This portion adds the text and math to the top part of the figure window
subplot(3,1,1), text(0,1,['Iteration 4'])
text(0.2,.8,['xr = (xu + xl) / 2 = ',num2str(xr)])
text(0,.6,['Finding the value of the function at the lower and upper
guesses and the estimated root'])
text(0.2,.4,['f(xl) = ',num2str(f(xl))])
text(0.2,.2,['f(xu) = ',num2str(f(xu))])
text(0.2,0,['f(xr) = ',num2str(f(xr))])
axis off
hold off
% Check the interval between which the root lies
if f(xu)*f(xr)<0
xl=xr;
else
xu=xr;
end
% Calculate relative approximate error
ea=abs((xr-xp)/xr)*100;
% This portion adds the text and math to the bottom part of the figure
window
subplot(3,1,3), text(0,1,['Absolute relative approximate error'])
text(0,.8,['ea = abs((xr - xp) / xr)*100 = ',num2str(ea),'%'])
text(0,.4,['Check the interval between which the root lies. Does it lie in
( xl , xu ) or ( xr , xu )?'])
text(0.2,0.2,['xu = ',num2str(xu)])
text(0.2,0,['xl = ',num2str(xl)])
axis off
xp=xr;
%
------------------------------------------------------------------------------% Iteration 5
figure('Position',wind)
xr=(xu+xl)/2;
% This graphs the function and two lines representing the two guesses
clf
subplot(3,1,2),fplot(f,[lxrange,uxrange])
hold on
plot([xl,xl],[maxi,mini],'y','linewidth',2)
plot([xu,xu],[maxi,mini],'g','linewidth',2)
plot([xr,xr],[maxi,mini],'r','linewidth',2)
plot([lxrange,uxrange],[0,0],'k','linewidth',1)
title('Entered function on given interval with upper and lower guesses')
% This portion adds the text and math to the top part of the figure window
subplot(3,1,1), text(0,1,['Iteration 5'])
text(0.2,.8,['xr = (xu + xl) / 2 = ',num2str(xr)])
text(0,.6,['Finding the value of the function at the lower and upper
guesses and the estimated root'])
text(0.2,.4,['f(xl) = ',num2str(f(xl))])
text(0.2,.2,['f(xu) = ',num2str(f(xu))])
text(0.2,0,['f(xr) = ',num2str(f(xr))])
axis off
hold off
% Check the interval between which the root lies
if f(xu)*f(xr)<0
xl=xr;
else
xu=xr;
end
% Calculate relative approximate error
ea=abs((xr-xp)/xr)*100;
% This portion adds the text and math to the bottom part of the figure
window
subplot(3,1,3), text(0,1,['Absolute relative approximate error'])
text(0,.8,['ea = abs((xr - xp) / xr)*100 = ',num2str(ea),'%'])
text(0,.4,['Check the interval between which the root lies. Does it lie in
( xl , xu ) or ( xr , xu )?'])
text(0.2,0.2,['xu = ',num2str(xu)])
text(0.2,0,['xl = ',num2str(xl)])
axis off
xp=xr;
III. analysis
IV. data and graphic
V. summary
VI. reference
http://nm.mathforcollege.com/topics/bisection_method.html