clc
clear

disp 'Taylor Waller'

x_val = 0;
dx = 0.01
y_val = 10 * (1 - exp(-x_val / 3));

x_list = [];
y_list = [];

while y_val < 9.8
x_list(end+1) = x_val;
y_list(end+1) = y_val;
    
x_val = x_val + dx;
y_val = 10 * (1 - exp(-x_val / 3));
end
x_list(end+1) = x_val;
y_list(end+1) = y_val;

x_max = x_val;
fprintf('The determined x_max is: %.4f seconds\n', x_max);
figure;
plot(x_list, y_list, 'LineWidth', 2);
xlabel('Time, x (seconds)');
ylabel('Force, y (newtons)');
title(sprintf('Force vs. Time (x_{max} = %.2f s)', x_max));
grid on;

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: