% Define the speed range for the plot
n = linspace(0, 100, 1000); % Speed (rpm)

% Define the power equations
Pp = 51.818* n.^3; % Power for Pp
Pmotor1 = 278.96 * n; % Power for motor 1
Pmotor2 = 409.72 * n; % Power for motor 2
Pmotor3 = 555.55 * n; % Power for motor 2


% Plotting the power-speed curves
figure;
hold on;
plot(n, Pp, 'r-', 'LineWidth', 2, 'DisplayName', 'Pp = 12.35 * n^3');
plot(n, Pmotor1, 'b-', 'LineWidth', 2, 'DisplayName', 'Pmotor1 = 278.96 * n');
plot(n, Pmotor2, 'y-', 'LineWidth', 2, 'DisplayName', 'Pmotor2 = 409.72* n');
plot(n, Pmotor3, 'g-', 'LineWidth', 2, 'DisplayName', 'Pmotor3 = 555.55 * n');


% Labeling the graph
xlabel('Speed (n) [rps]');
ylabel('Power [kW]');
title('Power vs Speed for Pp and Motors');
legend('show');
grid on;

% Adjust axis to ensure all curves are visible
xlim([0 5])
    ylim([0 2500]);

hold off;
