% Parameters
T0 = 90; % Initial temperature of tea (°C)
Ts = 25; % Room temperature (°C)
k = 0.08; % Cooling constant
% Time in minutes
t = linspace(0, 60, 200);
% Newton's Law of Cooling
T = Ts + (T0 - Ts) * exp(-k * t);
% Plot
plot(t, T, 'LineWidth', 1.5);
xlabel('Time (minutes)');
ylabel('Temperature (°C)');
title("Newton's Law of Cooling");
grid on;
legend('Newton''s Law of Cooling');
To embed this project on your website, copy the following code and paste it into your website's HTML: