public function calculateLam(Resistor $res, $pcbID)
 {
     $pcb = $this->pcbService->getItem($pcbID);
     $system = $this->systemService->getItem($pcb->getSystemID());
     $sysTemp = $system->getTemp();
     $res->setTemp($sysTemp + $res->getDPTemp() + $res->getPassiveTemp());
     $material = $this->getResMaterialByShortcut($res->getMaterial());
     $base = $material['Lamb'];
     $piT_tab = $material['FactorT'];
     $piS_tab = intval($material['FactorS']);
     $temp = $res->getTemp();
     $piT = exp(-1 * $piT_tab / (8.617000000000001 * 1.0E-5) * (1 / ($temp + 273) - 1 / 298));
     $pDiss = $res->getDissipationPower();
     $s_pom = $pDiss / $res->getMaxPower();
     switch ($piS_tab) {
         case 0:
             $piS = 1;
             break;
         case 1:
             $piS = 0.71 * exp(1.1 * $s_pom);
             break;
         case 2:
             $piS = 0.54 * exp(2.04 * $s_pom);
             break;
     }
     $piP = pow($pDiss, 0.39);
     $piQ = $res->getQuality();
     $sEnv = $res->getEnvironment();
     $piE = $this->systemService->getPiE(91, $sEnv);
     $lambda = $base * $piT * $piP * $piS * $piQ * $piE * pow(10, -6);
     return $lambda;
 }