Questions: 213

Answers by our Experts: 199

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

A ball is thrown vertically upwards with an initial velocity of 30 m/s.

Using a time step of 0.02 s up to 6.20 s, write a matlab code to give a plot of the vertical distance versus 

time for this ball.

Hint ; Motion under gravity is described by the equation : 𝑣𝑦 = 𝑣𝑜𝑦𝑡 +1/2𝑔𝑡²


and gravitational acceleration 𝑔 is here taken as negative.



Write a short comment explaining the code:


function DrawCircle(a, b, r)

%DRAWCIRCLE draws a circle on the coordinate plane

% a and b are the x-axis and y-axis coordinates of the center

% of the circle and r is its radius


t = 0:pi/180:2*pi;

x = r*cos(t) + a;

y = r*sin(t) + b;


plot(x, y, '-', a, b, '.');

axis equal

axis padded


text(a, b,'\leftarrow center')

title("The circle of radius " + string(r));

xlabel("X");

ylabel("Y")


end


Write a short comment explaining the code:



equipment = ["Power generator", "Transformer", "Stepper motor", "DC motor"];

price = [30, 10, 15, 8.5];

n = 4;

tot_number = 0;

tot_cost = 0;

for i=1:n

number = input("Enter number of " + equipment(i) + ": ");

tot_number = tot_number + number;

tot_cost = tot_cost + number * price(i);

end

avg_cost = tot_cost /tot_number;

fprintf("\n");

fprintf("The total number of equipment: %d\n", tot_number);

fprintf("The total cost: £%.2f\n", tot_cost);

fprintf("The average cost £%.2f per item\n", avg_cost);


Table 1: Driving styles associated with acceleration values


Driving style Economic (1) Normal(2) Aggressive(3)

Acceleration magnitude [m/s2 ]


Economic (1)

0.7-2.3


Normal(2)

2.31-3.30


Aggressive(3)

3.31-8.5 


Create variable ds mapping to store corresponding classification values of 1,2 or 3, which represent different driving style as shown in Table 1. You need to evaluate only the magnitude the of the acceleration/deceleration


Write a code to Extract the following data from the dataset.


Pack T1 C


Pack T2 C


Pack T3 C


Pack T4 C


The extracted data represent temperature measured from four sensors located around the battery pack. Calculate minimum, maximum and average temperature for each sensor.


Use bar command to plot at the same figure the calculated minimum, maximum and average values for each sensor. Add legend, grid and title. Add labels to all axes


Plot on the same figure the calculated acceleration and the classification variable ds mapping

against time. Use left side y-axis and a line style to plot the acceleration. Use right side

y-axis to illustrate the driving style classification. Hint: You may use plotyy to complete this

task. Add labels to all axes. Add legend to the figure.


Table 2: Example of classification


acceleration value ds_mapping

-1.2 1

1.23 1

3.2 2

-4.3 3

9.5 0






1. Extract the following data from the dataset:


• Motor Pwr (50w)


• Aux Pwr (50w)


• A/C Pwr (100w)


2. Assign the extracted data to variables. Note that appropriate conversion must be done to obtain power in kW for all variables. Use description in the “Log File Format.docx” to get more details about conversion rates


Knowing that average acceleration in a time interval ∆t = ti+1 − ti can be expressed as 𝑎𝑖 = 𝑣𝑖+1 − 𝑣𝑖 / ∆𝑡


where vi+1 − vi is the change in velocity between successive measurements,


write a code to: 

3) Calculate acceleration in m/s2 using speed and time data extracted from the dataset. Hint: You may use for ... end loop to complete this task.


Driving style Economic (1) Normal (2) Aggressive (3)


Acceleration magnitude [m/s2] 0.7-2.3 2.31-3.30 3.31-8.5


1.     A company is offering a job with a salary of Rs. 50,000.00 for the first year and a 4% raise each year after that. If that 4% raise continues every year,

Find the total amount of money an employee would earn in a 10-years career.(Using the geometric Progression).

Table 1: Driving styles associated with acceleration values


Driving style Economic (1) Normal (2) Aggressive (3)

Acceleration magnitude [m/s2 ] 0.7-2.3 2.31-3.30 3.31-8.5 



Create variable ds mapping to store corresponding classification values of 1,2 or 3, which represent different driving style as shown in Table 1. You need to evaluate only the magnitude the of the acceleration/deceleration.


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS