diff options
author | Sunil Shetye | 2018-06-25 18:20:39 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-06-26 11:06:22 +0530 |
commit | 7465daea85285ba7f291b6bf6ddc45caa9e7ad65 (patch) | |
tree | e8e3e4dd60d469c290d55de15644ddbc1e013bc6 /js/Linear/CLSS_f.js | |
parent | 7c70459c10aed0d74ee03896abaf47fefdbf7c8f (diff) | |
download | sci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.tar.gz sci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.tar.bz2 sci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.zip |
add spacing to end of block also
Diffstat (limited to 'js/Linear/CLSS_f.js')
-rw-r--r-- | js/Linear/CLSS_f.js | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/js/Linear/CLSS_f.js b/js/Linear/CLSS_f.js index 1a78799d..d4c2976a 100644 --- a/js/Linear/CLSS_f.js +++ b/js/Linear/CLSS_f.js @@ -18,60 +18,61 @@ function CLSS_f() { model.dep_ut = [false,true]; exprs = [[strcat(sci2exp(A))],[strcat(sci2exp(B))],[strcat(sci2exp(C))],[strcat(sci2exp(D))],[strcat(sci2exp(x0))]]; gr_i = []; - x = standard_define([4,2],model,exprs,gr_i); + this.x = standard_define([4,2],model,exprs,gr_i); } CLSS_f.prototype.details = function CLSS_f() { + return this.x; } CLSS_f.prototype.get = function CLSS_f() { } CLSS_f.prototype.set = function CLSS_f() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; exprs = graphics.exprs; if (size(exprs,"*")==7) { - exprs = exprs[[1:4,7]-1]; -} + exprs = exprs[[1:4,7]-1]; + } model = arg1.model; while (true) { - [ok,A,B,C,D,x0,exprs] = scicos_getvalue("Set continuous linear system parameters",[["A matrix"],["B matrix"],["C matrix"],["D matrix"],["Initial state"]],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); - if (!ok) { -break; -} - out = size(C,1); - if (out==0) { - out = []; -} - in1 = size(B,2); - if (in1==0) { - in1 = []; -} - [ms,ns] = size(A); - if (ms!=ns) { -message("A matrix must be square"); - } else { - [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); - if (ok) { - graphics.exprs = exprs; - rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; - if (D!=[]) { - if (norm(D,1)!=0) { - mmm = [true,true]; - } else { - mmm = [false,true]; -} - if (or(model.dep_ut!=mmm)) { - model.dep_ut = mmm; -} - } else { - model.dep_ut = [false,true]; -} - model.state = x0.slice(); - model.rpar = rpar; - x.graphics = graphics; - x.model = model; -break; -} -} -} + [ok,A,B,C,D,x0,exprs] = scicos_getvalue("Set continuous linear system parameters",[["A matrix"],["B matrix"],["C matrix"],["D matrix"],["Initial state"]],list("mat",[-1,-1],"mat",["size(%1,2)","-1"],"mat",["-1","size(%1,2)"],"mat",[-1,-1],"vec","size(%1,2)"),exprs); + if (!ok) { + break; + } + out = size(C,1); + if (out==0) { + out = []; + } + in1 = size(B,2); + if (in1==0) { + in1 = []; + } + [ms,ns] = size(A); + if (ms!=ns) { + message("A matrix must be square"); + } else { + [model,graphics,ok] = check_io(model,graphics,in1,out,[],[]); + if (ok) { + graphics.exprs = exprs; + rpar = [[A.slice()],[B.slice()],[C.slice()],[D.slice()]]; + if (D!=[]) { + if (norm(D,1)!=0) { + mmm = [true,true]; + } else { + mmm = [false,true]; + } + if (or(model.dep_ut!=mmm)) { + model.dep_ut = mmm; + } + } else { + model.dep_ut = [false,true]; + } + model.state = x0.slice(); + model.rpar = rpar; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } + } } } |