Yuan_Kevin_Lab08

pdf

School

Binghamton University *

*We aren’t endorsed by this school

Course

ME-212

Subject

Mathematics

Date

Feb 20, 2024

Type

pdf

Pages

4

Uploaded by EarlBeaverMaster948

Report
Contents Part 01 Part 02 Part 03 Part 04 Part 01 clc clear close all theta = cone = linspace(0,2,100); [Theta_cone, R_cone] = meshgrid(theta, cone); Xxcone = ycone = Zzcone = linspace(@, 2*pi, 100); R_cone .* cos(Theta_cone); R_cone .* sin(Theta_cone); 4 * R_cone; hemisphere_theta = linspace(@,2*pi, 100); hemisphere _psi = linspace(9, pi, 100); [T_sphere, P_sphere] = meshgrid(hemisphere_theta, hemisphere_x = 2 * sin(P_sphere) .* cos(T_sphere); hemisphere_y = 2 * sin(P_sphere) .* sin(T_sphere); hemisphere_z = 8 + 2 * cos(P_sphere); %Figure surf(xcone, ycone, zcone, 'FaceColor', ‘'cyan') figure(1) title('Ice Cream Cone'); xlabel('X-axis") ylabel('Y-axis') zlabel(’ hold on grid on surf(hemisphere_x, hemisphere_y, hemisphere_z) Z-axis'); hemisphere psi);
Ice Cream Cone Z-axis Part 02 clc clear close all % Define variables x = linspace(-1.6, 1.8, 1000); % x values y = X.*¥(x-1.7).*(x+0.5).*(x-0.7).*(x+1.5); % Evaluate the polynomial % Plot figure; plot(x, y, 'b-', 'LineWidth', 1.5); xlabel('x'"); ylabel('y'); title('Numerical Approach: Polynomial Plot'); grid on;
5 Numerical Approach: Polynomial Plot | N | - n - - = | Part 03 clc clear close all % Define numerator_coeffs = [-10, -20, 9, 10, 8, 11, -3]; % numerator polynomial denominator_coeffs = [2, 4, -1]; % denominator polynomial % use deconv [quotient_coeffs, remainder_coeffs] = deconv(numerator_coeffs, denominator_coeffs); % Display disp('Quotient coefficients:'); disp(quotient_coeffs); disp('Remainder coefficients:'); disp(remainder_coeffs); Quotient coefficients: -5 o 2 1 3 Remainder coefficients: 0 0 0 (%] 0 0 0 Part 04
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
clc clear close all a? define constants r = 20; % Radius H=2%*pr; % Height % Prompt for user y = input('Enter the amount of fuel (in inches from the bottom): '); % Calculate the volume V=(pi*y/ 3)* ((3*r - y)*2 + r"2 + y*2); % Convert volume to gallons V_gallons =V / 231; % Display the volume of the tank fprintf('Volume of fuel in the tank at y = %.2f inches: %.2f gallons\n', y, V_gallons); % Plot these values of y and v y_values = linspace(9, 40, 1000); V_values = (pi * y_values / 3) .* ((3*r - y_values).”2 + r~2 + y_values.”2) / 231; % Plotting figure; plot(y_values, V_values, 'b-', 'LineWidth', 1.5); xlabel('Level of fuel (y in inches)'); ylabel('Volume of fuel (gallons)'); title('Volume of Fuel in the Tank vs. Level of Fuel'); grid on; Error using input Cannot call INPUT from EVALC. Error in Yuan_Kevin_Lab@8 (line 78) y = input('Enter the amount of fuel (in inches from the bottom): '); Published with MATLAB® R2023a