diff options
26 files changed, 1049 insertions, 1049 deletions
diff --git a/data_structures_correct/Bache.js b/data_structures_correct/Bache.js index 5a2585c..c85c3d5 100644 --- a/data_structures_correct/Bache.js +++ b/data_structures_correct/Bache.js @@ -1,46 +1,46 @@ -function Bache() { - - Bache.prototype.define = function Bache() { - this.in1 = 2; - this.out = 3; - - var model = scicos_model(); - model.in = new ScilabDouble(math.transpose(math.range(-1, -this.in1, -1, true))); - model.out = new ScilabDouble(math.transpose(math.range(-1, -this.out, -1, true))); - - this.Patm = 1.013E5; - this.A = 1; - this.ze1 = 40; - this.ze2 = 0; - this.zs1 = 40; - this.zs2 = 0; - this.z0 = 30; - this.T0 = 290; - this.p_rho = 0; - - model.rpar = new ScilabDouble([this.Patm], [this.A], [this.ze1], [this.ze2], [this.zs1], [this.zs2], [this.z0], [this.T0], [this.p_rho]); - model.sim = new ScilabString(["Bache"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["Bache"]); - mo.inputs = new ScilabString(["Ce1", "Ce2"]); - mo.outputs = new ScilabString(["Cs1", "Cs2", "yNiveau"]); - mo.parameters = list(new ScilabString(["Patm"], ["A"], ["ze1"], ["ze2"], ["zs1"], ["zs2"], ["z0"], ["T0"], ["p_rho"]), new ScilabDouble([this.Patm], [this.A], [this.ze1], [this.ze2], [this.zs1], [this.zs2], [this.z0], [this.T0], [this.p_rho])); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(getData(mo.inputs), '*'), 1)); - model.out = new ScilabDouble(...ones(size(getData(mo.outputs), '*'), 1)); - - var exprs = new ScilabString([this.Patm.toString()], [this.A.toString()], [this.ze1.toString()], [this.ze2.toString()], [this.zs1.toString()], [this.zs2.toString()], [this.z0.toString()], [this.T0.toString()], [this.p_rho.toString()]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Bache\",sz(1),sz(2));"]); - this.x = new standard_define([2, 2], model, exprs, list(gr_i, 0)); - this.x.graphics.in_implicit = new ScilabString(["I"], ["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"], ["I"], ["E"]); - return new BasicBlock(this.x); - } - Bache.prototype.details = function Bache() { - return this.x; - } -} +function Bache() {
+
+ Bache.prototype.define = function Bache() {
+ this.in1 = 2;
+ this.out = 3;
+
+ var model = scicos_model();
+ model.in = new ScilabDouble(math.transpose(math.range(-1, -this.in1, -1, true)));
+ model.out = new ScilabDouble(math.transpose(math.range(-1, -this.out, -1, true)));
+
+ this.Patm = 1.013E5;
+ this.A = 1;
+ this.ze1 = 40;
+ this.ze2 = 0;
+ this.zs1 = 40;
+ this.zs2 = 0;
+ this.z0 = 30;
+ this.T0 = 290;
+ this.p_rho = 0;
+
+ model.rpar = new ScilabDouble([this.Patm], [this.A], [this.ze1], [this.ze2], [this.zs1], [this.zs2], [this.z0], [this.T0], [this.p_rho]);
+ model.sim = new ScilabString(["Bache"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["Bache"]);
+ mo.inputs = new ScilabString(["Ce1", "Ce2"]);
+ mo.outputs = new ScilabString(["Cs1", "Cs2", "yNiveau"]);
+ mo.parameters = list(new ScilabString(["Patm"], ["A"], ["ze1"], ["ze2"], ["zs1"], ["zs2"], ["z0"], ["T0"], ["p_rho"]), new ScilabDouble([this.Patm], [this.A], [this.ze1], [this.ze2], [this.zs1], [this.zs2], [this.z0], [this.T0], [this.p_rho]));
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(getData(mo.inputs), '*'), 1));
+ model.out = new ScilabDouble(...ones(size(getData(mo.outputs), '*'), 1));
+
+ var exprs = new ScilabString([this.Patm.toString()], [this.A.toString()], [this.ze1.toString()], [this.ze2.toString()], [this.zs1.toString()], [this.zs2.toString()], [this.z0.toString()], [this.T0.toString()], [this.p_rho.toString()]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Bache\",sz(1),sz(2));"]);
+ this.x = new standard_define([2, 2], model, exprs, list(gr_i, 0));
+ this.x.graphics.in_implicit = new ScilabString(["I"], ["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"], ["I"], ["E"]);
+ return new BasicBlock(this.x);
+ }
+ Bache.prototype.details = function Bache() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/CVS.js b/data_structures_correct/CVS.js index 8091332..8643d0e 100644 --- a/data_structures_correct/CVS.js +++ b/data_structures_correct/CVS.js @@ -1,58 +1,58 @@ -function CVS() { - - CVS.prototype.define = function CVS() { - this.ModelName = "CVS"; - this.PrametersValue = new ScilabDouble(); - this.ParametersName = new ScilabDouble(); - var model = scicos_model(); - this.Typein = []; - this.Typeout = []; - this.MI = []; - this.MO = []; - this.P = [[2,50,1,0],[70,98,2,0],[70,2,-2,0]]; - this.PortName = [["vin"],["p"],["n"]]; - - for (var i = 0; i < size(this.P, "r"); i++) { - if (this.P[i][2] == 1) { - this.Typein.push(["E"]); - this.MI.push(this.PortName[i]); - } - - if (this.P[i][2] == 2) { - this.Typein.push(["I"]); - this.MI.push(this.PortName[i]); - } - if (this.P[i][2] == -1) { - this.Typeout.push(["E"]); - this.MO.push(this.PortName[i]); - } - if (this.P[i][2] == -2) { - this.Typeout.push(["I"]); - this.MO.push(this.PortName[i]); - } - } - - var mo = modelica(); - model.sim = new ScilabString([this.ModelName]); - mo.inputs = new ScilabString(...this.MI); - mo.outputs = new ScilabString(...this.MO); - model.rpar = this.PrametersValue; - mo.parameters = list(this.ParametersName, this.PrametersValue, new ScilabDouble(...zeros(getData(this.ParametersName)))); - var exprs = new ScilabDouble(); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CVS\",sz(1),sz(2));"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([false, true]); - mo.model = new ScilabString([this.ModelName]); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1)); - model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1)); - this.x = new standard_define(new ScilabDouble([2.1, 3]), model, exprs, list(new ScilabString([gr_i]), new ScilabDouble([0]))); - this.x.graphics.in_implicit = new ScilabDouble(this.Typein); - this.x.graphics.out_implicit = new ScilabDouble(this.Typeout); - return new BasicBlock(this.x); - } - - CVS.prototype.details = function CVS() { - return this.x; - } -} +function CVS() {
+
+ CVS.prototype.define = function CVS() {
+ this.ModelName = "CVS";
+ this.PrametersValue = new ScilabDouble();
+ this.ParametersName = new ScilabDouble();
+ var model = scicos_model();
+ this.Typein = [];
+ this.Typeout = [];
+ this.MI = [];
+ this.MO = [];
+ this.P = [[2,50,1,0],[70,98,2,0],[70,2,-2,0]];
+ this.PortName = [["vin"],["p"],["n"]];
+
+ for (var i = 0; i < size(this.P, "r"); i++) {
+ if (this.P[i][2] == 1) {
+ this.Typein.push(["E"]);
+ this.MI.push(this.PortName[i]);
+ }
+
+ if (this.P[i][2] == 2) {
+ this.Typein.push(["I"]);
+ this.MI.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -1) {
+ this.Typeout.push(["E"]);
+ this.MO.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -2) {
+ this.Typeout.push(["I"]);
+ this.MO.push(this.PortName[i]);
+ }
+ }
+
+ var mo = new modelica_function();
+ model.sim = new ScilabString([this.ModelName]);
+ mo.inputs = new ScilabString(...this.MI);
+ mo.outputs = new ScilabString(...this.MO);
+ model.rpar = this.PrametersValue;
+ mo.parameters = list(this.ParametersName, this.PrametersValue, new ScilabDouble(...zeros(getData(this.ParametersName))));
+ var exprs = new ScilabDouble();
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CVS\",sz(1),sz(2));"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+ mo.model = new ScilabString([this.ModelName]);
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1));
+ model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1));
+ this.x = new standard_define(new ScilabDouble([2.1, 3]), model, exprs, list(new ScilabString([gr_i]), new ScilabDouble([0])));
+ this.x.graphics.in_implicit = new ScilabDouble(this.Typein);
+ this.x.graphics.out_implicit = new ScilabDouble(this.Typeout);
+ return new BasicBlock(this.x);
+ }
+
+ CVS.prototype.details = function CVS() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/Capacitor.js b/data_structures_correct/Capacitor.js index eae92f9..60e0c1e 100644 --- a/data_structures_correct/Capacitor.js +++ b/data_structures_correct/Capacitor.js @@ -1,31 +1,31 @@ -function Capacitor() { - - Capacitor.prototype.define = function Capacitor() { - - var model = scicos_model(); - var C = 0.01, v = 0; - model.rpar = new ScilabDouble([C],[v]); - model.sim = new ScilabString(["Capacitor"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["Capacitor"]); - mo.inputs = new ScilabString(["p"]); - mo.outputs = new ScilabString(["n"]); - mo.parameters = list(new ScilabString(["C", "v"]), list(new ScilabDouble([C]), new ScilabDouble([v])), new ScilabDouble([0, 1])); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1)); - model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1)); - - var exprs = new ScilabString([C], [v]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Capacitor\",sz(1),sz(2));"]); - this.x = new standard_define(new ScilabDouble([2, 1.1]), model, exprs, list(gr_i, new ScilabDouble([0]))); - this.x.graphics.in_implicit = new ScilabString(["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - Capacitor.prototype.details = function Capacitor() { - return this.x; - } -} +function Capacitor() {
+
+ Capacitor.prototype.define = function Capacitor() {
+
+ var model = scicos_model();
+ var C = 0.01, v = 0;
+ model.rpar = new ScilabDouble([C],[v]);
+ model.sim = new ScilabString(["Capacitor"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["Capacitor"]);
+ mo.inputs = new ScilabString(["p"]);
+ mo.outputs = new ScilabString(["n"]);
+ mo.parameters = list(new ScilabString(["C", "v"]), list(new ScilabDouble([C]), new ScilabDouble([v])), new ScilabDouble([0, 1]));
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1));
+ model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1));
+
+ var exprs = new ScilabString([C], [v]);
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Capacitor\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 1.1]), model, exprs, list(gr_i, new ScilabDouble([0])));
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+ Capacitor.prototype.details = function Capacitor() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/ConstantVoltage.js b/data_structures_correct/ConstantVoltage.js index ec5fcd6..cb57690 100644 --- a/data_structures_correct/ConstantVoltage.js +++ b/data_structures_correct/ConstantVoltage.js @@ -1,32 +1,32 @@ -function ConstantVoltage() { - - ConstantVoltage.prototype.define = function ConstantVoltage() { - this.V = 0.01; - - var model = scicos_model(); - model.rpar = new ScilabDouble([this.V]); - model.in = new ScilabDouble([1]); - model.out = new ScilabDouble([1]); - model.sim = new ScilabString(["ConstantVoltage"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([false, false]); - - var mo = modelica(); - mo.model = new ScilabString(["ConstantVoltage"]); - mo.inputs = new ScilabString(["p"]); - mo.outputs = new ScilabString(["n"]); - mo.parameters = list(new ScilabString(["V"]), list(new ScilabDouble([this.V]))); - model.equations = mo; - - var exprs = new ScilabString([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], model, exprs, list(gr_i, new ScilabDouble([0]))); - this.x.graphics.in_implicit = new ScilabString(["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - ConstantVoltage.prototype.details = function ConstantVoltage() { - return this.x; - } -} +function ConstantVoltage() {
+
+ ConstantVoltage.prototype.define = function ConstantVoltage() {
+ this.V = 0.01;
+
+ var model = scicos_model();
+ model.rpar = new ScilabDouble([this.V]);
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble([1]);
+ model.sim = new ScilabString(["ConstantVoltage"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["ConstantVoltage"]);
+ mo.inputs = new ScilabString(["p"]);
+ mo.outputs = new ScilabString(["n"]);
+ mo.parameters = list(new ScilabString(["V"]), list(new ScilabDouble([this.V])));
+ model.equations = mo;
+
+ var exprs = new ScilabString([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], model, exprs, list(gr_i, new ScilabDouble([0])));
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+ ConstantVoltage.prototype.details = function ConstantVoltage() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/CurrentSensor.js b/data_structures_correct/CurrentSensor.js index 1841fe9..a94201c 100644 --- a/data_structures_correct/CurrentSensor.js +++ b/data_structures_correct/CurrentSensor.js @@ -1,29 +1,29 @@ -function CurrentSensor() { - - CurrentSensor.prototype.define = function CurrentSensor() { - var model = scicos_model(); - model.in = new ScilabDouble([1]); - model.out = new ScilabDouble([1], [1]); - model.sim = new ScilabString(["CurrentSensor"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["CurrentSensor"]); - mo.inputs = new ScilabString(["p"]); - mo.outputs = new ScilabString(["n"], ["i"]); - model.equations = mo; - - var exprs = new ScilabDouble(); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CurrentSensor\",sz(1),sz(2));"]); - this.x = standard_define(new ScilabDouble([2, 2]), model, exprs, list(gr_i, new ScilabDouble([0]))); - this.x.graphics.in_implicit = new ScilabString(["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"], ["E"]); - return new BasicBlock(this.x); - } - - CurrentSensor.prototype.details = function CurrentSensor() { - return this.x; - } -} +function CurrentSensor() {
+
+ CurrentSensor.prototype.define = function CurrentSensor() {
+ var model = scicos_model();
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble([1], [1]);
+ model.sim = new ScilabString(["CurrentSensor"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["CurrentSensor"]);
+ mo.inputs = new ScilabString(["p"]);
+ mo.outputs = new ScilabString(["n"], ["i"]);
+ model.equations = mo;
+
+ var exprs = new ScilabDouble();
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"CurrentSensor\",sz(1),sz(2));"]);
+ this.x = standard_define(new ScilabDouble([2, 2]), model, exprs, list(gr_i, new ScilabDouble([0])));
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"], ["E"]);
+ return new BasicBlock(this.x);
+ }
+
+ CurrentSensor.prototype.details = function CurrentSensor() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/Diode.js b/data_structures_correct/Diode.js index aab1eaf..90177bf 100644 --- a/data_structures_correct/Diode.js +++ b/data_structures_correct/Diode.js @@ -1,36 +1,36 @@ -function Diode() { - - Diode.prototype.define = function Diode() { - - this.Ids = 1.e-6; - this.Vt = 0.04; - this.Maxexp = 15; - this.R = 1.e8; - - var model = scicos_model(); - model.rpar = new ScilabDouble([this.Ids], [this.Vt], [this.Maxexp], [this.R]); - model.in = new ScilabDouble([1]); - model.out = new ScilabDouble([1]); - model.sim = new ScilabString(["Diode"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["Diode"]); - mo.inputs = new ScilabString(["p"]); - mo.outputs = new ScilabString(["n"]); - mo.parameters = list(new ScilabString(["Ids", "Vt", "Maxexp", "R"]), list(new ScilabDouble([this.Ids]), new ScilabDouble([this.Vt]), new ScilabDouble([this.Maxexp]), new ScilabDouble([this.R]))); - model.equations = mo; - - var exprs = new ScilabString([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(new ScilabDouble([2, 1]), model, exprs, list(gr_i, 0)); - this.x.graphics.in_implicit = new ScilabString(["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - Diode.prototype.details = function Diode() { - return this.x; - } -} +function Diode() {
+
+ Diode.prototype.define = function Diode() {
+
+ this.Ids = 1.e-6;
+ this.Vt = 0.04;
+ this.Maxexp = 15;
+ this.R = 1.e8;
+
+ var model = scicos_model();
+ model.rpar = new ScilabDouble([this.Ids], [this.Vt], [this.Maxexp], [this.R]);
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble([1]);
+ model.sim = new ScilabString(["Diode"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["Diode"]);
+ mo.inputs = new ScilabString(["p"]);
+ mo.outputs = new ScilabString(["n"]);
+ mo.parameters = list(new ScilabString(["Ids", "Vt", "Maxexp", "R"]), list(new ScilabDouble([this.Ids]), new ScilabDouble([this.Vt]), new ScilabDouble([this.Maxexp]), new ScilabDouble([this.R])));
+ model.equations = mo;
+
+ var exprs = new ScilabString([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(new ScilabDouble([2, 1]), model, exprs, list(gr_i, 0));
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+ Diode.prototype.details = function Diode() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/FROMMO.js b/data_structures_correct/FROMMO.js index e854ad0..a59a1ae 100644 --- a/data_structures_correct/FROMMO.js +++ b/data_structures_correct/FROMMO.js @@ -1,33 +1,33 @@ -function FROMMO() { - - FROMMO.prototype.define = function FROMMO() { - - var model = scicos_model(); - model.sim = new ScilabString(["frommo"]); - model.in = new ScilabDouble(); - model.in2 = new ScilabDouble(); - model.intyp = new ScilabDouble([1]); - model.out = new ScilabDouble([-1]); - model.out2 = new ScilabDouble([-2]); - model.outtyp = new ScilabDouble([-1]); - model.ipar = new ScilabDouble(); - model.opar = list(new ScilabString(["A"])); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([false, false]); - - var mo = modelica(); - mo.model = new ScilabString(["frommo"]); - mo.outputs = new ScilabString(["n"]); - - var exprs = new ScilabString(["A"]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"FROMMO\",sz(1),sz(2));"]); - this.x = new standard_define(new ScilabDouble([2, 1]), model, exprs, gr_i); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - FROMMO.prototype.details = function FROMMO() { - return this.x; - } -} - +function FROMMO() {
+
+ FROMMO.prototype.define = function FROMMO() {
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["frommo"]);
+ model.in = new ScilabDouble();
+ model.in2 = new ScilabDouble();
+ model.intyp = new ScilabDouble([1]);
+ model.out = new ScilabDouble([-1]);
+ model.out2 = new ScilabDouble([-2]);
+ model.outtyp = new ScilabDouble([-1]);
+ model.ipar = new ScilabDouble();
+ model.opar = list(new ScilabString(["A"]));
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["frommo"]);
+ mo.outputs = new ScilabString(["n"]);
+
+ var exprs = new ScilabString(["A"]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"FROMMO\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 1]), model, exprs, gr_i);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+ FROMMO.prototype.details = function FROMMO() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/Flowmeter.js b/data_structures_correct/Flowmeter.js index 4e5b7c9..a10f96b 100644 --- a/data_structures_correct/Flowmeter.js +++ b/data_structures_correct/Flowmeter.js @@ -1,61 +1,61 @@ -function Flowmeter() { - - Flowmeter.prototype.define = function Flowmeter() { - this.ModelName = "Flowmeter"; - this.PrametersValue = 1; - this.ParametersName = "Qini"; - - var model = scicos_model(); - - this.Typein = []; - this.Typeout = []; - - this.MI = []; - this.MO = []; - this.P = [[50,105,-1,90],[0,10,2,0],[101,10,-2,0]]; - this.PortName = [["Mesure"],["C1"],["C2"]]; - - for (var i = 0; i < size(this.P, "r"); i++) { - if (this.P[i][2] == 1) { - this.Typein.push(["E"]); - this.MI.push(this.PortName[i]); - } - - if (this.P[i][2] == 2) { - this.Typein.push(["I"]); - this.MI.push(this.PortName[i]); - } - if (this.P[i][2] == -1) { - this.Typeout.push(["E"]); - this.MO.push(this.PortName[i]); - } - if (this.P[i][2] == -2) { - this.Typeout.push(["I"]); - this.MO.push(this.PortName[i]); - } - } - - var mo = modelica(); - model.sim = new ScilabString([this.ModelName]); - mo.inputs = new ScilabString(...this.MI); - mo.outputs = new ScilabString(...this.MO); - model.rpar = new ScilabDouble([this.PrametersValue]); - mo.parameters = list(new ScilabString([this.ParametersName]), new ScilabDouble([this.PrametersValue]), new ScilabDouble(zeros([this.ParametersName]))); - var exprs = new ScilabString(["1"]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Flowmeter\",sz(1),sz(2));"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([false, true]); - mo.model = new ScilabString([this.ModelName]); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1)); - model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1)); - this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, list(new ScilabString([gr_i]), new ScilabDouble([0]))); - this.x.graphics.in_implicit = new ScilabDouble(this.Typein); - this.x.graphics.out_implicit = new ScilabDouble(this.Typeout); - return new BasicBlock(this.x); - } - - Flowmeter.prototype.details = function Flowmeter() { - return this.x; - } -} +function Flowmeter() {
+
+ Flowmeter.prototype.define = function Flowmeter() {
+ this.ModelName = "Flowmeter";
+ this.PrametersValue = 1;
+ this.ParametersName = "Qini";
+
+ var model = scicos_model();
+
+ this.Typein = [];
+ this.Typeout = [];
+
+ this.MI = [];
+ this.MO = [];
+ this.P = [[50,105,-1,90],[0,10,2,0],[101,10,-2,0]];
+ this.PortName = [["Mesure"],["C1"],["C2"]];
+
+ for (var i = 0; i < size(this.P, "r"); i++) {
+ if (this.P[i][2] == 1) {
+ this.Typein.push(["E"]);
+ this.MI.push(this.PortName[i]);
+ }
+
+ if (this.P[i][2] == 2) {
+ this.Typein.push(["I"]);
+ this.MI.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -1) {
+ this.Typeout.push(["E"]);
+ this.MO.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -2) {
+ this.Typeout.push(["I"]);
+ this.MO.push(this.PortName[i]);
+ }
+ }
+
+ var mo = new modelica_function();
+ model.sim = new ScilabString([this.ModelName]);
+ mo.inputs = new ScilabString(...this.MI);
+ mo.outputs = new ScilabString(...this.MO);
+ model.rpar = new ScilabDouble([this.PrametersValue]);
+ mo.parameters = list(new ScilabString([this.ParametersName]), new ScilabDouble([this.PrametersValue]), new ScilabDouble(zeros([this.ParametersName])));
+ var exprs = new ScilabString(["1"]);
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Flowmeter\",sz(1),sz(2));"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+ mo.model = new ScilabString([this.ModelName]);
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1));
+ model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1));
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, list(new ScilabString([gr_i]), new ScilabDouble([0])));
+ this.x.graphics.in_implicit = new ScilabDouble(this.Typein);
+ this.x.graphics.out_implicit = new ScilabDouble(this.Typeout);
+ return new BasicBlock(this.x);
+ }
+
+ Flowmeter.prototype.details = function Flowmeter() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/GOTOMO.js b/data_structures_correct/GOTOMO.js index 19361c9..6da9404 100644 --- a/data_structures_correct/GOTOMO.js +++ b/data_structures_correct/GOTOMO.js @@ -1,33 +1,33 @@ -function GOTOMO() { - - GOTOMO.prototype.define = function GOTOMO() { - - var model = scicos_model(); - model.sim = new ScilabString(["gotomo"]); - model.in = new ScilabDouble([-1]); - model.in2 = new ScilabDouble([-2]); - model.intyp = new ScilabDouble(); - model.out = new ScilabDouble(); - model.out2 = new ScilabDouble(); - model.outtyp = new ScilabDouble([1]); - model.ipar = new ScilabDouble([1]); - model.opar = list(new ScilabString(["A"])); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([false, false]); - - var mo = modelica(); - mo.model = new ScilabString(["gotomo"]); - mo.inputs = new ScilabString(["p"]); - - var exprs = new ScilabString(["A"], [sci2exp(1)]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GOTOMO\",sz(1),sz(2));"]); - this.x = new standard_define(new ScilabDouble([2, 1]), model, exprs, gr_i); - this.x.graphics.in_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - GOTOMO.prototype.details = function GOTOMO() { - return this.x; - } -} - +function GOTOMO() {
+
+ GOTOMO.prototype.define = function GOTOMO() {
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["gotomo"]);
+ model.in = new ScilabDouble([-1]);
+ model.in2 = new ScilabDouble([-2]);
+ model.intyp = new ScilabDouble();
+ model.out = new ScilabDouble();
+ model.out2 = new ScilabDouble();
+ model.outtyp = new ScilabDouble([1]);
+ model.ipar = new ScilabDouble([1]);
+ model.opar = list(new ScilabString(["A"]));
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["gotomo"]);
+ mo.inputs = new ScilabString(["p"]);
+
+ var exprs = new ScilabString(["A"], [sci2exp(1)]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"GOTOMO\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 1]), model, exprs, gr_i);
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+ GOTOMO.prototype.details = function GOTOMO() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/Ground.js b/data_structures_correct/Ground.js index 9ebe910..ba365af 100644 --- a/data_structures_correct/Ground.js +++ b/data_structures_correct/Ground.js @@ -1,30 +1,30 @@ -function Ground() { - - Ground.prototype.define = function Ground() { - - var model = scicos_model(); - model.in = new ScilabDouble([1]); - model.out = new ScilabDouble(); - model.sim = new ScilabString(["Ground"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["Ground"]); - mo.inputs = new ScilabString(["p"]); - mo.outputs = new ScilabDouble(); - model.equations = mo; - - var exprs = new ScilabString([""]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Ground\",sz(1),sz(2));"]); - this.x = standard_define(new ScilabDouble([1, 1]), model, exprs, list(gr_i, new ScilabDouble([0]))); - this.x.graphics.in_implicit = new ScilabString(["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new GroundBlock(this.x); - } - - Ground.prototype.details = function Ground() { - return this.x; - } -} +function Ground() {
+
+ Ground.prototype.define = function Ground() {
+
+ var model = scicos_model();
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble();
+ model.sim = new ScilabString(["Ground"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["Ground"]);
+ mo.inputs = new ScilabString(["p"]);
+ mo.outputs = new ScilabDouble();
+ model.equations = mo;
+
+ var exprs = new ScilabString([""]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Ground\",sz(1),sz(2));"]);
+ this.x = standard_define(new ScilabDouble([1, 1]), model, exprs, list(gr_i, new ScilabDouble([0])));
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new GroundBlock(this.x);
+ }
+
+ Ground.prototype.details = function Ground() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/Gyrator.js b/data_structures_correct/Gyrator.js index 3c716af..569d29f 100644 --- a/data_structures_correct/Gyrator.js +++ b/data_structures_correct/Gyrator.js @@ -1,57 +1,57 @@ -function Gyrator() { - - Gyrator.prototype.define = function Gyrator() { - this.ModelName = "Gyrator"; - this.PrametersValue = [[1],[1]]; - this.ParametersName = [["G1"],["G2"]]; - this.model = scicos_model(); - this.Typein = []; - this.Typeout = []; - this.MI = []; - this.MO = []; - this.P = [[2.5, 90, 2, 0],[2.5, 10, 2, 0],[97.5, 90, -2, 0],[97.5, 10, -2, 0]]; - this.PortName = [["p1"],["n1"],["p2"],["n2"]]; - - for (var i = 0; i < size(this.P, "r"); i++) { - if (this.P[i][2] == 1) { - this.Typein.push(["E"]); - this.MI.push(this.PortName[i]); - } - if (this.P[i][2] == 2) { - this.Typein.push(["I"]); - this.MI.push(this.PortName[i]); - } - if (this.P[i][2] == -1) { - this.Typeout.push(["E"]); - this.MO.push(this.PortName[i]); - } - if (this.P[i][2] == -2) { - this.Typeout.push(["I"]); - this.MO.push(this.PortName[i]); - } - } - var model = scicos_model(); - var mo = modelica(); - model.sim = new ScilabString([this.ModelName]); - mo.inputs = new ScilabString(...this.MI); - mo.outputs = new ScilabString(...this.MO); - console.log(this.MI); - model.rpar = new ScilabDouble(...this.PrametersValue); - mo.parameters = list(new ScilabString(...this.ParametersName), new ScilabDouble(...this.PrametersValue), new ScilabDouble(...zeros(this.ParametersName))); - var exprs = new ScilabString(["1"], ["1"]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"Gyrator",sz(1),sz(2));"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([false, true]); - mo.model = new ScilabString([this.ModelName]); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1)); - model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1)); - this.x = standard_define([2, 2], model, exprs, list(gr_i, new ScilabDouble([0]))); - this.x.graphics.in_implicit = new ScilabString(...this.Typein); - this.x.graphics.out_implicit = new ScilabString(...this.Typeout); - return new BasicBlock(this.x); - } - Gyrator.prototype.details = function Gyrator() { - return this.x; - } -} +function Gyrator() {
+
+ Gyrator.prototype.define = function Gyrator() {
+ this.ModelName = "Gyrator";
+ this.PrametersValue = [[1],[1]];
+ this.ParametersName = [["G1"],["G2"]];
+ this.model = scicos_model();
+ this.Typein = [];
+ this.Typeout = [];
+ this.MI = [];
+ this.MO = [];
+ this.P = [[2.5, 90, 2, 0],[2.5, 10, 2, 0],[97.5, 90, -2, 0],[97.5, 10, -2, 0]];
+ this.PortName = [["p1"],["n1"],["p2"],["n2"]];
+
+ for (var i = 0; i < size(this.P, "r"); i++) {
+ if (this.P[i][2] == 1) {
+ this.Typein.push(["E"]);
+ this.MI.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == 2) {
+ this.Typein.push(["I"]);
+ this.MI.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -1) {
+ this.Typeout.push(["E"]);
+ this.MO.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -2) {
+ this.Typeout.push(["I"]);
+ this.MO.push(this.PortName[i]);
+ }
+ }
+ var model = scicos_model();
+ var mo = new modelica_function();
+ model.sim = new ScilabString([this.ModelName]);
+ mo.inputs = new ScilabString(...this.MI);
+ mo.outputs = new ScilabString(...this.MO);
+ console.log(this.MI);
+ model.rpar = new ScilabDouble(...this.PrametersValue);
+ mo.parameters = list(new ScilabString(...this.ParametersName), new ScilabDouble(...this.PrametersValue), new ScilabDouble(...zeros(this.ParametersName)));
+ var exprs = new ScilabString(["1"], ["1"]);
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"Gyrator",sz(1),sz(2));"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+ mo.model = new ScilabString([this.ModelName]);
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1));
+ model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1));
+ this.x = standard_define([2, 2], model, exprs, list(gr_i, new ScilabDouble([0])));
+ this.x.graphics.in_implicit = new ScilabString(...this.Typein);
+ this.x.graphics.out_implicit = new ScilabString(...this.Typeout);
+ return new BasicBlock(this.x);
+ }
+ Gyrator.prototype.details = function Gyrator() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/INIMPL_f.js b/data_structures_correct/INIMPL_f.js index 4b35d43..68555d7 100644 --- a/data_structures_correct/INIMPL_f.js +++ b/data_structures_correct/INIMPL_f.js @@ -1,28 +1,28 @@ -function INIMPL_f() { - - INIMPL_f.prototype.define = function INIMPL_f() { - var model = scicos_model(); - model.sim = new ScilabString(["inimpl"]); - model.out = new ScilabDouble([-1]); - model.out2 = new ScilabDouble([1]); - model.ipar = new ScilabDouble([1]); - model.dep_ut = new ScilabBoolean([false, false]); - model.blocktype = new ScilabString(["c"]); - - var mo = modelica(); - mo.model = new ScilabString(["PORT"]); - mo.outputs = new ScilabString(["n"]); - mo.inputs = new ScilabDouble(); - model.equations = mo; - - var exprs = new ScilabString(["1"]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"INIMPL_f",sz(1),sz(2));"]); - this.x = new standard_define(new ScilabDouble([1, 1]), model, exprs, gr_i); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new ImplicitInBlock(this.x); - } - INIMPL_f.prototype.details = function INIMPL_f() { - return this.x; - } -} +function INIMPL_f() {
+
+ INIMPL_f.prototype.define = function INIMPL_f() {
+ var model = scicos_model();
+ model.sim = new ScilabString(["inimpl"]);
+ model.out = new ScilabDouble([-1]);
+ model.out2 = new ScilabDouble([1]);
+ model.ipar = new ScilabDouble([1]);
+ model.dep_ut = new ScilabBoolean([false, false]);
+ model.blocktype = new ScilabString(["c"]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["PORT"]);
+ mo.outputs = new ScilabString(["n"]);
+ mo.inputs = new ScilabDouble();
+ model.equations = mo;
+
+ var exprs = new ScilabString(["1"]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"INIMPL_f",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([1, 1]), model, exprs, gr_i);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new ImplicitInBlock(this.x);
+ }
+ INIMPL_f.prototype.details = function INIMPL_f() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/IdealTransformer.js b/data_structures_correct/IdealTransformer.js index 4a8666f..d2a9fa5 100644 --- a/data_structures_correct/IdealTransformer.js +++ b/data_structures_correct/IdealTransformer.js @@ -1,60 +1,60 @@ -function IdealTransformer() { - - IdealTransformer.prototype.define = function IdealTransformer() { - this.ModelName = "IdealTransformer"; - this.PrametersValue = [1]; - this.ParametersName = ["N"]; - - var model = scicos_model(); - - this.Typein = []; - this.Typeout = []; - this.MI = []; - this.MO = []; - this.P = [[2.5,90,2,0],[2.5,10,2,0],[97.5,90,-2,0],[97.5,10,-2,0]]; - this.PortName = [["p1"],["n1"],["p2"],["n2"]]; - - for (var i = 0; i < size(this.P, "r"); i++) { - if (this.P[i][2] == 1) { - this.Typein.push(["E"]); - this.MI.push(this.PortName[i]); - } - - if (this.P[i][2] == 2) { - this.Typein.push(["I"]); - this.MI.push(this.PortName[i]); - } - if (this.P[i][2] == -1) { - this.Typeout.push(["E"]); - this.MO.push(this.PortName[i]); - } - if (this.P[i][2] == -2) { - this.Typeout.push(["I"]); - this.MO.push(this.PortName[i]); - } - } - var mo = modelica(); - model.sim = new ScilabString([this.ModelName]); - mo.inputs = new ScilabString(...this.MI); - mo.outputs = new ScilabString(...this.MO); - model.rpar = new ScilabDouble(this.PrametersValue); - mo.parameters = list(new ScilabString(this.ParametersName), new ScilabDouble(this.PrametersValue), new ScilabDouble(zeros(getData(this.ParametersName)))); - var exprs = new ScilabString(["1"]); - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IdealTransformer\",sz(1),sz(2));"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([false, true]); - mo.model = new ScilabString([this.ModelName]); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1)); - model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1)); - this.x = new standard_define(new ScilabDouble([2,2]), model, exprs, list(gr_i), new ScilabDouble([0])); - this.x.graphics.in_implicit = new ScilabDouble(this.Typein); - this.x.graphics.out_implicit = new ScilabDouble(this.Typeout); - return new BasicBlock(this.x); - } - - IdealTransformer.prototype.details = function IdealTransformer() { - return this.x; - } - -} +function IdealTransformer() {
+
+ IdealTransformer.prototype.define = function IdealTransformer() {
+ this.ModelName = "IdealTransformer";
+ this.PrametersValue = [1];
+ this.ParametersName = ["N"];
+
+ var model = scicos_model();
+
+ this.Typein = [];
+ this.Typeout = [];
+ this.MI = [];
+ this.MO = [];
+ this.P = [[2.5,90,2,0],[2.5,10,2,0],[97.5,90,-2,0],[97.5,10,-2,0]];
+ this.PortName = [["p1"],["n1"],["p2"],["n2"]];
+
+ for (var i = 0; i < size(this.P, "r"); i++) {
+ if (this.P[i][2] == 1) {
+ this.Typein.push(["E"]);
+ this.MI.push(this.PortName[i]);
+ }
+
+ if (this.P[i][2] == 2) {
+ this.Typein.push(["I"]);
+ this.MI.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -1) {
+ this.Typeout.push(["E"]);
+ this.MO.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -2) {
+ this.Typeout.push(["I"]);
+ this.MO.push(this.PortName[i]);
+ }
+ }
+ var mo = new modelica_function();
+ model.sim = new ScilabString([this.ModelName]);
+ mo.inputs = new ScilabString(...this.MI);
+ mo.outputs = new ScilabString(...this.MO);
+ model.rpar = new ScilabDouble(this.PrametersValue);
+ mo.parameters = list(new ScilabString(this.ParametersName), new ScilabDouble(this.PrametersValue), new ScilabDouble(zeros(getData(this.ParametersName))));
+ var exprs = new ScilabString(["1"]);
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"IdealTransformer\",sz(1),sz(2));"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+ mo.model = new ScilabString([this.ModelName]);
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1));
+ model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1));
+ this.x = new standard_define(new ScilabDouble([2,2]), model, exprs, list(gr_i), new ScilabDouble([0]));
+ this.x.graphics.in_implicit = new ScilabDouble(this.Typein);
+ this.x.graphics.out_implicit = new ScilabDouble(this.Typeout);
+ return new BasicBlock(this.x);
+ }
+
+ IdealTransformer.prototype.details = function IdealTransformer() {
+ return this.x;
+ }
+
+}
diff --git a/data_structures_correct/Inductor.js b/data_structures_correct/Inductor.js index 851a005..b64efe4 100644 --- a/data_structures_correct/Inductor.js +++ b/data_structures_correct/Inductor.js @@ -1,34 +1,34 @@ -function Inductor() { - - Inductor.prototype.define = function Inductor() { - this.L = 1.0E-5; - - var model = scicos_model(); - model.in = new ScilabDouble([1]); - model.out = new ScilabDouble([1]); - model.rpar = new ScilabDouble([this.L.toExponential(1)]); - model.sim = new ScilabString(["Inductor"]); - - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["Inductor"]); - mo.inputs = new ScilabString(["p"]); - mo.outputs = new ScilabString(["n"]); - mo.parameters = list(new ScilabString(["L"]), list(new ScilabDouble([this.L.toExponential(1)]))); - model.equations = mo; - - var exprs = new ScilabString([this.L]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Inductor\",sz(1),sz(2));"]); - this.x = standard_define([2, 0.9], model, exprs, list(gr_i, 0)); - this.x.graphics.in_implicit = new ScilabString(["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - Inductor.prototype.details = function Inductor() { - return this.x; - } -} - +function Inductor() {
+
+ Inductor.prototype.define = function Inductor() {
+ this.L = 1.0E-5;
+
+ var model = scicos_model();
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble([1]);
+ model.rpar = new ScilabDouble([this.L.toExponential(1)]);
+ model.sim = new ScilabString(["Inductor"]);
+
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["Inductor"]);
+ mo.inputs = new ScilabString(["p"]);
+ mo.outputs = new ScilabString(["n"]);
+ mo.parameters = list(new ScilabString(["L"]), list(new ScilabDouble([this.L.toExponential(1)])));
+ model.equations = mo;
+
+ var exprs = new ScilabString([this.L]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Inductor\",sz(1),sz(2));"]);
+ this.x = standard_define([2, 0.9], model, exprs, list(gr_i, 0));
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+ Inductor.prototype.details = function Inductor() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/MBLOCK.js b/data_structures_correct/MBLOCK.js index e2b6725..59f8f59 100644 --- a/data_structures_correct/MBLOCK.js +++ b/data_structures_correct/MBLOCK.js @@ -1,45 +1,45 @@ -function MBLOCK() { - - MBLOCK.prototype.define = function MBLOCK() { - this.in1 = ["u1"]; - this.intype = ["I"]; - this.out = [["y1"],["y2"]]; - this.outtype = [["I"],["E"]]; - this.param = [["R"],["L"]]; - this.paramv = list(new ScilabDouble([0.1]), new ScilabDouble([0.0001])); - this.pprop = [[0],[0]]; - this.nameF = "generic"; - - var exprs = tlist(["MBLOCK", "in", "intype", "out", "outtype", "param", "paramv", "pprop", "nameF", "funtxt"], new ScilabString(["MBLOCK", "in", "intype", "out", "outtype", "param", "paramv", "pprop", "nameF", "funtxt"]), new ScilabString([sci2exp(this.in1)]), new ScilabString([sci2exp(this.intype)]), new ScilabString([sci2exp(this.out)]), new ScilabString([sci2exp(this.outtype)]), new ScilabString([sci2exp(this.param)]), list(new ScilabString([0.1]), new ScilabString([0.0001])), new ScilabString([sci2exp(this.pprop)]), new ScilabString([this.nameF]), new ScilabDouble()); - - var model = scicos_model(); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([false, true]); - model.rpar = []; - - for (var i = 0; i < this.paramv.length; i++) { - model.rpar.push(getData(this.paramv[i])); - } - - model.rpar = new ScilabDouble(...model.rpar); - var mo = modelica(); - mo.model = new ScilabString([this.nameF]); - mo.parameters = list(new ScilabString(...this.param), this.paramv); - model.sim = list(mo.model, new ScilabDouble([30004])); - mo.inputs = new ScilabString(this.in1); - mo.outputs = new ScilabString(...this.out); - model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "r"), 1)); - model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "r"), 1)); - model.equations = mo; - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MBLOCK\",sz(1),sz(2));"]); - - this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); - this.x.graphics.in_implicit = new ScilabString(this.intype); - this.x.graphics.out_implicit = new ScilabString(...this.outtype); - return new BasicBlock(this.x); - } - - MBLOCK.prototype.details = function MBLOCK() { - return this.x; - } -} +function MBLOCK() {
+
+ MBLOCK.prototype.define = function MBLOCK() {
+ this.in1 = ["u1"];
+ this.intype = ["I"];
+ this.out = [["y1"],["y2"]];
+ this.outtype = [["I"],["E"]];
+ this.param = [["R"],["L"]];
+ this.paramv = list(new ScilabDouble([0.1]), new ScilabDouble([0.0001]));
+ this.pprop = [[0],[0]];
+ this.nameF = "generic";
+
+ var exprs = tlist(["MBLOCK", "in", "intype", "out", "outtype", "param", "paramv", "pprop", "nameF", "funtxt"], new ScilabString(["MBLOCK", "in", "intype", "out", "outtype", "param", "paramv", "pprop", "nameF", "funtxt"]), new ScilabString([sci2exp(this.in1)]), new ScilabString([sci2exp(this.intype)]), new ScilabString([sci2exp(this.out)]), new ScilabString([sci2exp(this.outtype)]), new ScilabString([sci2exp(this.param)]), list(new ScilabString([0.1]), new ScilabString([0.0001])), new ScilabString([sci2exp(this.pprop)]), new ScilabString([this.nameF]), new ScilabDouble());
+
+ var model = scicos_model();
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+ model.rpar = [];
+
+ for (var i = 0; i < this.paramv.length; i++) {
+ model.rpar.push(getData(this.paramv[i]));
+ }
+
+ model.rpar = new ScilabDouble(...model.rpar);
+ var mo = new modelica_function();
+ mo.model = new ScilabString([this.nameF]);
+ mo.parameters = list(new ScilabString(...this.param), this.paramv);
+ model.sim = list(mo.model, new ScilabDouble([30004]));
+ mo.inputs = new ScilabString(this.in1);
+ mo.outputs = new ScilabString(...this.out);
+ model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "r"), 1));
+ model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "r"), 1));
+ model.equations = mo;
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MBLOCK\",sz(1),sz(2));"]);
+
+ this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i);
+ this.x.graphics.in_implicit = new ScilabString(this.intype);
+ this.x.graphics.out_implicit = new ScilabString(...this.outtype);
+ return new BasicBlock(this.x);
+ }
+
+ MBLOCK.prototype.details = function MBLOCK() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/NMOS.js b/data_structures_correct/NMOS.js index feac070..a03a9f1 100644 --- a/data_structures_correct/NMOS.js +++ b/data_structures_correct/NMOS.js @@ -1,40 +1,40 @@ -function NMOS() { - - NMOS.prototype.define = function NMOS() { - this.W = 20.e-6; - this.L = 6.e-6; - this.Beta = 0.041e-3; - this.Vt = 0.8; - this.K2 = 1.144; - this.K5 = 0.7311; - this.dW = -2.5e-6; - this.dL = -1.5e-6; - this.RDS = 1.e+7; - - var model = scicos_model(); - model.sim = new ScilabString(["NMOS"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["NMOS"]); - mo.outputs = new ScilabString(["D"], ["B"], ["S"]); - mo.inputs = new ScilabString(["G"]); - mo.parameters = list(new ScilabString(["W"], ["L"], ["Beta"], ["Vt"], ["K2"], ["K5"], ["dW"], ["dL"], ["RDS"]), new ScilabDouble([this.W], [this.L], [this.Beta], [this.Vt], [this.K2], [this.K5], [this.dW], [this.dL], [this.RDS])); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1)); - model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1)); - - var exprs = new ScilabString([this.W], [this.L], [this.Beta], [this.Vt], [this.K2], [this.K5], [this.dW], [this.dL], [this.RDS]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"NMOS\",sz(1),sz(2));"]); - this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); - this.x.graphics.in_implicit = new ScilabString(["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"], ["I"], ["I"]); - return new BasicBlock(this.x); - } - NMOS.prototype.details = function NMOS() { - return this.x; - } -} - +function NMOS() {
+
+ NMOS.prototype.define = function NMOS() {
+ this.W = 20.e-6;
+ this.L = 6.e-6;
+ this.Beta = 0.041e-3;
+ this.Vt = 0.8;
+ this.K2 = 1.144;
+ this.K5 = 0.7311;
+ this.dW = -2.5e-6;
+ this.dL = -1.5e-6;
+ this.RDS = 1.e+7;
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["NMOS"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["NMOS"]);
+ mo.outputs = new ScilabString(["D"], ["B"], ["S"]);
+ mo.inputs = new ScilabString(["G"]);
+ mo.parameters = list(new ScilabString(["W"], ["L"], ["Beta"], ["Vt"], ["K2"], ["K5"], ["dW"], ["dL"], ["RDS"]), new ScilabDouble([this.W], [this.L], [this.Beta], [this.Vt], [this.K2], [this.K5], [this.dW], [this.dL], [this.RDS]));
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1));
+ model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1));
+
+ var exprs = new ScilabString([this.W], [this.L], [this.Beta], [this.Vt], [this.K2], [this.K5], [this.dW], [this.dL], [this.RDS]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"NMOS\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i);
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"], ["I"], ["I"]);
+ return new BasicBlock(this.x);
+ }
+ NMOS.prototype.details = function NMOS() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/NPN.js b/data_structures_correct/NPN.js index f6f9c9d..f88489e 100644 --- a/data_structures_correct/NPN.js +++ b/data_structures_correct/NPN.js @@ -1,56 +1,56 @@ -function NPN() { - - NPN.prototype.define = function NPN() { - this.ModelName = "NPN"; - this.PrametersValue = [[50], [0.1], [0], [0.02], [1.200e-10], [5.000e-09], [1.000e-12], [4.000e-13], [5.000e-13], [0.8], [0.4], [0.8], [0.333], [1.000e-15], [1.000e-15], [0.02585], [40]]; - this.ParametersName = [["Bf"], ["Br"], ["Is"], ["Vak"], ["Tauf"], ["Taur"], ["Ccs"], ["Cje"], ["Cjc"], ["Phie"], ["Me"], ["Phic"], ["Mc"], ["Gbc"], ["Gbe"], ["Vt"], ["EMinMax"]]; - this.model = scicos_model(); - this.Typein = []; - this.Typeout = []; - this.MI = []; - this.MO = []; - this.P = [[100, 90, -2, 0], [0, 50, 2, 0], [100, 10, -2, 0]]; - this.PortName = [["C"], ["B"], ["E"]]; - - for (var i = 0; i < size(this.P, "r"); i++) { - if (this.P[i][2] == 1) { - this.Typein.push(["E"]); - this.MI.push(this.PortName[i]); - } - if (this.P[i][2] == 2) { - this.Typein.push(["I"]); - this.MI.push(this.PortName[i]); - } - if (this.P[i][2] == -1) { - this.Typeout.push(["E"]); - this.MO.push(this.PortName[i]); - } - if (this.P[i][2] == -2) { - this.Typeout.push(["I"]); - this.MO.push(this.PortName[i]); - } - } - var model = scicos_model(); - var mo = modelica(); - model.sim = new ScilabString([this.ModelName]); - mo.inputs = new ScilabString(...this.MI); - mo.outputs = new ScilabString(...this.MO); - model.rpar = new ScilabDouble(...this.PrametersValue); - mo.parameters = list(new ScilabString(...this.ParametersName), new ScilabDouble(...this.PrametersValue), new ScilabDouble(...zeros(this.ParametersName))); - var exprs = new ScilabString(["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));"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([false, true]); - mo.model = new ScilabString([this.ModelName]); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1)); - model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1)); - this.x = standard_define([2, 2], model, exprs, list(gr_i, new ScilabDouble([0]))); - this.x.graphics.in_implicit = new ScilabString(...this.Typein); - this.x.graphics.out_implicit = new ScilabString(...this.Typeout); - return new BasicBlock(this.x); - } - NPN.prototype.details = function NPN() { - return this.x; - } -} +function NPN() {
+
+ NPN.prototype.define = function NPN() {
+ this.ModelName = "NPN";
+ this.PrametersValue = [[50], [0.1], [0], [0.02], [1.200e-10], [5.000e-09], [1.000e-12], [4.000e-13], [5.000e-13], [0.8], [0.4], [0.8], [0.333], [1.000e-15], [1.000e-15], [0.02585], [40]];
+ this.ParametersName = [["Bf"], ["Br"], ["Is"], ["Vak"], ["Tauf"], ["Taur"], ["Ccs"], ["Cje"], ["Cjc"], ["Phie"], ["Me"], ["Phic"], ["Mc"], ["Gbc"], ["Gbe"], ["Vt"], ["EMinMax"]];
+ this.model = scicos_model();
+ this.Typein = [];
+ this.Typeout = [];
+ this.MI = [];
+ this.MO = [];
+ this.P = [[100, 90, -2, 0], [0, 50, 2, 0], [100, 10, -2, 0]];
+ this.PortName = [["C"], ["B"], ["E"]];
+
+ for (var i = 0; i < size(this.P, "r"); i++) {
+ if (this.P[i][2] == 1) {
+ this.Typein.push(["E"]);
+ this.MI.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == 2) {
+ this.Typein.push(["I"]);
+ this.MI.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -1) {
+ this.Typeout.push(["E"]);
+ this.MO.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -2) {
+ this.Typeout.push(["I"]);
+ this.MO.push(this.PortName[i]);
+ }
+ }
+ var model = scicos_model();
+ var mo = new modelica_function();
+ model.sim = new ScilabString([this.ModelName]);
+ mo.inputs = new ScilabString(...this.MI);
+ mo.outputs = new ScilabString(...this.MO);
+ model.rpar = new ScilabDouble(...this.PrametersValue);
+ mo.parameters = list(new ScilabString(...this.ParametersName), new ScilabDouble(...this.PrametersValue), new ScilabDouble(...zeros(this.ParametersName)));
+ var exprs = new ScilabString(["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));"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+ mo.model = new ScilabString([this.ModelName]);
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1));
+ model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1));
+ this.x = standard_define([2, 2], model, exprs, list(gr_i, new ScilabDouble([0])));
+ this.x.graphics.in_implicit = new ScilabString(...this.Typein);
+ this.x.graphics.out_implicit = new ScilabString(...this.Typeout);
+ return new BasicBlock(this.x);
+ }
+ NPN.prototype.details = function NPN() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/OUTIMPL_f.js b/data_structures_correct/OUTIMPL_f.js index c5846e7..25207b3 100644 --- a/data_structures_correct/OUTIMPL_f.js +++ b/data_structures_correct/OUTIMPL_f.js @@ -1,30 +1,30 @@ -function OUTIMPL_f() { - - OUTIMPL_f.prototype.define = function OUTIMPL_f() { - var model = scicos_model(); - model.in = new ScilabDouble([-1]); - model.in2 = new ScilabDouble([1]); - - this.prt = 1; - model.sim = new ScilabString(["outimpl"]); - model.ipar = new ScilabDouble([1]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([false, false]); - - var mo = modelica(); - mo.model = new ScilabString(["PORT"]); - mo.inputs = new ScilabString(["n"]); - mo.outputs = new ScilabDouble(); - model.equations = mo; - - var exprs = new ScilabString(["1"]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"OUTIMPL_f",sz(1),sz(2));"]); - this.x = new standard_define(new ScilabDouble([1, 1]), model, exprs, gr_i); - this.x.graphics.in_implicit = new ScilabString(["I"]); - return new ImplicitOutBlock(this.x); - } - OUTIMPL_f.prototype.details = function OUTIMPL_f() { - return this.x; - } -} +function OUTIMPL_f() {
+
+ OUTIMPL_f.prototype.define = function OUTIMPL_f() {
+ var model = scicos_model();
+ model.in = new ScilabDouble([-1]);
+ model.in2 = new ScilabDouble([1]);
+
+ this.prt = 1;
+ model.sim = new ScilabString(["outimpl"]);
+ model.ipar = new ScilabDouble([1]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["PORT"]);
+ mo.inputs = new ScilabString(["n"]);
+ mo.outputs = new ScilabDouble();
+ model.equations = mo;
+
+ var exprs = new ScilabString(["1"]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),"OUTIMPL_f",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([1, 1]), model, exprs, gr_i);
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ return new ImplicitOutBlock(this.x);
+ }
+ OUTIMPL_f.prototype.details = function OUTIMPL_f() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/OpAmp.js b/data_structures_correct/OpAmp.js index 055bdde..f347cfb 100644 --- a/data_structures_correct/OpAmp.js +++ b/data_structures_correct/OpAmp.js @@ -1,34 +1,34 @@ -function OpAmp() { - - OpAmp.prototype.define = function OpAmp() { - this.S = []; - this.Z = []; - - var model = scicos_model(); - model.sim = new ScilabString(["OpAmp"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = model.sim; - mo.inputs = new ScilabString(["in_p"], ["in_n"]); - mo.outputs = new ScilabString(["out"]); - mo.parameters = list(new ScilabDouble(), new ScilabDouble()); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1)); - model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1)); - model.rpar = new ScilabDouble(); - - var exprs = new ScilabString(); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"OpAmp\",sz(1),sz(2));"]); - this.x = new standard_define(new ScilabDouble([3, 5]), model, exprs, gr_i); - this.x.graphics.in_implicit = new ScilabString(["I"], ["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - OpAmp.prototype.details = function OpAmp() { - return this.x; - } -} - +function OpAmp() {
+
+ OpAmp.prototype.define = function OpAmp() {
+ this.S = [];
+ this.Z = [];
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["OpAmp"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = model.sim;
+ mo.inputs = new ScilabString(["in_p"], ["in_n"]);
+ mo.outputs = new ScilabString(["out"]);
+ mo.parameters = list(new ScilabDouble(), new ScilabDouble());
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1));
+ model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1));
+ model.rpar = new ScilabDouble();
+
+ var exprs = new ScilabString();
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"OpAmp\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([3, 5]), model, exprs, gr_i);
+ this.x.graphics.in_implicit = new ScilabString(["I"], ["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+ OpAmp.prototype.details = function OpAmp() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/PNP.js b/data_structures_correct/PNP.js index cb5843a..1c16f94 100644 --- a/data_structures_correct/PNP.js +++ b/data_structures_correct/PNP.js @@ -1,63 +1,63 @@ -function PNP() { - - PNP.prototype.define = function PNP() { - this.ModelName = "PNP"; - this.PrametersValue = [[50],[0.1],[0],[0.02],[1.200e-10],[5.000e-09],[1.000e-12],[4.000e-13],[5.000e-13],[0.8],[0.4],[0.8],[0.333],[1.000e-15],[1.000e-15],[0.02585],[40]]; - this.ParametersName = [["Bf"],["Br"],["Is"],["Vak"],["Tauf"],["Taur"],["Ccs"],["Cje"],["Cjc"],["Phie"],["Me"],["Phic"],["Mc"],["Gbc"],["Gbe"],["Vt"],["EMinMax"]]; - - var model = scicos_model(); - this.Typein = []; - this.Typeout = []; - this.MI = []; - this.MO = []; - this.P = [[100, 90, -2, 0], [0, 50, 2, 0], [100, 10, -2, 0]]; - this.PortName = [["C"], ["B"], ["E"]]; - - for (var i = 0; i < size(this.P, "r"); i++) { - if (this.P[i][2] == 1) { - this.Typein.push(["E"]); - this.MI.push(this.PortName[i]); - } - - if (this.P[i][2] == 2) { - this.Typein.push(["I"]); - this.MI.push(this.PortName[i]); - } - if (this.P[i][2] == -1) { - this.Typeout.push(["E"]); - this.MO.push(this.PortName[i]); - } - if (this.P[i][2] == -2) { - this.Typeout.push(["I"]); - this.MO.push(this.PortName[i]); - } - } - - var mo = modelica(); - model.sim = new ScilabString([this.ModelName]); - mo.inputs = new ScilabString(...this.MI); - mo.outputs = new ScilabString(...this.MO); - model.rpar = new ScilabDouble(...this.PrametersValue); - - var arr = []; - arr.push(zeros(getData(this.ParametersName))); - mo.parameters = list(new ScilabString(...this.ParametersName), new ScilabDouble(...this.PrametersValue), new ScilabDouble(...math.transpose(arr))); - var exprs = new ScilabString(["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 = "xstringb(orig(1),orig(2),\"PNP\",sz(1),sz(2));" - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([false, true]); - mo.model = new ScilabString([this.ModelName]); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1)); - model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1)); - this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, list(new ScilabString([gr_i]), new ScilabDouble([0]))); - this.x.graphics.in_implicit = new ScilabDouble(...this.Typein); - this.x.graphics.out_implicit = new ScilabDouble(...this.Typeout); - - return new BasicBlock(this.x); - } - - PNP.prototype.details = function PNP() { - return this.x; - } -} +function PNP() {
+
+ PNP.prototype.define = function PNP() {
+ this.ModelName = "PNP";
+ this.PrametersValue = [[50],[0.1],[0],[0.02],[1.200e-10],[5.000e-09],[1.000e-12],[4.000e-13],[5.000e-13],[0.8],[0.4],[0.8],[0.333],[1.000e-15],[1.000e-15],[0.02585],[40]];
+ this.ParametersName = [["Bf"],["Br"],["Is"],["Vak"],["Tauf"],["Taur"],["Ccs"],["Cje"],["Cjc"],["Phie"],["Me"],["Phic"],["Mc"],["Gbc"],["Gbe"],["Vt"],["EMinMax"]];
+
+ var model = scicos_model();
+ this.Typein = [];
+ this.Typeout = [];
+ this.MI = [];
+ this.MO = [];
+ this.P = [[100, 90, -2, 0], [0, 50, 2, 0], [100, 10, -2, 0]];
+ this.PortName = [["C"], ["B"], ["E"]];
+
+ for (var i = 0; i < size(this.P, "r"); i++) {
+ if (this.P[i][2] == 1) {
+ this.Typein.push(["E"]);
+ this.MI.push(this.PortName[i]);
+ }
+
+ if (this.P[i][2] == 2) {
+ this.Typein.push(["I"]);
+ this.MI.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -1) {
+ this.Typeout.push(["E"]);
+ this.MO.push(this.PortName[i]);
+ }
+ if (this.P[i][2] == -2) {
+ this.Typeout.push(["I"]);
+ this.MO.push(this.PortName[i]);
+ }
+ }
+
+ var mo = new modelica_function();
+ model.sim = new ScilabString([this.ModelName]);
+ mo.inputs = new ScilabString(...this.MI);
+ mo.outputs = new ScilabString(...this.MO);
+ model.rpar = new ScilabDouble(...this.PrametersValue);
+
+ var arr = [];
+ arr.push(zeros(getData(this.ParametersName)));
+ mo.parameters = list(new ScilabString(...this.ParametersName), new ScilabDouble(...this.PrametersValue), new ScilabDouble(...math.transpose(arr)));
+ var exprs = new ScilabString(["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 = "xstringb(orig(1),orig(2),\"PNP\",sz(1),sz(2));"
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+ mo.model = new ScilabString([this.ModelName]);
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(this.MI, "*"), 1));
+ model.out = new ScilabDouble(...ones(size(this.MO, "*"), 1));
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, list(new ScilabString([gr_i]), new ScilabDouble([0])));
+ this.x.graphics.in_implicit = new ScilabDouble(...this.Typein);
+ this.x.graphics.out_implicit = new ScilabDouble(...this.Typeout);
+
+ return new BasicBlock(this.x);
+ }
+
+ PNP.prototype.details = function PNP() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/PerteDP.js b/data_structures_correct/PerteDP.js index e5060b1..667c206 100644 --- a/data_structures_correct/PerteDP.js +++ b/data_structures_correct/PerteDP.js @@ -1,41 +1,41 @@ -function PerteDP() { - - PerteDP.prototype.define = function PerteDP() { - this.L = 10; - this.D = 0.2; - this.lambda = 0.03; - this.z1 = 0; - this.z2 = 0; - this.p_rho = 0; - - var model = scicos_model(); - model.in = new ScilabDouble([1]); - model.out = new ScilabDouble([1]); - model.rpar = new ScilabDouble([this.L], [this.D], [this.lambda], [this.z1], [this.z2], [this.p_rho]); - model.sim = new ScilabString(["PerteDP"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["PerteDP"]); - mo.inputs = new ScilabString(["C1"]); - mo.outputs = new ScilabString(["C2"]); - mo.parameters = list(new ScilabString(["L"], ["D"], ["lambda"], ["z1"], ["z2"], ["p_rho"]), new ScilabDouble([this.L], [this.D], [this.lambda], [this.z1], [this.z2], [this.p_rho])); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1)); - model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1)); - - var exprs = new ScilabString([this.L], [this.D], [this.lambda], [this.z1], [this.z2], [this.p_rho]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PerteDP\",sz(1),sz(2));"]); - this.x = standard_define([2, 1], model, exprs, list(gr_i, 0)); - this.x.graphics.in_implicit = new ScilabString(["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - PerteDP.prototype.details = function PerteDP() { - return this.x; - } - -} - +function PerteDP() {
+
+ PerteDP.prototype.define = function PerteDP() {
+ this.L = 10;
+ this.D = 0.2;
+ this.lambda = 0.03;
+ this.z1 = 0;
+ this.z2 = 0;
+ this.p_rho = 0;
+
+ var model = scicos_model();
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble([1]);
+ model.rpar = new ScilabDouble([this.L], [this.D], [this.lambda], [this.z1], [this.z2], [this.p_rho]);
+ model.sim = new ScilabString(["PerteDP"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["PerteDP"]);
+ mo.inputs = new ScilabString(["C1"]);
+ mo.outputs = new ScilabString(["C2"]);
+ mo.parameters = list(new ScilabString(["L"], ["D"], ["lambda"], ["z1"], ["z2"], ["p_rho"]), new ScilabDouble([this.L], [this.D], [this.lambda], [this.z1], [this.z2], [this.p_rho]));
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1));
+ model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1));
+
+ var exprs = new ScilabString([this.L], [this.D], [this.lambda], [this.z1], [this.z2], [this.p_rho]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PerteDP\",sz(1),sz(2));"]);
+ this.x = standard_define([2, 1], model, exprs, list(gr_i, 0));
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+ PerteDP.prototype.details = function PerteDP() {
+ return this.x;
+ }
+
+}
+
diff --git a/data_structures_correct/PotentialSensor.js b/data_structures_correct/PotentialSensor.js index fb2581b..c7114d5 100644 --- a/data_structures_correct/PotentialSensor.js +++ b/data_structures_correct/PotentialSensor.js @@ -1,31 +1,31 @@ -function PotentialSensor() { - - PotentialSensor.prototype.define = function PotentialSensor() { - - var model = scicos_model(); - model.in = new ScilabDouble([1]); - model.out = new ScilabDouble([1]); - model.rpar = new ScilabDouble(); - model.sim = new ScilabString(["PotentialSensor"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["PotentialSensor"]); - mo.inputs = new ScilabString(["p"]); - mo.outputs = new ScilabString(["v"]); - model.equations = mo; - - var exprs = new ScilabString([""]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PotentialSensor\",sz(1),sz(2));"]); - this.x = standard_define([2, 2], model, exprs, list(gr_i, 0)); - this.x.graphics.in_implicit = new ScilabString(["I"]); - this.x.graphics.out_implicit = new ScilabString(["E"]); - return new BasicBlock(this.x); - } - PotentialSensor.prototype.details = function PotentialSensor() { - return this.x; - } -} - +function PotentialSensor() {
+
+ PotentialSensor.prototype.define = function PotentialSensor() {
+
+ var model = scicos_model();
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble([1]);
+ model.rpar = new ScilabDouble();
+ model.sim = new ScilabString(["PotentialSensor"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["PotentialSensor"]);
+ mo.inputs = new ScilabString(["p"]);
+ mo.outputs = new ScilabString(["v"]);
+ model.equations = mo;
+
+ var exprs = new ScilabString([""]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PotentialSensor\",sz(1),sz(2));"]);
+ this.x = standard_define([2, 2], model, exprs, list(gr_i, 0));
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["E"]);
+ return new BasicBlock(this.x);
+ }
+ PotentialSensor.prototype.details = function PotentialSensor() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/PuitsP.js b/data_structures_correct/PuitsP.js index 4cffe74..6c5ff3e 100644 --- a/data_structures_correct/PuitsP.js +++ b/data_structures_correct/PuitsP.js @@ -1,34 +1,34 @@ -function PuitsP() { - - PuitsP.prototype.define = function PuitsP() { - this.P0 = 100000; - this.T0 = 290; - this.H0 = 100000; - this.option_temperature = 1; - - var model = scicos_model(); - model.rpar = new ScilabDouble([this.P0], [this.T0], [this.H0], [this.option_temperature]); - model.sim = new ScilabString(["Puits"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["Puits"]); - mo.inputs = new ScilabString(["C"]); - mo.outputs = new ScilabDouble(); - mo.parameters = list(new ScilabString(["P0"], ["T0"], ["H0"], ["option_temperature"]), new ScilabDouble([this.P0], [this.T0], [this.H0], [this.option_temperature])); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1)); - - var exprs = new ScilabString([this.P0], [this.T0], [this.H0], [this.option_temperature]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PuitsP\",sz(1),sz(2));"]); - this.x = standard_define([2.5, 2], model, exprs, list(gr_i, new ScilabDouble(0))); - this.x.graphics.in_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - PuitsP.prototype.details = function PuitsP() { - return this.x; - } -} - +function PuitsP() {
+
+ PuitsP.prototype.define = function PuitsP() {
+ this.P0 = 100000;
+ this.T0 = 290;
+ this.H0 = 100000;
+ this.option_temperature = 1;
+
+ var model = scicos_model();
+ model.rpar = new ScilabDouble([this.P0], [this.T0], [this.H0], [this.option_temperature]);
+ model.sim = new ScilabString(["Puits"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["Puits"]);
+ mo.inputs = new ScilabString(["C"]);
+ mo.outputs = new ScilabDouble();
+ mo.parameters = list(new ScilabString(["P0"], ["T0"], ["H0"], ["option_temperature"]), new ScilabDouble([this.P0], [this.T0], [this.H0], [this.option_temperature]));
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1));
+
+ var exprs = new ScilabString([this.P0], [this.T0], [this.H0], [this.option_temperature]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PuitsP\",sz(1),sz(2));"]);
+ this.x = standard_define([2.5, 2], model, exprs, list(gr_i, new ScilabDouble(0)));
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+ PuitsP.prototype.details = function PuitsP() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/Resistor.js b/data_structures_correct/Resistor.js index c8ca7f4..1ef43d6 100644 --- a/data_structures_correct/Resistor.js +++ b/data_structures_correct/Resistor.js @@ -1,33 +1,33 @@ -function Resistor() { - - Resistor.prototype.define = function Resistor() { - this.R = 0.01; - - var model = scicos_model(); - model.rpar = new ScilabDouble([this.R]); - model.sim = new ScilabString(["resistor"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["Resistor"]); - mo.inputs = new ScilabString(["p"]); - mo.outputs = new ScilabString(["n"]); - mo.parameters = list(new ScilabString(["R"]), list(new ScilabDouble([this.R]))); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1)); - model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1)); - - var exprs = new ScilabString([this.R]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Resistor\",sz(1),sz(2));"]); - this.x = standard_define([2, 1], model, exprs, list(gr_i, 0)); - this.x.graphics.in_implicit = new ScilabString(["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - Resistor.prototype.details = function Resistor() { - return this.x; - } -} - +function Resistor() {
+
+ Resistor.prototype.define = function Resistor() {
+ this.R = 0.01;
+
+ var model = scicos_model();
+ model.rpar = new ScilabDouble([this.R]);
+ model.sim = new ScilabString(["resistor"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["Resistor"]);
+ mo.inputs = new ScilabString(["p"]);
+ mo.outputs = new ScilabString(["n"]);
+ mo.parameters = list(new ScilabString(["R"]), list(new ScilabDouble([this.R])));
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1));
+ model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1));
+
+ var exprs = new ScilabString([this.R]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Resistor\",sz(1),sz(2));"]);
+ this.x = standard_define([2, 1], model, exprs, list(gr_i, 0));
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+ Resistor.prototype.details = function Resistor() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/SineVoltage.js b/data_structures_correct/SineVoltage.js index e2bd1e4..f6c580d 100644 --- a/data_structures_correct/SineVoltage.js +++ b/data_structures_correct/SineVoltage.js @@ -1,38 +1,38 @@ -function SineVoltage() { - - SineVoltage.prototype.define = function SineVoltage() { - var model = scicos_model(); - model.in = new ScilabDouble([1]); - model.out = new ScilabDouble([1]); - - this.V = 1; - this.ph = 0; - this.frq = 1; - this.offset = 0; - this.start = 0; - - model.rpar = new ScilabDouble([this.V], [this.ph], [this.frq], [this.offset], [this.start]); - model.sim = new ScilabString(["SineVoltage"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["SineVoltage"]); - mo.inputs = new ScilabString(["p"]); - mo.outputs = new ScilabString(["n"]); - mo.parameters = list(new ScilabString(["V"], ["phase"], ["freqHz"], ["offset"], ["startTime"]), list(new ScilabDouble([this.V]), new ScilabDouble([this.ph]), new ScilabDouble([this.frq]), new ScilabDouble([this.offset]), new ScilabDouble([this.start]))); - model.equations = mo; - - var exprs = new ScilabString([this.V], [this.ph], [this.frq], [this.offset], [this.start]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SineVoltage\",sz(1),sz(2));"]); - this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); - this.x.graphics.in_implicit = new ScilabString(["I"]); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - - SineVoltage.prototype.details = function SineVoltage() { - return this.x; - } -} +function SineVoltage() {
+
+ SineVoltage.prototype.define = function SineVoltage() {
+ var model = scicos_model();
+ model.in = new ScilabDouble([1]);
+ model.out = new ScilabDouble([1]);
+
+ this.V = 1;
+ this.ph = 0;
+ this.frq = 1;
+ this.offset = 0;
+ this.start = 0;
+
+ model.rpar = new ScilabDouble([this.V], [this.ph], [this.frq], [this.offset], [this.start]);
+ model.sim = new ScilabString(["SineVoltage"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["SineVoltage"]);
+ mo.inputs = new ScilabString(["p"]);
+ mo.outputs = new ScilabString(["n"]);
+ mo.parameters = list(new ScilabString(["V"], ["phase"], ["freqHz"], ["offset"], ["startTime"]), list(new ScilabDouble([this.V]), new ScilabDouble([this.ph]), new ScilabDouble([this.frq]), new ScilabDouble([this.offset]), new ScilabDouble([this.start])));
+ model.equations = mo;
+
+ var exprs = new ScilabString([this.V], [this.ph], [this.frq], [this.offset], [this.start]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SineVoltage\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i);
+ this.x.graphics.in_implicit = new ScilabString(["I"]);
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+
+ SineVoltage.prototype.details = function SineVoltage() {
+ return this.x;
+ }
+}
diff --git a/data_structures_correct/SourceP.js b/data_structures_correct/SourceP.js index 20b9e5a..08212bc 100644 --- a/data_structures_correct/SourceP.js +++ b/data_structures_correct/SourceP.js @@ -1,36 +1,36 @@ -function SourceP() { - - SourceP.prototype.define = function SourceP() { - var model = scicos_model(); - - this.P0 = 300000; - this.T0 = 290; - this.H0 = 100000; - this.option_temperature = 1; - - model.rpar = new ScilabDouble([this.P0], [this.T0], [this.H0], [this.option_temperature]); - model.sim = new ScilabString(["Source"]); - model.blocktype = new ScilabString(["c"]); - model.dep_ut = new ScilabBoolean([true, false]); - - var mo = modelica(); - mo.model = new ScilabString(["Source"]); - mo.inputs = new ScilabDouble(); - mo.outputs = new ScilabString(["C"]); - mo.parameters = list(new ScilabString(["P0"], ["T0"], ["H0"], ["option_temperature"]), new ScilabDouble([this.P0], [this.T0], [this.H0], [this.option_temperature])); - model.equations = mo; - model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1)); - model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1)); - - var exprs = new ScilabString([this.P0], [this.T0], [this.H0], [this.option_temperature]); - - var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SourceP\",sz(1),sz(2));"]); - this.x = new standard_define([2.5, 2], model, exprs, list(gr_i, new ScilabDouble([0]))); - this.x.graphics.out_implicit = new ScilabString(["I"]); - return new BasicBlock(this.x); - } - - SourceP.prototype.details = function SourceP() { - return this.x; - } -} +function SourceP() {
+
+ SourceP.prototype.define = function SourceP() {
+ var model = scicos_model();
+
+ this.P0 = 300000;
+ this.T0 = 290;
+ this.H0 = 100000;
+ this.option_temperature = 1;
+
+ model.rpar = new ScilabDouble([this.P0], [this.T0], [this.H0], [this.option_temperature]);
+ model.sim = new ScilabString(["Source"]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var mo = new modelica_function();
+ mo.model = new ScilabString(["Source"]);
+ mo.inputs = new ScilabDouble();
+ mo.outputs = new ScilabString(["C"]);
+ mo.parameters = list(new ScilabString(["P0"], ["T0"], ["H0"], ["option_temperature"]), new ScilabDouble([this.P0], [this.T0], [this.H0], [this.option_temperature]));
+ model.equations = mo;
+ model.in = new ScilabDouble(...ones(size(getData(mo.inputs), "*"), 1));
+ model.out = new ScilabDouble(...ones(size(getData(mo.outputs), "*"), 1));
+
+ var exprs = new ScilabString([this.P0], [this.T0], [this.H0], [this.option_temperature]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"SourceP\",sz(1),sz(2));"]);
+ this.x = new standard_define([2.5, 2], model, exprs, list(gr_i, new ScilabDouble([0])));
+ this.x.graphics.out_implicit = new ScilabString(["I"]);
+ return new BasicBlock(this.x);
+ }
+
+ SourceP.prototype.details = function SourceP() {
+ return this.x;
+ }
+}
|