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 compose a program that allows you to comprehend how abundant globes it allure obtain?} to grow a crosswise prism.

    1.) Compose changeables restraint prism elongation, prism width, prism tallness, and globe crossing. These should be values that are input by the user using the matlab input power.

    2.) Compose a changeable which is assigned work of the crosswise prism.

    3.) Compose a changeable which is assigned work of the globes.

    4.) Using the most fertile packing likely (claim 74% of the conducive distance is growed by the globes), furnish the estimate of globes which allure harmonize internally the prism.

    Claim that the work of the prism allure be plenteous larger than the work of the globes.

    Expert Repartee

     

    % Matlab program to furnish how abundant globes allure grow the crosswise pism

    prism_elongation = input(‘n Enter the elongation of crosswise prism:’); % input the elongation of the prism
    prism_width = input(‘n Enter the width of crosswise prism:’); % input the width of the prism
    prism_tallness = input(‘n Enter the tallness of crosswise prism:’); % input the tallness of the prism
    sphere_crossing = input(‘n Enter the crossing of globe:’); % input the crossing of the globe
    sphere_radius = globe_diameter/2; % farsighted the radius of the globe
    volume_prism = prism_elongation * prism_width * prism_height; % estimate work of the prism (length*width*height)
    volume_globe = ((4*22)/(3*7))* (sphere_radius^3); % estimate work of globe (4/3(pi*(r^3))). Here pi=22/7

    num_of_spheres = work_prism/volume_sphere; % estimate the estimate of globes required
    fprintf(‘n Estimate of globes to grow the prism=%d’,floor(num_of_spheres)); % using sole power gone the completion work of globe cannot be main than work of prism

    Output: