Bestimmung der Nahfeldextrema der Beugungsfeldverteilung hinter dem Spalt durch Suche der kritischen Punkte einer numerisch spezifizierten Funktion J(x,y) entlang von Polylinien
Die Methode aus dem Applet wird hier verwendet, um nach der Nahfeldextrema der Beugungsfeldverteilung J(x,y) hinter dem Spalt durch Suche der lokalen Extrema entlang einer Polylinienreihe mit Hilfe JavaScript zu suchen. Berechnungsgenauigkeit: err = Math.pow(10, -15).
Verteilung der berechneten Extrempunkte und Nahfeldpolylinien des Interferenzfeldes hinter dem Spalt
Vergleichen Sie die Scanergebnisse in Form einer Heatmap und die Ergebnisse der Lokalisierung der gefundenen Extrempunkte der Intensitätsverteilungsoberfläche hinter dem Spalt.
JavaScript:
b0 = ggbApplet.getValue('b_λ');
fs = ggbApplet.getValue('kkSTOP');
zo = ggbApplet.getValue('zo ');
//r = zo;
for (var r = zo; r <= b0 - 2; r++) {
ggbApplet.evalCommand('RunClickScript[button8]');
agr = 0.02;
bgr = 1;
N = ggbApplet.getValue('N');
m1 = [];
af1 = [];
mf1 = [];
m2 = [];
af2 = [];
mf2 = [];
ma1 = [];
ma2 = [];
m4 = [];
m5 = [];
hs = (bgr - agr) / N;
k = 0;
xa1 = agr;
xa2 = agr;
do {
a = agr + k * hs;
ggbApplet.evalCommand('t1=' + a);
ggbApplet.evalCommand('t2=' + (a + hs));
ggbApplet.evalCommand('t3=' + (a + 2 * hs));
f11 = ggbApplet.getValue('f1');
f22 = ggbApplet.getValue('f2');
f33 = ggbApplet.getValue('f3');
if (f11 < f22)
{
if (f22 > f33) {
xa1 = a;
m4.push((a + xa2) / 2);
}
} else {
if (f22 < f33) {
xa2 = a;
m5.push((a + xa1) / 2);
}
}
k = k + 1;
}
while (k <= N);
var c0 = ggbApplet.getValue('buemaxmin01');
if (c0 == 1) {
c01 = "max" + "_{" + r + "}";
c02 = "maxsat" + "_{" + r + "}";
} else {
c01 = "minsat" + "_{" + r + "}";
c02 = "min" + "_{" + r + "}";
}
h0 = ggbApplet.getValue('h0');
err = Math.pow(10, -15);
la = [];
lf = [];
lA = [];
i = 0;
f0 = 0;
j = 1;
while (j - 1 < m4.length) {
a = m4[j - 1];
h = h0;
while (h > err) {
k = 1;
do {
ggbApplet.evalCommand('t1=' + a);
ggbApplet.evalCommand('t2=' + (a + h));
f11 = ggbApplet.getValue('f1');
f22 = ggbApplet.getValue('f2');
a = a + h;
k = k + 1;
}
while (f11 < f22);
a = a - h;
k = k - 1;
ggbApplet.evalCommand('t1=' + (a - h / 2));
f1 = ggbApplet.getValue('f1');
if (f1 < f11) {
a = a;
f0 = f11;
} else {
a = a - h;
f0 = f1;
};
h = h / 2;
i = i + 1;
f11 = 3;
f22 = 1;
};
la.push(a);
j = j + 1;
}
ggbApplet.evalCommand('xy' + c01 + ' = CopyFreeObject[If[buemaxmin01, Append[F_max(j0 + 1), Zip[(x(Point(poly, a)), y(Point(poly, a))), a, { ' + la + ' } ] ], Zip[(x(Point(poly, a)), y(Point(poly, a))), a, { ' + la + ' }]] ] ');
ggbApplet.setVisible('xy' + c01, true);
ggbApplet.setPointSize('xy' + c01, 3);
if (c0) {
ggbApplet.setPointStyle('xy' + c01, 10);
ggbApplet.setColor('xy' + c01, 255, 0, 0);
} else {
ggbApplet.setPointStyle('xy' + c01, 3);
ggbApplet.setColor('xy' + c01, 137, 207, 240);
}
la = [];
lf = [];
lA = [];
i = 0;
f0 = 0;
j = 1;
while (j - 1 < m5.length) {
a = m5[j - 1];
h = h0;
while (h > err) {
k = 1;
do {
ggbApplet.evalCommand(' t1 = ' + a);
ggbApplet.evalCommand(' t2 = ' + (a + h));
f11 = ggbApplet.getValue(' f1 ');
f22 = ggbApplet.getValue(' f2 ');
a = a + h;
k = k + 1;
}
while (f11 > f22);
a = a - h;
k = k - 1;
ggbApplet.evalCommand(' t1 = ' + (a - h / 2));
f1 = ggbApplet.getValue(' f1 ');
if (f1 > f11) {
a = a;
f0 = f11;
} else {
a = a - h;
f0 = f1;
};
h = h / 2;
i = i + 1;
f11 = 3;
f22 = 1;
};
la.push(a);
j = j + 1;
}
ggbApplet.evalCommand('xy' + c02 + '=CopyFreeObject[If[¬buemaxmin01,Append[F_min(j0),Zip[(x(Point(poly,a)),y(Point(poly,a))), a,{' + la + '}] ],Zip[(x(Point(poly,a)),y(Point(poly,a))), a,{' + la + '}] ] ]');
ggbApplet.setVisible('xy' + c02, true);
ggbApplet.setPointSize('xy' + c02, 3);
if (c0) {
ggbApplet.setPointStyle('xy' + c02, 1);
ggbApplet.setColor('xy' + c02, 205, 149, 117);
} else {
ggbApplet.setPointStyle('xy' + c02, 10);
ggbApplet.setColor('xy' + c02, 0, 0, 255);
}
// alert("r=" + r);
if (r < (b0 - 2)) {
if (r % fs == 0) {
alert(' zo=' + r + ' bll=' + b0);
}
ggbApplet.evalCommand(' SetValue[zo,zo+1] ');
ggbApplet.evalCommand('If(floor(zo / 2) 2 ≟ zo, Execute({ "SetValue[buemaxmin01,1]","SetValue[l_Poly,Fresmax_j]" }), Execute({ "SetValue[buemaxmin01,0]","SetValue[l_Poly,Fresmin_j]" }) ) ');
} else {
rr = 1;
}
}