eval('gset terminal postscript color');
eval('gset output "out.ps"');

# CFC Konzentration nach Tabelle und berechnet

z = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65];
CFC11 = [6.8e9, 3.9e9, 2.2e9, 1.1e9, 3.4e8, 5.1e7, 8.3e5, 2.6e2, 0, 0, 0, 0, 0, 0];
CFC12 = [1.2e10, 6.7e9, 3.8e9, 2.0e9, 7.8e8, 2.7e8, 6.4e7, 6.3e6, 1.8e5, 2.4e3, 3.5e1, 9.8e-1, 4.6e-2, 3.4e-3];
CFC = CFC11 + CFC12;
plot(CFC,z);
semilogx(CFC,z);

# vz = 0.16 - 0.3 mm/s
# http://www.aero.jussieu.fr/~sparc/SPARC2000_new/PosterSess3/Session3_4/Butchart/XABS/node3.html
# vz = 0.2 mm/s
# http://www.aero.jussieu.fr/~sparc/SPARC2000_new/PosterSess1/SessionP1_6/McLandress/ext_abstract/ext_abstract.html

vz = 0.2/10; # cm/s
k1 = -1/(log(CFC(3))*vz);
k2 = 0;
c = 0;
J = -1/k1*1/vz*exp(k1*z+k2)+c
n = exp(-1/k1*1/vz*exp(k1*z+k2)+c)
plot(n(3:length(n)),z(3:length(n)))
semilogx(n(3:length(n)),z(3:length(n)));

k1 = -0.59
n = exp(-1/k1*1/vz*exp(k1*z+k2)+c)
plot(n(3:length(n)),z(3:length(n)))
semilogx(n(3:length(n)),z(3:length(n)));
