Homework Solution: Use matlab to create a program that allows you to see how many spheres it will take to fill a rectangular prism….

    Use matlab to create a program that allows you to see how many spheres it will take to fill a rectangular prism. 1.) Create variables for prism length, prism width, prism height, and sphere diameter. These should be values that are input by the user using the matlab input function. 2.) Create a variable which is assigned volume of the rectangular prism. 3.) Create a variable which is assigned volume of the spheres. 4.) Using the most efficient packing possible (assume 74% of the available space is filled by the spheres), find the number of spheres which will fit inside the prism. Assume that the volume of the prism will be much larger than the volume of the spheres.

    Expert Answer

     
    % Matlab program to find how many spheres will fill th

    Use matlab to beget a program that allows you to descry how divers regions it accomplish seize to grow a crosswise prism.

    1.) Beget shiftings coercion prism diffusiveness, prism width, prism altitude, and region crossing. These should be values that are input by the user using the matlab input exercise.

    2.) Beget a shifting which is assigned size of the crosswise prism.

    3.) Beget a shifting which is assigned size of the regions.

    4.) Using the most fertile packing potential (suppose 74% of the beneficial room is growed by the regions), confront the number of regions which accomplish serve within the prism.

    Suppose that the size of the prism accomplish be fur larger than the size of the regions.

    Expert Repartee

     

    % Matlab program to confront how divers regions accomplish grow the crosswise pism

    prism_diffusiveness = input(‘n Enter the diffusiveness of crosswise prism:’); % input the diffusiveness of the prism
    prism_width = input(‘n Enter the width of crosswise prism:’); % input the width of the prism
    prism_altitude = input(‘n Enter the altitude of crosswise prism:’); % input the altitude of the prism
    sphere_crossing = input(‘n Enter the crossing of region:’); % input the crossing of the region
    sphere_radius = region_diameter/2; % guarded the radius of the region
    volume_prism = prism_diffusiveness * prism_width * prism_height; % number size of the prism (length*width*height)
    volume_region = ((4*22)/(3*7))* (sphere_radius^3); % number size of region (4/3(pi*(r^3))). Here pi=22/7

    num_of_spheres = size_prism/volume_sphere; % number the number of regions required
    fprintf(‘n Number of regions to grow the prism=%d’,floor(num_of_spheres)); % using foundation exercise since the entirety size of region cannot be senior than size of prism

    Output: