void seven_wire_antenna() { nec_context* nec; nec = nec_create(); nec_wire(nec, 1, 9, 0.0, 0.0, 0.0, -0.0166, 0.0045, 0.0714, 0.001, 1.0, 1.0); nec_wire(nec, 2, 7, -0.0166, 0.0045, 0.0714, -0.0318, -0.0166, 0.017, 0.001, 1.0, 1.0); nec_wire(nec, 3, 7, -0.0318, -0.0166, 0.017, -0.0318, -0.0287, 0.0775, 0.001, 1.0, 1.0); nec_wire(nec, 4, 11, -0.0318, -0.0287, 0.0775, -0.0318, 0.0439, 0.014, 0.001, 1.0, 1.0); nec_wire(nec, 5, 7, -0.0318, 0.0439, 0.014, -0.0318, 0.0045, 0.0624, 0.001, 1.0, 1.0); nec_wire(nec, 6, 5, -0.0318, 0.0045, 0.0624, -0.0106, 0.0378, 0.0866, 0.001, 1.0, 1.0); nec_wire(nec, 7, 7, -0.0106, 0.0378, 0.0866, -0.0106, 0.0257, 0.023, 0.001, 1.0, 1.0); nec_geometry_complete(nec, 1, 0); nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0); nec_fr_card(nec, 0, 1, 1600.0, 0.0); nec_ex_card(nec, 0, 1, 1, 0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0); // nec_rp_card(nec, 0, 90, 1, 0,0,0,0, 0, 90, 1, 0, 0, 0); nec_rp_card(nec, 0, 17, 45, 0,5,0,0, 0, 0, 5, 8, 0, 0); printf("Impedance: %f, %f\n",nec_impedance_real(nec,0), nec_impedance_imag(nec,0)); printf("Gain: %f, %f +/- %f dB\n",nec_gain_max(nec,0), nec_gain_mean(nec,0), nec_gain_sd(nec,0)); printf("RHCP Gain: %f, %f +/- %f dB\n",nec_gain_rhcp_max(nec,0), nec_gain_rhcp_mean(nec,0), nec_gain_rhcp_sd(nec,0)); printf("LHCP Gain: %f, %f +/- %f dB\n",nec_gain_lhcp_max(nec,0), nec_gain_lhcp_mean(nec,0), nec_gain_lhcp_sd(nec,0)); nec_delete(nec); }
void simple_example() { /* GW 0 9 0. 0. 2. 0. 0. 7 .1 GE 1 FR 0 1 0 30. EX 0 5 0 1. GN 1 RP 0 90 1 0000 0 90 1 0 */ nec_context* nec; nec = nec_create(); nec_wire(nec, 0, 9, 0, 0, 2, 0, 0, 7, 0.1, 1, 1); nec_geometry_complete(nec, 1, 0); nec_gn_card(nec, 1, 0, 0, 0, 0, 0, 0, 0); nec_fr_card(nec, 0, 1, 30, 0); nec_ex_card(nec, 0, 0, 5, 0, 1.0, 0, 0, 0, 0, 0); nec_rp_card(nec, 0, 90, 1, 0,5,0,0, 0, 90, 1, 0, 0, 0); printf("Gain: %f, %f +/- %f dB\n",nec_gain_max(nec,0), nec_gain_mean(nec,0), nec_gain_sd(nec,0)); printf("RHCP Gain: %f, %f +/- %f dB\n",nec_gain_rhcp_max(nec,0), nec_gain_rhcp_mean(nec,0), nec_gain_rhcp_sd(nec,0)); printf("LHCP Gain: %f, %f +/- %f dB\n",nec_gain_lhcp_max(nec,0), nec_gain_lhcp_mean(nec,0), nec_gain_lhcp_sd(nec,0)); nec_delete(nec); }
HANDLE_NEC(nec_sc_card(nec, 3, 0.010415, 0.000780, 0.018324, 0.010415, -0.000780, 0.018324)); HANDLE_NEC(nec_sc_card(nec, 3, 0.010415, 0.000780, 0.015707, 0.010415, -0.000780, 0.015707)); HANDLE_NEC(nec_sc_card(nec, 3, 0.010415, 0.000780, 0.013089, 0.010415, -0.000780, 0.013089)); HANDLE_NEC(nec_sc_card(nec, 3, 0.010415, 0.000780, 0.010471, 0.010415, -0.000780, 0.010471)); HANDLE_NEC(nec_sc_card(nec, 3, 0.010415, 0.000780, 0.007853, 0.010415, -0.000780, 0.007853)); HANDLE_NEC(nec_sc_card(nec, 3, 0.010415, 0.000780, 0.005236, 0.010415, -0.000780, 0.005236)); HANDLE_NEC(nec_sc_card(nec, 3, 0.010415, 0.000780, 0.002618, 0.010415, -0.000780, 0.002618)); HANDLE_NEC(nec_sc_card(nec, 3, 0.010415, 0.000780, 0.000000, 0.010415, -0.000780, 0.000000)); HANDLE_NEC(nec_sc_card(nec, 3, 0.007811, 0.000585, 0.000000, 0.007811, -0.000585, 0.000000)); HANDLE_NEC(nec_sc_card(nec, 3, 0.005208, 0.000390, 0.000000, 0.005208, -0.000390, 0.000000)); HANDLE_NEC(nec_sc_card(nec, 3, 0.002604, 0.000195, 0.000000, 0.002604, -0.000195, 0.000000)); HANDLE_NEC(nec_sc_card(nec, 3, 0.000026, 0.000002, 0.000000, 0.000026, -0.000002, 0.000000)); HANDLE_NEC(nec_gm_card(nec, 0, 4, 0.000000, 0.000000, 8.571429, 0,0,0,0)); HANDLE_NEC(nec_wire(nec, 1,15,0.000000,0.005829,0.004961,0.000000,-0.005829,0.004961,0.000248,1,1)); HANDLE_NEC(nec_gm_card(nec, 0, 0, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, -0.078830, 0)); HANDLE_NEC(nec_geometry_complete(nec, 0)); HANDLE_NEC(nec_fr_card(nec, 0,1, 10450.000000, 0)); HANDLE_NEC(nec_ex_card(nec,0,1,8,0,1.000000,0.000000, 0, 0, 0, 0)); HANDLE_NEC(nec_ld_card(nec,5,0,0,0,3.720000E+07, 0, 0)); HANDLE_NEC(nec_pt_card(nec,-1, 0, 0, 0)); HANDLE_NEC(nec_rp_card(nec, 0,361,3,1,5,0,0,0.000000,0.000000,1.000000,45.000000, 0, 0)); /* ----- ANTENNA INPUT PARAMETERS ----- TAG SEG VOLTAGE (VOLTS) CURRENT (AMPS) IMPEDANCE (OHMS) ADMITTANCE (MHOS) POWER NO. NO. REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY REAL IMAGINARY (WATTS) 1 8 1.0000E+00 0.0000E+00 9.2145E-03 6.7375E-04 1.0795E+02 -7.8930E+00 9.2145E-03 6.7375E-04 4.6072E-03 */ REQUIRE((nec_impedance_real(nec,0) - 1.0795E+02 < 1E-3)); REQUIRE((nec_impedance_imag(nec,0) - -7.8930E+00 < 1E-3));