function [gammatan] = entalpie(rho0, p0)

n=0;
c1=0;
c2=0;
c3=0;
c4=0;
c5=0;
c6=0;
c7=0;
c8=0;
c9=0;
c10=0;
c11=0;
theta=90;                %Stoßwinkel in Grad
gamma=1.2;
gammatan=1.4;            %initialisieren von gammatan
M1=35;

%rho0=0.088           %Dichte 20km Flughöhe [kg/m³]
%p0=5000                 %Druck 20km Flughöhe [N/m²]
while gammatan~=gamma 
if n >=10
    break
end

gamma=gammatan;
    
rho=rho0*(((gamma+1)*(M1)^2)*(sind(theta))^2)/((gamma-1)*((M1)^2)*((sind(theta))^2)+2); %Rankine-Huginot-Beziehung für Dichte nach dem Stoß
p=p0*((2*gamma*((M1)^2)*(sind(theta))^2)-(gamma-1))/(gamma+1); %Rankine-Huginot-Beziehung für den Druck hinter dem Stoß

Y=log10(rho/1.292); %Y für Gleichung siehe Zeile 205
X=log10(p/(1.013*10^5)); %X wie für die Gleichung gefordert
Z=X-Y; %Z für Gleichung siehe Zeile 205
if Y>-0.50 & Z<=0.30
    c1=1.400000;
    c2=0;
    c3=0;
    c4=0;
    c5=0;
    c6=0;
    c7=0;
    c8=0;
    c9=0;
    c10=0;
    c11=0;
elseif Y>-0.50 & Z>0.30 & Z<=1.15
    c1=1.42598;
    c2=0.000918;
    c3=-0.092209;
    c4=-0.002226;
    c5=0.019772;
    c6=-0.036600;
    c7=-0.077469;
    c8=0.043878;
    c9=-15.0;
    c10=-1.0;
    c11=-1.040;
elseif Y>-0.50 & Z>1.15 & Z<=1.60
    c1=1.64689;
    c2=-0.062155;
    c3=-0.334994;
    c4=0.063612;
    c5=-0.038332;
    c6=-0.014468;
    c7=0.073421;
    c8=-0.002442;
    c9=-15.0;
    c10=-1.0;
    c11=-1.360;
elseif Y>-0.50 & Z>1.60
    c1=1.48558;
    c2=-0.453562;
    c3=-0.152096;
    c4=0.303350;
    c5=-0.459282;
    c6=0.448395;
    c7=0.220546;
    c8=-0.292293;
    c9=-10.0;
    c10=-1.0;
    c11=-1.600;
elseif Y>-4.50 & Y<=-0.50 & Z<=0.30
    c1=1.4000;
    c2=0;
    c3=0;
    c4=0;
    c5=0;
    c6=0;
    c7=0;
    c8=0;
    c9=0;
    c10=0;
    c11=0;
elseif Y>-4.50 & Y<=-0.50 & Z>0.30 & Z<=0.98
    c1=1.42176;
    c2=-0.000366;
    c3=-0.083614;
    c4=0.000675;
    c5=0.005272;
    c6=-0.115853;
    c7=-0.007363;
    c8=0.146179;
    c9=-20.0;
    c10=-1.0;
    c11=-0.860;
elseif Y>-4.50 & Y<=-0.50 & Z>0.98 & Z<=1.38
    c1=1.74436;
    c2=-0.035354;
    c3=-0.415045;
    c4=0.061921;
    c5=0.018536;
    c6=0.043582;
    c7=0.44353;
    c8=-0.049750;
    c9=-20.0;
    c10=-1.04;
    c11=-1.336;
elseif Y>-4.50 & Y<=-0.50 & Z>1.38 & Z<=2.04
    c1=1.49674;
    c2=-0.021583;
    c3=-0.197008;
    c4=0.030886;
    c5=-0.157738;
    c6=-0.009158;
    c7=0.123213;
    c8=-0.006553;
    c9=-10;
    c10=-1.05;
    c11=-1.895;
elseif Y>-4.50 & Y<=-0.50 & Z>2.04
    c1=1.10421;
    c2=-0.033664;
    c3=0.031768;
    c4=0.024335;
    c5=-0.178802;
    c6=-0.017456;
    c7=0.080373;
    c8=0.002511;
    c9=-15.0;
    c10=-1.08;
    c11=-2.650;
elseif Y>=-7 & Y<=-4.5 & Z<=0.398
    c1=1.4000;
    c2=0;
    c3=0;
    c4=0;
    c5=0;
    c6=0;
    c7=0;
    c8=0;
    c9=0;
    c10=0;
    c11=0;
elseif Y>=-7 & Y<=-4.5 & Z>0.398 & Z<=0.87
    c1=1.47003;
    c2=0.007939;
    c3=-0.244205;
    c4=-0.025607;
    c5=0.872248;
    c6=0.049452;
    c7=-0.764158;
    c8=0.000147;
    c9=-20.0;
    c10=-1.0;
    c11=-0.742;
elseif Y>=-7 & Y<=-4.5 & Z>0.87 & Z<=1.27
    c1=3.18652;
    c2=0.137930;
    c3=-1.89529;
    c4=-0.103490;
    c5=-2.14572;
    c6=-0.272717;
    c7=2.06586;
    c8=0.223046;
    c9=-15.0;
    c10=-1.0;
    c11=-1.041;
elseif Y>=-7 & Y<=-4.5 & Z>1.27 & Z<=1.863
    c1=1.63963;
    c2=-0.001004;
    c3=-0.303549;
    c4=0.016464;
    c5=-0.852169;
    c6=-0.101237;
    c7=0.503123;
    c8=0.043580;
    c9=-10.0;
    c10=-1.0;
    c11=-1.544;
elseif Y>=-7 & Y<=-4.5 & Z>1.863
    c1=1.55889;
    c2=0.055932;
    c3=-0.211764;
    c4=-0.023548;
    c5=-0.549041;
    c6=-0.101758;
    c7=0.276732;
    c8=0.046031;
    c9=-15.0;
    c10=-1.0;
    c11=-2.250;

end
gammatan=c1+c2*Y+c3*Z+c4*Y*Z+((c5+c6*Y+c7*Z+c8*Y*Z)/(1+exp(c9*(X+c10*Y+c11)))); %Berechnent den Isentropenexponenten nach Tannhill
n = n+1; %Zähler um endlosschleife zu verhindern
end
gammatan = gamma;

%h=(p/rho)*((gamma)/(gamma-1)) % Entalpie-Berechnung für spätere
%Betrachtung