/* HelicalArray.c / OpenMOM / ch.17 */ #include #include #include "omm_datalib.h" int main(void) { const double fstart = 11.85e9; const double fstop = 11.85e9; const int fdiv = 0; const int N = 11; // =0/9/10/11 const double turn = 2; const double rhelix = 3.98e-3; const double alpha = 4; const double a = 0.5e-3; const double h = 1.25e-3; const double dia = 385e-3; const double tilt = 30; // チルト角[度] const double d = 1e-3; // 基本要素長 const double pi = 4 * atan(1); const double dtor = pi / 180; char title[BUFSIZ], fout[BUFSIZ]; if (N == 0) { sprintf(title, "Helical Antenna %gturn", turn); sprintf(fout, "Helical_%gturn.omm", turn); } else { sprintf(title, "Helical Antenna Array Na=%d tilt=%gdeg", 3 * N * (N + 1), tilt); sprintf(fout, "HelicalArray_Na%d_%ddeg.omm", 3 * N * (N + 1), (int)tilt); } // initialize omm_init(); // title omm_title(title); // geometry // ground omm_ground(); const double dangle = 2 * pi * turn; const double dz = rhelix * dangle * tan(alpha * dtor); const double larm = dz / sin(alpha * dtor); const int div = NINT(larm, d); if (N == 0) { // feed omm_geometry_zline(0, h, 0, 0, 1); omm_feed(1, 0); // helix omm_geometry_wire(2, 0, rhelix, 0, 0, h, h, NINT(rhelix, d)); omm_geometry_wire(2, rhelix, rhelix, 0, dangle / dtor, h, h + dz, div); } else { const double srad = dia / (2 * N); for (int n = 1; n <= N; n++) { const int na = 6 * n; const double r = n * srad; for (int ia = 0; ia < na; ia++) { const double x0 = r * cos(2 * pi * ia / na); const double y0 = r * sin(2 * pi * ia / na); // feed omm_geometry_zline(0, h, x0, y0, 1); omm_feed(1, 0); // helix const double f = (fstart + fstop) / 2; const double lambda = 2.99792458e8 / f; const double angle0 = -360 * (x0 / lambda) * sin(tilt * dtor); // deg omm_geometry_wire(2, 0, rhelix, angle0, angle0, 0, 0, NINT(rhelix, d)); omm_offset(x0, y0, h); omm_geometry_wire(2, rhelix, rhelix, angle0, angle0 + dangle / dtor, 0, dz, div); omm_offset(x0, y0, h); } } } // radius omm_radiusall(1, a); // not draw node omm_geom3dnode(0, 0, 0); // frequency omm_frequency(fstart, fstop, fdiv); /* // current distribution omm_plotcurrent(1, 0); // frequency char. //omm_plotsmith(); //omm_plotzin(1, 0, 0, 0); //omm_plotyin(1, 0, 0, 0); //omm_plotref(1, 0, 0, 0); //omm_freqdiv(10); */ // far1d field omm_plotfar1d('Y', 720, 0); omm_far1dcomponent(0, 0, 1); omm_far1dscale(-10, +35, 9); // window size omm_window3d(400, 400, 12, 60, 30); // output omm_outdata(fout); return 0; }