Ticket #48298: patch-src-Mshichmanhodgesmosfet.cc.diff
File patch-src-Mshichmanhodgesmosfet.cc.diff, 2.6 KB (added by Schamschula (Marius Schamschula), 9 years ago) |
---|
-
src/Mshichmanhodgesmosfet.cc
old new 123 123 double vb = extvar(3); // V-bulk 124 124 double T = extvar(4); // Temperature 125 125 126 double k = mu0*Cox* pow((T + Tshift)/300.0,-3.0/2.0)*W/L;127 double dkdT = mu0*Cox*W*(-3.0/2)* pow((T + Tshift)/300.0,-5.0/2.0 )*(1.0/300.0)/L;126 double k = mu0*Cox*std::pow((T + Tshift)/300.0,-3.0/2.0)*W/L; 127 double dkdT = mu0*Cox*W*(-3.0/2)*std::pow((T + Tshift)/300.0,-5.0/2.0 )*(1.0/300.0)/L; 128 128 129 129 double vgs = vg - vs; 130 130 double vds = vd - vs; … … 138 138 } 139 139 else if ( ( (vgs-Vth)>= vds ) && (vds>=0)) 140 140 { 141 *ids = k*((vgs-Vth)*vds - pow(vds,2)/2 ) + vds/rd;141 *ids = k*((vgs-Vth)*vds - std::pow(vds,2)/2 ) + vds/rd; 142 142 *gm = k*vds; 143 143 *gd = k*(vgs-Vth-vds) + (1/rd); 144 *didT = dkdT*((vgs-Vth)*vds-( pow(vds,2))/2);144 *didT = dkdT*((vgs-Vth)*vds-(std::pow(vds,2))/2); 145 145 } 146 146 else if (((vgs-Vth)>=(vds))&&(vds<0)) 147 147 { … … 152 152 } 153 153 else // (i.e. if 0 <= vgs-vth <= vds) 154 154 { 155 *ids = (k/2)* pow((vgs-Vth),2) + vds/rd;155 *ids = (k/2)*std::pow((vgs-Vth),2) + vds/rd; 156 156 *gm = k*(vgs-Vth); 157 157 *gd = 1/rd; 158 *didT= (dkdT/(2))* pow((vgs-Vth),2);158 *didT= (dkdT/(2))*std::pow((vgs-Vth),2); 159 159 } 160 160 161 161 *P = -(*ids)*vds; … … 177 177 double vb = extvar(3); // V-bulk 178 178 double T = extvar(4); // Temperature 179 179 180 double k = - mu0*Cox* pow((T + Tshift)/300.0,-3.0/2.0)*W/L;181 double dkdT = - mu0*Cox*W*(-3.0/2.0)* pow((T + Tshift)/300.0,-5.0/2.0 )*(1.0/300.0)/L;180 double k = - mu0*Cox*std::pow((T + Tshift)/300.0,-3.0/2.0)*W/L; 181 double dkdT = - mu0*Cox*W*(-3.0/2.0)*std::pow((T + Tshift)/300.0,-5.0/2.0 )*(1.0/300.0)/L; 182 182 183 183 double vgs = vg - vs; 184 184 double vds = vd - vs; … … 192 192 } 193 193 else if ( ( (vgs-Vth)<= vds ) && (vds<=0)) 194 194 { 195 *ids = k*((vgs-Vth)*vds - pow(vds,2)/2 ) + vds/rd;195 *ids = k*((vgs-Vth)*vds - std::pow(vds,2)/2 ) + vds/rd; 196 196 *gm = k*vds; 197 197 *gd = k*(vgs-Vth-vds) + (1/rd); 198 *didT = dkdT*((vgs-Vth)*vds-( pow(vds,2))/2);198 *didT = dkdT*((vgs-Vth)*vds-(std::pow(vds,2))/2); 199 199 } 200 200 else if (((vgs-Vth)<=(vds))&&(vds>0)) 201 201 { … … 206 206 } 207 207 else // (i.e. if 0 <= vgs-vth <= vds) 208 208 { 209 *ids = (k/2)* pow((vgs-Vth),2) + vds/rd;209 *ids = (k/2)*std::pow((vgs-Vth),2) + vds/rd; 210 210 *gm = k*(vgs-Vth); 211 211 *gd = 1/rd; 212 *didT= (dkdT/(2))* pow((vgs-Vth),2);212 *didT= (dkdT/(2))*std::pow((vgs-Vth),2); 213 213 } 214 214 215 215 *P = -(*ids)*vds;