subplot(2,1,1)

Report 5 Downloads 42 Views
Assigned: December 2

5 6 7 8 9 10 11 12 13 14 15

Fall 2013

Due: December 8

h = 0.3; x = 0:h:3; y = f(x); [d1,d2] = myDerivative(h,y); subplot(2,1,1); plot(x,dfdx(x),’r*’,x,d1,’ko’); legend(’Exact derivative’,’Estimated Derivative’); max(abs(dfdx(x)-d1)) subplot(2,1,2); plot(x,df2dx2(x),’r*’,x,d2,’ko’); max(abs(df2dx2(x)-d2)) end code

8. Freight trains can be extremely massive, and therefore require enormous power provided by the locomotives to get moving. They also require tremendous braking power to stop. Modern trains use regenerative braking, similar to the systems used in hybrid cars, to mitigate the energy lost in conventional braking systems. (a) In this problem you will write a function named trainPower with the following function declaration line begin code 1

[intBrakePow, intEnginePow] = trainPower(x, y, tstep, mass, friction) end code where the input arguments are • • • • •

x: a vector with n elements representing the x-position of the train in meters y: a vector with n elements representing the y-position of the train in meters tstep: a scalar that is the time (in seconds) between each data point in x and y mass: the mass of the train in kilograms friction: the friction factor of the train in Newton/(meter/sec) (The friction is assumed to be proportional to the speed of the train, so this is a scalar value.)

The output arguments are • intBrakePow: a n-by-1 vector of the instantaneous power being produced by the brakes at each data point, and • intEnginePow: a n-by-1 vector of the instantaneous power being produced by the engine at each data point. In order to detemine these values let m represent the mass of the train, k represent the friction factor of the train, and s, v and a represent the distance, velocity and acceleration of the train in the direction of the track. First, the (x, y) data needs to be resolved into the distance, velocity, and acceleration in the tangential direction of the track: i. Determine the distance, dist, the train has traveled during each time steps. The first element of dist should equal zero (i.e. if t = 0, then dist = 0). For the subsequent time steps dist should be the distance between x and y at the current timestep and x

11 of 13

Assigned: December 2

Fall 2013

and y at the previous timestep: q disti = (xi

xi

1)

Due: December 8

2

+ (yi

yi

1)

2

for i > 0

ii. Find the cumulative sum of dist to get the total distance, s, the train has traveled at each timestep. Numerically di↵erentiate s using the function from Problem 7 to obtain s˙ (which is v) and s¨ (which is v, ˙ and hence a). Now we can calculate the force and power produced by the engine and brakes. We will assume that the engine and brakes never act simultaneosly: i. The force at the wheel/track interface is due to engine at time t, if ma(t) + kv(t) > 0. In that case, the force from the engine is Fe (t) = ma(t) + kv(t), and the braking force is Fb (t) = 0. ii. Similarly, the force from the brakes at time t is nonzero if ma(t) + kv(t) < 0. In that case, the force from the brakes is Fb (t) = ma(t) + kv(t) and the engine force is Fe (t) = 0. iii. When Fe 6= 0, the instantaneous power being delivered to the wheels, from the engine, is Pe (t) = Fe (t)v(t). Similarly, when Fb 6= 0, the power being delivered to the energy storage system from the braking system is Pb (t) = Fb (t)v(t). (b) Now you will write a function that calculates the total energy outputted by the engine and the total energy regenerated from the brakes. For both of these calculations assume that the systems are lossless(i.e. all of the energy produced by the engine moves the train and all of the braking energy is captured by the regenerative braking system). Write a function named trainEnergy with the following declaration line begin code 1

[engEnergy, brkEnergy] = trainEnergy(tstep, intBrakePow, intEnginePow) end code where the input arguments are • tstep: a scalar that is the time (in seconds) between each data point in x and y • intBrakePow: a n-by-1 vector of the instantaneous power being produced by the brakes at each data point as outputted by trainPower • intEnginePow: a n-by-1 vector of the instantaneous power being produced by the engine at each data point as outputted by trainPower And the output arguments are • engineEnergy: The total energy produced by the engine. Energy is the integral (over time) of power. Use the trapz command in Matlab to compute this integral. • brakeEnergy: The total energy recaptured by the braking system. Energy is the integral (over time) of power. Use the trapz command in Matlab to compute this integral.

You should test your functions with small examples first. Once you are confident everything is working correctly, you can test your functions using the data in the trainData.mat file, that is included in the assignment download. This is dataset of GPS points from a car on a long train. It 12 of 13

Assigned: December 2

Fall 2013

Due: December 8

includes (x, y) position data in meters that was recorded at 4-second intervals (representing 852 seconds of data). The following figure shows the train velocity and acceleration. The next figure shows the instantaneous power produced by the engine and recovered by the brake system. It was assumed that the train has a total mass of 7000 metric tons (7 ⇥ 106 kg) and a friction factor of 8 ⇥ 103 (Newtons/(meter/second)).

Figure 2: Train Velocity and Acceleration

Figure 3: Train Power Profile

13 of 13

Recommend Documents