summaryrefslogtreecommitdiff
path: root/js/NonLinear
diff options
context:
space:
mode:
Diffstat (limited to 'js/NonLinear')
-rw-r--r--js/NonLinear/ABSBLK_f.js5
-rw-r--r--js/NonLinear/ABSBLK_f.pickle6
-rw-r--r--js/NonLinear/ABS_VALUE.js41
-rw-r--r--js/NonLinear/ABS_VALUE.pickle6
-rw-r--r--js/NonLinear/COSBLK_f.js5
-rw-r--r--js/NonLinear/COSBLK_f.pickle6
-rw-r--r--js/NonLinear/DLRADAPT_f.js49
-rw-r--r--js/NonLinear/DLRADAPT_f.pickle6
-rw-r--r--js/NonLinear/EXPBLK_f.js37
-rw-r--r--js/NonLinear/EXPBLK_f.pickle6
-rw-r--r--js/NonLinear/EXPBLK_m.js37
-rw-r--r--js/NonLinear/EXPBLK_m.pickle6
-rw-r--r--js/NonLinear/FSV_f.js5
-rw-r--r--js/NonLinear/FSV_f.pickle6
-rw-r--r--js/NonLinear/INTRP2BLK_f.js43
-rw-r--r--js/NonLinear/INTRP2BLK_f.pickle6
-rw-r--r--js/NonLinear/INTRPLBLK_f.js41
-rw-r--r--js/NonLinear/INTRPLBLK_f.pickle6
-rw-r--r--js/NonLinear/INVBLK.js5
-rw-r--r--js/NonLinear/INVBLK.pickle6
-rw-r--r--js/NonLinear/INVBLK_f.js5
-rw-r--r--js/NonLinear/INVBLK_f.pickle6
-rw-r--r--js/NonLinear/LOGBLK_f.js41
-rw-r--r--js/NonLinear/LOGBLK_f.pickle6
-rw-r--r--js/NonLinear/LOOKUP2D.js129
-rw-r--r--js/NonLinear/LOOKUP2D.pickle8
-rw-r--r--js/NonLinear/LOOKUP_c.pickle8
-rw-r--r--js/NonLinear/LOOKUP_f.js47
-rw-r--r--js/NonLinear/LOOKUP_f.pickle6
-rw-r--r--js/NonLinear/MAXMIN.js89
-rw-r--r--js/NonLinear/MAXMIN.pickle6
-rw-r--r--js/NonLinear/MAX_f.js5
-rw-r--r--js/NonLinear/MAX_f.pickle6
-rw-r--r--js/NonLinear/MIN_f.js5
-rw-r--r--js/NonLinear/MIN_f.pickle6
-rw-r--r--js/NonLinear/POWBLK_f.js43
-rw-r--r--js/NonLinear/POWBLK_f.pickle6
-rw-r--r--js/NonLinear/PRODUCT.js81
-rw-r--r--js/NonLinear/PRODUCT.pickle6
-rw-r--r--js/NonLinear/PROD_f.js5
-rw-r--r--js/NonLinear/PROD_f.pickle6
-rw-r--r--js/NonLinear/QUANT_f.js57
-rw-r--r--js/NonLinear/QUANT_f.pickle6
-rw-r--r--js/NonLinear/SATURATION.js49
-rw-r--r--js/NonLinear/SATURATION.pickle6
-rw-r--r--js/NonLinear/SAT_f.js41
-rw-r--r--js/NonLinear/SAT_f.pickle6
-rw-r--r--js/NonLinear/SIGNUM.js41
-rw-r--r--js/NonLinear/SIGNUM.pickle6
-rw-r--r--js/NonLinear/SINBLK_f.js5
-rw-r--r--js/NonLinear/SINBLK_f.pickle6
-rw-r--r--js/NonLinear/TANBLK_f.js7
-rw-r--r--js/NonLinear/TANBLK_f.pickle6
-rw-r--r--js/NonLinear/TrigFun.js33
-rw-r--r--js/NonLinear/TrigFun.pickle6
55 files changed, 603 insertions, 520 deletions
diff --git a/js/NonLinear/ABSBLK_f.js b/js/NonLinear/ABSBLK_f.js
index a5cacb5f..7ab1aff9 100644
--- a/js/NonLinear/ABSBLK_f.js
+++ b/js/NonLinear/ABSBLK_f.js
@@ -8,13 +8,14 @@ function ABSBLK_f() {
model.blocktype = "c";
model.dep_ut = [true,false];
gr_i = [];
- x = standard_define([2,2],model,[],gr_i);
+ this.x = standard_define([2,2],model,[],gr_i);
}
ABSBLK_f.prototype.details = function ABSBLK_f() {
+ return this.x;
}
ABSBLK_f.prototype.get = function ABSBLK_f() {
}
ABSBLK_f.prototype.set = function ABSBLK_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/NonLinear/ABSBLK_f.pickle b/js/NonLinear/ABSBLK_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/ABSBLK_f.pickle
+++ b/js/NonLinear/ABSBLK_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/ABS_VALUE.js b/js/NonLinear/ABS_VALUE.js
index 6d946c72..9d5074eb 100644
--- a/js/NonLinear/ABS_VALUE.js
+++ b/js/NonLinear/ABS_VALUE.js
@@ -12,35 +12,36 @@ function ABS_VALUE() {
model.dep_ut = [true,false];
exprs = [string([1])];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
ABS_VALUE.prototype.details = function ABS_VALUE() {
+ return this.x;
}
ABS_VALUE.prototype.get = function ABS_VALUE() {
}
ABS_VALUE.prototype.set = function ABS_VALUE() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs);
- if (!ok) {
-break;
-}
- graphics.exprs = exprs;
- if (ok) {
- if (zcr!=0) {
- model.nmode = -1;
- model.nzcross = -1;
- } else {
- model.nmode = 0;
- model.nzcross = 0;
-}
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ graphics.exprs = exprs;
+ if (ok) {
+ if (zcr!=0) {
+ model.nmode = -1;
+ model.nzcross = -1;
+ } else {
+ model.nmode = 0;
+ model.nzcross = 0;
+ }
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/ABS_VALUE.pickle b/js/NonLinear/ABS_VALUE.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/ABS_VALUE.pickle
+++ b/js/NonLinear/ABS_VALUE.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/COSBLK_f.js b/js/NonLinear/COSBLK_f.js
index 2710f73f..5420afd1 100644
--- a/js/NonLinear/COSBLK_f.js
+++ b/js/NonLinear/COSBLK_f.js
@@ -9,13 +9,14 @@ function COSBLK_f() {
model.blocktype = "c";
model.dep_ut = [true,false];
gr_i = [];
- x = standard_define([2,2],model,[],gr_i);
+ this.x = standard_define([2,2],model,[],gr_i);
}
COSBLK_f.prototype.details = function COSBLK_f() {
+ return this.x;
}
COSBLK_f.prototype.get = function COSBLK_f() {
}
COSBLK_f.prototype.set = function COSBLK_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/NonLinear/COSBLK_f.pickle b/js/NonLinear/COSBLK_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/COSBLK_f.pickle
+++ b/js/NonLinear/COSBLK_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/DLRADAPT_f.js b/js/NonLinear/DLRADAPT_f.js
index 2a151d95..e985a696 100644
--- a/js/NonLinear/DLRADAPT_f.js
+++ b/js/NonLinear/DLRADAPT_f.js
@@ -20,39 +20,40 @@ function DLRADAPT_f() {
model.dep_ut = [true,false];
exprs = [[sci2exp(p)],[sci2exp(rn)],[sci2exp(rd,0)],[sci2exp(g)],[sci2exp(last_u)],[sci2exp(last_y)]];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
DLRADAPT_f.prototype.details = function DLRADAPT_f() {
+ return this.x;
}
DLRADAPT_f.prototype.get = function DLRADAPT_f() {
}
DLRADAPT_f.prototype.set = function DLRADAPT_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,p,rn,rd,g,last_u,last_y,exprs] = scicos_getvalue("Set block parameters",[["Vector of p mesh points"],["Numerator roots (one line for each mesh)"],["Denominator roots (one line for each mesh)"],["Vector of gain at mesh points"],["past inputs (Num degree values)"],["past outputs (Den degree values)"]],list("vec",-1,"mat",[-1,-1],"mat",["size(%1,\'*\')","-1"],"vec","size(%1,\'*\')","vec","size(%2,2)","vec","size(%3,2)"),exprs);
- if (!ok) {
-break;
-}
- m = size(rn,2);
- [npt,n] = size(rd);
- if (m>=n) {
-message("Transfer must be strictly proper");
- } else if (size(rn,1)!=0&&size(rn,1)!=size(p,"*")) {
-message("Numerator roots matrix row size\'s is incorrect");
- } else {
- rpar = [[p.slice()],[real(rn.slice())],[imag(rn.slice())],[real(rd.slice())],[imag(rd.slice())],[g.slice()]];
- ipar = [[m],[n],[npt]];
- model.dstate = [[last_u.slice()],[last_y.slice()]];
- model.rpar = rpar;
- model.ipar = ipar;
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,p,rn,rd,g,last_u,last_y,exprs] = scicos_getvalue("Set block parameters",[["Vector of p mesh points"],["Numerator roots (one line for each mesh)"],["Denominator roots (one line for each mesh)"],["Vector of gain at mesh points"],["past inputs (Num degree values)"],["past outputs (Den degree values)"]],list("vec",-1,"mat",[-1,-1],"mat",["size(%1,\'*\')","-1"],"vec","size(%1,\'*\')","vec","size(%2,2)","vec","size(%3,2)"),exprs);
+ if (!ok) {
+ break;
+ }
+ m = size(rn,2);
+ [npt,n] = size(rd);
+ if (m>=n) {
+ message("Transfer must be strictly proper");
+ } else if (size(rn,1)!=0&&size(rn,1)!=size(p,"*")) {
+ message("Numerator roots matrix row size\'s is incorrect");
+ } else {
+ rpar = [[p.slice()],[real(rn.slice())],[imag(rn.slice())],[real(rd.slice())],[imag(rd.slice())],[g.slice()]];
+ ipar = [[m],[n],[npt]];
+ model.dstate = [[last_u.slice()],[last_y.slice()]];
+ model.rpar = rpar;
+ model.ipar = ipar;
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/DLRADAPT_f.pickle b/js/NonLinear/DLRADAPT_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/DLRADAPT_f.pickle
+++ b/js/NonLinear/DLRADAPT_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/EXPBLK_f.js b/js/NonLinear/EXPBLK_f.js
index e3b39f45..05b21300 100644
--- a/js/NonLinear/EXPBLK_f.js
+++ b/js/NonLinear/EXPBLK_f.js
@@ -12,34 +12,35 @@ function EXPBLK_f() {
model.dep_ut = [true,false];
exprs = ["%e"];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
EXPBLK_f.prototype.details = function EXPBLK_f() {
+ return this.x;
}
EXPBLK_f.prototype.get = function EXPBLK_f() {
}
EXPBLK_f.prototype.set = function EXPBLK_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
if (size(exprs,"*")==2) {
- exprs = exprs[2-1];
-}
+ exprs = exprs[2-1];
+ }
while (true) {
- [ok,a,exprs] = scicos_getvalue("Set a^u block parameters","a (>0)",list("vec",1),exprs);
- if (!ok) {
-break;
-}
- if (or(a<=0)) {
-message("a^u : a must be positive");
- } else {
- graphics.exprs = exprs;
- model.rpar = a;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,a,exprs] = scicos_getvalue("Set a^u block parameters","a (>0)",list("vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (or(a<=0)) {
+ message("a^u : a must be positive");
+ } else {
+ graphics.exprs = exprs;
+ model.rpar = a;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/EXPBLK_f.pickle b/js/NonLinear/EXPBLK_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/EXPBLK_f.pickle
+++ b/js/NonLinear/EXPBLK_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/EXPBLK_m.js b/js/NonLinear/EXPBLK_m.js
index 0c162d3d..1731a333 100644
--- a/js/NonLinear/EXPBLK_m.js
+++ b/js/NonLinear/EXPBLK_m.js
@@ -16,34 +16,35 @@ function EXPBLK_m() {
model.dep_ut = [true,false];
exprs = ["%e"];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
EXPBLK_m.prototype.details = function EXPBLK_m() {
+ return this.x;
}
EXPBLK_m.prototype.get = function EXPBLK_m() {
}
EXPBLK_m.prototype.set = function EXPBLK_m() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
if (size(exprs,"*")==2) {
- exprs = exprs[2-1];
-}
+ exprs = exprs[2-1];
+ }
while (true) {
- [ok,a,exprs] = scicos_getvalue("Set a^u block parameters","a (>0)",list("vec",1),exprs);
- if (!ok) {
-break;
-}
- if (or(a<=0)) {
-message("a^u : a must be positive");
- } else {
- graphics.exprs = exprs;
- model.rpar = a;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,a,exprs] = scicos_getvalue("Set a^u block parameters","a (>0)",list("vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (or(a<=0)) {
+ message("a^u : a must be positive");
+ } else {
+ graphics.exprs = exprs;
+ model.rpar = a;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/EXPBLK_m.pickle b/js/NonLinear/EXPBLK_m.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/EXPBLK_m.pickle
+++ b/js/NonLinear/EXPBLK_m.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/FSV_f.js b/js/NonLinear/FSV_f.js
index 8820fd33..eedc7cf2 100644
--- a/js/NonLinear/FSV_f.js
+++ b/js/NonLinear/FSV_f.js
@@ -10,13 +10,14 @@ function FSV_f() {
model.dep_ut = [true,false];
exprs = " ";
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
FSV_f.prototype.details = function FSV_f() {
+ return this.x;
}
FSV_f.prototype.get = function FSV_f() {
}
FSV_f.prototype.set = function FSV_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/NonLinear/FSV_f.pickle b/js/NonLinear/FSV_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/FSV_f.pickle
+++ b/js/NonLinear/FSV_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/INTRP2BLK_f.js b/js/NonLinear/INTRP2BLK_f.js
index 479b0919..34a642be 100644
--- a/js/NonLinear/INTRP2BLK_f.js
+++ b/js/NonLinear/INTRP2BLK_f.js
@@ -14,36 +14,37 @@ function INTRP2BLK_f() {
model.dep_ut = [true,false];
exprs = [[strcat(sci2exp(a))],[strcat(sci2exp(b))],[strcat(sci2exp(c,0))]];
gr_i = [];
- x = standard_define([3,2],model,exprs,gr_i);
+ this.x = standard_define([3,2],model,exprs,gr_i);
}
INTRP2BLK_f.prototype.details = function INTRP2BLK_f() {
+ return this.x;
}
INTRP2BLK_f.prototype.get = function INTRP2BLK_f() {
}
INTRP2BLK_f.prototype.set = function INTRP2BLK_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,a,b,c,exprs] = scicos_getvalue("Set Interpolation block parameters",[["X coord."],["Y coord."],["Z values"]],list("vec",-1,"vec",-1,"mat",[-1,-1]),exprs);
- if (!ok) {
-break;
-}
- if (size(a,"*")!=size(c,"c")||size(b,"*")!=size(c,"r")) {
-message("incompatible dimension");
- } else if (min(a.slice(2-1,$)-a.slice(1-1,$-1))<=0||min(b.slice(2-1,$)-b.slice(1-1,$-1))<=0) {
-message("X and Y must be strictly increasing");
- } else {
- if (ok) {
- graphics.exprs = exprs;
- model.rpar = [[a.slice()],[b.slice()],[c.slice()]];
- model.ipar = [[size(a,"*")],[size(b,"*")]];
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
-}
+ [ok,a,b,c,exprs] = scicos_getvalue("Set Interpolation block parameters",[["X coord."],["Y coord."],["Z values"]],list("vec",-1,"vec",-1,"mat",[-1,-1]),exprs);
+ if (!ok) {
+ break;
+ }
+ if (size(a,"*")!=size(c,"c")||size(b,"*")!=size(c,"r")) {
+ message("incompatible dimension");
+ } else if (min(a.slice(2-1,$)-a.slice(1-1,$-1))<=0||min(b.slice(2-1,$)-b.slice(1-1,$-1))<=0) {
+ message("X and Y must be strictly increasing");
+ } else {
+ if (ok) {
+ graphics.exprs = exprs;
+ model.rpar = [[a.slice()],[b.slice()],[c.slice()]];
+ model.ipar = [[size(a,"*")],[size(b,"*")]];
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
+ }
}
}
diff --git a/js/NonLinear/INTRP2BLK_f.pickle b/js/NonLinear/INTRP2BLK_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/INTRP2BLK_f.pickle
+++ b/js/NonLinear/INTRP2BLK_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/INTRPLBLK_f.js b/js/NonLinear/INTRPLBLK_f.js
index 0baee92b..6ff946f6 100644
--- a/js/NonLinear/INTRPLBLK_f.js
+++ b/js/NonLinear/INTRPLBLK_f.js
@@ -12,35 +12,36 @@ function INTRPLBLK_f() {
model.dep_ut = [true,false];
exprs = [[strcat(sci2exp(a))],[strcat(sci2exp(b))]];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
INTRPLBLK_f.prototype.details = function INTRPLBLK_f() {
+ return this.x;
}
INTRPLBLK_f.prototype.get = function INTRPLBLK_f() {
}
INTRPLBLK_f.prototype.set = function INTRPLBLK_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,a,b,exprs] = scicos_getvalue("Set Interpolation block parameters",[["X coord."],["Y coord."]],list("vec",-1,"vec",-1),exprs);
- if (!ok) {
-break;
-}
- if (size(a,"*")!=size(b,"*")) {
-message("X and Y must have the same size");
- } else if (min(a.slice(2-1,$)-a.slice(1-1,$-1))<=0) {
-message("X must be strictly increasing");
- } else {
- if (ok) {
- graphics.exprs = exprs;
- model.rpar = [[a.slice()],[b.slice()]];
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
-}
+ [ok,a,b,exprs] = scicos_getvalue("Set Interpolation block parameters",[["X coord."],["Y coord."]],list("vec",-1,"vec",-1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (size(a,"*")!=size(b,"*")) {
+ message("X and Y must have the same size");
+ } else if (min(a.slice(2-1,$)-a.slice(1-1,$-1))<=0) {
+ message("X must be strictly increasing");
+ } else {
+ if (ok) {
+ graphics.exprs = exprs;
+ model.rpar = [[a.slice()],[b.slice()]];
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
+ }
}
}
diff --git a/js/NonLinear/INTRPLBLK_f.pickle b/js/NonLinear/INTRPLBLK_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/INTRPLBLK_f.pickle
+++ b/js/NonLinear/INTRPLBLK_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/INVBLK.js b/js/NonLinear/INVBLK.js
index d5d559f3..2d359c7b 100644
--- a/js/NonLinear/INVBLK.js
+++ b/js/NonLinear/INVBLK.js
@@ -10,13 +10,14 @@ function INVBLK() {
model.dep_ut = [true,false];
exprs = " ";
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
INVBLK.prototype.details = function INVBLK() {
+ return this.x;
}
INVBLK.prototype.get = function INVBLK() {
}
INVBLK.prototype.set = function INVBLK() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/NonLinear/INVBLK.pickle b/js/NonLinear/INVBLK.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/INVBLK.pickle
+++ b/js/NonLinear/INVBLK.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/INVBLK_f.js b/js/NonLinear/INVBLK_f.js
index bca99397..db0136bf 100644
--- a/js/NonLinear/INVBLK_f.js
+++ b/js/NonLinear/INVBLK_f.js
@@ -10,13 +10,14 @@ function INVBLK_f() {
model.dep_ut = [true,false];
exprs = " ";
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
INVBLK_f.prototype.details = function INVBLK_f() {
+ return this.x;
}
INVBLK_f.prototype.get = function INVBLK_f() {
}
INVBLK_f.prototype.set = function INVBLK_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/NonLinear/INVBLK_f.pickle b/js/NonLinear/INVBLK_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/INVBLK_f.pickle
+++ b/js/NonLinear/INVBLK_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/LOGBLK_f.js b/js/NonLinear/LOGBLK_f.js
index d57bfed7..00f01aa1 100644
--- a/js/NonLinear/LOGBLK_f.js
+++ b/js/NonLinear/LOGBLK_f.js
@@ -12,36 +12,37 @@ function LOGBLK_f() {
model.dep_ut = [true,false];
exprs = "%e";
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
LOGBLK_f.prototype.details = function LOGBLK_f() {
+ return this.x;
}
LOGBLK_f.prototype.get = function LOGBLK_f() {
}
LOGBLK_f.prototype.set = function LOGBLK_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
if (size(exprs,"*")==2) {
- exprs = exprs[2-1];
-}
+ exprs = exprs[2-1];
+ }
while (true) {
- [ok,a,exprs] = scicos_getvalue("Set log block parameters","Basis (>1)",list("vec",1),exprs);
- if (!ok) {
-break;
-}
- if (a<=1) {
-message("Basis must be larger than 1");
- } else {
- if (ok) {
- graphics.exprs = exprs;
- model.rpar = a;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
-}
+ [ok,a,exprs] = scicos_getvalue("Set log block parameters","Basis (>1)",list("vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (a<=1) {
+ message("Basis must be larger than 1");
+ } else {
+ if (ok) {
+ graphics.exprs = exprs;
+ model.rpar = a;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
+ }
}
}
diff --git a/js/NonLinear/LOGBLK_f.pickle b/js/NonLinear/LOGBLK_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/LOGBLK_f.pickle
+++ b/js/NonLinear/LOGBLK_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/LOOKUP2D.js b/js/NonLinear/LOOKUP2D.js
index 355a3523..1c70c61a 100644
--- a/js/NonLinear/LOOKUP2D.js
+++ b/js/NonLinear/LOOKUP2D.js
@@ -18,81 +18,82 @@ function LOOKUP2D() {
model.dep_ut = [true,false];
exprs = list(strcat(sci2exp(xx)),strcat(sci2exp(yy)),strcat(sci2exp(zz)),sci2exp(Method),Graf);
gr_i = [];
- x = standard_define([2.5,2],model,exprs,gr_i);
+ this.x = standard_define([2.5,2],model,exprs,gr_i);
}
LOOKUP2D.prototype.details = function LOOKUP2D() {
+ return this.x;
}
LOOKUP2D.prototype.get = function LOOKUP2D() {
}
LOOKUP2D.prototype.set = function LOOKUP2D() {
- x = arg1;
+ this.x = arg1;
model = arg1.model;
graphics = arg1.graphics;
exprs = graphics.exprs;
ok = false;
SaveExit = false;
while (true) {
- Ask_again = false;
- [ok,xx,yy,zz,Method,graf,exprs] = scicos_getvalue("2D Lookup table parameters",[["Row index input values"],["Column index input values"],["Table data"],["Lookup method(1..5)"],["Launch graphic window(y/n)?"]],list("vec",-1,"vec",-1,"mat",[-1,-1],"vec",1,"str",1),exprs);
- if (!ok) {
-break;
-}
- mtd = int(Method);
- if (mtd<1) {
- mtd = 1;
-}
- if (mtd>6) {
- mtd = 6;
-}
- if (graf!="y"&&graf!="Y") {
- graf = "n";
-}
- exprs[5-1] = "n";
- exprs[4-1] = sci2exp(mtd);
- METHOD = getmethod(mtd);
- if (!Ask_again) {
- xx = xx.slice();
- yy = yy.slice();
- [nx,mx] = size(xx);
- [ny,my] = size(yy);
- [nz,mz] = size(zz);
- if (((nx<=1)||(ny<=1))) {
-x_message("input row/column data size should be greater than one");
- Ask_again = true;
-}
- if (!((nx==nz)&&(ny==mz))) {
-x_message("incompatible size of x and y");
- Ask_again = true;
-}
- [ok] = test_increasing(xx);
- if ((!ok)) {
-x_message("Row input values must be monotonically increasing");
- Ask_again = true;
-}
- [ok] = test_increasing(yy);
- if ((!ok)) {
-x_message("Column input values must be monotonically increasing");
- Ask_again = true;
-}
-}
- if (!Ask_again) {
- if ((graf=="Y"||graf=="y")) {
- gh = gcf();
- curwin = gh.figure_id;
- save_curwin = curwin;
- gh2 = scf();
- curwin = max(winsid())+1;
-plot3d(xx,yy,zz,35,45,"X@Y@Z",[5,2,4]);
- curwin = save_curwin;
- gh.figure_id = curwin;
-}
- model.rpar = [[xx.slice()],[yy.slice()],[zz.slice()]];
- model.ipar = [[nx],[ny],[mtd]];
- graphics.exprs = exprs;
- x.model = model;
- x.graphics = graphics;
-break;
-}
-}
+ Ask_again = false;
+ [ok,xx,yy,zz,Method,graf,exprs] = scicos_getvalue("2D Lookup table parameters",[["Row index input values"],["Column index input values"],["Table data"],["Lookup method(1..5)"],["Launch graphic window(y/n)?"]],list("vec",-1,"vec",-1,"mat",[-1,-1],"vec",1,"str",1),exprs);
+ if (!ok) {
+ break;
+ }
+ mtd = int(Method);
+ if (mtd<1) {
+ mtd = 1;
+ }
+ if (mtd>6) {
+ mtd = 6;
+ }
+ if (graf!="y"&&graf!="Y") {
+ graf = "n";
+ }
+ exprs[5-1] = "n";
+ exprs[4-1] = sci2exp(mtd);
+ METHOD = getmethod(mtd);
+ if (!Ask_again) {
+ xx = xx.slice();
+ yy = yy.slice();
+ [nx,mx] = size(xx);
+ [ny,my] = size(yy);
+ [nz,mz] = size(zz);
+ if (((nx<=1)||(ny<=1))) {
+ x_message("input row/column data size should be greater than one");
+ Ask_again = true;
+ }
+ if (!((nx==nz)&&(ny==mz))) {
+ x_message("incompatible size of x and y");
+ Ask_again = true;
+ }
+ [ok] = test_increasing(xx);
+ if ((!ok)) {
+ x_message("Row input values must be monotonically increasing");
+ Ask_again = true;
+ }
+ [ok] = test_increasing(yy);
+ if ((!ok)) {
+ x_message("Column input values must be monotonically increasing");
+ Ask_again = true;
+ }
+ }
+ if (!Ask_again) {
+ if ((graf=="Y"||graf=="y")) {
+ gh = gcf();
+ curwin = gh.figure_id;
+ save_curwin = curwin;
+ gh2 = scf();
+ curwin = max(winsid())+1;
+ plot3d(xx,yy,zz,35,45,"X@Y@Z",[5,2,4]);
+ curwin = save_curwin;
+ gh.figure_id = curwin;
+ }
+ model.rpar = [[xx.slice()],[yy.slice()],[zz.slice()]];
+ model.ipar = [[nx],[ny],[mtd]];
+ graphics.exprs = exprs;
+ this.x.model = model;
+ this.x.graphics = graphics;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/LOOKUP2D.pickle b/js/NonLinear/LOOKUP2D.pickle
index e8e2a47d..a808c055 100644
--- a/js/NonLinear/LOOKUP2D.pickle
+++ b/js/NonLinear/LOOKUP2D.pickle
@@ -2,8 +2,10 @@ c__builtin__
set
p0
((lp1
-S'order'
+S'x'
p2
-atp3
-Rp4
+aS'order'
+p3
+atp4
+Rp5
. \ No newline at end of file
diff --git a/js/NonLinear/LOOKUP_c.pickle b/js/NonLinear/LOOKUP_c.pickle
index 8cef5b52..b1c7cff9 100644
--- a/js/NonLinear/LOOKUP_c.pickle
+++ b/js/NonLinear/LOOKUP_c.pickle
@@ -12,8 +12,10 @@ aS'argn'
p5
aS'xy'
p6
-aS'curwin'
+aS'x'
p7
-atp8
-Rp9
+aS'curwin'
+p8
+atp9
+Rp10
. \ No newline at end of file
diff --git a/js/NonLinear/LOOKUP_f.js b/js/NonLinear/LOOKUP_f.js
index 89ff8713..335d06fc 100644
--- a/js/NonLinear/LOOKUP_f.js
+++ b/js/NonLinear/LOOKUP_f.js
@@ -9,14 +9,15 @@ function LOOKUP_f() {
model.blocktype = "c";
model.dep_ut = [true,false];
gr_i = [];
- x = standard_define([2,2],model,[],gr_i);
+ this.x = standard_define([2,2],model,[],gr_i);
}
LOOKUP_f.prototype.details = function LOOKUP_f() {
+ return this.x;
}
LOOKUP_f.prototype.get = function LOOKUP_f() {
}
LOOKUP_f.prototype.set = function LOOKUP_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
@@ -25,26 +26,26 @@ function LOOKUP_f() {
xx = rpar.slice(1-1,n);
yy = rpar.slice(n+1-1,2*n);
while (true) {
-[ln,fun]=where()
- if (!or(fun=="do_eval")) {
- [xx,yy,ok,gc] = edit_curv(xx,yy,"axy");
- } else {
- ok = true;
-}
- if (!ok) {
-break;
-}
- n = size(xx,"*");
- if (or(xx.slice(2-1,n)-xx.slice(1-1,n-1)<=0)) {
-message("You have not defined a function");
- ok = false;
-}
- if (ok) {
- model.rpar = [[xx.slice()],[yy.slice()]];
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ln,fun]=where()
+ if (!or(fun=="do_eval")) {
+ [xx,yy,ok,gc] = edit_curv(xx,yy,"axy");
+ } else {
+ ok = true;
+ }
+ if (!ok) {
+ break;
+ }
+ n = size(xx,"*");
+ if (or(xx.slice(2-1,n)-xx.slice(1-1,n-1)<=0)) {
+ message("You have not defined a function");
+ ok = false;
+ }
+ if (ok) {
+ model.rpar = [[xx.slice()],[yy.slice()]];
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/LOOKUP_f.pickle b/js/NonLinear/LOOKUP_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/LOOKUP_f.pickle
+++ b/js/NonLinear/LOOKUP_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/MAXMIN.js b/js/NonLinear/MAXMIN.js
index c85734cb..b6726e22 100644
--- a/js/NonLinear/MAXMIN.js
+++ b/js/NonLinear/MAXMIN.js
@@ -10,59 +10,60 @@ function MAXMIN() {
model.ipar = 0;
exprs = [string(transpose([2,1,1]))];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
- x.graphics.style = "MAXMIN;displayedLabel=MAX";
+ this.x = standard_define([2,2],model,exprs,gr_i);
+ this.x.graphics.style = "MAXMIN;displayedLabel=MAX";
}
MAXMIN.prototype.details = function MAXMIN() {
+ return this.x;
}
MAXMIN.prototype.get = function MAXMIN() {
}
MAXMIN.prototype.set = function MAXMIN() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,mm,nin,zcr,exprs] = scicos_getvalue("Set Max/Min block parameters",[["Min (1) or Max (2) "],["Number of input vectors (1 or 2)"],["zero-crossing (1: yes, 0;no)"]],list("vec",1,"vec",1,"vec",1),exprs);
- if (!ok) {
-break;
-}
- if (zcr!=0) {
- zcr = -1;
-}
- if (mm!=1) {
- mm = 2;
-}
- if (nin!=1&&nin!=2) {
-message("Wrong number of inputs, only 1 and 2 allowed");
- ok = false;
-}
- if (ok) {
- if (nin==1) {
- [model,graphics,ok] = check_io(model,graphics,-1,1,[],[]);
- } else {
- [model,graphics,ok] = check_io(model,graphics,[-1,-1],-1,[],[]);
-}
-}
- if (ok) {
- model.nzcross = zcr;
- if (nin==1) {
- model.nmode = abs(zcr);
- } else {
- model.nmode = zcr;
-}
- model.ipar = mm;
- if (mm==1) {
- label = "MIN";
- } else {
- label = "MAX";
-}
- graphics.style = "MAXMIN;displayedLabel="+label;
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,mm,nin,zcr,exprs] = scicos_getvalue("Set Max/Min block parameters",[["Min (1) or Max (2) "],["Number of input vectors (1 or 2)"],["zero-crossing (1: yes, 0;no)"]],list("vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (zcr!=0) {
+ zcr = -1;
+ }
+ if (mm!=1) {
+ mm = 2;
+ }
+ if (nin!=1&&nin!=2) {
+ message("Wrong number of inputs, only 1 and 2 allowed");
+ ok = false;
+ }
+ if (ok) {
+ if (nin==1) {
+ [model,graphics,ok] = check_io(model,graphics,-1,1,[],[]);
+ } else {
+ [model,graphics,ok] = check_io(model,graphics,[-1,-1],-1,[],[]);
+ }
+ }
+ if (ok) {
+ model.nzcross = zcr;
+ if (nin==1) {
+ model.nmode = abs(zcr);
+ } else {
+ model.nmode = zcr;
+ }
+ model.ipar = mm;
+ if (mm==1) {
+ label = "MIN";
+ } else {
+ label = "MAX";
+ }
+ graphics.style = "MAXMIN;displayedLabel="+label;
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/MAXMIN.pickle b/js/NonLinear/MAXMIN.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/MAXMIN.pickle
+++ b/js/NonLinear/MAXMIN.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/MAX_f.js b/js/NonLinear/MAX_f.js
index 8367bd9d..e3640328 100644
--- a/js/NonLinear/MAX_f.js
+++ b/js/NonLinear/MAX_f.js
@@ -11,13 +11,14 @@ function MAX_f() {
model.dep_ut = [true,false];
exprs = " ";
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
MAX_f.prototype.details = function MAX_f() {
+ return this.x;
}
MAX_f.prototype.get = function MAX_f() {
}
MAX_f.prototype.set = function MAX_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/NonLinear/MAX_f.pickle b/js/NonLinear/MAX_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/MAX_f.pickle
+++ b/js/NonLinear/MAX_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/MIN_f.js b/js/NonLinear/MIN_f.js
index b38c5eef..18f5d484 100644
--- a/js/NonLinear/MIN_f.js
+++ b/js/NonLinear/MIN_f.js
@@ -11,13 +11,14 @@ function MIN_f() {
model.dep_ut = [true,false];
exprs = sci2exp(in1);
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
MIN_f.prototype.details = function MIN_f() {
+ return this.x;
}
MIN_f.prototype.get = function MIN_f() {
}
MIN_f.prototype.set = function MIN_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/NonLinear/MIN_f.pickle b/js/NonLinear/MIN_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/MIN_f.pickle
+++ b/js/NonLinear/MIN_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/POWBLK_f.js b/js/NonLinear/POWBLK_f.js
index b74479bd..1714dfa1 100644
--- a/js/NonLinear/POWBLK_f.js
+++ b/js/NonLinear/POWBLK_f.js
@@ -12,37 +12,38 @@ function POWBLK_f() {
model.dep_ut = [true,false];
exprs = string(a);
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
POWBLK_f.prototype.details = function POWBLK_f() {
+ return this.x;
}
POWBLK_f.prototype.get = function POWBLK_f() {
}
POWBLK_f.prototype.set = function POWBLK_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
if (size(exprs,"*")==2) {
- exprs = exprs[2-1];
-}
+ exprs = exprs[2-1];
+ }
while (true) {
- [ok,a,exprs] = scicos_getvalue("Set u^a block parameters","to the power of",list("vec",1),exprs);
- if (!ok) {
-break;
-}
- graphics.exprs = exprs;
- if (a==int(a)) {
- model.ipar = a;
- model.rpar = [];
- } else {
- model.rpar = a;
- model.ipar = [];
-}
- model.firing = [];
- x.graphics = graphics;
- x.model = model;
-break;
-}
+ [ok,a,exprs] = scicos_getvalue("Set u^a block parameters","to the power of",list("vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ graphics.exprs = exprs;
+ if (a==int(a)) {
+ model.ipar = a;
+ model.rpar = [];
+ } else {
+ model.rpar = a;
+ model.ipar = [];
+ }
+ model.firing = [];
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
}
}
diff --git a/js/NonLinear/POWBLK_f.pickle b/js/NonLinear/POWBLK_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/POWBLK_f.pickle
+++ b/js/NonLinear/POWBLK_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/PRODUCT.js b/js/NonLinear/PRODUCT.js
index 03fbc655..e6449743 100644
--- a/js/NonLinear/PRODUCT.js
+++ b/js/NonLinear/PRODUCT.js
@@ -11,55 +11,56 @@ function PRODUCT() {
model.dep_ut = [true,false];
exprs = sci2exp(sgn);
gr_i = [];
- x = standard_define([2,3],model,exprs,gr_i);
+ this.x = standard_define([2,3],model,exprs,gr_i);
}
PRODUCT.prototype.details = function PRODUCT() {
+ return this.x;
}
PRODUCT.prototype.get = function PRODUCT() {
}
PRODUCT.prototype.set = function PRODUCT() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
model = arg1.model;
exprs = graphics.exprs;
while (true) {
- [ok,sgn,exprs] = scicos_getvalue([[" Set multiplication block parameters"],["(multiplication is set with + 1, division with -1)"],[""]],"Number of inputs or sign vector",list("vec",-1),exprs);
- if (!ok) {
-break;
-}
- sgn = sgn.slice();
- if (size(sgn,1)==1) {
- if (sgn<1) {
-message("Number of inputs must be > 0");
- ok = false;
- } else if (sgn==1) {
- in1 = -1;
- sgn = [];
- nout = 1;
- } else {
- in1 = -ones(sgn,1);
- sgn = ones(sgn,1);
- nout = -1;
-}
- } else {
- if (!and(abs(sgn)==1)) {
-message("Signs can only be +1 or -1");
- ok = false;
- } else {
- in1 = -ones(size(sgn,1),1);
- nout = -1;
-}
-}
- if (ok) {
- [model,graphics,ok] = check_io(model,graphics,in1,nout,[],[]);
-}
- if (ok) {
- model.ipar = sgn;
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,sgn,exprs] = scicos_getvalue([[" Set multiplication block parameters"],["(multiplication is set with + 1, division with -1)"],[""]],"Number of inputs or sign vector",list("vec",-1),exprs);
+ if (!ok) {
+ break;
+ }
+ sgn = sgn.slice();
+ if (size(sgn,1)==1) {
+ if (sgn<1) {
+ message("Number of inputs must be > 0");
+ ok = false;
+ } else if (sgn==1) {
+ in1 = -1;
+ sgn = [];
+ nout = 1;
+ } else {
+ in1 = -ones(sgn,1);
+ sgn = ones(sgn,1);
+ nout = -1;
+ }
+ } else {
+ if (!and(abs(sgn)==1)) {
+ message("Signs can only be +1 or -1");
+ ok = false;
+ } else {
+ in1 = -ones(size(sgn,1),1);
+ nout = -1;
+ }
+ }
+ if (ok) {
+ [model,graphics,ok] = check_io(model,graphics,in1,nout,[],[]);
+ }
+ if (ok) {
+ model.ipar = sgn;
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/PRODUCT.pickle b/js/NonLinear/PRODUCT.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/PRODUCT.pickle
+++ b/js/NonLinear/PRODUCT.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/PROD_f.js b/js/NonLinear/PROD_f.js
index 039a765b..af76e144 100644
--- a/js/NonLinear/PROD_f.js
+++ b/js/NonLinear/PROD_f.js
@@ -7,13 +7,14 @@ function PROD_f() {
model.out = -1;
model.blocktype = "c";
model.dep_ut = [true,false];
- x = standard_define([1,1],model,[],[]);
+ this.x = standard_define([1,1],model,[],[]);
}
PROD_f.prototype.details = function PROD_f() {
+ return this.x;
}
PROD_f.prototype.get = function PROD_f() {
}
PROD_f.prototype.set = function PROD_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/NonLinear/PROD_f.pickle b/js/NonLinear/PROD_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/PROD_f.pickle
+++ b/js/NonLinear/PROD_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/QUANT_f.js b/js/NonLinear/QUANT_f.js
index a21c671c..d54077a6 100644
--- a/js/NonLinear/QUANT_f.js
+++ b/js/NonLinear/QUANT_f.js
@@ -13,43 +13,44 @@ function QUANT_f() {
model.dep_ut = [true,false];
exprs = [[string(pas)],[string(meth)]];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
QUANT_f.prototype.details = function QUANT_f() {
+ return this.x;
}
QUANT_f.prototype.get = function QUANT_f() {
}
QUANT_f.prototype.set = function QUANT_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,pas,meth,exprs] = scicos_getvalue("Set parameters",[["Step"],["Quantization Type (1-4)"]],list("vec",1,"vec",1),exprs);
- if (!ok) {
-break;
-}
- if (meth<1||meth>4) {
-message("Quantization Type must be from 1 to 4");
- } else {
- rpar = pas;
- model.rpar = rpar;
- model.ipar = meth;
- switch (meth) {
- case 1:
- model.sim = "qzrnd";
- case 2:
- model.sim = "qztrn";
- case 3:
- model.sim = "qzflr";
- case 4:
- model.sim = "qzcel";
-}
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,pas,meth,exprs] = scicos_getvalue("Set parameters",[["Step"],["Quantization Type (1-4)"]],list("vec",1,"vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (meth<1||meth>4) {
+ message("Quantization Type must be from 1 to 4");
+ } else {
+ rpar = pas;
+ model.rpar = rpar;
+ model.ipar = meth;
+ switch (meth) {
+ case 1:
+ model.sim = "qzrnd";
+ case 2:
+ model.sim = "qztrn";
+ case 3:
+ model.sim = "qzflr";
+ case 4:
+ model.sim = "qzcel";
+ }
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/QUANT_f.pickle b/js/NonLinear/QUANT_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/QUANT_f.pickle
+++ b/js/NonLinear/QUANT_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/SATURATION.js b/js/NonLinear/SATURATION.js
index 9d4ee666..d435baa6 100644
--- a/js/NonLinear/SATURATION.js
+++ b/js/NonLinear/SATURATION.js
@@ -15,39 +15,40 @@ function SATURATION() {
model.dep_ut = [true,false];
exprs = [[string(maxp)],[string(minp)],[string(model.nmode)]];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
SATURATION.prototype.details = function SATURATION() {
+ return this.x;
}
SATURATION.prototype.get = function SATURATION() {
}
SATURATION.prototype.set = function SATURATION() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,maxp,minp,zeroc,exprs] = scicos_getvalue("Set Saturation parameters",[["Upper limit"],["Lower limit"],["zero crossing (0:no, 1:yes)"]],list("vec",1,"vec",1,"vec",1),exprs);
- if (!ok) {
-break;
-}
- if (maxp<=minp) {
-message("Upper limit must be > Lower limit");
- } else {
- rpar = [[maxp],[minp]];
- model.rpar = rpar;
- if (zeroc!=0) {
- model.nzcross = 2;
- model.nmode = 1;
- } else {
- model.nzcross = 0;
- model.nmode = 0;
-}
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,maxp,minp,zeroc,exprs] = scicos_getvalue("Set Saturation parameters",[["Upper limit"],["Lower limit"],["zero crossing (0:no, 1:yes)"]],list("vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (maxp<=minp) {
+ message("Upper limit must be > Lower limit");
+ } else {
+ rpar = [[maxp],[minp]];
+ model.rpar = rpar;
+ if (zeroc!=0) {
+ model.nzcross = 2;
+ model.nmode = 1;
+ } else {
+ model.nzcross = 0;
+ model.nmode = 0;
+ }
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/SATURATION.pickle b/js/NonLinear/SATURATION.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/SATURATION.pickle
+++ b/js/NonLinear/SATURATION.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/SAT_f.js b/js/NonLinear/SAT_f.js
index dec7d1c5..6686e659 100644
--- a/js/NonLinear/SAT_f.js
+++ b/js/NonLinear/SAT_f.js
@@ -15,35 +15,36 @@ function SAT_f() {
model.dep_ut = [true,false];
exprs = [[string(minp)],[string(maxp)],[string(slope)]];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
SAT_f.prototype.details = function SAT_f() {
+ return this.x;
}
SAT_f.prototype.get = function SAT_f() {
}
SAT_f.prototype.set = function SAT_f() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,minp,maxp,pente,exprs] = scicos_getvalue("Set Saturation parameters",[["Min"],["Max"],["Slope"]],list("vec",1,"vec",1,"vec",1),exprs);
- if (!ok) {
-break;
-}
- if (maxp<=0) {
-message("Max must be strictly positive");
- } else if (pente<=0) {
-message("Slope must be strictly positive");
- } else {
- rpar = [[minp/pente],[maxp/pente],[pente]];
- model.rpar = rpar;
- model.firing = [];
- graphics.exprs = exprs;
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,minp,maxp,pente,exprs] = scicos_getvalue("Set Saturation parameters",[["Min"],["Max"],["Slope"]],list("vec",1,"vec",1,"vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (maxp<=0) {
+ message("Max must be strictly positive");
+ } else if (pente<=0) {
+ message("Slope must be strictly positive");
+ } else {
+ rpar = [[minp/pente],[maxp/pente],[pente]];
+ model.rpar = rpar;
+ model.firing = [];
+ graphics.exprs = exprs;
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/SAT_f.pickle b/js/NonLinear/SAT_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/SAT_f.pickle
+++ b/js/NonLinear/SAT_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/SIGNUM.js b/js/NonLinear/SIGNUM.js
index eac404cd..e5cf8b00 100644
--- a/js/NonLinear/SIGNUM.js
+++ b/js/NonLinear/SIGNUM.js
@@ -12,35 +12,36 @@ function SIGNUM() {
model.dep_ut = [true,false];
exprs = [string([1])];
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
SIGNUM.prototype.details = function SIGNUM() {
+ return this.x;
}
SIGNUM.prototype.get = function SIGNUM() {
}
SIGNUM.prototype.set = function SIGNUM() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
while (true) {
- [ok,zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs);
- if (!ok) {
-break;
-}
- graphics.exprs = exprs;
- if (ok) {
- if (zcr!=0) {
- model.nmode = -1;
- model.nzcross = -1;
- } else {
- model.nmode = 0;
- model.nzcross = 0;
-}
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,zcr,exprs] = scicos_getvalue("Set block parameters",["use zero_crossing (1: yes) (0:no)"],list("vec",1),exprs);
+ if (!ok) {
+ break;
+ }
+ graphics.exprs = exprs;
+ if (ok) {
+ if (zcr!=0) {
+ model.nmode = -1;
+ model.nzcross = -1;
+ } else {
+ model.nmode = 0;
+ model.nzcross = 0;
+ }
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/SIGNUM.pickle b/js/NonLinear/SIGNUM.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/SIGNUM.pickle
+++ b/js/NonLinear/SIGNUM.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/SINBLK_f.js b/js/NonLinear/SINBLK_f.js
index 16a79b3e..f71f9ab2 100644
--- a/js/NonLinear/SINBLK_f.js
+++ b/js/NonLinear/SINBLK_f.js
@@ -9,13 +9,14 @@ function SINBLK_f() {
model.dep_ut = [true,false];
exprs = " ";
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
SINBLK_f.prototype.details = function SINBLK_f() {
+ return this.x;
}
SINBLK_f.prototype.get = function SINBLK_f() {
}
SINBLK_f.prototype.set = function SINBLK_f() {
- x = arg1;
+ this.x = arg1;
}
}
diff --git a/js/NonLinear/SINBLK_f.pickle b/js/NonLinear/SINBLK_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/SINBLK_f.pickle
+++ b/js/NonLinear/SINBLK_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/TANBLK_f.js b/js/NonLinear/TANBLK_f.js
index a0e07ae7..c92309d8 100644
--- a/js/NonLinear/TANBLK_f.js
+++ b/js/NonLinear/TANBLK_f.js
@@ -10,14 +10,15 @@ function TANBLK_f() {
model.dep_ut = [true,false];
exprs = sci2exp(in1);
gr_i = [];
- x = standard_define([2,2],model,exprs,gr_i);
+ this.x = standard_define([2,2],model,exprs,gr_i);
}
TANBLK_f.prototype.details = function TANBLK_f() {
+ return this.x;
}
TANBLK_f.prototype.get = function TANBLK_f() {
}
TANBLK_f.prototype.set = function TANBLK_f() {
- x = arg1;
- x.model.firing = [];
+ this.x = arg1;
+ this.x.model.firing = [];
}
}
diff --git a/js/NonLinear/TANBLK_f.pickle b/js/NonLinear/TANBLK_f.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/TANBLK_f.pickle
+++ b/js/NonLinear/TANBLK_f.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file
diff --git a/js/NonLinear/TrigFun.js b/js/NonLinear/TrigFun.js
index e1aaf7bf..ef058d3e 100644
--- a/js/NonLinear/TrigFun.js
+++ b/js/NonLinear/TrigFun.js
@@ -9,33 +9,34 @@ function TrigFun() {
model.dep_ut = [true,false];
exprs = "sin";
gr_i = [];
- x = standard_define([4,2],model,exprs,gr_i);
+ this.x = standard_define([4,2],model,exprs,gr_i);
}
TrigFun.prototype.details = function TrigFun() {
+ return this.x;
}
TrigFun.prototype.get = function TrigFun() {
}
TrigFun.prototype.set = function TrigFun() {
- x = arg1;
+ this.x = arg1;
graphics = arg1.graphics;
exprs = graphics.exprs;
model = arg1.model;
PREVAR_FF = [["sin"],["cos"],["tan"],["asin"],["acos"],["atan"],["sinh"],["cosh"],["tanh"],["asinh"],["acosh"],["atanh"]];
PREVAR_GG = [["Choose among "+strcat(PREVAR_FF.slice(1-1,4),", ")],[strcat(PREVAR_FF.slice(5-1,$),", ")]];
while (true) {
- [ok,fun,exprs] = scicos_getvalue(PREVAR_GG,"Function",list("str",1),exprs);
- if (!ok) {
-break;
-}
- if (find(PREVAR_FF==fun)==[]) {
-message("Sorry but "+fun+" is not in the list!");
- } else {
- graphics.exprs = exprs;
-execstr("model.sim=list(\'"+fun+"_blk\',4)");
- x.graphics = graphics;
- x.model = model;
-break;
-}
-}
+ [ok,fun,exprs] = scicos_getvalue(PREVAR_GG,"Function",list("str",1),exprs);
+ if (!ok) {
+ break;
+ }
+ if (find(PREVAR_FF==fun)==[]) {
+ message("Sorry but "+fun+" is not in the list!");
+ } else {
+ graphics.exprs = exprs;
+ execstr("model.sim=list(\'"+fun+"_blk\',4)");
+ this.x.graphics = graphics;
+ this.x.model = model;
+ break;
+ }
+ }
}
}
diff --git a/js/NonLinear/TrigFun.pickle b/js/NonLinear/TrigFun.pickle
index 154645d8..0d1dde24 100644
--- a/js/NonLinear/TrigFun.pickle
+++ b/js/NonLinear/TrigFun.pickle
@@ -2,6 +2,8 @@ c__builtin__
set
p0
((lp1
-tp2
-Rp3
+S'x'
+p2
+atp3
+Rp4
. \ No newline at end of file