Source: functions_resistance.js

"use strict";

/**
* d.c. resistance of a conductor at 20degC, Ohm.
* @param {number} resistivity Electrical resistivity of conductor or material at 20degC, Ohm.m
* @param {number} CSA Cross-sectional area of cable or conductor, mm2
* @param {number} length Length of cable or conductor, m
* @return Conductor resistance, Ohm
* @customfunction
*/
function resistanceDC20(resistivity, CSA, length) {  
    var json =  httpGetCall("electrical/impedance/dc20/" + resistivity + "/" + CSA + "/" + length);
    var data = JSON.parse(json);  
    return data.dcResistance20;  
  } 
  
  /**
  * d.c. resistance of a conductor at TdegC, Ohm.
  * @param {number} resistivity Electrical resistivity of conductor or material at 20degC, Ohm.m
  * @param {number} CSA Cross-sectional area of cable or conductor, mm2
  * @param {number} length Length of cable or conductor, m
  * @param {number} temperature Operating temperature of a conductor or material, degC
  * @param {number} temperatureCoefficient Temperature Coefficient (resistance) at 20degC, 1/K
  * @return Conductor resistance, Ohm
  * @customfunction
  */
  function resistanceDCT(resistivity, CSA, length, temperature, temperatureCoefficient) {  
    var json =  httpGetCall("electrical/impedance/dcT/" + resistivity + "/" + CSA + "/" + length + "/" + temperature + "/" + temperatureCoefficient);
    var data = JSON.parse(json);  
    return data.dcResistance;  
  } 
  
  /**
  * d.c. resistance temperature adjustment.
  * Find resistance at operating temperature given the resistance at the base temperature, Ohm.
  * @param {number} resistanceResistance of a cable (single conductor) or circuit element, Ohm 
  * @param {number} temperatureBase Base temperature of a conductor or material, degC
  * @param {number} temperatureOperating  Operating temperature of a conductor or material, degC
  * @param {number} temperatureCoefficient Temperature Coefficient (resistance) at 20degC, 1/K
  * @return Conductor resistance, Ohm
  * @customfunction
  */
  function resistanceDeltaT(resistance, temperatureBase, temperatureOperating, temperatureCoefficient) {  
    var json =  httpGetCall("electrical/impedance/deltaT/" + resistance + "/" + temperatureBase+ "/" + temperatureOperating + "/" + temperatureCoefficient);
    var data = JSON.parse(json);  
    return data[1].Value;  
  }