summaryrefslogtreecommitdiff
path: root/js/NonLinear
diff options
context:
space:
mode:
Diffstat (limited to 'js/NonLinear')
-rw-r--r--js/NonLinear/ABSBLK_f.js18
-rw-r--r--js/NonLinear/ABS_VALUE.js58
-rw-r--r--js/NonLinear/COSBLK_f.js20
-rw-r--r--js/NonLinear/DLRADAPT_f.js80
-rw-r--r--js/NonLinear/EXPBLK_f.js54
-rw-r--r--js/NonLinear/EXPBLK_m.js62
-rw-r--r--js/NonLinear/FSV_f.js22
-rw-r--r--js/NonLinear/INTRP2BLK_f.js60
-rw-r--r--js/NonLinear/INTRPLBLK_f.js54
-rw-r--r--js/NonLinear/INVBLK.js22
-rw-r--r--js/NonLinear/INVBLK_f.js22
-rw-r--r--js/NonLinear/LOGBLK_f.js56
-rw-r--r--js/NonLinear/LOOKUP2D.js136
-rw-r--r--js/NonLinear/LOOKUP_f.js60
-rw-r--r--js/NonLinear/MAXMIN.js88
-rw-r--r--js/NonLinear/MAX_f.js24
-rw-r--r--js/NonLinear/MIN_f.js24
-rw-r--r--js/NonLinear/POWBLK_f.js62
-rw-r--r--js/NonLinear/PRODUCT.js86
-rw-r--r--js/NonLinear/PROD_f.js16
-rw-r--r--js/NonLinear/QUANT_f.js74
-rw-r--r--js/NonLinear/SATURATION.js70
-rw-r--r--js/NonLinear/SAT_f.js62
-rw-r--r--js/NonLinear/SIGNUM.js58
-rw-r--r--js/NonLinear/SINBLK_f.js20
-rw-r--r--js/NonLinear/TANBLK_f.js24
-rw-r--r--js/NonLinear/TrigFun.js46
27 files changed, 689 insertions, 689 deletions
diff --git a/js/NonLinear/ABSBLK_f.js b/js/NonLinear/ABSBLK_f.js
index 8f7ed9bc..a5cacb5f 100644
--- a/js/NonLinear/ABSBLK_f.js
+++ b/js/NonLinear/ABSBLK_f.js
@@ -1,20 +1,20 @@
/* autogenerated from "macros/NonLinear/ABSBLK_f.sci" */
function ABSBLK_f() {
ABSBLK_f.prototype.define = function ABSBLK_f() {
-model=scicos_model();
-model.sim=list("absblk",1);
-model.in1=-1;
-model.out=-1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-gr_i=[];
-x=standard_define([2,2],model,[],gr_i);
+ model = scicos_model();
+ model.sim = list("absblk",1);
+ model.in1 = -1;
+ model.out = -1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ gr_i = [];
+ x = standard_define([2,2],model,[],gr_i);
}
ABSBLK_f.prototype.details = function ABSBLK_f() {
}
ABSBLK_f.prototype.get = function ABSBLK_f() {
}
ABSBLK_f.prototype.set = function ABSBLK_f() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/NonLinear/ABS_VALUE.js b/js/NonLinear/ABS_VALUE.js
index 2bd8b5f1..6d946c72 100644
--- a/js/NonLinear/ABS_VALUE.js
+++ b/js/NonLinear/ABS_VALUE.js
@@ -1,44 +1,44 @@
/* autogenerated from "macros/NonLinear/ABS_VALUE.sci" */
function ABS_VALUE() {
ABS_VALUE.prototype.define = function ABS_VALUE() {
-nu=-1;
-model=scicos_model();
-model.sim=list("absolute_value",4);
-model.in1=nu;
-model.out=nu;
-model.nzcross=nu;
-model.nmode=nu;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[string([1])];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ nu = -1;
+ model = scicos_model();
+ model.sim = list("absolute_value",4);
+ model.in1 = nu;
+ model.out = nu;
+ model.nzcross = nu;
+ model.nmode = nu;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [string([1])];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
ABS_VALUE.prototype.details = function ABS_VALUE() {
}
ABS_VALUE.prototype.get = function ABS_VALUE() {
}
ABS_VALUE.prototype.set = function ABS_VALUE() {
-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) {
+ 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;
+ 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;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/COSBLK_f.js b/js/NonLinear/COSBLK_f.js
index 95a693b2..2710f73f 100644
--- a/js/NonLinear/COSBLK_f.js
+++ b/js/NonLinear/COSBLK_f.js
@@ -1,21 +1,21 @@
/* autogenerated from "macros/NonLinear/COSBLK_f.sci" */
function COSBLK_f() {
COSBLK_f.prototype.define = function COSBLK_f() {
-in1=1;
-model=scicos_model();
-model.sim="cosblk";
-model.in1=-1;
-model.out=-1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-gr_i=[];
-x=standard_define([2,2],model,[],gr_i);
+ in1 = 1;
+ model = scicos_model();
+ model.sim = "cosblk";
+ model.in1 = -1;
+ model.out = -1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ gr_i = [];
+ x = standard_define([2,2],model,[],gr_i);
}
COSBLK_f.prototype.details = function COSBLK_f() {
}
COSBLK_f.prototype.get = function COSBLK_f() {
}
COSBLK_f.prototype.set = function COSBLK_f() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/NonLinear/DLRADAPT_f.js b/js/NonLinear/DLRADAPT_f.js
index 38d79f15..2a151d95 100644
--- a/js/NonLinear/DLRADAPT_f.js
+++ b/js/NonLinear/DLRADAPT_f.js
@@ -1,56 +1,56 @@
/* autogenerated from "macros/NonLinear/DLRADAPT_f.sci" */
function DLRADAPT_f() {
DLRADAPT_f.prototype.define = function DLRADAPT_f() {
-p=[[0],[1]];
-rn=[];
-rd=[[math.complex(0.2,0.8),math.complex(0.2,-0.8)],[math.complex(0.3,0.7),math.complex(0.3,-0.7)]];
-g=[[1],[1]];
-last_u=[];
-last_y=[[0],[0]];
-model=scicos_model();
-model.sim="dlradp";
-model.in1=[[1],[1]];
-model.out=1;
-model.evtin=1;
-model.dstate=[[last_u],[last_y]];
-model.rpar=[[p.slice()],[real(rn.slice())],[imag(rn.slice())],[real(rd.slice())],[imag(rd.slice())],[g.slice()]];
-model.ipar=[[0],[2],[2]];
-model.blocktype="d";
-model.firing=[];
-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);
+ p = [[0],[1]];
+ rn = [];
+ rd = [[math.complex(0.2,0.8),math.complex(0.2,-0.8)],[math.complex(0.3,0.7),math.complex(0.3,-0.7)]];
+ g = [[1],[1]];
+ last_u = [];
+ last_y = [[0],[0]];
+ model = scicos_model();
+ model.sim = "dlradp";
+ model.in1 = [[1],[1]];
+ model.out = 1;
+ model.evtin = 1;
+ model.dstate = [[last_u],[last_y]];
+ model.rpar = [[p.slice()],[real(rn.slice())],[imag(rn.slice())],[real(rd.slice())],[imag(rd.slice())],[g.slice()]];
+ model.ipar = [[0],[2],[2]];
+ model.blocktype = "d";
+ model.firing = [];
+ 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);
}
DLRADAPT_f.prototype.details = function DLRADAPT_f() {
}
DLRADAPT_f.prototype.get = function DLRADAPT_f() {
}
DLRADAPT_f.prototype.set = function DLRADAPT_f() {
-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) {
+ 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) {
+ 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,"*")) {
+ } 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;
+ } 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;
}
}
diff --git a/js/NonLinear/EXPBLK_f.js b/js/NonLinear/EXPBLK_f.js
index 67333791..e3b39f45 100644
--- a/js/NonLinear/EXPBLK_f.js
+++ b/js/NonLinear/EXPBLK_f.js
@@ -1,43 +1,43 @@
/* autogenerated from "macros/NonLinear/EXPBLK_f.sci" */
function EXPBLK_f() {
EXPBLK_f.prototype.define = function EXPBLK_f() {
-in1=1;
-a=math.E;
-model=scicos_model();
-model.sim="expblk";
-model.in1=-1;
-model.out=-1;
-model.rpar=a;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=["%e"];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = 1;
+ a = math.E;
+ model = scicos_model();
+ model.sim = "expblk";
+ model.in1 = -1;
+ model.out = -1;
+ model.rpar = a;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = ["%e"];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
EXPBLK_f.prototype.details = function EXPBLK_f() {
}
EXPBLK_f.prototype.get = function EXPBLK_f() {
}
EXPBLK_f.prototype.set = function EXPBLK_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-if (size(exprs,"*")==2) {
-exprs=exprs[2-1];
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ if (size(exprs,"*")==2) {
+ exprs = exprs[2-1];
}
-while (true) {
-[ok,a,exprs]=scicos_getvalue("Set a^u block parameters","a (>0)",list("vec",1),exprs);
-if (!ok) {
+ 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)) {
+ if (or(a<=0)) {
message("a^u : a must be positive");
-} else {
-graphics.exprs=exprs;
-model.rpar=a;
-x.graphics=graphics;
-x.model=model;
+ } else {
+ graphics.exprs = exprs;
+ model.rpar = a;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/EXPBLK_m.js b/js/NonLinear/EXPBLK_m.js
index 2be7b405..0c162d3d 100644
--- a/js/NonLinear/EXPBLK_m.js
+++ b/js/NonLinear/EXPBLK_m.js
@@ -1,47 +1,47 @@
/* autogenerated from "macros/NonLinear/EXPBLK_m.sci" */
function EXPBLK_m() {
EXPBLK_m.prototype.define = function EXPBLK_m() {
-in1=1;
-a=math.E;
-model=scicos_model();
-model.sim=list("expblk_m",4);
-model.in1=-1;
-model.in2=-2;
-model.out=-1;
-model.out2=-2;
-model.intyp=1;
-model.outtyp=1;
-model.rpar=a;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=["%e"];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = 1;
+ a = math.E;
+ model = scicos_model();
+ model.sim = list("expblk_m",4);
+ model.in1 = -1;
+ model.in2 = -2;
+ model.out = -1;
+ model.out2 = -2;
+ model.intyp = 1;
+ model.outtyp = 1;
+ model.rpar = a;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = ["%e"];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
EXPBLK_m.prototype.details = function EXPBLK_m() {
}
EXPBLK_m.prototype.get = function EXPBLK_m() {
}
EXPBLK_m.prototype.set = function EXPBLK_m() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-if (size(exprs,"*")==2) {
-exprs=exprs[2-1];
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ if (size(exprs,"*")==2) {
+ exprs = exprs[2-1];
}
-while (true) {
-[ok,a,exprs]=scicos_getvalue("Set a^u block parameters","a (>0)",list("vec",1),exprs);
-if (!ok) {
+ 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)) {
+ if (or(a<=0)) {
message("a^u : a must be positive");
-} else {
-graphics.exprs=exprs;
-model.rpar=a;
-x.graphics=graphics;
-x.model=model;
+ } else {
+ graphics.exprs = exprs;
+ model.rpar = a;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/FSV_f.js b/js/NonLinear/FSV_f.js
index b3ae1233..8820fd33 100644
--- a/js/NonLinear/FSV_f.js
+++ b/js/NonLinear/FSV_f.js
@@ -1,22 +1,22 @@
/* autogenerated from "macros/NonLinear/FSV_f.sci" */
function FSV_f() {
FSV_f.prototype.define = function FSV_f() {
-in1=1;
-model=scicos_model();
-model.sim=list("fsv",1);
-model.in1=in1;
-model.out=in1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=" ";
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = 1;
+ model = scicos_model();
+ model.sim = list("fsv",1);
+ model.in1 = in1;
+ model.out = in1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = " ";
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
FSV_f.prototype.details = function FSV_f() {
}
FSV_f.prototype.get = function FSV_f() {
}
FSV_f.prototype.set = function FSV_f() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/NonLinear/INTRP2BLK_f.js b/js/NonLinear/INTRP2BLK_f.js
index 08429dd4..479b0919 100644
--- a/js/NonLinear/INTRP2BLK_f.js
+++ b/js/NonLinear/INTRP2BLK_f.js
@@ -1,46 +1,46 @@
/* autogenerated from "macros/NonLinear/INTRP2BLK_f.sci" */
function INTRP2BLK_f() {
INTRP2BLK_f.prototype.define = function INTRP2BLK_f() {
-a=[[0],[1]];
-b=[[0],[1]];
-c=[[0,1],[1,2]];
-model=scicos_model();
-model.sim=list("intrp2",1);
-model.in1=[[1],[1]];
-model.out=1;
-model.rpar=[[a],[b],[c.slice()]];
-model.ipar=[[2],[2]];
-model.blocktype="c";
-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);
+ a = [[0],[1]];
+ b = [[0],[1]];
+ c = [[0,1],[1,2]];
+ model = scicos_model();
+ model.sim = list("intrp2",1);
+ model.in1 = [[1],[1]];
+ model.out = 1;
+ model.rpar = [[a],[b],[c.slice()]];
+ model.ipar = [[2],[2]];
+ model.blocktype = "c";
+ 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);
}
INTRP2BLK_f.prototype.details = function INTRP2BLK_f() {
}
INTRP2BLK_f.prototype.get = function INTRP2BLK_f() {
}
INTRP2BLK_f.prototype.set = function INTRP2BLK_f() {
-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) {
+ 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")) {
+ 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) {
+ } 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;
+ } 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;
}
}
diff --git a/js/NonLinear/INTRPLBLK_f.js b/js/NonLinear/INTRPLBLK_f.js
index 7472a5a9..0baee92b 100644
--- a/js/NonLinear/INTRPLBLK_f.js
+++ b/js/NonLinear/INTRPLBLK_f.js
@@ -1,43 +1,43 @@
/* autogenerated from "macros/NonLinear/INTRPLBLK_f.sci" */
function INTRPLBLK_f() {
INTRPLBLK_f.prototype.define = function INTRPLBLK_f() {
-a=[[0],[1]];
-b=[[0],[1]];
-model=scicos_model();
-model.sim="intrpl";
-model.in1=1;
-model.out=1;
-model.rpar=[[a],[b]];
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[strcat(sci2exp(a))],[strcat(sci2exp(b))]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ a = [[0],[1]];
+ b = [[0],[1]];
+ model = scicos_model();
+ model.sim = "intrpl";
+ model.in1 = 1;
+ model.out = 1;
+ model.rpar = [[a],[b]];
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[strcat(sci2exp(a))],[strcat(sci2exp(b))]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
INTRPLBLK_f.prototype.details = function INTRPLBLK_f() {
}
INTRPLBLK_f.prototype.get = function INTRPLBLK_f() {
}
INTRPLBLK_f.prototype.set = function INTRPLBLK_f() {
-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) {
+ 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,"*")) {
+ 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) {
+ } 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;
+ } else {
+ if (ok) {
+ graphics.exprs = exprs;
+ model.rpar = [[a.slice()],[b.slice()]];
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/INVBLK.js b/js/NonLinear/INVBLK.js
index 440959e8..d5d559f3 100644
--- a/js/NonLinear/INVBLK.js
+++ b/js/NonLinear/INVBLK.js
@@ -1,22 +1,22 @@
/* autogenerated from "macros/NonLinear/INVBLK.sci" */
function INVBLK() {
INVBLK.prototype.define = function INVBLK() {
-in1=-1;
-model=scicos_model();
-model.sim=list("invblk4",4);
-model.in1=in1;
-model.out=in1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=" ";
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = -1;
+ model = scicos_model();
+ model.sim = list("invblk4",4);
+ model.in1 = in1;
+ model.out = in1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = " ";
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
INVBLK.prototype.details = function INVBLK() {
}
INVBLK.prototype.get = function INVBLK() {
}
INVBLK.prototype.set = function INVBLK() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/NonLinear/INVBLK_f.js b/js/NonLinear/INVBLK_f.js
index 21ea62cb..bca99397 100644
--- a/js/NonLinear/INVBLK_f.js
+++ b/js/NonLinear/INVBLK_f.js
@@ -1,22 +1,22 @@
/* autogenerated from "macros/NonLinear/INVBLK_f.sci" */
function INVBLK_f() {
INVBLK_f.prototype.define = function INVBLK_f() {
-in1=-1;
-model=scicos_model();
-model.sim="invblk";
-model.in1=in1;
-model.out=in1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=" ";
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = -1;
+ model = scicos_model();
+ model.sim = "invblk";
+ model.in1 = in1;
+ model.out = in1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = " ";
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
INVBLK_f.prototype.details = function INVBLK_f() {
}
INVBLK_f.prototype.get = function INVBLK_f() {
}
INVBLK_f.prototype.set = function INVBLK_f() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/NonLinear/LOGBLK_f.js b/js/NonLinear/LOGBLK_f.js
index bc17f2bf..d57bfed7 100644
--- a/js/NonLinear/LOGBLK_f.js
+++ b/js/NonLinear/LOGBLK_f.js
@@ -1,44 +1,44 @@
/* autogenerated from "macros/NonLinear/LOGBLK_f.sci" */
function LOGBLK_f() {
LOGBLK_f.prototype.define = function LOGBLK_f() {
-in1=1;
-a=math.E;
-model=scicos_model();
-model.sim="logblk";
-model.in1=-1;
-model.out=-1;
-model.rpar=a;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs="%e";
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = 1;
+ a = math.E;
+ model = scicos_model();
+ model.sim = "logblk";
+ model.in1 = -1;
+ model.out = -1;
+ model.rpar = a;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = "%e";
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
LOGBLK_f.prototype.details = function LOGBLK_f() {
}
LOGBLK_f.prototype.get = function LOGBLK_f() {
}
LOGBLK_f.prototype.set = function LOGBLK_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-if (size(exprs,"*")==2) {
-exprs=exprs[2-1];
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ if (size(exprs,"*")==2) {
+ exprs = exprs[2-1];
}
-while (true) {
-[ok,a,exprs]=scicos_getvalue("Set log block parameters","Basis (>1)",list("vec",1),exprs);
-if (!ok) {
+ while (true) {
+ [ok,a,exprs] = scicos_getvalue("Set log block parameters","Basis (>1)",list("vec",1),exprs);
+ if (!ok) {
break;
}
-if (a<=1) {
+ 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;
+ } else {
+ if (ok) {
+ graphics.exprs = exprs;
+ model.rpar = a;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/LOOKUP2D.js b/js/NonLinear/LOOKUP2D.js
index 9576a841..355a3523 100644
--- a/js/NonLinear/LOOKUP2D.js
+++ b/js/NonLinear/LOOKUP2D.js
@@ -1,96 +1,96 @@
/* autogenerated from "macros/NonLinear/LOOKUP2D.sci" */
function LOOKUP2D() {
LOOKUP2D.prototype.define = function LOOKUP2D() {
-model=scicos_model();
-xx=[1:4];
-yy=[1:3];
-zz=[[4,5,6],[16,19,20],[10,18,23],[6,3,-1]];
-Method=1;
-Graf="n";
-Nx=length(xx);
-Ny=length(yy);
-model.sim=list("lookup2d",4);
-model.in1=[[1],[1]];
-model.out=1;
-model.rpar=[[xx.slice()],[yy.slice()],[zz.slice()]];
-model.ipar=[[Nx],[Ny],[Method]];
-model.blocktype="c";
-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);
+ model = scicos_model();
+ xx = [1:4];
+ yy = [1:3];
+ zz = [[4,5,6],[16,19,20],[10,18,23],[6,3,-1]];
+ Method = 1;
+ Graf = "n";
+ Nx = length(xx);
+ Ny = length(yy);
+ model.sim = list("lookup2d",4);
+ model.in1 = [[1],[1]];
+ model.out = 1;
+ model.rpar = [[xx.slice()],[yy.slice()],[zz.slice()]];
+ model.ipar = [[Nx],[Ny],[Method]];
+ model.blocktype = "c";
+ 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);
}
LOOKUP2D.prototype.details = function LOOKUP2D() {
}
LOOKUP2D.prototype.get = function LOOKUP2D() {
}
LOOKUP2D.prototype.set = function LOOKUP2D() {
-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) {
+ 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;
+ mtd = int(Method);
+ if (mtd<1) {
+ mtd = 1;
}
-if (mtd>6) {
-mtd=6;
+ if (mtd>6) {
+ mtd = 6;
}
-if (graf!="y"&&graf!="Y") {
-graf="n";
+ 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))) {
+ 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;
+ Ask_again = true;
}
-if (!((nx==nz)&&(ny==mz))) {
+ if (!((nx==nz)&&(ny==mz))) {
x_message("incompatible size of x and y");
-Ask_again=true;
+ Ask_again = true;
}
-[ok]=test_increasing(xx);
-if ((!ok)) {
+ [ok] = test_increasing(xx);
+ if ((!ok)) {
x_message("Row input values must be monotonically increasing");
-Ask_again=true;
+ Ask_again = true;
}
-[ok]=test_increasing(yy);
-if ((!ok)) {
+ [ok] = test_increasing(yy);
+ if ((!ok)) {
x_message("Column input values must be monotonically increasing");
-Ask_again=true;
+ 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;
+ 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;
+ 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;
+ model.rpar = [[xx.slice()],[yy.slice()],[zz.slice()]];
+ model.ipar = [[nx],[ny],[mtd]];
+ graphics.exprs = exprs;
+ x.model = model;
+ x.graphics = graphics;
break;
}
}
diff --git a/js/NonLinear/LOOKUP_f.js b/js/NonLinear/LOOKUP_f.js
index 79bf816d..89ff8713 100644
--- a/js/NonLinear/LOOKUP_f.js
+++ b/js/NonLinear/LOOKUP_f.js
@@ -1,48 +1,48 @@
/* autogenerated from "macros/NonLinear/LOOKUP_f.sci" */
function LOOKUP_f() {
LOOKUP_f.prototype.define = function LOOKUP_f() {
-model=scicos_model();
-model.sim="lookup";
-model.in1=1;
-model.out=1;
-model.rpar=[[-2],[-1],[1],[2],[-1],[1],[-1],[1]];
-model.blocktype="c";
-model.dep_ut=[true,false];
-gr_i=[];
-x=standard_define([2,2],model,[],gr_i);
+ model = scicos_model();
+ model.sim = "lookup";
+ model.in1 = 1;
+ model.out = 1;
+ model.rpar = [[-2],[-1],[1],[2],[-1],[1],[-1],[1]];
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ gr_i = [];
+ x = standard_define([2,2],model,[],gr_i);
}
LOOKUP_f.prototype.details = function LOOKUP_f() {
}
LOOKUP_f.prototype.get = function LOOKUP_f() {
}
LOOKUP_f.prototype.set = function LOOKUP_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-rpar=model.rpar;
-n=size(rpar,"*")/2;
-xx=rpar.slice(1-1,n);
-yy=rpar.slice(n+1-1,2*n);
-while (true) {
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ rpar = model.rpar;
+ n = size(rpar,"*")/2;
+ 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 (!or(fun=="do_eval")) {
+ [xx,yy,ok,gc] = edit_curv(xx,yy,"axy");
+ } else {
+ ok = true;
}
-if (!ok) {
+ if (!ok) {
break;
}
-n=size(xx,"*");
-if (or(xx.slice(2-1,n)-xx.slice(1-1,n-1)<=0)) {
+ 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;
+ ok = false;
}
-if (ok) {
-model.rpar=[[xx.slice()],[yy.slice()]];
-x.graphics=graphics;
-x.model=model;
+ if (ok) {
+ model.rpar = [[xx.slice()],[yy.slice()]];
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/MAXMIN.js b/js/NonLinear/MAXMIN.js
index 66a6a999..c85734cb 100644
--- a/js/NonLinear/MAXMIN.js
+++ b/js/NonLinear/MAXMIN.js
@@ -1,66 +1,66 @@
/* autogenerated from "macros/NonLinear/MAXMIN.sci" */
function MAXMIN() {
MAXMIN.prototype.define = function MAXMIN() {
-model=scicos_model();
-model.sim=list("minmax",4);
-model.out=1;
-model.in1=-1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-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";
+ model = scicos_model();
+ model.sim = list("minmax",4);
+ model.out = 1;
+ model.in1 = -1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ 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";
}
MAXMIN.prototype.details = function MAXMIN() {
}
MAXMIN.prototype.get = function MAXMIN() {
}
MAXMIN.prototype.set = function MAXMIN() {
-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) {
+ 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 (zcr!=0) {
+ zcr = -1;
}
-if (mm!=1) {
-mm=2;
+ if (mm!=1) {
+ mm = 2;
}
-if (nin!=1&&nin!=2) {
+ if (nin!=1&&nin!=2) {
message("Wrong number of inputs, only 1 and 2 allowed");
-ok=false;
+ 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) {
+ 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;
+ 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";
+ 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;
+ graphics.style = "MAXMIN;displayedLabel="+label;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/MAX_f.js b/js/NonLinear/MAX_f.js
index f22c9af9..8367bd9d 100644
--- a/js/NonLinear/MAX_f.js
+++ b/js/NonLinear/MAX_f.js
@@ -1,23 +1,23 @@
/* autogenerated from "macros/NonLinear/MAX_f.sci" */
function MAX_f() {
MAX_f.prototype.define = function MAX_f() {
-in1=-1;
-model=scicos_model();
-model.sim="maxblk";
-model.in1=in1;
-model.out=1;
-model.dstate=[[0],[0]];
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=" ";
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = -1;
+ model = scicos_model();
+ model.sim = "maxblk";
+ model.in1 = in1;
+ model.out = 1;
+ model.dstate = [[0],[0]];
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = " ";
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
MAX_f.prototype.details = function MAX_f() {
}
MAX_f.prototype.get = function MAX_f() {
}
MAX_f.prototype.set = function MAX_f() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/NonLinear/MIN_f.js b/js/NonLinear/MIN_f.js
index 03eaef5d..b38c5eef 100644
--- a/js/NonLinear/MIN_f.js
+++ b/js/NonLinear/MIN_f.js
@@ -1,23 +1,23 @@
/* autogenerated from "macros/NonLinear/MIN_f.sci" */
function MIN_f() {
MIN_f.prototype.define = function MIN_f() {
-in1=-1;
-model=scicos_model();
-model.sim="minblk";
-model.in1=in1;
-model.out=1;
-model.dstate=[[0],[0]];
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=sci2exp(in1);
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = -1;
+ model = scicos_model();
+ model.sim = "minblk";
+ model.in1 = in1;
+ model.out = 1;
+ model.dstate = [[0],[0]];
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = sci2exp(in1);
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
MIN_f.prototype.details = function MIN_f() {
}
MIN_f.prototype.get = function MIN_f() {
}
MIN_f.prototype.set = function MIN_f() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/NonLinear/POWBLK_f.js b/js/NonLinear/POWBLK_f.js
index d766c8c8..b74479bd 100644
--- a/js/NonLinear/POWBLK_f.js
+++ b/js/NonLinear/POWBLK_f.js
@@ -1,47 +1,47 @@
/* autogenerated from "macros/NonLinear/POWBLK_f.sci" */
function POWBLK_f() {
POWBLK_f.prototype.define = function POWBLK_f() {
-in1=1;
-a=1.5;
-model=scicos_model();
-model.sim="powblk";
-model.in1=-1;
-model.out=-1;
-model.rpar=a;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=string(a);
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = 1;
+ a = 1.5;
+ model = scicos_model();
+ model.sim = "powblk";
+ model.in1 = -1;
+ model.out = -1;
+ model.rpar = a;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = string(a);
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
POWBLK_f.prototype.details = function POWBLK_f() {
}
POWBLK_f.prototype.get = function POWBLK_f() {
}
POWBLK_f.prototype.set = function POWBLK_f() {
-x=arg1;
-graphics=arg1.graphics;
-exprs=graphics.exprs;
-model=arg1.model;
-if (size(exprs,"*")==2) {
-exprs=exprs[2-1];
+ x = arg1;
+ graphics = arg1.graphics;
+ exprs = graphics.exprs;
+ model = arg1.model;
+ if (size(exprs,"*")==2) {
+ 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) {
+ 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=[];
+ 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;
+ model.firing = [];
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/PRODUCT.js b/js/NonLinear/PRODUCT.js
index 711602e9..03fbc655 100644
--- a/js/NonLinear/PRODUCT.js
+++ b/js/NonLinear/PRODUCT.js
@@ -1,63 +1,63 @@
/* autogenerated from "macros/NonLinear/PRODUCT.sci" */
function PRODUCT() {
PRODUCT.prototype.define = function PRODUCT() {
-sgn=[[1],[-1]];
-model=scicos_model();
-model.sim=list("product",4);
-model.in1=[[-1],[-1]];
-model.out=-1;
-model.ipar=sgn;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=sci2exp(sgn);
-gr_i=[];
-x=standard_define([2,3],model,exprs,gr_i);
+ sgn = [[1],[-1]];
+ model = scicos_model();
+ model.sim = list("product",4);
+ model.in1 = [[-1],[-1]];
+ model.out = -1;
+ model.ipar = sgn;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = sci2exp(sgn);
+ gr_i = [];
+ x = standard_define([2,3],model,exprs,gr_i);
}
PRODUCT.prototype.details = function PRODUCT() {
}
PRODUCT.prototype.get = function PRODUCT() {
}
PRODUCT.prototype.set = function PRODUCT() {
-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) {
+ 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) {
+ 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;
+ 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)) {
+ } 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;
+ 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,graphics,ok] = check_io(model,graphics,in1,nout,[],[]);
}
-if (ok) {
-model.ipar=sgn;
-graphics.exprs=exprs;
-x.graphics=graphics;
-x.model=model;
+ if (ok) {
+ model.ipar = sgn;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/PROD_f.js b/js/NonLinear/PROD_f.js
index fbff118c..039a765b 100644
--- a/js/NonLinear/PROD_f.js
+++ b/js/NonLinear/PROD_f.js
@@ -1,19 +1,19 @@
/* autogenerated from "macros/NonLinear/PROD_f.sci" */
function PROD_f() {
PROD_f.prototype.define = function PROD_f() {
-model=scicos_model();
-model.sim=list("prod",2);
-model.in1=[[-1],[-1]];
-model.out=-1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-x=standard_define([1,1],model,[],[]);
+ model = scicos_model();
+ model.sim = list("prod",2);
+ model.in1 = [[-1],[-1]];
+ model.out = -1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ x = standard_define([1,1],model,[],[]);
}
PROD_f.prototype.details = function PROD_f() {
}
PROD_f.prototype.get = function PROD_f() {
}
PROD_f.prototype.set = function PROD_f() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/NonLinear/QUANT_f.js b/js/NonLinear/QUANT_f.js
index 20616789..a21c671c 100644
--- a/js/NonLinear/QUANT_f.js
+++ b/js/NonLinear/QUANT_f.js
@@ -1,53 +1,53 @@
/* autogenerated from "macros/NonLinear/QUANT_f.sci" */
function QUANT_f() {
QUANT_f.prototype.define = function QUANT_f() {
-pas=0.1;
-meth=1;
-model=scicos_model();
-model.sim="qzrnd";
-model.in1=-1;
-model.out=-1;
-model.rpar=pas;
-model.ipar=meth;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[string(pas)],[string(meth)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ pas = 0.1;
+ meth = 1;
+ model = scicos_model();
+ model.sim = "qzrnd";
+ model.in1 = -1;
+ model.out = -1;
+ model.rpar = pas;
+ model.ipar = meth;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[string(pas)],[string(meth)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
QUANT_f.prototype.details = function QUANT_f() {
}
QUANT_f.prototype.get = function QUANT_f() {
}
QUANT_f.prototype.set = function QUANT_f() {
-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) {
+ 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) {
+ 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";
+ } 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;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/SATURATION.js b/js/NonLinear/SATURATION.js
index f964564e..9d4ee666 100644
--- a/js/NonLinear/SATURATION.js
+++ b/js/NonLinear/SATURATION.js
@@ -1,51 +1,51 @@
/* autogenerated from "macros/NonLinear/SATURATION.sci" */
function SATURATION() {
SATURATION.prototype.define = function SATURATION() {
-minp=-1;
-maxp=1;
-rpar=[[maxp],[minp]];
-model=scicos_model();
-model.sim=list("satur",4);
-model.in1=1;
-model.nzcross=2;
-model.nmode=1;
-model.out=1;
-model.rpar=rpar;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[string(maxp)],[string(minp)],[string(model.nmode)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ minp = -1;
+ maxp = 1;
+ rpar = [[maxp],[minp]];
+ model = scicos_model();
+ model.sim = list("satur",4);
+ model.in1 = 1;
+ model.nzcross = 2;
+ model.nmode = 1;
+ model.out = 1;
+ model.rpar = rpar;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[string(maxp)],[string(minp)],[string(model.nmode)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
SATURATION.prototype.details = function SATURATION() {
}
SATURATION.prototype.get = function SATURATION() {
}
SATURATION.prototype.set = function SATURATION() {
-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) {
+ 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) {
+ 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;
+ } 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;
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/SAT_f.js b/js/NonLinear/SAT_f.js
index 52827570..dec7d1c5 100644
--- a/js/NonLinear/SAT_f.js
+++ b/js/NonLinear/SAT_f.js
@@ -1,47 +1,47 @@
/* autogenerated from "macros/NonLinear/SAT_f.sci" */
function SAT_f() {
SAT_f.prototype.define = function SAT_f() {
-minp=-1;
-maxp=1;
-slope=1;
-rpar=[[minp],[maxp],[slope]];
-model=scicos_model();
-model.sim=list("lusat",1);
-model.in1=1;
-model.nzcross=2;
-model.out=1;
-model.rpar=[[minp],[maxp],[slope]];
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[[string(minp)],[string(maxp)],[string(slope)]];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ minp = -1;
+ maxp = 1;
+ slope = 1;
+ rpar = [[minp],[maxp],[slope]];
+ model = scicos_model();
+ model.sim = list("lusat",1);
+ model.in1 = 1;
+ model.nzcross = 2;
+ model.out = 1;
+ model.rpar = [[minp],[maxp],[slope]];
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [[string(minp)],[string(maxp)],[string(slope)]];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
SAT_f.prototype.details = function SAT_f() {
}
SAT_f.prototype.get = function SAT_f() {
}
SAT_f.prototype.set = function SAT_f() {
-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) {
+ 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) {
+ if (maxp<=0) {
message("Max must be strictly positive");
-} else if (pente<=0) {
+ } 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;
+ } else {
+ rpar = [[minp/pente],[maxp/pente],[pente]];
+ model.rpar = rpar;
+ model.firing = [];
+ graphics.exprs = exprs;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/SIGNUM.js b/js/NonLinear/SIGNUM.js
index fdf0ba07..eac404cd 100644
--- a/js/NonLinear/SIGNUM.js
+++ b/js/NonLinear/SIGNUM.js
@@ -1,44 +1,44 @@
/* autogenerated from "macros/NonLinear/SIGNUM.sci" */
function SIGNUM() {
SIGNUM.prototype.define = function SIGNUM() {
-nu=-1;
-model=scicos_model();
-model.sim=list("signum",4);
-model.in1=nu;
-model.out=nu;
-model.nzcross=nu;
-model.nmode=nu;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=[string([1])];
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ nu = -1;
+ model = scicos_model();
+ model.sim = list("signum",4);
+ model.in1 = nu;
+ model.out = nu;
+ model.nzcross = nu;
+ model.nmode = nu;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = [string([1])];
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
SIGNUM.prototype.details = function SIGNUM() {
}
SIGNUM.prototype.get = function SIGNUM() {
}
SIGNUM.prototype.set = function SIGNUM() {
-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) {
+ 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;
+ 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;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}
diff --git a/js/NonLinear/SINBLK_f.js b/js/NonLinear/SINBLK_f.js
index 3ef09cf7..16a79b3e 100644
--- a/js/NonLinear/SINBLK_f.js
+++ b/js/NonLinear/SINBLK_f.js
@@ -1,21 +1,21 @@
/* autogenerated from "macros/NonLinear/SINBLK_f.sci" */
function SINBLK_f() {
SINBLK_f.prototype.define = function SINBLK_f() {
-model=scicos_model();
-model.sim="sinblk";
-model.in1=-1;
-model.out=-1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=" ";
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ model = scicos_model();
+ model.sim = "sinblk";
+ model.in1 = -1;
+ model.out = -1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = " ";
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
SINBLK_f.prototype.details = function SINBLK_f() {
}
SINBLK_f.prototype.get = function SINBLK_f() {
}
SINBLK_f.prototype.set = function SINBLK_f() {
-x=arg1;
+ x = arg1;
}
}
diff --git a/js/NonLinear/TANBLK_f.js b/js/NonLinear/TANBLK_f.js
index c785c9c9..a0e07ae7 100644
--- a/js/NonLinear/TANBLK_f.js
+++ b/js/NonLinear/TANBLK_f.js
@@ -1,23 +1,23 @@
/* autogenerated from "macros/NonLinear/TANBLK_f.sci" */
function TANBLK_f() {
TANBLK_f.prototype.define = function TANBLK_f() {
-in1=-1;
-model=scicos_model();
-model.sim="tanblk";
-model.in1=in1;
-model.out=in1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs=sci2exp(in1);
-gr_i=[];
-x=standard_define([2,2],model,exprs,gr_i);
+ in1 = -1;
+ model = scicos_model();
+ model.sim = "tanblk";
+ model.in1 = in1;
+ model.out = in1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = sci2exp(in1);
+ gr_i = [];
+ x = standard_define([2,2],model,exprs,gr_i);
}
TANBLK_f.prototype.details = function TANBLK_f() {
}
TANBLK_f.prototype.get = function TANBLK_f() {
}
TANBLK_f.prototype.set = function TANBLK_f() {
-x=arg1;
-x.model.firing=[];
+ x = arg1;
+ x.model.firing = [];
}
}
diff --git a/js/NonLinear/TrigFun.js b/js/NonLinear/TrigFun.js
index 73840461..e1aaf7bf 100644
--- a/js/NonLinear/TrigFun.js
+++ b/js/NonLinear/TrigFun.js
@@ -1,39 +1,39 @@
/* autogenerated from "macros/NonLinear/TrigFun.sci" */
function TrigFun() {
TrigFun.prototype.define = function TrigFun() {
-model=scicos_model();
-model.sim=list("sin_blk",4);
-model.in1=-1;
-model.out=-1;
-model.blocktype="c";
-model.dep_ut=[true,false];
-exprs="sin";
-gr_i=[];
-x=standard_define([4,2],model,exprs,gr_i);
+ model = scicos_model();
+ model.sim = list("sin_blk",4);
+ model.in1 = -1;
+ model.out = -1;
+ model.blocktype = "c";
+ model.dep_ut = [true,false];
+ exprs = "sin";
+ gr_i = [];
+ x = standard_define([4,2],model,exprs,gr_i);
}
TrigFun.prototype.details = function TrigFun() {
}
TrigFun.prototype.get = function TrigFun() {
}
TrigFun.prototype.set = function TrigFun() {
-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) {
+ 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)==[]) {
+ if (find(PREVAR_FF==fun)==[]) {
message("Sorry but "+fun+" is not in the list!");
-} else {
-graphics.exprs=exprs;
+ } else {
+ graphics.exprs = exprs;
execstr("model.sim=list(\'"+fun+"_blk\',4)");
-x.graphics=graphics;
-x.model=model;
+ x.graphics = graphics;
+ x.model = model;
break;
}
}