/* BeToL.c / OpenMOM / ch.12 */ #include #include "omm_datalib.h" static void xtriangle(double x0, double y0, double z0, double w, double h, double d) { const int div = NINT(w / 2, d); omm_geometry_yline(y0 - w / 2, y0 + w / 2, z0, x0, 2 * div); omm_geometry_xline(x0, x0 + h, y0, z0, div); omm_geometry_wire(1, x0, x0 + h, y0 + w / 2, y0, z0, z0, div); omm_geometry_wire(1, x0, x0 + h, y0 - w / 2, y0, z0, z0, div); for (int i = 1; i < div; i++) { const double dy = (w / 2) * i / div; const double dx = h * (1 - dy / (w / 2)); omm_geometry_xline(x0, x0 + dx, y0 + dy, z0, div - i); omm_geometry_xline(x0, x0 + dx, y0 - dy, z0, div - i); omm_geometry_yline(y0 - dy, y0 + dy, z0, x0 + dx, 2 * i); } } int main(void) { const double fstart = 2e9; const double fstop = 8e9; const int fdiv = 30; const double L3 = 100e-3; const double Sx = 0.22 * L3; const double Sy = 0.26 * L3; const double Sz = 0.12 * L3; const double t = 0.1 * L3; const double Wv = 0.14 * L3; const double dWv = 0.02 * L3; const double dh = 0.01 * L3; const double d = 0.01 * L3; // Šî–{—v‘f’· // initialize omm_init(); // title omm_title("Bent Two-Leaf Antenna"); // geometry for (int side = -1; side <= +1; side += 2) { // triangle xtriangle(side * Sx / 2, 0, Sz, Sy, - side * t, d); // vertical int div1 = NINT(Wv, d); if (div1 % 2 == 1) div1++; omm_geometry_xrect(side * Sx / 2, - Wv / 2, + Wv / 2, dh, Sz, div1, NINT(Sz - dh, d)); if (side < 0) { // -X : short int div2 = NINT(dWv, d); if (div2 % 2 == 1) div2++; omm_geometry_xrect(side * Sx / 2, - dWv / 2, + dWv / 2, 0, dh, div2, NINT(dh, d)); } else { // +X : feed omm_geometry_zline(0, dh, Sx / 2, 0, NINT(dh, d)); omm_feed(1, 0); } } omm_ground(); omm_radiusall(1, 0.2 * d); // frequency omm_frequency(fstart, fstop, fdiv); // frequency char. //omm_plotsmith(); omm_plotzin(1, 0, 0, 0); //omm_plotyin(1, 0, 0, 0); omm_plotref(1, 0, 0, 0); omm_freqdiv(6); // far0d field //omm_plotfar0d(90, 0, 1, 0, 0, 0); // far1d field omm_plotfar1d('Y', 180, 0); omm_plotfar1d('Z', 180, 0); omm_far1dcomponent(1, 0, 0); omm_far1dscale(-25, +10, 7); // output omm_outdata("BeToL2.omm"); return 0; }