Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This is a matlab based coding question. Please add comment statements for each s

ID: 3812177 • Letter: T

Question

This is a matlab based coding question. Please add comment statements for each section of code. Thanks!!

Also, if you could show verification calculations of the equations that would be great!!!

outer_radius.txt:

7
8.5
6
4.5
7.5

inner_radius.txt:

5
8
4
3.5
5.5

mass.txt:

10
3
15
20
7.5

Problem 3 Background Understanding moment of inertia is important for physics calculations and the design of machines. Moment of inertia depends on the geometry of the object being studied, but is usually able to be calculated for simple objects with an algebraic expression. Problem Statement The moment of inertia of an object measures the resistance of the object to rotational acceleration about a particular axis. The higher the moment of inertia, the more energy it takes to accelerate the object and cause it to rotate about an axis. Consider the following hollow sphere: For this sphere spinning about any axis passing directly through its center, the mass moment of inertia I, of the sphere is: 2m (rs -rs (1) I is the mass moment of inertia (kg m where m is mass of the sphere (kg) r is sphere inner radius (m) r is sphere outer radius (m) You have been assigned to work on a project to design lightweight hollow spheres such as the one above for use in a new machine part. Your team has come up with five designs for these spheres, and the masses and radii of each sphere design are given in the files mass.txt, inner radius.txt and outer radius.txt.

Explanation / Answer

A=importdata('inner_radius.txt');

B=importdata('outer_radius.txt');

C=importdata('mass.txt');

%getrow count

inrows=size(A,1);

outrows=size(B,1);

massrows=size(C,1);

%convert to vectorusing row count here

in_vctr=reshape(A',1,inrows);

out_vctr=reshape(B',1,inrows);

mass_vctr=reshape(C',1,massrows);

%formula I=2m/5((r2^5-r1^5)/((r2^3-r1^3))

%use loop variable and store the values into vector

%using vector math for the above formula and storing into final vector

final_vec=((2*mass_vctr)/5)*((((out_vctr.^5)-(in_vctr.^5)))/((out_vctr.^3)-(in_vctr.^3)));

%displaying the list after inputs paired

disp(final_vec);

%using if else statement we use for loop for vectors individual elemnet and check if any value >high

high=final_vec(1);

index=1;

for i=1:length(final_vec)

if(final_vec(i)>high)

high=final_vec(i);%store high value in high and ake the index

index=i;

end

end

%get the highest value inertia's corresponding values using the index

out_radius=out_vctr(index);

inner_radius=in_vctr(index);

mass_val=mass_vctr(index);

fprintf('The highest moment of Inertia is %d and corresponding outer radius ,inner radius and mass are: %d,%d,%d ',high,out_radius,inner_radius,mass_val)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote