Antenna Calculator

Antenna Calculator

 

http://www.mwrf.net/tool/rf/antenna/

 

https://www.changpuak.ch/electronics/

▸ Antenna Design

 

=================

 

天线直径、效率、增益、频率计算工具 --- 参考JS源码

function CalculateVal() {

    var G, D, N, F, NumFields, L, c, tmp, tmp2;
    
    c = 300000000;
    

    NumFields = 0;
    if ((window.document.Form.GAIN.value == null) || (window.document.Form.GAIN.value == "")) {
        G = "";
        NumFields=NumFields + 1;
    }
    else {
        G=window.document.Form.GAIN.value;
    }
    if ((window.document.Form.DIAMETER.value == null) || (window.document.Form.DIAMETER.value == "")) {
        D = "";
        NumFields=NumFields + 1;
    }
    else {
        D = window.document.Form.DIAMETER.value;
    }
    if ((window.document.Form.EFF.value == null) || (window.document.Form.EFF.value == "")) {
        N = "";
        NumFields=NumFields + 1;
    }
    else {
        N = window.document.Form.EFF.value;
    }
    if ((window.document.Form.FREQ.value == null) || (window.document.Form.FREQ.value == "")) {
        F = "";
        NumFields=NumFields + 1;
    }
    else {
        F = window.document.Form.FREQ.value;
    }

    if (NumFields == 0) {
        alert("请把需要计算的那个量留空.");
    }
    else if (NumFields == 1) {
        if (G=="") {
            L = c / (parseFloat(F) * 1000000); 
            tmp = (Math.PI * parseFloat(D))/L;
            tmp = Math.pow(tmp, 2);
            tmp = tmp * (parseFloat(N)/100);
            G = 10 * (Math.log(tmp) / Math.log(10));
        }
        else if (D=="") {
            L = c / (parseFloat(F) * 1000000); 
            tmp = Math.pow(10, (G/10));
            tmp = (tmp / (parseFloat(N)/100));
            tmp = Math.pow(tmp, 0.5);
            D = (tmp * L) / Math.PI;
        }
        else if (N=="") {
            L = c / (parseFloat(F) * 1000000);
            tmp = Math.pow(10, (G/10));
            tmp2 = ((Math.PI * parseFloat(D))/L);
            tmp2 = Math.pow(tmp2, 2);
            N = tmp / tmp2;
            N = N * 100;
        }
        else if (F=="") {
            tmp = Math.pow(10, (G/10));
            tmp = (tmp / (parseFloat(N)/100));
            tmp = Math.pow(tmp, 0.5);
            tmp2 = (Math.PI * parseFloat(D))/tmp;
            F = c / tmp2;
            F = F / 1000000;
        }
        window.document.Form.GAIN.value = round(G, 3);
        window.document.Form.DIAMETER.value = round(D, 3);
        window.document.Form.EFF.value = round(N, 3);
        window.document.Form.FREQ.value = round(F, 3);    
    }
    else {
        alert("You need to enter data into every field except the field you wish to be calculated.");
    }

}

function round(val, places) {
    val = val * Math.pow(10, places)
    val = Math.round(val)
    val = val / Math.pow(10, places)
    return val
}

 

方位角和倾斜角计算 --- 参考JS源码

function CalculateAZ() {
    var DTOR, RTOD, A, B, F, RSAT, ESHEIGHT, ESLAT, ESLONG, SATLAT, SATLONG, XS, YS, ZS, EE, BETA, RHO;
    var TXS, TYS, TZS, DIST, AZ, XS2, YS2, ZS2, TXS2, TYS2, TZS2, DIST2, RANGE;

    DTOR=Math.PI/180; RTOD=180/Math.PI;    A=6378.3880;    B=6356.9120;    F=1/297;
    RSAT=Math.pow((6028.82*((24*60)-4)), 2/3);
    Check(window.document.Form.ESH, "0");
    Check(window.document.Form.ESLA, "0");
    Check(window.document.Form.ESLO, "0");
    Check(window.document.Form.SATLA, "0");
    Check(window.document.Form.SATLO, "0");
    ESHEIGHT=window.document.Form.ESH.value;
    ESLAT=window.document.Form.ESLA.value;
    ESLONG=window.document.Form.ESLO.value;
    SATLAT=window.document.Form.SATLA.value;
    SATLONG=window.document.Form.SATLO.value;
    XS=RSAT*Math.cos(DTOR*SATLAT)*Math.cos(DTOR*SATLONG);
    XS2=RSAT*Math.cos(-SATLAT*DTOR)*Math.cos(SATLONG*DTOR);
    YS=RSAT*Math.cos(DTOR*SATLAT)*Math.sin(DTOR*SATLONG);
    YS2=RSAT*Math.cos(-SATLAT*DTOR)*Math.sin(SATLONG*DTOR);
    ZS=RSAT*Math.sin(DTOR*SATLAT);
    ZS2=-RSAT*Math.sin(DTOR*SATLAT);
    EE=2*F - Math.pow(F, 2);
    BETA=Math.atan((1-EE)*Math.tan(ESLAT*DTOR));
    RHO=A*(1-F)/Math.sqrt(1-(2-F)*F*Math.cos(ESLAT*DTOR)*Math.cos(ESLAT*DTOR));
    TXS=(XS*Math.cos(ESLONG*DTOR)+YS*Math.sin(ESLONG*DTOR)-RHO*Math.cos(BETA))*Math.sin(ESLAT*DTOR)-(ZS-RHO*Math.sin(BETA))*Math.cos(ESLAT*DTOR);
    TXS2=(XS2*Math.cos(ESLONG*DTOR)+YS2*Math.sin(ESLONG*DTOR)-RHO*Math.cos(BETA))*Math.sin(ESLAT*DTOR)-(ZS2-RHO*Math.sin(BETA))*Math.cos(ESLAT*DTOR);
    TYS=-XS*Math.sin(ESLONG*DTOR)+YS*Math.cos(ESLONG*DTOR);
    TYS2=-XS2*Math.sin(ESLONG*DTOR)+YS2*Math.cos(ESLONG*DTOR);
    TZS=(XS*Math.cos(ESLONG*DTOR)+YS*Math.sin(ESLONG*DTOR)-RHO*Math.cos(BETA))*Math.cos(ESLAT*DTOR)+(ZS-RHO*Math.sin(BETA))*Math.sin(ESLAT*DTOR)-(ESHEIGHT/1000);
    TZS2=(XS2*Math.cos(ESLONG*DTOR)+YS2*Math.sin(ESLONG*DTOR)-RHO*Math.cos(BETA))*Math.cos(ESLAT*DTOR)+(ZS2-RHO*Math.sin(BETA))*Math.sin(ESLAT*DTOR)-(ESHEIGHT/1000);
    DIST=Math.sqrt(TXS*TXS+TYS*TYS+TZS*TZS);
    DIST2=Math.sqrt(TXS2*TXS2+TYS2*TYS2+TZS2*TZS2)
    AZ=180-RTOD*ATAN2(TXS,TYS);
    EL=Math.asin(TZS/DIST)*RTOD;
    RANGE=Math.max(DIST, DIST2);

    window.document.Form.AZ.value = round(AZ, 3);
    window.document.Form.EA.value = round(EL, 3);
    window.document.Form.RANGE.value = round(RANGE, 3);
}

function Check(obRef, def) {
    if ((obRef.value == null) || (obRef.value == "")) {
        obRef.value = def;
    }
}

function ATAN2(x, y) {
    var tmp;
    if (y == 0) {
        if (x > 0) {
            tmp = 0;
        } else {
            if (x < 0) {
                tmp = Math.PI;
            } else {
                tmp = 1/0;
            }
        }
    } else {
        if (y > 0) {
            tmp = (Math.PI/2) - Math.atan(x/y);
        } else {
            tmp = -(Math.PI/2) - Math.atan(x/y);
        }
    }
    return tmp
}

function round(val, places) {
    val = val * Math.pow(10, places)
    val = Math.round(val)
    val = val / Math.pow(10, places)
    return val
}

 

接收天线噪声温度和G/T计算工具 --- 参考JS源码

function CalculateVal() {

    var T = new Array(7);
    var G = new Array(6);
    var tmpNoise, tmpGT, tmpFigure;
    
    Check(window.document.Form.AG, "0");
    Check(window.document.Form.ANN, "0");
    Check(window.document.Form.WL, "0");
    Check(window.document.Form.LN, "0");
    Check(window.document.Form.LG, "0");
    Check(window.document.Form.CL1, "0");
    Check(window.document.Form.AmN, "0");
    Check(window.document.Form.AmG, "0");
    Check(window.document.Form.CL2, "0");
    Check(window.document.Form.RN, "0");
    
    G[1] = Math.pow(10, ((window.document.Form.AG.value)/10));
    T[1] = window.document.Form.ANN.value;
    G[2] = Math.pow(10, ((window.document.Form.WL.value)/-10));
    T[2] = FindNoiseFromVal(window.document.Form.WL.value * -1);
    G[3] = Math.pow(10, ((window.document.Form.LG.value)/10));
    T[3] = FindNoiseFromFigure(ConvertdBToVal(window.document.Form.LN.value));
    G[4] = Math.pow(10, ((window.document.Form.CL1.value)/-10));
    T[4] = FindNoiseFromVal(window.document.Form.CL1.value * -1);
    G[5] = Math.pow(10, ((window.document.Form.AmG.value)/10));
    T[5] = FindNoiseFromFigure(ConvertdBToVal(window.document.Form.AmN.value));
    G[6] = Math.pow(10, ((window.document.Form.CL2.value)/-10));
    T[6] = FindNoiseFromVal(window.document.Form.CL2.value * -1);
    T[7] = FindNoiseFromFigure(ConvertdBToVal(window.document.Form.RN.value));

    tmpNoise = (T[1] * G[2]) + (T[2] * G[2])
    tmpNoise = tmpNoise + T[3] + (T[4]/G[3])
    tmpNoise = tmpNoise + (T[5]/(G[3]*G[4]))
    tmpNoise = tmpNoise + (T[6]/(G[3]*G[4]*G[5]))
    tmpNoise = tmpNoise + (T[7]/(G[3]*G[4]*G[5]*G[6]))

    tmpGT = G[1] / tmpNoise
    
    tmpGT = tmpGT * G[2]

    tmpGT = 10 * Math.log(tmpGT) * Math.LOG10E

    tmpFigure = 10 *  Math.log((tmpNoise/290)+1) * Math.LOG10E

    window.document.Form.NOISE.value = round(tmpNoise, 3);
    window.document.Form.FIGURE.value = round(tmpFigure, 3);
    window.document.Form.GT.value = round(tmpGT, 3);

}

function FindNoiseFromFigure(NF) {

    NF = ((NF-1)*290);
    return NF
    
}

function ConvertdBToVal(tmpVal) {

    tmpVal =  Math.pow(10, tmpVal/10);
    return tmpVal
    
}

function FindNoiseFromVal(tmpVal) {

    tmpVal = Math.pow(10, tmpVal/10);
    tmpVal = (((1 - tmpVal)/tmpVal)*290);
    return tmpVal

}

function Check(obRef, def) {

    if ((obRef.value == null) || (obRef.value == "")) {
        obRef.value = def;
    }

}

function round(val, places) {

    val = val * Math.pow(10, places)
    val = Math.round(val)
    val = val / Math.pow(10, places)
    return val

}

 

================== End

 

posted @ 2020-09-19 05:34  lsgxeva  阅读(810)  评论(0编辑  收藏  举报