diff options
author | Sunil Shetye | 2018-07-12 23:16:08 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-13 10:21:08 +0530 |
commit | 214ade87a6cef2bf55f9b9f2848ffafc02f37f18 (patch) | |
tree | 50fdfe7b1e8850622825e362ca865be3f0911009 /js/Electrical | |
parent | a2bfd6050ab2b5b6bbede92393b1f61d4ecc25aa (diff) | |
download | sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.tar.gz sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.tar.bz2 sci2js-214ade87a6cef2bf55f9b9f2848ffafc02f37f18.zip |
add more global variables
Diffstat (limited to 'js/Electrical')
48 files changed, 406 insertions, 282 deletions
diff --git a/js/Electrical/CCS.js b/js/Electrical/CCS.js index fac95aa1..61b96852 100644 --- a/js/Electrical/CCS.js +++ b/js/Electrical/CCS.js @@ -36,15 +36,15 @@ function CCS() { mo.outputs = MO; this.model.rpar = new ScilabDouble(PrametersValue); mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); - var exprs = []; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CCS\",sz(1),sz(2));"]); + this.exprs = []; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CCS\",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.1,3],this.model,exprs,list(gr_i,0)); + this.x = standard_define([2.1,3],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); @@ -60,7 +60,7 @@ function CCS() { CCS.prototype.set = function CCS() { this.x = arg1; this.graphics = arg1.graphics; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; this.model = arg1.model; this.x = arg1; return new BasicBlock(this.x); diff --git a/js/Electrical/CCS.pickle b/js/Electrical/CCS.pickle index 86117e01..35f6a110 100644 --- a/js/Electrical/CCS.pickle +++ b/js/Electrical/CCS.pickle @@ -6,10 +6,14 @@ S'x' p2 aS'model' p3 -aS'graphics' +aS'gr_i' p4 -atp5 -Rp6 +aS'exprs' +p5 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Electrical/CVS.js b/js/Electrical/CVS.js index 40920b17..052d7100 100644 --- a/js/Electrical/CVS.js +++ b/js/Electrical/CVS.js @@ -36,15 +36,15 @@ function CVS() { mo.outputs = MO; this.model.rpar = new ScilabDouble(PrametersValue); mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); - var exprs = []; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CVS\",sz(1),sz(2));"]); + this.exprs = []; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CVS\",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.1,3],this.model,exprs,list(gr_i,0)); + this.x = standard_define([2.1,3],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); @@ -60,7 +60,7 @@ function CVS() { CVS.prototype.set = function CVS() { this.x = arg1; this.graphics = arg1.graphics; - var exprs = this.graphics.exprs; + this.exprs = this.graphics.exprs; this.model = arg1.model; this.x = arg1; return new BasicBlock(this.x); diff --git a/js/Electrical/CVS.pickle b/js/Electrical/CVS.pickle index 86117e01..35f6a110 100644 --- a/js/Electrical/CVS.pickle +++ b/js/Electrical/CVS.pickle @@ -6,10 +6,14 @@ S'x' p2 aS'model' p3 -aS'graphics' +aS'gr_i' p4 -atp5 -Rp6 +aS'exprs' +p5 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'arg1' p1 diff --git a/js/Electrical/Capacitor.js b/js/Electrical/Capacitor.js index 8b9601f7..d11d389c 100644 --- a/js/Electrical/Capacitor.js +++ b/js/Electrical/Capacitor.js @@ -16,9 +16,9 @@ function Capacitor() { this.model.equations = new ScilabDouble([mo]); this.model.in1 = new ScilabDouble([ones(size(mo.inputs,"*"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"*"),1)]); - var exprs = string([[this.C],[this.v]]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Capacitor\",sz(1),sz(2));"]); - this.x = standard_define([2,1.1],this.model,exprs,list(gr_i,0)); + this.exprs = string([[this.C],[this.v]]); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Capacitor\",sz(1),sz(2));"]); + this.x = standard_define([2,1.1],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -36,18 +36,19 @@ function Capacitor() { Capacitor.prototype.set = function Capacitor() { this.C = parseFloat(arguments[0]["C"]) this.v = parseFloat(arguments[0]["v"]) + 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; while (true) { - [ok,this.C,this.v,exprs] = scicos_getvalue("Set Capacitor block parameter",["C (F)","Initial Voltage"],list("vec",1,"vec",1),exprs); + [ok,this.C,this.v,this.exprs] = scicos_getvalue("Set Capacitor block parameter",["C (F)","Initial Voltage"],list("vec",1,"vec",1),this.exprs); if (!ok) { break; } this.model.rpar = new ScilabDouble([this.C]); this.model.equations.parameters[2-1] = list(new ScilabDouble([this.C]), new ScilabDouble([this.v])); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/Capacitor.pickle b/js/Electrical/Capacitor.pickle index ecb39b69..f3585d18 100644 --- a/js/Electrical/Capacitor.pickle +++ b/js/Electrical/Capacitor.pickle @@ -2,18 +2,22 @@ c__builtin__ set p0 ((lp1 -S'x' +S'C' p2 -aS'model' -p3 aS'v' +p3 +aS'exprs' p4 -aS'C' +aS'gr_i' p5 aS'graphics' p6 -atp7 -Rp8 +aS'x' +p7 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Electrical/ConstantVoltage.js b/js/Electrical/ConstantVoltage.js index 8ac4d151..dc90df63 100644 --- a/js/Electrical/ConstantVoltage.js +++ b/js/Electrical/ConstantVoltage.js @@ -15,9 +15,9 @@ function ConstantVoltage() { mo.outputs = "n"; mo.parameters = list("V",list(this.V)); this.model.equations = new ScilabDouble([mo]); - var exprs = string(this.V); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ConstantVoltage\",sz(1),sz(2));"]); - this.x = standard_define([1.5,1.1],this.model,exprs,list(gr_i,0)); + this.exprs = string(this.V); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"ConstantVoltage\",sz(1),sz(2));"]); + this.x = standard_define([1.5,1.1],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -32,18 +32,19 @@ function ConstantVoltage() { } ConstantVoltage.prototype.set = function ConstantVoltage() { this.V = parseFloat(arguments[0]["V"]) + 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; while (true) { - [ok,this.V,exprs] = scicos_getvalue("Set ConstantVoltage block parameter","V (volt)",list("vec",1),exprs); + [ok,this.V,this.exprs] = scicos_getvalue("Set ConstantVoltage block parameter","V (volt)",list("vec",1),this.exprs); if (!ok) { break; } this.model.rpar = new ScilabDouble([this.V]); this.model.equations.parameters[2-1] = list(new ScilabDouble([this.V])); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/ConstantVoltage.pickle b/js/Electrical/ConstantVoltage.pickle index 2de4f0ac..92a04c12 100644 --- a/js/Electrical/ConstantVoltage.pickle +++ b/js/Electrical/ConstantVoltage.pickle @@ -2,16 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'graphics' p2 -aS'model' +aS'exprs' p3 -aS'V' +aS'gr_i' p4 -aS'graphics' +aS'V' p5 -atp6 -Rp7 +aS'x' +p6 +aS'model' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 diff --git a/js/Electrical/CurrentSensor.js b/js/Electrical/CurrentSensor.js index e055927e..73659ef1 100644 --- a/js/Electrical/CurrentSensor.js +++ b/js/Electrical/CurrentSensor.js @@ -12,9 +12,9 @@ function CurrentSensor() { mo.inputs = "p"; mo.outputs = [["n"],["i"]]; this.model.equations = new ScilabDouble([mo]); - var exprs = []; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CurrentSensor\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); + this.exprs = []; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CurrentSensor\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["E"]]; return new BasicBlock(this.x); diff --git a/js/Electrical/CurrentSensor.pickle b/js/Electrical/CurrentSensor.pickle index 13759532..31a790d2 100644 --- a/js/Electrical/CurrentSensor.pickle +++ b/js/Electrical/CurrentSensor.pickle @@ -6,8 +6,14 @@ S'x' p2 aS'model' p3 -atp4 -Rp5 +aS'gr_i' +p4 +aS'exprs' +p5 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/Diode.js b/js/Electrical/Diode.js index f696eef6..d29202b3 100644 --- a/js/Electrical/Diode.js +++ b/js/Electrical/Diode.js @@ -18,9 +18,9 @@ function Diode() { mo.outputs = "n"; mo.parameters = list(["Ids","Vt","Maxexp","R"],list(this.Ids,this.Vt,this.Maxexp,this.R)); this.model.equations = new ScilabDouble([mo]); - var exprs = string([[this.Ids],[this.Vt],[this.Maxexp],[this.R]]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Diode\",sz(1),sz(2));"]); - this.x = standard_define([2,1],this.model,exprs,list(gr_i,0)); + this.exprs = string([[this.Ids],[this.Vt],[this.Maxexp],[this.R]]); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Diode\",sz(1),sz(2));"]); + this.x = standard_define([2,1],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -42,18 +42,19 @@ function Diode() { this.Vt = parseFloat(arguments[0]["Vt"]) this.Maxexp = parseFloat(arguments[0]["Maxexp"]) this.R = parseFloat(arguments[0]["R"]) + 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; while (true) { - [ok,this.Ids,this.Vt,this.Maxexp,this.R,exprs] = scicos_getvalue("Set Diode block parameter",["Saturation cuurent (A)","Voltage equivalent to temperature (Volt)","Max exponent for linear continuation","R (ohm)"],list("vec",1,"vec",1,"vec",1,"vec",1),exprs); + [ok,this.Ids,this.Vt,this.Maxexp,this.R,this.exprs] = scicos_getvalue("Set Diode block parameter",["Saturation cuurent (A)","Voltage equivalent to temperature (Volt)","Max exponent for linear continuation","R (ohm)"],list("vec",1,"vec",1,"vec",1,"vec",1),this.exprs); if (!ok) { break; } this.model.rpar = new ScilabDouble([this.Ids],[this.Vt],[this.Maxexp],[this.R]); this.model.equations.parameters = list(["Ids","Vt","Maxexp","R"],list(this.Ids,this.Vt,this.Maxexp,this.R)); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/Diode.pickle b/js/Electrical/Diode.pickle index 0e45a349..cb1adba4 100644 --- a/js/Electrical/Diode.pickle +++ b/js/Electrical/Diode.pickle @@ -2,22 +2,26 @@ c__builtin__ set p0 ((lp1 -S'Maxexp' +S'R' p2 aS'Ids' p3 -aS'R' +aS'Maxexp' p4 -aS'Vt' +aS'exprs' p5 -aS'graphics' +aS'gr_i' p6 -aS'x' +aS'Vt' p7 -aS'model' +aS'graphics' p8 -atp9 -Rp10 +aS'x' +p9 +aS'model' +p10 +atp11 +Rp12 .(dp0 S'arg1' p1 diff --git a/js/Electrical/Ground.js b/js/Electrical/Ground.js index 50163380..e7c04710 100644 --- a/js/Electrical/Ground.js +++ b/js/Electrical/Ground.js @@ -11,9 +11,9 @@ function Ground() { mo.model = "Ground"; mo.inputs = "p"; this.model.equations = new ScilabDouble([mo]); - var exprs = ""; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Ground\",sz(1),sz(2));"]); - this.x = standard_define([1,1],this.model,exprs,list(gr_i,0)); + this.exprs = ""; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Ground\",sz(1),sz(2));"]); + this.x = standard_define([1,1],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new GroundBlock(this.x); diff --git a/js/Electrical/Ground.pickle b/js/Electrical/Ground.pickle index 4ffcd0a3..bec9342e 100644 --- a/js/Electrical/Ground.pickle +++ b/js/Electrical/Ground.pickle @@ -6,8 +6,14 @@ S'x' p2 aS'model' p3 -atp4 -Rp5 +aS'gr_i' +p4 +aS'exprs' +p5 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/Gyrator.js b/js/Electrical/Gyrator.js index bf52abfb..00c0e951 100644 --- a/js/Electrical/Gyrator.js +++ b/js/Electrical/Gyrator.js @@ -36,15 +36,15 @@ function Gyrator() { mo.outputs = MO; this.model.rpar = new ScilabDouble(PrametersValue); mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); - var exprs = [["1"],["1"]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Gyrator\",sz(1),sz(2));"]); + this.exprs = [["1"],["1"]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Gyrator\",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); @@ -62,19 +62,20 @@ function Gyrator() { Gyrator.prototype.set = function Gyrator() { this.G1 = arguments[0]["G1"] this.G2 = arguments[0]["G2"] + 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.G1,this.G2,exprs] = scicos_getvalue([["Set Gyrator block parameters:"],[""],["G1: Gyration conductance"],["G2: Gyration conductance"]],["G1","G2"],list("vec",1,"vec",1),exprs); + [ok,this.G1,this.G2,this.exprs] = scicos_getvalue([["Set Gyrator block parameters:"],[""],["G1: Gyration conductance"],["G2: Gyration conductance"]],["G1","G2"],list("vec",1,"vec",1),this.exprs); if (!ok) { break; } this.x.model.equations.parameters[2-1] = list(this.G1,this.G2); - this.x.graphics.exprs = exprs; + this.x.graphics.exprs = this.exprs; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/Gyrator.pickle b/js/Electrical/Gyrator.pickle index 6de599d3..c683f394 100644 --- a/js/Electrical/Gyrator.pickle +++ b/js/Electrical/Gyrator.pickle @@ -2,18 +2,22 @@ c__builtin__ set p0 ((lp1 -S'x' +S'G2' p2 -aS'model' +aS'G1' p3 -aS'G2' +aS'exprs' p4 -aS'G1' +aS'gr_i' p5 aS'graphics' p6 -atp7 -Rp8 +aS'x' +p7 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/IdealTransformer.js b/js/Electrical/IdealTransformer.js index 3b2037c2..a24cdbb2 100644 --- a/js/Electrical/IdealTransformer.js +++ b/js/Electrical/IdealTransformer.js @@ -36,15 +36,15 @@ function IdealTransformer() { mo.outputs = MO; this.model.rpar = new ScilabDouble(PrametersValue); mo.parameters = list(ParametersName,PrametersValue,zeros(ParametersName)); - var exprs = ["1"]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IdealTransformer\",sz(1),sz(2));"]); + this.exprs = ["1"]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IdealTransformer\",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); @@ -60,19 +60,20 @@ function IdealTransformer() { } IdealTransformer.prototype.set = function IdealTransformer() { this.N = arguments[0]["N"] + 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.N,exprs] = scicos_getvalue([["Set Transformer block parameters:"],[""],["N:"+" Turn ratio (N1/N2)"]],["N"],list("vec",1),exprs); + [ok,this.N,this.exprs] = scicos_getvalue([["Set Transformer block parameters:"],[""],["N:"+" Turn ratio (N1/N2)"]],["N"],list("vec",1),this.exprs); if (!ok) { break; } this.x.model.equations.parameters[2-1] = list(this.N); - this.x.graphics.exprs = exprs; + this.x.graphics.exprs = this.exprs; break; } return new BasicBlock(this.x); diff --git a/js/Electrical/IdealTransformer.pickle b/js/Electrical/IdealTransformer.pickle index 6420988c..19ad5954 100644 --- a/js/Electrical/IdealTransformer.pickle +++ b/js/Electrical/IdealTransformer.pickle @@ -2,16 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'N' p2 -aS'model' +aS'exprs' p3 -aS'N' +aS'gr_i' p4 aS'graphics' p5 -atp6 -Rp7 +aS'x' +p6 +aS'model' +p7 +atp8 +Rp9 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/Inductor.js b/js/Electrical/Inductor.js index bf577ee0..fc028e43 100644 --- a/js/Electrical/Inductor.js +++ b/js/Electrical/Inductor.js @@ -15,9 +15,9 @@ function Inductor() { mo.outputs = "n"; mo.parameters = list("L",list(this.L)); this.model.equations = new ScilabDouble([mo]); - var exprs = string(this.L); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Inductor\",sz(1),sz(2));"]); - this.x = standard_define([2,0.9],this.model,exprs,list(gr_i,0)); + this.exprs = string(this.L); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Inductor\",sz(1),sz(2));"]); + this.x = standard_define([2,0.9],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -32,18 +32,19 @@ function Inductor() { } Inductor.prototype.set = function Inductor() { this.L = parseFloat(arguments[0]["L"]) + 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; while (true) { - [ok,this.L,exprs] = scicos_getvalue("Set Inductor block parameter","L (H)",list("vec",1),exprs); + [ok,this.L,this.exprs] = scicos_getvalue("Set Inductor block parameter","L (H)",list("vec",1),this.exprs); if (!ok) { break; } this.model.rpar = new ScilabDouble([this.L]); this.model.equations.parameters[2-1] = list(new ScilabDouble([this.L])); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/Inductor.pickle b/js/Electrical/Inductor.pickle index 6fd3d126..b7c3a7df 100644 --- a/js/Electrical/Inductor.pickle +++ b/js/Electrical/Inductor.pickle @@ -2,16 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'L' p2 -aS'model' +aS'exprs' p3 -aS'L' +aS'gr_i' p4 aS'graphics' p5 -atp6 -Rp7 +aS'x' +p6 +aS'model' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 diff --git a/js/Electrical/MOTOR.js b/js/Electrical/MOTOR.js index 254d7d5b..0683c275 100644 --- a/js/Electrical/MOTOR.js +++ b/js/Electrical/MOTOR.js @@ -7,9 +7,9 @@ function MOTOR() { this.model.sim = new ScilabString(["motor"]); this.model.blocktype = new ScilabString(["c"]); this.model.dep_ut = new ScilabDouble([true,false]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MOTOR\",sz(1),sz(2));"]); - var exprs = ""; - this.x = standard_define([2,2],this.model,exprs,gr_i); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MOTOR\",sz(1),sz(2));"]); + this.exprs = ""; + this.x = standard_define([2,2],this.model,this.exprs,this.gr_i); this.x.graphics.out_implicit = [["I"],["I"]]; this.x.graphics.in_implicit = ["I"]; return new BasicBlock(this.x); diff --git a/js/Electrical/MOTOR.pickle b/js/Electrical/MOTOR.pickle index a1c0ad46..9c6210d5 100644 --- a/js/Electrical/MOTOR.pickle +++ b/js/Electrical/MOTOR.pickle @@ -6,8 +6,14 @@ S'x' p2 aS'model' p3 -atp4 -Rp5 +aS'gr_i' +p4 +aS'exprs' +p5 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/NMOS.js b/js/Electrical/NMOS.js index 5096d9f5..7632989f 100644 --- a/js/Electrical/NMOS.js +++ b/js/Electrical/NMOS.js @@ -22,9 +22,9 @@ function NMOS() { this.model.equations = new ScilabDouble([mo]); this.model.in1 = new ScilabDouble([ones(size(mo.inputs,"*"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"*"),1)]); - var exprs = [[string(this.W)],[string(this.L)],[string(this.Beta)],[string(this.Vt)],[string(this.K2)],[string(this.K5)],[string(this.dW)],[string(this.dL)],[string(this.RDS)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"NMOS\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,gr_i); + this.exprs = [[string(this.W)],[string(this.L)],[string(this.Beta)],[string(this.Vt)],[string(this.K2)],[string(this.K5)],[string(this.dW)],[string(this.dL)],[string(this.RDS)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"NMOS\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,this.gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["I"],["I"]]; return new BasicBlock(this.x); @@ -56,17 +56,18 @@ function NMOS() { this.dW = parseFloat(arguments[0]["dW"]) this.dL = parseFloat(arguments[0]["dL"]) this.RDS = parseFloat(arguments[0]["RDS"]) + 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; while (true) { - [ok,this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS,exprs] = scicos_getvalue("Set NMOS Transistor block parameters",["Width [m]","Length [m]","Transconductance parameter [A/(V*V)]","Zero bias threshold voltage [V]","Bulk threshold parameter","Reduction of pinch-off region","Narrowing of channel [m]","Shortening of channel [m]","Drain-Source-Resistance [Ohm]"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); + [ok,this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS,this.exprs] = scicos_getvalue("Set NMOS Transistor block parameters",["Width [m]","Length [m]","Transconductance parameter [A/(V*V)]","Zero bias threshold voltage [V]","Bulk threshold parameter","Reduction of pinch-off region","Narrowing of channel [m]","Shortening of channel [m]","Drain-Source-Resistance [Ohm]"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),this.exprs); if (!ok) { break; } this.model.equations.parameters[2-1] = list(new ScilabDouble([this.W]), new ScilabDouble([this.L]), new ScilabDouble([this.Beta]), new ScilabDouble([this.Vt]), new ScilabDouble([this.K2]), new ScilabDouble([this.K5]), new ScilabDouble([this.dW]), new ScilabDouble([this.dL]), new ScilabDouble([this.RDS])); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/NMOS.pickle b/js/Electrical/NMOS.pickle index 9990c4ba..2be5e1af 100644 --- a/js/Electrical/NMOS.pickle +++ b/js/Electrical/NMOS.pickle @@ -8,26 +8,30 @@ aS'K5' p3 aS'RDS' p4 -aS'L' -p5 aS'K2' +p5 +aS'L' p6 -aS'Beta' +aS'exprs' p7 -aS'Vt' +aS'Beta' p8 -aS'W' +aS'gr_i' p9 -aS'graphics' +aS'Vt' p10 -aS'x' +aS'W' p11 -aS'model' +aS'graphics' p12 -aS'dW' +aS'x' p13 -atp14 -Rp15 +aS'model' +p14 +aS'dW' +p15 +atp16 +Rp17 .(dp0 S'arg1' p1 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); diff --git a/js/Electrical/NPN.pickle b/js/Electrical/NPN.pickle index 8930541b..aa977a9f 100644 --- a/js/Electrical/NPN.pickle +++ b/js/Electrical/NPN.pickle @@ -2,48 +2,52 @@ c__builtin__ set p0 ((lp1 -S'Me' +S'Vak' p2 -aS'Vak' +aS'Cjc' p3 -aS'Bf' +aS'Cje' p4 -aS'Gbe' +aS'Phic' p5 -aS'Tauf' +aS'Bf' p6 -aS'Gbc' +aS'Br' p7 -aS'Mc' +aS'Me' p8 -aS'Phic' +aS'Phie' p9 -aS'Cjc' +aS'Gbe' p10 -aS'Is' +aS'Tauf' p11 -aS'Phie' +aS'Gbc' p12 -aS'Ccs' +aS'Mc' p13 -aS'Cje' +aS'Ccs' p14 aS'Taur' p15 -aS'Vt' +aS'graphics' p16 -aS'Br' +aS'EMinMax' p17 -aS'graphics' +aS'Is' p18 -aS'EMinMax' +aS'exprs' p19 -aS'x' +aS'gr_i' p20 -aS'model' +aS'Vt' p21 -atp22 -Rp23 +aS'x' +p22 +aS'model' +p23 +atp24 +Rp25 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/OpAmp.js b/js/Electrical/OpAmp.js index 4a807bc0..31437ba3 100644 --- a/js/Electrical/OpAmp.js +++ b/js/Electrical/OpAmp.js @@ -16,9 +16,9 @@ function OpAmp() { this.model.in1 = new ScilabDouble([ones(size(mo.inputs,"*"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"*"),1)]); this.model.rpar = new ScilabDouble(Z); - var exprs = string(Z); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"OpAmp\",sz(1),sz(2));"]); - this.x = standard_define([3,5],this.model,exprs,gr_i); + this.exprs = string(Z); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"OpAmp\",sz(1),sz(2));"]); + this.x = standard_define([3,5],this.model,this.exprs,this.gr_i); this.x.graphics.in_implicit = [["I"],["I"]]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -38,17 +38,18 @@ function OpAmp() { this.OLGain = arguments[0]["OLGain"] this.SatH = arguments[0]["SatH"] this.SatL = arguments[0]["SatL"] + 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; while (false) { - [ok,this.OLGain,this.SatH,this.SatL,exprs] = scicos_getvalue("Set the Operational Amplifier parameters",["Open Loop Gain","Positive saturation voltage","Negative saturation voltage"],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.OLGain,this.SatH,this.SatL,this.exprs] = scicos_getvalue("Set the Operational Amplifier parameters",["Open Loop Gain","Positive saturation voltage","Negative saturation voltage"],list("vec",1,"vec",1,"vec",1),this.exprs); if (!ok) { break; } this.model.equations.parameters[2-1] = list(new ScilabDouble([this.OLGain]), new ScilabDouble([this.SatH]), new ScilabDouble([this.SatL])); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/OpAmp.pickle b/js/Electrical/OpAmp.pickle index 4ca97336..e96d6dc2 100644 --- a/js/Electrical/OpAmp.pickle +++ b/js/Electrical/OpAmp.pickle @@ -4,18 +4,22 @@ p0 ((lp1 S'OLGain' p2 -aS'graphics' +aS'exprs' p3 -aS'SatH' +aS'gr_i' p4 -aS'x' +aS'graphics' p5 -aS'model' +aS'SatH' p6 -aS'SatL' +aS'x' p7 -atp8 -Rp9 +aS'model' +p8 +aS'SatL' +p9 +atp10 +Rp11 .(dp0 S'arg1' p1 diff --git a/js/Electrical/PMOS.js b/js/Electrical/PMOS.js index 01c64d2f..ae570801 100644 --- a/js/Electrical/PMOS.js +++ b/js/Electrical/PMOS.js @@ -22,9 +22,9 @@ function PMOS() { this.model.equations = new ScilabDouble([mo]); this.model.in1 = new ScilabDouble([ones(size(mo.inputs,"*"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"*"),1)]); - var exprs = [[string(this.W)],[string(this.L)],[string(this.Beta)],[string(this.Vt)],[string(this.K2)],[string(this.K5)],[string(this.dW)],[string(this.dL)],[string(this.RDS)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PMOS\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,gr_i); + this.exprs = [[string(this.W)],[string(this.L)],[string(this.Beta)],[string(this.Vt)],[string(this.K2)],[string(this.K5)],[string(this.dW)],[string(this.dL)],[string(this.RDS)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PMOS\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,this.gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["I"],["I"]]; return new BasicBlock(this.x); @@ -56,17 +56,18 @@ function PMOS() { this.dW = parseFloat(arguments[0]["dW"]) this.dL = parseFloat(arguments[0]["dL"]) this.RDS = parseFloat(arguments[0]["RDS"]) + 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; while (true) { - [ok,this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS,exprs] = scicos_getvalue("Set PMOS Transistor parameters",["Width [m]","Length [m]","Transconductance parameter [A/(V*V)]","Zero bias threshold voltage [V]","Bulk threshold parameter","Reduction of pinch-off region","Narrowing of channel [m]","Shortening of channel [m]","Drain-Source-Resistance [Ohm]"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),exprs); + [ok,this.W,this.L,this.Beta,this.Vt,this.K2,this.K5,this.dW,this.dL,this.RDS,this.exprs] = scicos_getvalue("Set PMOS Transistor parameters",["Width [m]","Length [m]","Transconductance parameter [A/(V*V)]","Zero bias threshold voltage [V]","Bulk threshold parameter","Reduction of pinch-off region","Narrowing of channel [m]","Shortening of channel [m]","Drain-Source-Resistance [Ohm]"],list("vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1,"vec",-1),this.exprs); if (!ok) { break; } this.model.equations.parameters[2-1] = list(new ScilabDouble([this.W]), new ScilabDouble([this.L]), new ScilabDouble([this.Beta]), new ScilabDouble([this.Vt]), new ScilabDouble([this.K2]), new ScilabDouble([this.K5]), new ScilabDouble([this.dW]), new ScilabDouble([this.dL]), new ScilabDouble([this.RDS])); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/PMOS.pickle b/js/Electrical/PMOS.pickle index 9990c4ba..2be5e1af 100644 --- a/js/Electrical/PMOS.pickle +++ b/js/Electrical/PMOS.pickle @@ -8,26 +8,30 @@ aS'K5' p3 aS'RDS' p4 -aS'L' -p5 aS'K2' +p5 +aS'L' p6 -aS'Beta' +aS'exprs' p7 -aS'Vt' +aS'Beta' p8 -aS'W' +aS'gr_i' p9 -aS'graphics' +aS'Vt' p10 -aS'x' +aS'W' p11 -aS'model' +aS'graphics' p12 -aS'dW' +aS'x' p13 -atp14 -Rp15 +aS'model' +p14 +aS'dW' +p15 +atp16 +Rp17 .(dp0 S'arg1' p1 diff --git a/js/Electrical/PNP.js b/js/Electrical/PNP.js index 3ba3ea3b..295f7c44 100644 --- a/js/Electrical/PNP.js +++ b/js/Electrical/PNP.js @@ -36,15 +36,15 @@ function PNP() { 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),\"PNP\",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),\"PNP\",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 PNP() { 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 PNP 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) function 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 PNP 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) function 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); diff --git a/js/Electrical/PNP.pickle b/js/Electrical/PNP.pickle index 8930541b..aa977a9f 100644 --- a/js/Electrical/PNP.pickle +++ b/js/Electrical/PNP.pickle @@ -2,48 +2,52 @@ c__builtin__ set p0 ((lp1 -S'Me' +S'Vak' p2 -aS'Vak' +aS'Cjc' p3 -aS'Bf' +aS'Cje' p4 -aS'Gbe' +aS'Phic' p5 -aS'Tauf' +aS'Bf' p6 -aS'Gbc' +aS'Br' p7 -aS'Mc' +aS'Me' p8 -aS'Phic' +aS'Phie' p9 -aS'Cjc' +aS'Gbe' p10 -aS'Is' +aS'Tauf' p11 -aS'Phie' +aS'Gbc' p12 -aS'Ccs' +aS'Mc' p13 -aS'Cje' +aS'Ccs' p14 aS'Taur' p15 -aS'Vt' +aS'graphics' p16 -aS'Br' +aS'EMinMax' p17 -aS'graphics' +aS'Is' p18 -aS'EMinMax' +aS'exprs' p19 -aS'x' +aS'gr_i' p20 -aS'model' +aS'Vt' p21 -atp22 -Rp23 +aS'x' +p22 +aS'model' +p23 +atp24 +Rp25 .(dp0 S'x.model.equations.parameters[2-1]' p1 diff --git a/js/Electrical/PotentialSensor.js b/js/Electrical/PotentialSensor.js index 850af214..c6e1bab1 100644 --- a/js/Electrical/PotentialSensor.js +++ b/js/Electrical/PotentialSensor.js @@ -13,8 +13,8 @@ function PotentialSensor() { mo.inputs = "p"; mo.outputs = ["v"]; this.model.equations = new ScilabDouble([mo]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PotentialSensor\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,"",list(gr_i,0)); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PotentialSensor\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,"",list(this.gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["E"]; return new BasicBlock(this.x); diff --git a/js/Electrical/PotentialSensor.pickle b/js/Electrical/PotentialSensor.pickle index 5e42e801..1677f93c 100644 --- a/js/Electrical/PotentialSensor.pickle +++ b/js/Electrical/PotentialSensor.pickle @@ -6,8 +6,14 @@ S'x' p2 aS'model' p3 -atp4 -Rp5 +aS'gr_i' +p4 +aS'exprs' +p5 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/Resistor.js b/js/Electrical/Resistor.js index fa493c6d..ab3ddf84 100644 --- a/js/Electrical/Resistor.js +++ b/js/Electrical/Resistor.js @@ -15,9 +15,9 @@ function Resistor() { this.model.equations = new ScilabDouble([mo]); this.model.in1 = new ScilabDouble([ones(size(mo.inputs,"*"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"*"),1)]); - var exprs = string(this.R); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Resistor\",sz(1),sz(2));"]); - this.x = standard_define([2,1],this.model,exprs,list(gr_i,0)); + this.exprs = string(this.R); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Resistor\",sz(1),sz(2));"]); + this.x = standard_define([2,1],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -32,18 +32,19 @@ function Resistor() { } Resistor.prototype.set = function Resistor() { this.R = parseFloat(arguments[0]["R"]) + 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; while (true) { - [ok,this.R,exprs] = scicos_getvalue("Set Resistor block parameter","R (ohm)",list("vec",1),exprs); + [ok,this.R,this.exprs] = scicos_getvalue("Set Resistor block parameter","R (ohm)",list("vec",1),this.exprs); if (!ok) { break; } this.model.rpar = new ScilabDouble([this.R]); this.model.equations.parameters[2-1] = list(new ScilabDouble([this.R])); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/Resistor.pickle b/js/Electrical/Resistor.pickle index c7940c9a..070fe90f 100644 --- a/js/Electrical/Resistor.pickle +++ b/js/Electrical/Resistor.pickle @@ -2,16 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'R' p2 -aS'model' +aS'exprs' p3 -aS'R' +aS'gr_i' p4 aS'graphics' p5 -atp6 -Rp7 +aS'x' +p6 +aS'model' +p7 +atp8 +Rp9 .(dp0 S'arg1' p1 diff --git a/js/Electrical/SineVoltage.js b/js/Electrical/SineVoltage.js index 97e2bfde..13b008b0 100644 --- a/js/Electrical/SineVoltage.js +++ b/js/Electrical/SineVoltage.js @@ -19,9 +19,9 @@ function SineVoltage() { mo.outputs = "n"; mo.parameters = list([["V"],["phase"],["freqHz"],["offset"],["startTime"]],list(this.V,this.ph,this.frq,this.offset,this.start)); this.model.equations = new ScilabDouble([mo]); - var exprs = [[string(this.V)],[string(this.ph)],[string(this.frq)],[string(this.offset)],[string(this.start)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SineVoltage\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,gr_i); + this.exprs = [[string(this.V)],[string(this.ph)],[string(this.frq)],[string(this.offset)],[string(this.start)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SineVoltage\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,this.gr_i); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -45,18 +45,19 @@ function SineVoltage() { this.frq = parseFloat(arguments[0]["frq"]) this.offset = parseFloat(arguments[0]["offset"]) this.start = parseFloat(arguments[0]["start"]) + 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; while (true) { - [ok,this.V,this.ph,this.frq,this.offset,this.start,exprs] = scicos_getvalue("Set voltage source parameter",["Amplitude (Volt)","phase (rad)","Frequency (Hz)","Voltageoffset (V)","Timeoffset (s)"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),exprs); + [ok,this.V,this.ph,this.frq,this.offset,this.start,this.exprs] = scicos_getvalue("Set voltage source parameter",["Amplitude (Volt)","phase (rad)","Frequency (Hz)","Voltageoffset (V)","Timeoffset (s)"],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1),this.exprs); if (!ok) { break; } this.model.rpar = new ScilabDouble([this.V],[this.ph],[this.frq],[this.offset],[this.start]); this.model.equations.parameters[2-1] = list(new ScilabDouble([this.V]), new ScilabDouble([this.ph]), new ScilabDouble([this.frq]), new ScilabDouble([this.offset]), new ScilabDouble([this.start])); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/SineVoltage.pickle b/js/Electrical/SineVoltage.pickle index db2b83d2..464dfc6e 100644 --- a/js/Electrical/SineVoltage.pickle +++ b/js/Electrical/SineVoltage.pickle @@ -2,24 +2,28 @@ c__builtin__ set p0 ((lp1 -S'graphics' +S'start' p2 -aS'offset' +aS'graphics' p3 -aS'start' +aS'offset' p4 -aS'frq' +aS'exprs' p5 -aS'V' +aS'frq' p6 -aS'x' +aS'gr_i' p7 -aS'model' +aS'V' p8 -aS'ph' +aS'x' p9 -atp10 -Rp11 +aS'model' +p10 +aS'ph' +p11 +atp12 +Rp13 .(dp0 S'arg1' p1 diff --git a/js/Electrical/Switch.js b/js/Electrical/Switch.js index a60c5e2a..5fc20dd9 100644 --- a/js/Electrical/Switch.js +++ b/js/Electrical/Switch.js @@ -18,9 +18,9 @@ function Switch() { this.model.in1 = new ScilabDouble([ones(size(mo.inputs,"*"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"*"),1)]); this.model.rpar = new ScilabDouble([Z]); - var exprs = string(Z); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Switch\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); + this.exprs = string(Z); + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Switch\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = [["I"],["E"]]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -38,17 +38,18 @@ function Switch() { Switch.prototype.set = function Switch() { this.Ron = parseFloat(arguments[0]["Ron"]) this.Roff = parseFloat(arguments[0]["Roff"]) + 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; while (true) { - [ok,this.Ron,this.Roff,exprs] = scicos_getvalue("Set non-ideal electrical switch parameters",["Resistance in On state (Ohm)","Resistance in Off state (Ohm)"],list("vec",1,"vec",1),exprs); + [ok,this.Ron,this.Roff,this.exprs] = scicos_getvalue("Set non-ideal electrical switch parameters",["Resistance in On state (Ohm)","Resistance in Off state (Ohm)"],list("vec",1,"vec",1),this.exprs); if (!ok) { break; } this.model.equations.parameters[2-1] = list(new ScilabDouble([this.Ron]), new ScilabDouble([this.Roff])); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/Switch.pickle b/js/Electrical/Switch.pickle index 478106f5..4c2ce9dd 100644 --- a/js/Electrical/Switch.pickle +++ b/js/Electrical/Switch.pickle @@ -2,18 +2,22 @@ c__builtin__ set p0 ((lp1 -S'x' +S'Roff' p2 -aS'model' +aS'Ron' p3 -aS'Roff' +aS'exprs' p4 -aS'Ron' +aS'gr_i' p5 aS'graphics' p6 -atp7 -Rp8 +aS'x' +p7 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'arg1' p1 diff --git a/js/Electrical/VVsourceAC.js b/js/Electrical/VVsourceAC.js index 84dcd9dc..907daeb0 100644 --- a/js/Electrical/VVsourceAC.js +++ b/js/Electrical/VVsourceAC.js @@ -16,9 +16,9 @@ function VVsourceAC() { mo.outputs = "n"; mo.parameters = list(["f"],list(this.FR)); this.model.equations = new ScilabDouble([mo]); - var exprs = [string(this.FR)]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VVsourceAC\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); + this.exprs = [string(this.FR)]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VVsourceAC\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = ["I","E"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -34,18 +34,19 @@ function VVsourceAC() { } VVsourceAC.prototype.set = function VVsourceAC() { this.FR = parseFloat(arguments[0]["FR"]) + 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; while (true) { - [ok,this.FR,exprs] = scicos_getvalue("Set voltage source parameter",["Frequency (Hz)"],list("vec",-1),exprs); + [ok,this.FR,this.exprs] = scicos_getvalue("Set voltage source parameter",["Frequency (Hz)"],list("vec",-1),this.exprs); if (!ok) { break; } this.model.rpar = new ScilabDouble([this.FR]); this.model.equations.parameters[2-1] = list(new ScilabDouble([this.FR])); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/VVsourceAC.pickle b/js/Electrical/VVsourceAC.pickle index 0d8e9a0a..b1563a7d 100644 --- a/js/Electrical/VVsourceAC.pickle +++ b/js/Electrical/VVsourceAC.pickle @@ -2,16 +2,20 @@ c__builtin__ set p0 ((lp1 -S'x' +S'FR' p2 -aS'model' +aS'exprs' p3 -aS'FR' +aS'gr_i' p4 aS'graphics' p5 -atp6 -Rp7 +aS'x' +p6 +aS'model' +p7 +atp8 +Rp9 .(dp0 S'FR' p1 diff --git a/js/Electrical/VariableResistor.js b/js/Electrical/VariableResistor.js index a2175f58..2efac33a 100644 --- a/js/Electrical/VariableResistor.js +++ b/js/Electrical/VariableResistor.js @@ -12,9 +12,9 @@ function VariableResistor() { this.model.equations = new ScilabDouble([mo]); this.model.in1 = new ScilabDouble([ones(size(mo.inputs,"*"),1)]); this.model.out = new ScilabDouble([ones(size(mo.outputs,"*"),1)]); - var exprs = []; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VariableResistor\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); + this.exprs = []; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VariableResistor\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = ["I","E"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); diff --git a/js/Electrical/VariableResistor.pickle b/js/Electrical/VariableResistor.pickle index 850419e5..4e1a30e9 100644 --- a/js/Electrical/VariableResistor.pickle +++ b/js/Electrical/VariableResistor.pickle @@ -6,8 +6,14 @@ S'x' p2 aS'model' p3 -atp4 -Rp5 +aS'gr_i' +p4 +aS'exprs' +p5 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/VoltageSensor.js b/js/Electrical/VoltageSensor.js index 40f04f65..5500324e 100644 --- a/js/Electrical/VoltageSensor.js +++ b/js/Electrical/VoltageSensor.js @@ -12,9 +12,9 @@ function VoltageSensor() { mo.inputs = "p"; mo.outputs = [["n"],["v"]]; this.model.equations = new ScilabDouble([mo]); - var exprs = []; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VoltageSensor\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); + this.exprs = []; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VoltageSensor\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = [["I"],["E"]]; return new VoltageSensorBlock(this.x); diff --git a/js/Electrical/VoltageSensor.pickle b/js/Electrical/VoltageSensor.pickle index 13759532..31a790d2 100644 --- a/js/Electrical/VoltageSensor.pickle +++ b/js/Electrical/VoltageSensor.pickle @@ -6,8 +6,14 @@ S'x' p2 aS'model' p3 -atp4 -Rp5 +aS'gr_i' +p4 +aS'exprs' +p5 +aS'graphics' +p6 +atp7 +Rp8 .(dp0 S'model.sim' p1 diff --git a/js/Electrical/VsourceAC.js b/js/Electrical/VsourceAC.js index 786b4a0b..60e84496 100644 --- a/js/Electrical/VsourceAC.js +++ b/js/Electrical/VsourceAC.js @@ -16,9 +16,9 @@ function VsourceAC() { mo.outputs = "n"; mo.parameters = list([["VA"],["f"]],list(this.VA,this.FR)); this.model.equations = new ScilabDouble([mo]); - var exprs = [[string(this.VA)],[string(this.FR)]]; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VsourceAC\",sz(1),sz(2));"]); - this.x = standard_define([2,2],this.model,exprs,list(gr_i,0)); + this.exprs = [[string(this.VA)],[string(this.FR)]]; + this.gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"VsourceAC\",sz(1),sz(2));"]); + this.x = standard_define([2,2],this.model,this.exprs,list(this.gr_i,0)); this.x.graphics.in_implicit = ["I"]; this.x.graphics.out_implicit = ["I"]; return new BasicBlock(this.x); @@ -36,18 +36,19 @@ function VsourceAC() { VsourceAC.prototype.set = function VsourceAC() { this.VA = parseFloat(arguments[0]["VA"]) this.FR = parseFloat(arguments[0]["FR"]) + 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; while (true) { - [ok,this.VA,this.FR,exprs] = scicos_getvalue("Set voltage source parameter",["Amplitude (Volt)","Frequency (Hz)"],list("vec",-1,"vec",-1),exprs); + [ok,this.VA,this.FR,this.exprs] = scicos_getvalue("Set voltage source parameter",["Amplitude (Volt)","Frequency (Hz)"],list("vec",-1,"vec",-1),this.exprs); if (!ok) { break; } this.model.rpar = new ScilabDouble([this.VA],[this.FR]); this.model.equations.parameters[2-1] = list(new ScilabDouble([this.VA]), new ScilabDouble([this.FR])); - this.graphics.exprs = new ScilabDouble([exprs]); + this.graphics.exprs = new ScilabDouble([this.exprs]); this.x.graphics = this.graphics; this.x.model = this.model; break; diff --git a/js/Electrical/VsourceAC.pickle b/js/Electrical/VsourceAC.pickle index 59a36993..01ffa4e3 100644 --- a/js/Electrical/VsourceAC.pickle +++ b/js/Electrical/VsourceAC.pickle @@ -2,18 +2,22 @@ c__builtin__ set p0 ((lp1 -S'x' +S'VA' p2 -aS'model' +aS'FR' p3 -aS'VA' +aS'exprs' p4 -aS'FR' +aS'gr_i' p5 aS'graphics' p6 -atp7 -Rp8 +aS'x' +p7 +aS'model' +p8 +atp9 +Rp10 .(dp0 S'FR' p1 |