diff options
Diffstat (limited to 'js/Electrical/NPN.js')
-rw-r--r-- | js/Electrical/NPN.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/js/Electrical/NPN.js b/js/Electrical/NPN.js index 88227a3c..5246a65a 100644 --- a/js/Electrical/NPN.js +++ b/js/Electrical/NPN.js @@ -36,15 +36,15 @@ function NPN() { mo.outputs = MO; this.model.rpar = new ScilabDouble(PrametersValue); mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); - var exprs = [["50"],["0.1"],["1.e-16"],["0.02"],["0.12e-9"],["5e-9"],["1e-12"],["0.4e-12"],["0.5e-12"],["0.8"],["0.4"],["0.8"],["0.333"],["1e-15"],["1e-15"],["0.02585"],["40"]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"NPN\",sz(1),sz(2));"]); + this.exprs = [["50"],["0.1"],["1.e-16"],["0.02"],["0.12e-9"],["5e-9"],["1e-12"],["0.4e-12"],["0.5e-12"],["0.8"],["0.4"],["0.8"],["0.333"],["1e-15"],["1e-15"],["0.02585"],["40"]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"NPN\",sz(1),sz(2));"]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabDouble([false,true]); mo.model = ModelName; this.model.equations = new ScilabDouble([mo]); this.model.in1 = new ScilabDouble([ones(size(MI,"*"),1)]); this.model.out = new ScilabDouble([ones(size(MO,"*"),1)]); - this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); + this.x = standard_define([2,2],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = Typein; this.x.graphics.out_implicit = Typeout; return new BasicBlock(this.x); @@ -92,19 +92,20 @@ function NPN() { this.Gbe = arguments[0]["Gbe"] this.Vt = arguments[0]["Vt"] this.EMinMax = arguments[0]["EMinMax"] + this.exprs = arguments[0]["exprs"] this.x = arg1; this.graphics = arg1.graphics; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; this.model = arg1.model; this.x = arg1; - var exprs = this.x.graphics.exprs; + this.exprs = this.x.graphics.exprs; while (true) { - [ok,this.Bf,this.Br,this.Is,this.Vak,this.Tauf,this.Taur,this.Ccs,this.Cje,this.Cjc,this.Phie,this.Me,this.Phic,this.Mc,this.Gbc,this.Gbe,this.Vt,this.EMinMax,exprs] = scicos_getvalue([["Set NPN block parameters:"],[""]],["Bf : Forward beta","Br : Reverse beta","Is : Transport saturation current","Vak : Early voltage (inverse), 1/Volt","Tauf: Ideal forward transit time","Taur: Ideal reverse transit time","Ccs : Collector-substrat(ground) cap.","Cje : Base-emitter zero bias depletion cap.","Cjc : Base-coll. zero bias depletion cap.","Phie: Base-emitter diffusion voltage","Me : Base-emitter gradation exponent","Phic: Base-collector diffusion voltage","Mc : Base-collector gradation exponent","Gbc : Base-collector conductance","Gbe : Base-emitter conductance","Vt : Voltage equivalent of temperature","EMinmax: if x > EMinMax, the exp(x) is linearized"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); + [ok,this.Bf,this.Br,this.Is,this.Vak,this.Tauf,this.Taur,this.Ccs,this.Cje,this.Cjc,this.Phie,this.Me,this.Phic,this.Mc,this.Gbc,this.Gbe,this.Vt,this.EMinMax,this.exprs] = scicos_getvalue([["Set NPN block parameters:"],[""]],["Bf : Forward beta","Br : Reverse beta","Is : Transport saturation current","Vak : Early voltage (inverse), 1/Volt","Tauf: Ideal forward transit time","Taur: Ideal reverse transit time","Ccs : Collector-substrat(ground) cap.","Cje : Base-emitter zero bias depletion cap.","Cjc : Base-coll. zero bias depletion cap.","Phie: Base-emitter diffusion voltage","Me : Base-emitter gradation exponent","Phic: Base-collector diffusion voltage","Mc : Base-collector gradation exponent","Gbc : Base-collector conductance","Gbe : Base-emitter conductance","Vt : Voltage equivalent of temperature","EMinmax: if x > EMinMax, the exp(x) is linearized"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",1),this.exprs); if (!ok) { break; } this.x.model.equations.parameters[2-1] = list(this.Bf,this.Br,this.Is,this.Vak,this.Tauf,this.Taur,this.Ccs,this.Cje,this.Cjc,this.Phie,this.Me,this.Phic,this.Mc,this.Gbc,this.Gbe,this.Vt,this.EMinMax); - this.x.graphics.exprs = exprs; + this.x.graphics.exprs = this.exprs; break; } return new BasicBlock(this.x); |