The EcoMarathon is an annual competition sponsored by Shell

The Eco-Marathon is an annual competition sponsored by Shell Oil, in which participants build special vehicles to achieve the highest possible fuel efficiency. The Eco-Marathon is held around the world with events in the United Kingdom, Finland, France, Holland, Japan, and the United States. A world record was set in the Eco-Marathon by a French team in 2003 called Microjoule with a performance of 10,705 miles per gallon. The Microjoule runs on ethanol. Write a MATLAB program to determine how far the Microjoule will travel in kilometers given a user-specified amount of ethanol, provided in units of grams. For your test case, you may assume that the user provides 100 grams of ethanol.

Solution

% matlab code to find how far did the microjoule drive in kilometers

ethanol_grams = input(\"Enter ethanol in grams: \");

% specific gravity = .789
ethanol = ethanol_grams/0.789;

% to gallon
oil = ethanol * 264.172 * 10^(-6);

% performance 10,705 miles per gallon
distance = 10705*oil;

% to kilometer
distance = distance * 1.60934;

fprintf(\"Distance covered by Microjoule: %f kilometers\ \",distance);

%{
output:

Enter ethanol in grams: 100
Distance covered by Microjoule: 576.825244 kilometers

%}

The Eco-Marathon is an annual competition sponsored by Shell Oil, in which participants build special vehicles to achieve the highest possible fuel efficiency.

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site