/* disc.c */ #include #include #include "omm_datalib.h" int main(void) { const int ground = 2; // グラウンドモデル(=0/1/2) const double r = 50e-3; // 円板半径 const int rdiv = 10; // 動径方向分割数 const double h = 25e-3; // モノポール高さ const int hdiv = 10; // モノポール分割数 const double fstart = 2e9; // 開始周波数 const double fstop = 4e9; // 終了周波数 const int fdiv = 20; // 周波数分割数 const double pi = 4 * atan(1); // initialize omm_init(); // title omm_title("円板+モノポールアンテナ"); // geometry // feed omm_geometry_zline(0, h / hdiv, 0, 0, 1); omm_feed(1, 0); omm_radius(0.3 * h / hdiv); // monopole omm_geometry_zline(h / hdiv, h, 0, 0, hdiv - 1); omm_radius(0.3 * h / hdiv); // ground if (ground == 0) { omm_ground(); } else if (ground == 1) { const int adiv = NINT(pi * r, r / rdiv); omm_geometry_plane(2, 0, r, r, 0, 0, 0, 360, 360, 0, 0, 0, 0, rdiv, adiv); } else if (ground == 2) { omm_geometry_wire(2, r, r, 0, 360, 0, 0, 4 * rdiv); omm_geometry_xline(-r, +r, 0, 0, 2 * rdiv); omm_geometry_yline(-r, +r, 0, 0, 2 * rdiv); for (int i = 1; i < rdiv; i++) { for (int j = 0; j < i; j++) { const double r1 = r * (i + 0) / rdiv; const double r2 = r1; const double r3 = r * (i + 1) / rdiv; const double a1 = (pi / 2) * (j + 0) / i; const double a2 = (pi / 2) * (j + 1) / i; const double a3 = (pi / 2) * (j + 1) / (i + 1); const double x1 = r1 * cos(a1); const double x2 = r2 * cos(a2); const double x3 = r3 * cos(a3); const double y1 = r1 * sin(a1); const double y2 = r2 * sin(a2); const double y3 = r3 * sin(a3); omm_geometry_triangle(+x1, +x2, +x3, +y1, +y2, +y3, 0, 0, 0); omm_geometry_triangle(-x1, -x2, -x3, +y1, +y2, +y3, 0, 0, 0); omm_geometry_triangle(-x1, -x2, -x3, -y1, -y2, -y3, 0, 0, 0); omm_geometry_triangle(+x1, +x2, +x3, -y1, -y2, -y3, 0, 0, 0); } } } // wire radius omm_radiusall(1, 0.2 * r / rdiv); // frequency omm_frequency(fstart, fstop, fdiv); // frequency char. omm_plotfrequency(1, 1, 1, 1); // far1d field omm_plotfar1d('X', 180, 0); omm_far1dstyle(0); omm_far1dcomponent(1, 0, 0); omm_far1ddb(1); omm_far1dscale(-30, +10, 8); // output char fout[BUFSIZ]; sprintf(fout, "disc%d.omm", ground); omm_outdata(fout); return 0; }