MatLab exercise (practice problem and solution script), Exercises of Matlab skills

From ME 2543 (simulation dynamics) course - focused on MatLab programming

Typology: Exercises

2020/2021

Uploaded on 07/30/2024

kaelyn-smith-1
kaelyn-smith-1 🇺🇸

2 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
% example 2.4.3 (falling body)
y_0 = 100;
t = 2;
g = 32.2;
y = y_0 - 1/2 * g * t^2
y = 35.6000
% example 2.4.4 (ideal gas law)
n = 10;
V = 100;
T = 400;
R = 0.08206;
p = (n * R * T) / V
p = 3.2824
% example 2.4.6 (barbell)
h = 6;
R = 3;
r = 1.5;
volume_of_spheres = (4/3 * pi * R^3) * 2;
volume_of_cylinder = pi * r^2 * h;
total_volume = volume_of_spheres + volume_of_cylinder
total_volume = 268.6062
1

Partial preview of the text

Download MatLab exercise (practice problem and solution script) and more Exercises Matlab skills in PDF only on Docsity!

% example 2.4.3 (falling body)

y_0 = 100; t = 2; g = 32.2;

y = y_0 - 1/2 * g * t^

y = 35.

% example 2.4.4 (ideal gas law)

n = 10; V = 100; T = 400; R = 0.08206; p = (n * R * T) / V

p = 3.

% example 2.4.6 (barbell)

h = 6; R = 3; r = 1.5;

volume_of_spheres = (4/3 * pi * R^3) * 2; volume_of_cylinder = pi * r^2 * h;

total_volume = volume_of_spheres + volume_of_cylinder

total_volume = 268.