/* Multiloop_modified.c / OpenMOM / ch.5 */ #include #include #include #include "omm_datalib.h" int main(void) { const int N = 3; // = 3, 5, 7 (odd) const double fstart = 2.2e9; const double fstop = 3.8e9; const int fdiv = 80; const double L3 = 100e-3; const double C1 = 1.19 * L3; const double Cn = 0.87 * L3; const double h = 0.1 * L3; const double Lv = 0.057 * L3; const double Lh = 0.200 * L3; const double radius = 0.002 * L3; const double e = 3 * radius; const double feed = (C1 + Cn) / 16; char title[BUFSIZ], fout[BUFSIZ]; sprintf(title, "modified Multiloop antenna N=%d", N); sprintf(fout, "Multiloop_modified_N%d.omm", N); // initialize omm_init(); // title omm_title(title); // geometry // loops double a_old = 0; for (int i = 1; i <= N; i++) { const double a = (N > 1) ? ((N - i) * C1 + (i - 1) * Cn) / (N - 1) / 8 : feed; const int div = NINT(2 * a, e); omm_geometry_xline(-a, +a, -a, h, div); omm_geometry_xline(-a, +a, +a, h, div); omm_geometry_yline(-a, +a, h, -a, div); omm_geometry_yline(-a, +a, h, +a, div); // connecting wires if (i > 1) { const int div2 = NINT(sqrt(2) * fabs(a - a_old), e); omm_geometry_wire(1, +a, +a_old, +a, +a_old, h, h, div2); omm_geometry_wire(1, +a, +a_old, -a, -a_old, h, h, div2); omm_geometry_wire(1, -a, -a_old, +a, +a_old, h, h, div2); omm_geometry_wire(1, -a, -a_old, -a, -a_old, h, h, div2); } a_old = a; } // feed omm_geometry_zline(0, e, feed, 0, 1); omm_feed(1, 0); omm_geometry_zline(e, Lv, feed, 0, NINT(Lv - e, e)); omm_geometry_yline(0, feed, Lv, feed, NINT(feed, e)); omm_geometry_xline(feed, 2 * feed - Lh, feed, Lv, NINT(Lh - feed, e)); omm_radiusall(1, radius); omm_z0(50); // ground omm_ground(); // frequency omm_frequency(fstart, fstop, fdiv); // frequency char. //omm_plotsmith(); //omm_plotzin(1, 0, 0, 0); //omm_plotyin(1, 0, 0, 0); omm_plotref(2, -20, 0, 4); // far1d field //omm_plotfar1d('X', 180, 0); //omm_plotfar1d('Y', 180, 0); //omm_far1dstyle(0); //omm_far1dcomponent(1, 0, 0); //omm_far1ddb(1); //omm_far1dscale(-20, +10, 6); // output omm_outdata(fout); return 0; }