summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhitya Kamakshidasan2016-07-05 11:39:44 +0530
committerGitHub2016-07-05 11:39:44 +0530
commitf52452598e4c3c15e3d78199c6912d1a2d9ab728 (patch)
tree3e0bd4d10700621f5d443fa2426a485e50b0b0aa
parentdc36ddca0ba67a86725bb584a33bcc59c12e6015 (diff)
parent6ce8f0da2ebd903c73505540796ad72ff2a27b15 (diff)
downloadxcos-on-web-f52452598e4c3c15e3d78199c6912d1a2d9ab728.tar.gz
xcos-on-web-f52452598e4c3c15e3d78199c6912d1a2d9ab728.tar.bz2
xcos-on-web-f52452598e4c3c15e3d78199c6912d1a2d9ab728.zip
Merge pull request #121 from Pooja-Mahadev-Soundalgekar/master
DS_NMOS
-rw-r--r--data_structures_correct/DEMUX_f.js27
-rw-r--r--data_structures_correct/NMOS.js40
-rw-r--r--data_structures_correct/NRMSOM_f.js24
-rw-r--r--data_structures_correct/OpAmp.js34
-rw-r--r--data_structures_correct/PDE.js24
-rw-r--r--data_structures_correct/POSTONEG_f.js24
-rw-r--r--data_structures_correct/PerteDP.js41
-rw-r--r--data_structures_correct/PotentialSensor.js31
8 files changed, 245 insertions, 0 deletions
diff --git a/data_structures_correct/DEMUX_f.js b/data_structures_correct/DEMUX_f.js
new file mode 100644
index 0000000..ed0f26c
--- /dev/null
+++ b/data_structures_correct/DEMUX_f.js
@@ -0,0 +1,27 @@
+function DEMUX_f() {
+
+ DEMUX_f.prototype.define = function DEMUX_f() {
+ this.out = 2;
+ var arr = [];
+ arr.push(math.range(-1, -this.out, -1, true)._data);
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["demux"]), new ScilabDouble([1]));
+ model.in = new ScilabDouble([0]);
+ model.out = new ScilabDouble(...math.transpose(arr));
+ model.ipar = new ScilabDouble([this.out]);
+ model.blocktype = new ScilabString(["c"]);
+ model.firing = new ScilabDouble();
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var exprs = new ScilabString([this.out]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"DEMUX_f\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([.5, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+ DEMUX_f.prototype.details = function DEMUX_f() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/NMOS.js b/data_structures_correct/NMOS.js
new file mode 100644
index 0000000..feac070
--- /dev/null
+++ b/data_structures_correct/NMOS.js
@@ -0,0 +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;
+ }
+}
+
diff --git a/data_structures_correct/NRMSOM_f.js b/data_structures_correct/NRMSOM_f.js
new file mode 100644
index 0000000..f80bb88
--- /dev/null
+++ b/data_structures_correct/NRMSOM_f.js
@@ -0,0 +1,24 @@
+function NRMSOM_f() {
+
+ NRMSOM_f.prototype.define = function NRMSOM_f() {
+ this.in1 = [[-1], [-1]];
+ this.nin = 2;
+
+ var model = scicos_model();
+ model.sim = new ScilabString(["junk"]);
+ model.in = new ScilabDouble(...this.in1);
+ model.out = new ScilabDouble([-1]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+
+ var exprs = new ScilabString([this.nin]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"NRMSOM_f\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([.2, 2]), model, exprs, gr_i);
+ return new BasicBlock(this.x);
+ }
+ NRMSOM_f.prototype.details = function NRMSOM_f() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/OpAmp.js b/data_structures_correct/OpAmp.js
new file mode 100644
index 0000000..055bdde
--- /dev/null
+++ b/data_structures_correct/OpAmp.js
@@ -0,0 +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;
+ }
+}
+
diff --git a/data_structures_correct/PDE.js b/data_structures_correct/PDE.js
new file mode 100644
index 0000000..2aa3a6d
--- /dev/null
+++ b/data_structures_correct/PDE.js
@@ -0,0 +1,24 @@
+function PDE() {
+
+ PDE.prototype.define = function PDE() {
+ this.params_pde = tlist(["paramspde", "a", "b", "txt_exp", "check_op1", "a1", "b1", "check_op2", "a2", "b2", "check_op3", "a3", "b3", "check_op4", "a4", "b4", "check_op5", "a5", "b5", "check_op6", "a6", "b6", "check_op7", "a7", "b7", "discr_cst", "discr_non_cst", "signe", "rad_automatique", "rad_manuel", "methode", "ord1", "ord2", "ord3", "degre", "nnode", "txt_pas", "CI", "dCI", "CLa", "CLa_exp", "CLb", "CLb_exp", "points"], new ScilabString(["paramspde"], ["a"], ["b"], ["txt_exp"], ["check_op1"], ["a1"], ["b1"], ["check_op2"], ["a2"], ["b2"], ["check_op3"], ["a3"], ["b3"], ["check_op4"], ["a4"], ["b4"], ["check_op5"], ["a5"], ["b5"], ["check_op6"], ["a6"], ["b6"], ["check_op7"], ["a7"], ["b7"], ["discr_cst"], ["discr_non_cst"], ["signe"], ["rad_automatique"], ["rad_manuel"], ["methode"], ["ord1"], ["ord2"], ["ord3"], ["degre"], ["nnode"], ["txt_pas"], ["CI"], ["dCI"], ["CLa"], ["CLa_exp"], ["CLb"], ["CLb_exp"], ["points"]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP1(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP2(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP3(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP4(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP5(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP6(t)"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString(["IN_EDP7(t)"]), new ScilabString(["0"]), new ScilabString(["0"]), new ScilabString(["0"]), new ScilabString(["0"]), new ScilabString(["0"]), new ScilabString(["0"]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString([""]), new ScilabString(["0"]), new ScilabString(["IN_CL1(t)"]), new ScilabString(["0"]), new ScilabString(["IN_CL2(t)"]), new ScilabString([""]));
+
+ var model = scicos_model();
+ model.state = new ScilabDouble(...zeros(10, 1));
+ model.sim = list(new ScilabString(["PDE"]), new ScilabDouble([0]));
+ model.in = new ScilabDouble([1], [1], [1], [1], [1]);
+ model.out = new ScilabDouble([10], [0]);
+ model.blocktype = new ScilabString(["c"]);
+ model.dep_ut = new ScilabBoolean([false, true]);
+
+ var label = list(this.params_pde, new ScilabDouble(), new ScilabString([""]));
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"PDE\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([3, 3]), model, label, gr_i);
+ return new BasicBlock(this.x);
+ }
+ PDE.prototype.details = function PDE() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/POSTONEG_f.js b/data_structures_correct/POSTONEG_f.js
new file mode 100644
index 0000000..97d9aa6
--- /dev/null
+++ b/data_structures_correct/POSTONEG_f.js
@@ -0,0 +1,24 @@
+function POSTONEG_f() {
+
+ POSTONEG_f.prototype.define = function POSTONEG_f() {
+ this.rpar = [[-1], [-1], [-1], [0]];
+
+ var model = scicos_model();
+ model.sim = list(new ScilabString(["zcross"]), new ScilabDouble([1]));
+ model.nzcross = new ScilabDouble([1]);
+ model.in = new ScilabDouble([1]);
+ model.evtout = new ScilabDouble([1]);
+ model.rpar = new ScilabDouble([-1], [-1], [-1], [0]);
+ model.blocktype = new ScilabString(["z"]);
+ model.dep_ut = new ScilabBoolean([true, false]);
+ model.firing = new ScilabDouble([-1]);
+
+ var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"POSTONEG_f\",sz(1),sz(2));"]);
+ this.x = new standard_define(new ScilabDouble([2, 2]), model, [], gr_i);
+ return new BasicBlock(this.x);
+ }
+ POSTONEG_f.prototype.details = function POSTONEG_f() {
+ return this.x;
+ }
+}
+
diff --git a/data_structures_correct/PerteDP.js b/data_structures_correct/PerteDP.js
new file mode 100644
index 0000000..e5060b1
--- /dev/null
+++ b/data_structures_correct/PerteDP.js
@@ -0,0 +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;
+ }
+
+}
+
diff --git a/data_structures_correct/PotentialSensor.js b/data_structures_correct/PotentialSensor.js
new file mode 100644
index 0000000..fb2581b
--- /dev/null
+++ b/data_structures_correct/PotentialSensor.js
@@ -0,0 +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;
+ }
+}
+