diff options
Diffstat (limited to 'webapp/data_structures_correct/Bache.js')
-rw-r--r-- | webapp/data_structures_correct/Bache.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/webapp/data_structures_correct/Bache.js b/webapp/data_structures_correct/Bache.js new file mode 100644 index 0000000..a4ecf43 --- /dev/null +++ b/webapp/data_structures_correct/Bache.js @@ -0,0 +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 = 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; + } +} |