# Plotting Muzzle velocity vs Pressure graph

I am trying to replicate the following plot between projectile muzzle velocity and initial gas pressure. The equations are as follows:

$$u_p(t)=\frac{2 c_0}{\gamma-1}\left\{1-\left[1+\frac{\gamma+1}{2 m c_0} P_0 t\right]^{-\frac{\gamma-1}{\gamma+1}}\right\}$$

The code that I used in MATLAB to replicate it is as follows:

clc; clear all; close all;

load('ExpData.mat') %Experimental data in the reference plot
load('CompData.mat') %Numerical results in the reference plot

% Define parameters
gamma = 1.67;
m = 40; % kg/m^2
barrel_length = 6; % meters
caliber = 25/1000; % meters
c_0 = 971.5; % m/s
P_0 = linspace(0,200e5,1000); % Pressure range from 0 to 200 bar in Pa
t = barrel_length/(c_0*sqrt(caliber^2/4*pi)); % Calculate time

% Calculate velocity
u_p = 2900.*(1 - (1 + (gamma+1)/(2*m*c_0)*P_0*t).^(-(gamma-1)/(gamma+1)));

% Plot pressure vs velocity
hold on
plot(P_0/1e5,u_p)
plot(ExpData(:,1),ExpData(:,2),'diamond','Color','blue','MarkerFaceColor','blue')
plot(CompData(:,1),CompData(:,2),'LineWidth',2)
xlabel('Pressure (bar)')
ylabel('Velocity (m/s)')


The code gives me the following:

Can anyone point out what's the error in the calculations?

• What is the meaning of time $t$? With the equation you are using for it, the result should have dimension [s/m] instead of just [s] as expected for time. Apr 9, 2023 at 19:43