summaryrefslogtreecommitdiff
path: root/js/Linear/DLR_f.js
diff options
context:
space:
mode:
authorSunil Shetye2018-06-19 23:23:04 +0530
committerSunil Shetye2018-06-21 18:33:20 +0530
commit8cf65fe92b28b8809abcb0eb59f951d26f30792f (patch)
treed9509c35b6a4c3096d4be449935f88af5568276a /js/Linear/DLR_f.js
parent3f563b9e29d42266d6680229da5c29f847804834 (diff)
downloadsci2js-8cf65fe92b28b8809abcb0eb59f951d26f30792f.tar.gz
sci2js-8cf65fe92b28b8809abcb0eb59f951d26f30792f.tar.bz2
sci2js-8cf65fe92b28b8809abcb0eb59f951d26f30792f.zip
distinguish between functions and arrays
maintain a list of functions
Diffstat (limited to 'js/Linear/DLR_f.js')
-rw-r--r--js/Linear/DLR_f.js73
1 files changed, 71 insertions, 2 deletions
diff --git a/js/Linear/DLR_f.js b/js/Linear/DLR_f.js
index c4748f7e..15c876f2 100644
--- a/js/Linear/DLR_f.js
+++ b/js/Linear/DLR_f.js
@@ -1,3 +1,72 @@
-Syntax error in input LexToken(ASSIGNMENT,'=',1,1930)
/* autogenerated from "macros/Linear/DLR_f.sci" */
-None
+function DLR_f() {
+ DLR_f.prototype.define = function DLR_f() {
+x0=0;
+A=-1;
+B=1;
+C=1;
+D=0;
+exprs=[["1"],["1+z"]];
+model=scicos_model();
+model.sim="dsslti";
+model.in1=1;
+model.out=1;
+model.evtin=1;
+model.dstate=x0.slice();
+model.rpar=[[A.slice()],[B.slice()],[C.slice()],[D.slice()]];
+model.blocktype="d";
+model.dep_ut=[false,false];
+gr_i=[];
+x=standard_define([2.5,2.5],model,exprs,gr_i);
+ }
+ DLR_f.prototype.details = function DLR_f() {
+ }
+ DLR_f.prototype.get = function DLR_f() {
+ }
+ DLR_f.prototype.set = function DLR_f() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+x0=model.dstate;
+ns=prod[size(x0)-1];
+PREVAR_scicos_context=PREVAR_scicos_context;
+PREVAR_scicos_context.z=%z;
+while (true) {
+[ok,num,den,exprs]=scicos_getvalue("Set discrete SISO transfer parameters",[["Numerator (z)"],["Denominator (z)"]],list("pol",1,"pol",1),exprs);
+if (!ok) {
+break;
+}
+if (degree[num-1]>degree[den-1]) {
+message("Transfer must be proper");
+ok=false;
+}
+if (ok) {
+H=cont_frm[num-1][den-1];
+[A,B,C,D]=H.slice(2-1,5);
+graphics.exprs=exprs;
+[ns1,ns1]=size(A);
+if (ns1<=ns) {
+x0=x0.slice(1-1,ns1);
+} else {
+x0[ns1-1][1-1]=0;
+}
+rpar=[[A.slice()],[B.slice()],[C.slice()],[D.slice()]];
+model.dstate=x0;
+model.rpar=rpar;
+if (norm(D,1)!=0) {
+mmm=[true,false];
+} else {
+mmm=[false,false];
+}
+if (or(model.dep_ut!=mmm)) {
+model.dep_ut=mmm;
+}
+x.graphics=graphics;
+x.model=model;
+break;
+}
+}
+x.model.firing=[];
+ }
+}