From cjayuayan at gmail.com Sun Sep 2 18:48:41 2018 From: cjayuayan at gmail.com (CJ Uayan) Date: Sun, 2 Sep 2018 09:48:41 -0700 (MST) Subject: [Scilab-users] SciLab Language Translator Message-ID: <1535906921532-0.post@n3.nabble.com> Hello dear scilab users! I'm a certified newbie in this platform. I was enrolled in a numerical method course that requires us to learn the scilab language. I would just like to ask if are there any way to convert my scilab sketches into the arduino format that uses C language? However, i found another problem: should i create my own function here in scilab such as digitalWrite and pinMode? Thank you Christian -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From fbulayog97 at gmail.com Mon Sep 3 07:35:20 2018 From: fbulayog97 at gmail.com (fernando_ab) Date: Sun, 2 Sep 2018 22:35:20 -0700 (MST) Subject: [Scilab-users] Using Scilab together with the C language Message-ID: <1535952920023-0.post@n3.nabble.com> I'm a new user of Scilab. I have a little background in C language. May I know if what are the things that Scilab can do together with C? For example, using Scilab and C at the same time on the Scilab console or the like. I'm sorry if this may be a noob question. Thanks for your time. -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From rouxph.22 at gmail.com Mon Sep 3 11:48:04 2018 From: rouxph.22 at gmail.com (philippe) Date: Mon, 3 Sep 2018 11:48:04 +0200 Subject: [Scilab-users] diary lost in try/catch statement . Message-ID: Hi, In scilab-5 I used to save console output of script file execution in a text file with "diary", this seems to fail in scilab-6, for new errors types recently added (Syntax error, Unexpected token ). Perhaps I misunderstood something in try/catch statement , let's consider the file bug_syntax_error.sce containing : diary(0) diary('file.txt','new'); try disp('let''s make an error') 1!=0 // syntax error catch disp('added to diary') end diary('file.txt','close') execute this script with CTRL+SHIFT+E or "exec" will not create file.txt --> exec('bug_syntax_error.sce', -1) ? la ligne 4 du fichier ex?cut? bug_syntax_error.sce 1!=0 // syntax error ^^ Erreur : Unexpected token '!' --> mgetl file.txt mgetl : Impossible d'ouvrir le fichier file.txt. execute this script from scinotes with CTRL+E will give : --> diary(0) --> diary('file.txt','new'); --> try disp('let''s make an error') > 1!=0 // syntax error > catch > disp('added to diary') > end 1!=0 // syntax error ^^ Erreur : Unexpected token '!' --> diary('file.txt','close') --> mgetl file.txt ans = ! ! ! ! !--> try disp('let''s make an error') ! ! ! ! > 1!=0 // syntax error ! ! ! ! > catch ! ! ! ! > disp('added to diary') ! ! ! ! > end ! ! ! ! 1!=0 // syntax error ! ! ! ! ^^ ! ! ! !Erreur : Unexpected token '!' ! ! ! ! ! ! ! !--> diary('file.txt','close') ! I also remark that those new errors (like bad comparisons 1=2 or bad string delimiters mixing ' and " ) have no localization. This doesn't happend with "old" errors (which have localization), replacing "1!=0" with "ieee(0),1/0" I get : --> exec('bug_syntax_error.sce', -1) let's make an error added to diary --> mgetl file.txt ans = ! ! ! ! ! let's make an error ! ! ! ! ! ! ! ! added to diary ! Best regards, Philippe From amonmayr at laas.fr Mon Sep 3 12:38:03 2018 From: amonmayr at laas.fr (amonmayr at laas.fr) Date: Mon, 3 Sep 2018 12:38:03 +0200 Subject: [Scilab-users] diary lost in try/catch statement . In-Reply-To: References: Message-ID: <4f6271ec-44a1-8588-0073-ee3a5d6cb407@laas.fr> Hello, As a workaround, if you replace ??? 1!=0? // syntax error with ??? str="1!=0"; ??? evstr(str); it seems to work as you expected. Anyway, I think the try/catch structure can catch errors occurring at runtime (like division by zero, etc ...), but not syntax errors. You are supposed to write syntactically correct Scilab! Antoine Le 03/09/2018 ? 11:48, philippe a ?crit?: > Hi, > > In scilab-5 I used to save console output of script file execution in a > text file with "diary", this seems to fail in scilab-6, for new errors > types recently added (Syntax error, Unexpected token ). Perhaps I > misunderstood something in try/catch statement , let's consider the file > bug_syntax_error.sce containing : > > diary(0) > diary('file.txt','new'); > try disp('let''s make an error') > 1!=0 // syntax error > catch > disp('added to diary') > end > diary('file.txt','close') > > > execute this script with CTRL+SHIFT+E or "exec" will not create file.txt > > > --> exec('bug_syntax_error.sce', -1) > ? la ligne 4 du fichier ex?cut? bug_syntax_error.sce > > 1!=0 // syntax error > ^^ > Erreur : Unexpected token '!' > > --> mgetl file.txt > > mgetl : Impossible d'ouvrir le fichier file.txt. > > execute this script from scinotes with CTRL+E will give : > > > --> diary(0) > > --> diary('file.txt','new'); > > --> try disp('let''s make an error') > > 1!=0 // syntax error > > catch > > disp('added to diary') > > end > 1!=0 // syntax error > ^^ > Erreur : Unexpected token '!' > > --> diary('file.txt','close') > > --> mgetl file.txt > ans = > > ! ! > ! ! > !--> try disp('let''s make an error') ! > ! ! > ! > 1!=0 // syntax error ! > ! ! > ! > catch ! > ! ! > ! > disp('added to diary') ! > ! ! > ! > end ! > ! ! > ! 1!=0 // syntax error ! > ! ! > ! ^^ ! > ! ! > !Erreur : Unexpected token '!' ! > ! ! > ! ! > ! ! > !--> diary('file.txt','close') ! > > > I also remark that those new errors (like bad comparisons 1=2 or bad > string delimiters mixing ' and " ) have no localization. This doesn't > happend with "old" errors (which have localization), replacing "1!=0" > with "ieee(0),1/0" I get : > > --> exec('bug_syntax_error.sce', -1) > > let's make an error > > added to diary > > --> mgetl file.txt > ans = > > ! ! > ! ! > ! let's make an error ! > ! ! > ! ! > ! ! > ! added to diary ! > > > Best regards, > > Philippe > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From rouxph.22 at gmail.com Mon Sep 3 19:08:20 2018 From: rouxph.22 at gmail.com (philippe) Date: Mon, 3 Sep 2018 19:08:20 +0200 Subject: [Scilab-users] diary lost in try/catch statement . In-Reply-To: <4f6271ec-44a1-8588-0073-ee3a5d6cb407@laas.fr> References: <4f6271ec-44a1-8588-0073-ee3a5d6cb407@laas.fr> Message-ID: Le 03/09/2018 ? 12:38, amonmayr at laas.fr a ?crit?: > Hello, > > As a workaround, if you replace > ??? 1!=0? // syntax error > with > ??? str="1!=0"; > ??? evstr(str); > it seems to work as you expected. Yes the bug disappear with execstr ? In fact my example wasn't clear enough, here is a better one showing my problem. I have a script nammed bugged.sce disp('let''s make an error') ieee(0);1/0 // syntax error //and I want to test it with and auxiliary script : unix("rm file.txt")// linux only diary(0) try diary('file.txt','new'); exec('bugged.sce',3); diary('file.txt','close'); catch disp('added to diary') [str,n,line,func]=lasterror(); printf(" error %d line %d in %s\n error message :\n %s\n",n,line,func,str) end diary('file.txt','close'); //then I get the expected file.txt --> disp('let''s make an error') let's make an error --> ieee(0);1/0;// syntax error added to diary error 999 line 0 in exec error message : Division par z?ro... //now replace bugged.sce with disp('let''s make an error') 1!=0 // syntax error //then I get a wrong file file.txt added to diary error 999 line 4 in error message : 1!=0;// syntax error because the diary before the error is lost ! The problem occurs only with "syntax error" : 'l'apostrophe' 1=2 1!=0 not with old errors like : ieee(0);1/0 rand(2,2)*rand(3,3); > > Anyway, I think the try/catch structure can catch errors occurring at > runtime (like division by zero, etc ...), but not syntax errors. > You are supposed to write syntactically correct Scilab! my goal is to retrieve errors automatically from scripts with bugs (for example for automatic testing of scripts I didn't wrote myself ) using lasterror() in the catch statement. Best Regards, Philippe From jrafaelbguerra at hotmail.com Mon Sep 3 22:30:47 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Mon, 3 Sep 2018 20:30:47 +0000 Subject: [Scilab-users] Scilab 6.0.1 crashes with printf command Message-ID: Dear Scilabers, Any clues on why the following command totally crashes Scilab 6.0.1 on Win7: --> printf("A = B ./(C+%%eps) (to avoid division by 0)\n"); while in Scilab 5.5.2 escapes % and outputs properly: A = B ./(C+%eps) (to avoid division by 0) How to escape % in Scilab 6.0.1's printf? PS: one workaround is to: printf("A = B ./(C+%seps) (to avoid division by 0)\n","%") but it looks weird... Regards, Rafael From heinznabielek at me.com Mon Sep 3 22:37:45 2018 From: heinznabielek at me.com (Heinz Nabielek) Date: Mon, 03 Sep 2018 22:37:45 +0200 Subject: [Scilab-users] Scilab 6.0.1 crashes with printf command In-Reply-To: References: Message-ID: On 03.09.2018, at 22:30, Rafael Guerra wrote: > > printf("A = B ./(C+%%eps) (to avoid division by 0)\n"); Same on Mac OS X Scilab 6.0.1.... Heinz "Scilb quit unexpectedly" Process: scilab-bin [985] Path: /Applications/scilab-6.0.1.app/Contents/MacOS/bin/scilab-bin Identifier: org.scilab.modules.jvm.Scilab Version: 0 Code Type: X86-64 (Native) Parent Process: ??? [939] Responsible: scilab-bin [985] User ID: 501 Date/Time: 2018-09-03 22:35:11.218 +0200 OS Version: Mac OS X 10.14 (18A377a) From rouxph.22 at gmail.com Mon Sep 3 22:41:38 2018 From: rouxph.22 at gmail.com (philippe) Date: Mon, 3 Sep 2018 22:41:38 +0200 Subject: [Scilab-users] Scilab 6.0.1 crashes with printf command In-Reply-To: References: Message-ID: Le 03/09/2018 ? 22:30, Rafael Guerra a ?crit?: > Dear Scilabers, > > Any clues on why the following command totally crashes Scilab 6.0.1 on Win7: > --> printf("A = B ./(C+%%eps) (to avoid division by 0)\n"); first note that printf is obsolete in scilab-6.0.0 and will be removed in scilab-6.1.0. But I confirm this the same behavior with mprintf and scilab-6.0.1 in ubuntu 18.04.1. Additional console message below if this can help. Best regards, Philippe Une erreur fatale a ?t? d?tect?e par Scilab. Veuillez v?rifier les fonctions d?finies par l'utilisateur (ou celles des modules externes), elles devraient appara?tre dans le suivi de la pile. Ou sinon, vous pouvez reporter un bug sur http://bugzilla.scilab.org/ avec : * un simple code qui reproduit le probl?me * le r?sultat de [a, b] = getdebuginfo() * l'information suivante : [jenny-a-03:05851] Signal: Erreur de segmentation (11) [jenny-a-03:05851] Signal code: (128) [jenny-a-03:05851] Failing at address: (nil) Pile d'appel?: 1: 0x8f260b (/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so) 2: 0x8e5318 < > (/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so) 3: 0x12890 < > (/lib/x86_64-linux-gnu/libpthread.so.0) 4: 0x387b9c , std::allocator > const&, wchar_t const*, std::vector >&, int*, int*)> (/usr/lib/scilab/libscilab-cli.so.6) 5: 0x37c2cb >&, int, std::vector >&)> (/usr/lib/scilab/libscilab-cli.so.6) 6: 0x48be3a >&, std::unordered_map, std::allocator >, types::InternalType*, std::hash (/usr/lib/scilab/libsciast.so.6) 7: 0x1c23fd ::visitprivate(ast::CallExp const&)> (/usr/lib/scilab/libsciast.so.6) 8: 0x1be9ff ::visitprivate(ast::SeqExp const&)> (/usr/lib/scilab/libsciast.so.6) 9: 0x1a17c2 (/usr/lib/scilab/libscilab-cli.so.6) 10: 0x19a52a (/usr/lib/scilab/libscilab-cli.so.6) 11: 0x19ac
(/usr/bin/scilab-bin) 12: 0x21b97 <__libc_start_main> (/lib/x86_64-linux-gnu/libc.so.6) 13: 0x24ca < > (/usr/bin/scilab-bin) Fin de la pile From klaus-rohe at t-online.de Mon Sep 3 22:58:43 2018 From: klaus-rohe at t-online.de (Klaus Rohe) Date: Mon, 3 Sep 2018 22:58:43 +0200 Subject: [Scilab-users] Please unsubscribe me from this mailing list. Message-ID: <001e01d443c8$e6a48990$b3ed9cb0$@t-online.de> Dipl.-Phys. Klaus Rohe Adolf-Kolping-Str. 10a 85625 Glonn Email: klaus-rohe at t-online.de Telefon: +49 (0) 8093 5402 Mobil: +49 (0) 170 8133634 -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Tue Sep 4 00:56:56 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Tue, 4 Sep 2018 00:56:56 +0200 Subject: [Scilab-users] Scilab 6.0.1 crashes with printf command In-Reply-To: References: Message-ID: Le 03/09/2018 ? 22:30, Rafael Guerra a ?crit?: > Dear Scilabers, > > Any clues on why the following command totally crashes Scilab 6.0.1 on Win7: > --> printf("A = B ./(C+%%eps) (to avoid division by 0)\n"); > > while in Scilab 5.5.2 escapes % and outputs properly: > A = B ./(C+%eps) (to avoid division by 0) > > How to escape % in Scilab 6.0.1's printf? > > PS: > one workaround is to: printf("A = B ./(C+%seps) (to avoid division by 0)\n","%") > but it looks weird... > > Regards, > Rafael > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users Hello, This is http://bugzilla.scilab.org/show_bug.cgi?id=15441, it has been fixed on branch-6.0 and master: http://gitweb.scilab.org/?p=scilab.git;a=commit;h=dd4dd2c315bbb4989ed25f631d7e887b0ed70c44 S. From jrafaelbguerra at hotmail.com Tue Sep 4 07:44:53 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Tue, 4 Sep 2018 05:44:53 +0000 Subject: [Scilab-users] Scilab 6.0.1 crashes with printf command In-Reply-To: References: Message-ID: Stephane, Thanks for the bugzilla reference, which I was surprised to see as I have searched there before posting, with search strings like %% but it produced no results... This raises my next question: how to seach Bugzilla for "%%" string? Regards, Rafael From jrafaelbguerra at hotmail.com Tue Sep 4 10:34:41 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Tue, 4 Sep 2018 08:34:41 +0000 Subject: [Scilab-users] Scilab 6.0.1 crashes with printf command In-Reply-To: References: Message-ID: The answer to my last question is Samuel's magic uman: --> uman -wb "%%" Forgot to install it in Scilab 6.0, what a mistake. Regards, Rafael -----Original Message----- From: users On Behalf Of Rafael Guerra Sent: Tuesday, September 04, 2018 7:45 AM To: Users mailing list for Scilab Subject: Re: [Scilab-users] Scilab 6.0.1 crashes with printf command Stephane, Thanks for the bugzilla reference, which I was surprised to see as I have searched there before posting, with search strings like %% but it produced no results... This raises my next question: how to seach Bugzilla for "%%" string? Regards, Rafael From paul.carrico at esterline.com Thu Sep 6 21:50:52 2018 From: paul.carrico at esterline.com (Carrico, Paul) Date: Thu, 6 Sep 2018 19:50:52 +0000 Subject: [Scilab-users] A plane intersecting a surface Message-ID: <3A6B7233274DB449A2A0053A47684F953FEB9CF5@BGS-EX01.auxitrol.ad> Dear All I've not been using scilab for a while, but I've a good opportunity to dive into it once again ;-) Is there a tool implemented into Scilab to determine the cross section of a 3D (experimental) surface and a plane? Note that : - the curve has not a Cartesian equation and it is composed of a point cloud coming for experimental measurement, - ideally the tool looks for the closest out of plane points in order to perform interpolations Before reinventing the wheel, I'm wondering if something exists. Nb: I built a saddle surface, but of course only points (not necessary equally spaced) exist in the real life. Thanks for any advice and suggestion Paul function [z]=saddle(x, y) z = x^2 - y^2 endfunction // surface making ... of course in the real life the surface comes from exprimental data (no cartesian equation is attached on)) n = 50; x = linspace(-2,2,n)'; y = linspace(-1,3,n)'; z = feval(x,y,saddle); plot3d(x,y,z); // plane equation: ax + by + cz + d = 0 EXPORT CONTROL : Cet email ne contient pas de donn?es techniques This email does not contain technical data -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.monmayrant at laas.fr Fri Sep 7 16:40:19 2018 From: antoine.monmayrant at laas.fr (antoine.monmayrant at laas.fr) Date: Fri, 7 Sep 2018 16:40:19 +0200 Subject: [Scilab-users] Solving generalized eigenvalue in scilab: spec()? Message-ID: <65aa7874-6f48-e611-e9af-d22a37c9d789@laas.fr> Hello, I need to solve a generalized eigenvalue problem, but I am not sure I am trying to use the right scilab function for that. Here is my generalized eigenvalue problem: ??? Sb*w=lambda*Sw*w ??? // Sb and Sw are matrices and I want to find the eigenvectors w and eigenvalues lambda Is "[alpha,beta,R] = spec(Sb,Sw)" the function I am supposed to call? I tried my best at understanding the spec() help page, but I am too far away from my area of expertise. If someone more knowledgeable than me can tell me whether I am on the right track or not and how to interpret [alpha,beta,R, I'll be more than grateful. Cheers, Antoine -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From stephane.mottelet at utc.fr Fri Sep 7 16:48:29 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Fri, 7 Sep 2018 16:48:29 +0200 Subject: [Scilab-users] Solving generalized eigenvalue in scilab: spec()? In-Reply-To: <65aa7874-6f48-e611-e9af-d22a37c9d789@laas.fr> References: <65aa7874-6f48-e611-e9af-d22a37c9d789@laas.fr> Message-ID: <1f61a766-2ab4-991f-c125-0fa1dfc1b4d6@utc.fr> Le 07/09/2018 ? 16:40, antoine.monmayrant at laas.fr a ?crit?: > Hello, > > I need to solve a generalized eigenvalue problem, but I am not sure I > am trying to use the right scilab function for that. > Here is my generalized eigenvalue problem: > ??? Sb*w=lambda*Sw*w > ??? // Sb and Sw are matrices and I want to find the eigenvectors w > and eigenvalues lambda > Is "[alpha,beta,R] = spec(Sb,Sw)" the function I am supposed to call? Yes, in terms of you notations: [alpha,beta,R] = spec(Sb,Sw) lambda = alpha./beta each R(:,i) is a candidate for your w and lambda(i) the associated geenralize eigenvalue S. > I tried my best at understanding the spec() help page, but I am too > far away from my area of expertise. > If someone more knowledgeable than me can tell me whether I am on the > right track or not and how to interpret [alpha,beta,R, I'll be more > than grateful. > > > Cheers, > > > Antoine > > -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From antoine.monmayrant at laas.fr Sat Sep 8 09:01:27 2018 From: antoine.monmayrant at laas.fr (antoine monmayrant) Date: Sat, 8 Sep 2018 09:01:27 +0200 Subject: [Scilab-users] Solving generalized eigenvalue in scilab: spec()? In-Reply-To: <1f61a766-2ab4-991f-c125-0fa1dfc1b4d6@utc.fr> References: <65aa7874-6f48-e611-e9af-d22a37c9d789@laas.fr> <1f61a766-2ab4-991f-c125-0fa1dfc1b4d6@utc.fr> Message-ID: <12090aa7-829f-f847-abb1-676cdbfab3c1@laas.fr> Thank you St?phane! Antoine Le 07/09/2018 ? 16:48, St?phane Mottelet a ?crit?: > Le 07/09/2018 ? 16:40, antoine.monmayrant at laas.fr a ?crit?: >> Hello, >> >> I need to solve a generalized eigenvalue problem, but I am not sure I >> am trying to use the right scilab function for that. >> Here is my generalized eigenvalue problem: >> ??? Sb*w=lambda*Sw*w >> ??? // Sb and Sw are matrices and I want to find the eigenvectors w >> and eigenvalues lambda >> Is "[alpha,beta,R] = spec(Sb,Sw)" the function I am supposed to call? > Yes, in terms of you notations: > > [alpha,beta,R] = spec(Sb,Sw) > lambda = alpha./beta > > each R(:,i) is a candidate for your w and lambda(i) the associated > geenralize eigenvalue > > S. >> I tried my best at understanding the spec() help page, but I am too >> far away from my area of expertise. >> If someone more knowledgeable than me can tell me whether I am on the >> right track or not and how to interpret [alpha,beta,R, I'll be more >> than grateful. >> >> >> Cheers, >> >> >> Antoine >> >> > From antoine.monmayrant at laas.fr Sat Sep 8 09:03:43 2018 From: antoine.monmayrant at laas.fr (antoine monmayrant) Date: Sat, 8 Sep 2018 09:03:43 +0200 Subject: [Scilab-users] Solving generalized eigenvalue in scilab: spec()? In-Reply-To: <1f61a766-2ab4-991f-c125-0fa1dfc1b4d6@utc.fr> References: <65aa7874-6f48-e611-e9af-d22a37c9d789@laas.fr> <1f61a766-2ab4-991f-c125-0fa1dfc1b4d6@utc.fr> Message-ID: <12574b2e-e30c-31a7-26b1-5508e2446dca@laas.fr> By the way, is it just me being completely stupid or the help page for "spec()" could be enhanced with a 2-line general introduction using layman terms? Antoine Le 07/09/2018 ? 16:48, St?phane Mottelet a ?crit?: > Le 07/09/2018 ? 16:40, antoine.monmayrant at laas.fr a ?crit?: >> Hello, >> >> I need to solve a generalized eigenvalue problem, but I am not sure I >> am trying to use the right scilab function for that. >> Here is my generalized eigenvalue problem: >> ??? Sb*w=lambda*Sw*w >> ??? // Sb and Sw are matrices and I want to find the eigenvectors w >> and eigenvalues lambda >> Is "[alpha,beta,R] = spec(Sb,Sw)" the function I am supposed to call? > Yes, in terms of you notations: > > [alpha,beta,R] = spec(Sb,Sw) > lambda = alpha./beta > > each R(:,i) is a candidate for your w and lambda(i) the associated > geenralize eigenvalue > > S. >> I tried my best at understanding the spec() help page, but I am too >> far away from my area of expertise. >> If someone more knowledgeable than me can tell me whether I am on the >> right track or not and how to interpret [alpha,beta,R, I'll be more >> than grateful. >> >> >> Cheers, >> >> >> Antoine >> >> > From jrafaelbguerra at hotmail.com Sat Sep 8 14:51:44 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Sat, 8 Sep 2018 12:51:44 +0000 Subject: [Scilab-users] A plane intersecting a surface In-Reply-To: <3A6B7233274DB449A2A0053A47684F953FEB9CF5@BGS-EX01.auxitrol.ad> References: <3A6B7233274DB449A2A0053A47684F953FEB9CF5@BGS-EX01.auxitrol.ad> Message-ID: Hi Paul, I am not aware of such tool. To extract the points in the experimental cloud that are within a given distance from the plane, use equation in: https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_plane If your cloud of points behaves well enough, you can interpolate it first into a dense grid (for instance using cshep2d) and then extract only the points that are very close to the plane. What would you like to do next with those points on the 2D plane? If you just need to highlight them in 3D view, then scatter3 is your buddy. Regards, Rafael -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Sat Sep 8 18:35:08 2018 From: stephane.mottelet at utc.fr (=?utf-8?Q?St=C3=A9phane_Mottelet?=) Date: Sat, 8 Sep 2018 18:35:08 +0200 Subject: [Scilab-users] A plane intersecting a surface In-Reply-To: <3A6B7233274DB449A2A0053A47684F953FEB9CF5@BGS-EX01.auxitrol.ad> References: <3A6B7233274DB449A2A0053A47684F953FEB9CF5@BGS-EX01.auxitrol.ad> Message-ID: <680A1F8E-701F-4243-AD42-B22A7DB74D65@utc.fr> Hello Paul Do you have an example of typical 3D data ? Can it be safely projected on a principal plane ? Is it noisy ? S. > Le 6 sept. 2018 ? 21:50, Carrico, Paul a ?crit : > > Dear All > I?ve not been using scilab for a while, but I?ve a good opportunity to dive into it once again ;-) > Is there a tool implemented into Scilab to determine the cross section of a 3D (experimental) surface and a plane? > Note that : > - the curve has not a Cartesian equation and it is composed of a point cloud coming for experimental measurement, > - ideally the tool looks for the closest out of plane points in order to perform interpolations > Before reinventing the wheel, I?m wondering if something exists. > Nb: I built a saddle surface, but of course only points (not necessary equally spaced) exist in the real life. > Thanks for any advice and suggestion > Paul > function [z]=saddle(x, y) > z = x^2 - y^2 > endfunction > > // surface making ... of course in the real life the surface comes from exprimental data (no cartesian equation is attached on)) > n = 50; > x = linspace(-2,2,n)'; > y = linspace(-1,3,n)'; > z = feval(x,y,saddle); > plot3d(x,y,z); > > // plane equation: ax + by + cz + d = 0 > > > > EXPORT CONTROL : > Cet email ne contient pas de donn?es techniques > This email does not contain technical data > > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Sat Sep 8 19:53:25 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Sat, 8 Sep 2018 19:53:25 +0200 Subject: [Scilab-users] arduino toolbox: now available for Scilab 6.0 Message-ID: <0802f308-058e-db76-0626-b9182c54f8d0@free.fr> Hello, This message just to announce that the Arduino toolbox is now available for Scilab 6.0, for Windows users. It should be listed in the ATOMS manager. https://atoms.scilab.org/toolboxes/arduino The portage to Linux (already available) shall be soon included in the toolbox. http://forge.scilab.org/index.php/p/arduino/issues/1556/ Volunteers to translate its help pages from french into english are welcome. Best regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Mon Sep 10 08:59:42 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Mon, 10 Sep 2018 08:59:42 +0200 Subject: [Scilab-users] xcos blocks : how to display the default label when adding a block in a diagram Message-ID: <84f0d631-1a19-6c1e-2b64-065646c13520@free.fr> Hello, After updating the Arduino toolbox, there is still an unfixed issue : when adding a block in a diagram, the expected default label of the block is not drawn: we must edit the block parameters and then validate, to display the label. Yet, the interface functions of blocks now define the x.graphics.style field for both "define" and "update" actions. For native Xcos blocks, the initial display is set through the SCI/modules/xcos/etc/Xcos-style.xml file. So i tried to create such a file (named Xcos-style.xml or arduino-style.xml) and set it in the ~/etc directory of the module, but it does not work. Any tip would be appreciated. Regards Samuel From Christophe.Dang at sidel.com Mon Sep 10 09:15:20 2018 From: Christophe.Dang at sidel.com (Dang Ngoc Chan, Christophe) Date: Mon, 10 Sep 2018 07:15:20 +0000 Subject: [Scilab-users] A plane intersecting a surface Message-ID: Hello, > De : users [mailto:users-bounces at lists.scilab.org] De la part de Rafael Guerra > Envoy? : samedi 8 septembre 2018 14:52 > > If your cloud of points behaves well enough, you can interpolate it first into a dense If nobody is expert in this field, then I could invoke a memory when I was a student. I've heard about an algorithm using intercept with tetrahedrons, it was used for surface rendering. So you might perform a Delaunay tessellation of your cloud, determine which tetrahedrons are cut and determine the coordinates of the intercepts. Or ask some CGI specialists. HTH Regards -- Christophe Dang Ngoc Chan Mechanical calculation engineer This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From paul.carrico at esterline.com Mon Sep 10 09:29:42 2018 From: paul.carrico at esterline.com (Carrico, Paul) Date: Mon, 10 Sep 2018 07:29:42 +0000 Subject: [Scilab-users] A plane intersecting a surface In-Reply-To: References: Message-ID: <3A6B7233274DB449A2A0053A47684F953FEBA16A@BGS-EX01.auxitrol.ad> Dear all Thanks Christophe, Rafael and St?phane for the first feedback; Only obvious things in the code hereafter, but it highlights I guess what I would like to do (to cross section the surface); the results are not really noisy and their number is of about few hundred. Concerning the Delaunay approach, I thought about it but I've been thinking a simplest solution may exist if I can plot the surface (interpolation from the grid) ? Paul ########################################### mode(0) function [z]=saddle(x, y) z = x^2 - y^2 endfunction function [z]=x_square(x, d) z = x^2 - d^2 endfunction function [z]=y_square(y, d) z = y^2 - d^2 endfunction // surface making ... of course in the real life the surface comes from experimental data (no Cartesian equation is attached on)) n = 50; x = linspace(-2,2,n)'; y = linspace(-1,3,n)'; z = feval(x,y,saddle); scf(0); plot3d(x,y,z); // obvious cases // n = (0 1 0) then z = x^2 - d^2 d = 0; z1 = x_square(x,d); scf(1); plot(x,z1); // n = (1 0 0) then z = d^2 - y^2 d = 0; z2 = y_square(y,d); scf(2); plot(x,z2); -----Message d'origine----- De : users [mailto:users-bounces at lists.scilab.org] De la part de Dang Ngoc Chan, Christophe Envoy? : lundi 10 septembre 2018 09:15 ? : Users mailing list for Scilab Objet : [EXTERNAL] Re: [Scilab-users] A plane intersecting a surface Hello, > De : users [mailto:users-bounces at lists.scilab.org] De la part de Rafael Guerra > Envoy? : samedi 8 septembre 2018 14:52 > > If your cloud of points behaves well enough, you can interpolate it first into a dense If nobody is expert in this field, then I could invoke a memory when I was a student. I've heard about an algorithm using intercept with tetrahedrons, it was used for surface rendering. So you might perform a Delaunay tessellation of your cloud, determine which tetrahedrons are cut and determine the coordinates of the intercepts. Or ask some CGI specialists. HTH Regards -- Christophe Dang Ngoc Chan Mechanical calculation engineer This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. _______________________________________________ users mailing list users at lists.scilab.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.scilab.org_mailman_listinfo_users&d=DwIFAw&c=0hKVUfnuoBozYN8UvxPA-w&r=4TCz--8bXfJhZZvIxJAemAJyz7Vfx78XvgYu3LN7eLo&m=P1df3Jy1yla9yY6mABJopK4mYcW7v-fqNLKDRWKGljw&s=Rx09ENmvHowtyMmodOUeRVEG2RZPKzK3Sy4zc7Mw0VM&e= EXPORT CONTROL : Cet email ne contient pas de donn?es techniques This email does not contain technical data -------------- next part -------------- An HTML attachment was scrubbed... URL: From jrafaelbguerra at hotmail.com Mon Sep 10 09:45:21 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Mon, 10 Sep 2018 00:45:21 -0700 (MST) Subject: [Scilab-users] A plane intersecting a surface In-Reply-To: References: <3A6B7233274DB449A2A0053A47684F953FEB9CF5@BGS-EX01.auxitrol.ad> Message-ID: <1536565521036-0.post@n3.nabble.com> Paul, The attached home-made example illustrates the very simple procedure that I have suggested earlier (i.e., using distance to plane + cshep2d function). PS: if you have multi-valued input data points then cshep2d will not work. Regards, Rafael -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From stephane.mottelet at utc.fr Mon Sep 10 09:50:52 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Mon, 10 Sep 2018 09:50:52 +0200 Subject: [Scilab-users] A plane intersecting a surface In-Reply-To: <3A6B7233274DB449A2A0053A47684F953FEBA16A@BGS-EX01.auxitrol.ad> References: <3A6B7233274DB449A2A0053A47684F953FEBA16A@BGS-EX01.auxitrol.ad> Message-ID: <96604571-fcd6-1770-d4a4-b3f7d2a54dbe@utc.fr> Hello Paul, Le 10/09/2018 ? 09:29, Carrico, Paul a ?crit?: > > Dear all > > Thanks Christophe, Rafael and St?phane for the first feedback; > > Only obvious things in the code hereafter, but it highlights I guess > what I would like to do (to cross section the surface); the results > are not really noisy and their number is of about few hundred. > > Concerning the Delaunay approach, I thought about it but I've been > thinking a simplest solution may exist if I can plot the surface > (interpolation from the grid) ? > in your set of (x_i,y_i,z_i) 3D points, are the (x_i,y_i) organized on a grid, i.e. cartesian product [discrete values of x] times [discrete values of y] ? S. > Paul > > ########################################### > > mode(0) > > function[*z*]=_saddle_(*x*, *y*) > > *z* = *x*^2 - *y*^2 > > endfunction > > function[*z*]=_x_square_(*x*, *d*) > > *z* = *x*^2 - *d*^2 > > endfunction > > function[*z*]=_y_square_(*y*, *d*) > > *z* = *y*^2 - *d*^2 > > endfunction > > /// surface making ... of course in the real life the surface comes > from experimental data (no Cartesian equation is attached on))/ > > n= 50; > > x= linspace(-2,2,n)'; > > y= linspace(-1,3,n)'; > > z= feval(x,y,_saddle_); > > scf(0); > > plot3d(x,y,z); > > /// obvious cases/ > > /// n = (0 1 0) then z = x^2 - d^2/ > > d= 0; > > z1= _x_square_(x,d); > > scf(1); > > plot(x,z1); > > /// n = (1 0 0) then z = d^2 - y^2/ > > d= 0; > > z2= _y_square_(y,d); > > scf(2); > > plot(x,z2); > > -----Message d'origine----- > De?: users [mailto:users-bounces at lists.scilab.org] De la part de Dang > Ngoc Chan, Christophe > Envoy??: lundi 10 septembre 2018 09:15 > ??: Users mailing list for Scilab > Objet?: [EXTERNAL] Re: [Scilab-users] A plane intersecting a surface > > Hello, > > > De : users [mailto:users-bounces at lists.scilab.org] De la part de > Rafael Guerra > > > Envoy? : samedi 8 septembre 2018 14:52 > > > > > > If your cloud of points behaves well enough, you can interpolate it > first into a dense > > If nobody is expert in this field, then I could invoke a memory when I > was a student. > > I've heard about an algorithm using intercept with tetrahedrons, > > it was used for surface rendering. > > So you might perform a Delaunay tessellation of your cloud, > > determine which tetrahedrons are cut > > and determine the coordinates of the intercepts. > > Or ask some CGI? specialists. > > HTH > > Regards > > -- > > Christophe Dang Ngoc Chan > > Mechanical calculation engineer > > This e-mail may contain confidential and/or privileged information. If > you are not the intended recipient (or have received this e-mail in > error), please notify the sender immediately and destroy this e-mail. > Any unauthorized copying, disclosure or distribution of the material > in this e-mail is strictly forbidden. > > _______________________________________________ > > users mailing list > > users at lists.scilab.org > > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.scilab.org_mailman_listinfo_users&d=DwIFAw&c=0hKVUfnuoBozYN8UvxPA-w&r=4TCz--8bXfJhZZvIxJAemAJyz7Vfx78XvgYu3LN7eLo&m=P1df3Jy1yla9yY6mABJopK4mYcW7v-fqNLKDRWKGljw&s=Rx09ENmvHowtyMmodOUeRVEG2RZPKzK3Sy4zc7Mw0VM&e= > > */EXPORT CONTROL : > /**Cet email ne contient pas de donn?es techniques > This email does not contain technical data* > -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.monmayrant at laas.fr Mon Sep 10 09:56:40 2018 From: antoine.monmayrant at laas.fr (antoine.monmayrant at laas.fr) Date: Mon, 10 Sep 2018 09:56:40 +0200 Subject: [Scilab-users] hist3d & density plots Message-ID: Hi all, I'm trying to plot the density of scatter points in (x,y). Basically, I have a huge Xvec and a huge Yvec of same size that represents the position of a huge number of points in a 2D plane. I would like to get a density plot, that is given a certain grid, a 2D plot representing the number of scatter points within a each cell of the grid. In matplotib, this corresponds to functions like "hist2d" and "hexbin". Is there any equivalent in Scilab? Or do I have to calculate by hand my density matrix and then use graplot or contourfill to plot my density? Any pointer at the least inefficient way to do this calculation is more than welcome... Thank you in advance for your help, Antoine -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From stephane.mottelet at utc.fr Mon Sep 10 11:00:37 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Mon, 10 Sep 2018 11:00:37 +0200 Subject: [Scilab-users] hist3d & density plots In-Reply-To: References: Message-ID: <361c72fa-9dac-3cbc-89df-95779116874c@utc.fr> Le 10/09/2018 ? 09:56, antoine.monmayrant at laas.fr a ?crit?: > Hi all, > > I'm trying to plot the density of scatter points in (x,y). > Basically, I have a huge Xvec and a huge Yvec of same size that > represents the position of a huge number of points in a 2D plane. > I would like to get a density plot, that is given a certain grid, a 2D > plot representing the number of scatter points within a each cell of > the grid. > In matplotib, this corresponds to functions like "hist2d" and "hexbin". > Is there any equivalent in Scilab? > Or do I have to calculate by hand my density matrix and then use > graplot or contourfill to plot my density? > Any pointer at the least inefficient way to do this calculation is > more than welcome... > > Thank you in advance for your help, > > > Antoine > Hello Antoine, The most efficient at the Scilab level would be to use the incremental feature of "sparse": function d=bins2d(x,y,xbins,ybins) ???? n = size(x,"*"); ??? [ix,cx] = dsearch(x,xbins); ??? [iy,cy] = dsearch(y,ybins); ??? kin = find((ix>0) & (iy>0)); ??? d = full(sparse([ix(kin) iy(kin)], ones(kin), [size(xbins,"*")-1, size(ybins,"*")-1])); end x = rand(10000,1,'normal'); y = rand(10000,1,'normal'); --> d = bins2d(x,y,-5:5,-5:5) ?d? = ?? 0.?? 0.?? 0.??? 0.???? 1.????? 0.????? 0.???? 0.??? 0.?? 0. ?? 0.?? 0.?? 0.??? 3.???? 4.????? 4.????? 0.???? 0.??? 0.?? 0. ?? 0.?? 0.?? 6.??? 31.??? 82.???? 80.???? 31.??? 2.??? 0.?? 0. ?? 0.?? 0.?? 24.?? 183.?? 477.??? 477.??? 200.?? 25.?? 3.?? 0. ?? 0.?? 5.?? 68.?? 439.?? 1131.?? 1158.?? 426.?? 57.?? 4.?? 0. ?? 0.?? 5.?? 91.?? 485.?? 1168.?? 1220.?? 438.?? 72.?? 3.?? 0. ?? 0.?? 4.?? 30.?? 190.?? 470.??? 472.??? 173.?? 21.?? 3.?? 0. ?? 0.?? 0.?? 6.??? 30.??? 83.???? 78.???? 24.??? 2.??? 0.?? 0. ?? 0.?? 1.?? 0.??? 2.???? 2.????? 3.????? 3.???? 0.??? 0.?? 0. ?? 0.?? 0.?? 0.??? 0.???? 0.????? 0.????? 0.???? 0.??? 0.?? 0. --> sum(d) ?ans? = ?? 10000. This feature is fixed in scilab-branch-6.0: S. -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From amonmayr at laas.fr Mon Sep 10 12:57:44 2018 From: amonmayr at laas.fr (amonmayr at laas.fr) Date: Mon, 10 Sep 2018 12:57:44 +0200 Subject: [Scilab-users] hist3d & density plots In-Reply-To: <361c72fa-9dac-3cbc-89df-95779116874c@utc.fr> References: <361c72fa-9dac-3cbc-89df-95779116874c@utc.fr> Message-ID: Le 10/09/2018 ? 11:00, St?phane Mottelet a ?crit?: > Le 10/09/2018 ? 09:56, antoine.monmayrant at laas.fr a ?crit?: >> Hi all, >> >> I'm trying to plot the density of scatter points in (x,y). >> Basically, I have a huge Xvec and a huge Yvec of same size that >> represents the position of a huge number of points in a 2D plane. >> I would like to get a density plot, that is given a certain grid, a >> 2D plot representing the number of scatter points within a each cell >> of the grid. >> In matplotib, this corresponds to functions like "hist2d" and "hexbin". >> Is there any equivalent in Scilab? >> Or do I have to calculate by hand my density matrix and then use >> graplot or contourfill to plot my density? >> Any pointer at the least inefficient way to do this calculation is >> more than welcome... >> >> Thank you in advance for your help, >> >> >> Antoine >> > Hello Antoine, > > The most efficient at the Scilab level would be to use the incremental > feature of "sparse": > > function d=bins2d(x,y,xbins,ybins) > ???? n = size(x,"*"); > ??? [ix,cx] = dsearch(x,xbins); > ??? [iy,cy] = dsearch(y,ybins); > ??? kin = find((ix>0) & (iy>0)); > ??? d = full(sparse([ix(kin) iy(kin)], ones(kin), [size(xbins,"*")-1, > size(ybins,"*")-1])); > end > > x = rand(10000,1,'normal'); > y = rand(10000,1,'normal'); > > --> d = bins2d(x,y,-5:5,-5:5) > ?d? = > > ?? 0.?? 0.?? 0.??? 0.???? 1.????? 0.????? 0.???? 0.??? 0.?? 0. > ?? 0.?? 0.?? 0.??? 3.???? 4.????? 4.????? 0.???? 0.??? 0.?? 0. > ?? 0.?? 0.?? 6.??? 31.??? 82.???? 80.???? 31.??? 2.??? 0.?? 0. > ?? 0.?? 0.?? 24.?? 183.?? 477.??? 477.??? 200.?? 25.?? 3.?? 0. > ?? 0.?? 5.?? 68.?? 439.?? 1131.?? 1158.?? 426.?? 57.?? 4.?? 0. > ?? 0.?? 5.?? 91.?? 485.?? 1168.?? 1220.?? 438.?? 72.?? 3.?? 0. > ?? 0.?? 4.?? 30.?? 190.?? 470.??? 472.??? 173.?? 21.?? 3.?? 0. > ?? 0.?? 0.?? 6.??? 30.??? 83.???? 78.???? 24.??? 2.??? 0.?? 0. > ?? 0.?? 1.?? 0.??? 2.???? 2.????? 3.????? 3.???? 0.??? 0.?? 0. > ?? 0.?? 0.?? 0.??? 0.???? 0.????? 0.????? 0.???? 0.??? 0.?? 0. > > > --> sum(d) > ?ans? = > > ?? 10000. Thanks a lot, it works and is really fast even 2*10? scatter points! > > This feature is fixed in scilab-branch-6.0: Huh, what do you mean? Is there a new function bins2d or hist2d in scilab-branch-6.0? Antoine > > S. > -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From stephane.mottelet at utc.fr Mon Sep 10 13:03:05 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Mon, 10 Sep 2018 13:03:05 +0200 Subject: [Scilab-users] hist3d & density plots In-Reply-To: References: <361c72fa-9dac-3cbc-89df-95779116874c@utc.fr> Message-ID: <6d929e1c-1978-7e6d-35c9-489ddb55b2b2@utc.fr> Le 10/09/2018 ? 12:57, amonmayr at laas.fr a ?crit?: > Le 10/09/2018 ? 11:00, St?phane Mottelet a ?crit?: >> Le 10/09/2018 ? 09:56, antoine.monmayrant at laas.fr a ?crit?: >>> Hi all, >>> >>> I'm trying to plot the density of scatter points in (x,y). >>> Basically, I have a huge Xvec and a huge Yvec of same size that >>> represents the position of a huge number of points in a 2D plane. >>> I would like to get a density plot, that is given a certain grid, a >>> 2D plot representing the number of scatter points within a each cell >>> of the grid. >>> In matplotib, this corresponds to functions like "hist2d" and "hexbin". >>> Is there any equivalent in Scilab? >>> Or do I have to calculate by hand my density matrix and then use >>> graplot or contourfill to plot my density? >>> Any pointer at the least inefficient way to do this calculation is >>> more than welcome... >>> >>> Thank you in advance for your help, >>> >>> >>> Antoine >>> >> Hello Antoine, >> >> The most efficient at the Scilab level would be to use the >> incremental feature of "sparse": >> >> function d=bins2d(x,y,xbins,ybins) >> ???? n = size(x,"*"); >> ??? [ix,cx] = dsearch(x,xbins); >> ??? [iy,cy] = dsearch(y,ybins); >> ??? kin = find((ix>0) & (iy>0)); >> ??? d = full(sparse([ix(kin) iy(kin)], ones(kin), [size(xbins,"*")-1, >> size(ybins,"*")-1])); >> end >> >> x = rand(10000,1,'normal'); >> y = rand(10000,1,'normal'); >> >> --> d = bins2d(x,y,-5:5,-5:5) >> ?d? = >> >> ?? 0.?? 0.?? 0.??? 0.???? 1.????? 0.????? 0.???? 0.??? 0.?? 0. >> ?? 0.?? 0.?? 0.??? 3.???? 4.????? 4.????? 0.???? 0.??? 0.?? 0. >> ?? 0.?? 0.?? 6.??? 31.??? 82.???? 80.???? 31.??? 2.??? 0.?? 0. >> ?? 0.?? 0.?? 24.?? 183.?? 477.??? 477.??? 200.?? 25.?? 3.?? 0. >> ?? 0.?? 5.?? 68.?? 439.?? 1131.?? 1158.?? 426.?? 57.?? 4.?? 0. >> ?? 0.?? 5.?? 91.?? 485.?? 1168.?? 1220.?? 438.?? 72.?? 3.?? 0. >> ?? 0.?? 4.?? 30.?? 190.?? 470.??? 472.??? 173.?? 21.?? 3.?? 0. >> ?? 0.?? 0.?? 6.??? 30.??? 83.???? 78.???? 24.??? 2.??? 0.?? 0. >> ?? 0.?? 1.?? 0.??? 2.???? 2.????? 3.????? 3.???? 0.??? 0.?? 0. >> ?? 0.?? 0.?? 0.??? 0.???? 0.????? 0.????? 0.???? 0.??? 0.?? 0. >> >> >> --> sum(d) >> ?ans? = >> >> ?? 10000. > Thanks a lot, it works and is really fast even 2*10? scatter points! >> >> This feature is fixed in scilab-branch-6.0: > Huh, what do you mean? Is there a new function bins2d or hist2d in > scilab-branch-6.0? No. "sparse" is broken in scilab-6.0.1, but fixed in scilab-branch-6.0. Hence the above code will work in scilab-5.5.2 or >= branch-6.0 S. > > Antoine >> >> S. >> > -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From rouxph.22 at gmail.com Mon Sep 10 13:25:57 2018 From: rouxph.22 at gmail.com (philippe) Date: Mon, 10 Sep 2018 13:25:57 +0200 Subject: [Scilab-users] arduino toolbox: now available for Scilab 6.0 In-Reply-To: <0802f308-058e-db76-0626-b9182c54f8d0@free.fr> References: <0802f308-058e-db76-0626-b9182c54f8d0@free.fr> Message-ID: Le 08/09/2018 ? 19:53, Samuel Gougeon a ?crit?: > > The portage to Linux (already available) shall be soon included in the > toolbox. > http://forge.scilab.org/index.php/p/arduino/issues/1556/ good news Samuel ! Philippe From n.strelkov at gmail.com Mon Sep 10 13:49:28 2018 From: n.strelkov at gmail.com (Nikolay Strelkov) Date: Mon, 10 Sep 2018 14:49:28 +0300 Subject: [Scilab-users] arduino toolbox: now available for Scilab 6.0 In-Reply-To: <0802f308-058e-db76-0626-b9182c54f8d0@free.fr> References: <0802f308-058e-db76-0626-b9182c54f8d0@free.fr> Message-ID: Dear Samuel! Thank you for good news! It would be very great if Linux version will be available for both Scilab 5.5.2 (as in Ubuntu 16.04 LTS) and Scilab 6.0 (as in Ubuntu 18.04 LTS) through ATOMS. I'm ready to test it with Arduino boards - I have Atmega328 based (Uno, Pro Mini, Nano) and Atmega2560-based (Mega). -- *With best regards,Ph.D., * *associate professor at MPEI ,IEEE member,maintainer of Mathieu functions toolbox for Scilab ,Nikolay Strelkov.* 2018-09-08 20:53 GMT+03:00 Samuel Gougeon : > Hello, > > This message just to announce that the Arduino toolbox is now available > for Scilab 6.0, for Windows users. > It should be listed in the ATOMS manager. > https://atoms.scilab.org/toolboxes/arduino > > The portage to Linux (already available) shall be soon included in the > toolbox. > http://forge.scilab.org/index.php/p/arduino/issues/1556/ > > Volunteers to translate its help pages from french into english are > welcome. > > Best regards > Samuel > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From antoine.monmayrant at laas.fr Mon Sep 10 14:35:25 2018 From: antoine.monmayrant at laas.fr (antoine.monmayrant at laas.fr) Date: Mon, 10 Sep 2018 14:35:25 +0200 Subject: [Scilab-users] Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ? Message-ID: <93817167-82e4-b13f-1d37-3b61ddafa584@laas.fr> Hello, I think I found a bug in the current 6.0 branch: a=uint8(rand(2,2)*255); b=rand(2,2); //let's be sure not to divide by 0 while or(b==0) ??? b=rand(2,2); end //adios amigo: Segmentation fault (core dumped) a./b Dividing a uint8 matrix by a double matrix is always causing a segfault on my machine. Can you reproduce this bug on your machine? Does anyone know whether it's a known bug or not? I have found : https://bugzilla.scilab.org/show_bug.cgi?id=15716 but it is not exactly the same (I don't do any division by zero, just element-wise division. Cheers, Antoine -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From stephane.mottelet at utc.fr Mon Sep 10 14:50:25 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Mon, 10 Sep 2018 14:50:25 +0200 Subject: [Scilab-users] Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ? In-Reply-To: <93817167-82e4-b13f-1d37-3b61ddafa584@laas.fr> References: <93817167-82e4-b13f-1d37-3b61ddafa584@laas.fr> Message-ID: Le 10/09/2018 ? 14:35, antoine.monmayrant at laas.fr a ?crit?: > Hello, > > > I think I found a bug in the current 6.0 branch: > > a=uint8(rand(2,2)*255); > b=rand(2,2); > //let's be sure not to divide by 0 > while or(b==0) > ??? b=rand(2,2); > end > //adios amigo: Segmentation fault (core dumped) > a./b > > Dividing a uint8 matrix by a double matrix is always causing a > segfault on my machine. > Can you reproduce this bug on your machine? > Does anyone know whether it's a known bug or not? > > I have found : > https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=15716 > but it is not exactly the same (I don't do any division by zero, just > element-wise division. > > > Cheers, > > > Antoine > Hello Antoine, Surely, this is a bug, but what type do you expect for the (eventual) result ? S. -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From jrafaelbguerra at hotmail.com Mon Sep 10 14:57:58 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Mon, 10 Sep 2018 12:57:58 +0000 Subject: [Scilab-users] A plane intersecting a surface In-Reply-To: <1536565521036-0.post@n3.nabble.com> References: <3A6B7233274DB449A2A0053A47684F953FEB9CF5@BGS-EX01.auxitrol.ad> <1536565521036-0.post@n3.nabble.com> Message-ID: The new attached snapshot is taken from a better angle to illustrate the plane cutting the 3D data cloud. PS: The Scilab 3D plots all use orthographic views. An option to include perspective is missing. -------------- next part -------------- A non-text attachment was scrubbed... Name: Scilab_plane_intersection_with_point_cloud_RG.png Type: image/png Size: 70539 bytes Desc: Scilab_plane_intersection_with_point_cloud_RG.png URL: From amonmayr at laas.fr Mon Sep 10 15:10:07 2018 From: amonmayr at laas.fr (amonmayr at laas.fr) Date: Mon, 10 Sep 2018 15:10:07 +0200 Subject: [Scilab-users] Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ? In-Reply-To: References: <93817167-82e4-b13f-1d37-3b61ddafa584@laas.fr> Message-ID: <516a18c5-1328-d6e7-a25b-ad66c7372cc3@laas.fr> Le 10/09/2018 ? 14:50, St?phane Mottelet a ?crit?: > Le 10/09/2018 ? 14:35, antoine.monmayrant at laas.fr a ?crit?: >> Hello, >> >> >> I think I found a bug in the current 6.0 branch: >> >> a=uint8(rand(2,2)*255); >> b=rand(2,2); >> //let's be sure not to divide by 0 >> while or(b==0) >> ??? b=rand(2,2); >> end >> //adios amigo: Segmentation fault (core dumped) >> a./b >> >> Dividing a uint8 matrix by a double matrix is always causing a >> segfault on my machine. >> Can you reproduce this bug on your machine? >> Does anyone know whether it's a known bug or not? >> >> I have found : >> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=15716 >> but it is not exactly the same (I don't do any division by zero, just >> element-wise division. >> >> >> Cheers, >> >> >> Antoine >> > Hello Antoine, > > Surely, this is a bug, but what type do you expect for the (eventual) > result ? I don't expect anything from this division, I don't think it makes much sense. :-) I just don't expect scilab to die when someone writes something like that! In fact, I discovered this bug while I was progressively changing the type of my variables from uint8 to double. As a side note, when dividing a uint8() by a double() matlab returns a uint8(), which is not really intuitive to me. Cheers, Antoine > > S. > -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From amonmayr at laas.fr Mon Sep 10 15:28:25 2018 From: amonmayr at laas.fr (amonmayr at laas.fr) Date: Mon, 10 Sep 2018 15:28:25 +0200 Subject: [Scilab-users] Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ? In-Reply-To: References: <93817167-82e4-b13f-1d37-3b61ddafa584@laas.fr> Message-ID: <2498231c-962d-3eb6-cc55-0ea6d509dff6@laas.fr> Le 10/09/2018 ? 14:50, St?phane Mottelet a ?crit?: > Le 10/09/2018 ? 14:35, antoine.monmayrant at laas.fr a ?crit?: >> Hello, >> >> >> I think I found a bug in the current 6.0 branch: >> >> a=uint8(rand(2,2)*255); >> b=rand(2,2); >> //let's be sure not to divide by 0 >> while or(b==0) >> ??? b=rand(2,2); >> end >> //adios amigo: Segmentation fault (core dumped) >> a./b >> >> Dividing a uint8 matrix by a double matrix is always causing a >> segfault on my machine. >> Can you reproduce this bug on your machine? >> Does anyone know whether it's a known bug or not? >> >> I have found : >> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=15716 >> but it is not exactly the same (I don't do any division by zero, just >> element-wise division. >> >> >> Cheers, >> >> >> Antoine >> > Hello Antoine, > > Surely, this is a bug, but what type do you expect for the (eventual) > result ? I reported a bug: https://bugzilla.scilab.org/show_bug.cgi?id=15759 Can some or you try my test script for your OS/scilab version? Weirdly enough, under scilab 5.5.2, there is no segfault, but scilab complains about a division by zero (whereas there is no division by zero). Antoine > > S. > -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From amonmayr at laas.fr Mon Sep 10 15:34:24 2018 From: amonmayr at laas.fr (amonmayr at laas.fr) Date: Mon, 10 Sep 2018 15:34:24 +0200 Subject: [Scilab-users] Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ? In-Reply-To: <2498231c-962d-3eb6-cc55-0ea6d509dff6@laas.fr> References: <93817167-82e4-b13f-1d37-3b61ddafa584@laas.fr> <2498231c-962d-3eb6-cc55-0ea6d509dff6@laas.fr> Message-ID: <80931731-f010-679a-3c5f-9925e8ea012c@laas.fr> Le 10/09/2018 ? 15:28, amonmayr at laas.fr a ?crit?: > Le 10/09/2018 ? 14:50, St?phane Mottelet a ?crit?: >> Le 10/09/2018 ? 14:35, antoine.monmayrant at laas.fr a ?crit?: >>> Hello, >>> >>> >>> I think I found a bug in the current 6.0 branch: >>> >>> a=uint8(rand(2,2)*255); >>> b=rand(2,2); >>> //let's be sure not to divide by 0 >>> while or(b==0) >>> ??? b=rand(2,2); >>> end >>> //adios amigo: Segmentation fault (core dumped) >>> a./b >>> >>> Dividing a uint8 matrix by a double matrix is always causing a >>> segfault on my machine. >>> Can you reproduce this bug on your machine? >>> Does anyone know whether it's a known bug or not? >>> >>> I have found : >>> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=15716 >>> but it is not exactly the same (I don't do any division by zero, >>> just element-wise division. >>> >>> >>> Cheers, >>> >>> >>> Antoine >>> >> Hello Antoine, >> >> Surely, this is a bug, but what type do you expect for the (eventual) >> result ? > I reported a bug: https://bugzilla.scilab.org/show_bug.cgi?id=15759 > Can some or you try my test script for your OS/scilab version? > Weirdly enough, under scilab 5.5.2, there is no segfault, but scilab > complains about a division by zero (whereas there is no division by > zero). Also, division (not element-wise division) gives a funny result, both for 5.5.2 and the current master: a=uint8(rand(2,2)*255); b=rand(2,2); //let's be sure not to divide by 0 while or(b==0) ??? b=rand(2,2); end //just a division : // master and scilab-6.0 : Operator / : Error -1 not yet managed. // 5.5.2 : !--error 26 //??? ??? ??? Too complex recursion! (recursion tables are full) //??? ??? ??? at line?????? 9 of function %i_r_i called by :?? ... a/b > > Antoine >> >> S. >> > -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From jrafaelbguerra at hotmail.com Mon Sep 10 15:44:36 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Mon, 10 Sep 2018 13:44:36 +0000 Subject: [Scilab-users] Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ? In-Reply-To: <2498231c-962d-3eb6-cc55-0ea6d509dff6@laas.fr> References: <93817167-82e4-b13f-1d37-3b61ddafa584@laas.fr> <2498231c-962d-3eb6-cc55-0ea6d509dff6@laas.fr> Message-ID: Antoine, As requested, your script seems to produce the same results in Win 7 64-bit Scilab 5.5.2 and 6.0.1, as you reported for Linux_x64. Regards, Rafael From Christophe.Dang at sidel.com Mon Sep 10 16:56:22 2018 From: Christophe.Dang at sidel.com (Dang Ngoc Chan, Christophe) Date: Mon, 10 Sep 2018 14:56:22 +0000 Subject: [Scilab-users] TR: A plane intersecting a surface Message-ID: Hello, [sorry Paul, it was mistakedly sent only to you] A far from optimal solution - not vectorised, the points are searched two times (almost each triangle side is common to another one - using the Delaunay tessellation. Requires the Atoms module cglab mode(0) function [z]=saddle(x, y) z = x^2 - y^2 endfunction A = [1 2 3 4]; function [d]=plane(A, x, y, z) d = A(1)*x + A(2)*y + A(3)*z + A(4); // cartesian equation endfunction // Dichotomy search of the intercept function [X]=intercept(A, x1, y1, z1, x2, y2, z2) epsilon = 1e-2; x = x1; y = y1; z = z1; d1 = plane(A, x1, y1, z1); d2 = plane(A, x2, y2, z2); if (abs(d1) <= epsilon) then x = x1; y = y1; z = z1; elseif (abs(d2) <= epsilon) then x = x2; y = y2; z = z2; else cont = %t; while cont x = 0.5*(x1 + x2); y = 0.5*(y1 + y2); z = 0.5*(z1 + z2); d = plane(A, x, y, z); if abs(d) <= epsilon then cont = %f else if (sign(d1*d) == 1) then x1 = x; y1 = y; z1 = z; else x2 = x; y2 = y; z2 = z; end end end end X = [x, y, z]; endfunction // surface making ... of course in the real life the surface comes from experimental data (no Cartesian equation is attached on)) //n = 10; n = 50; x = linspace(-2,2,n)'; y = linspace(-1,3,n)'; // reshape [X, Y] = ndgrid(x, y); X = matrix(X, size(X, "*"), 1)'; Y = matrix(Y, size(Y, "*"), 1)'; Z = saddle(X, Y); // tesselation tri = delaunay_2(X, Y); nbtri = size(tri, "r"); points = []; // detect when the plane crosses the side of a triangle // then set the intercept point as the middle for i = 1:nbtri x1 = X(tri(i, 1)); y1 = Y(tri(i, 1)); z1 = Z(tri(i, 1)); x2 = X(tri(i, 2)); y2 = Y(tri(i, 2)); z2 = Z(tri(i, 2)); x3 = X(tri(i, 3)); y3 = Y(tri(i, 3)); z3 = Z(tri(i, 3)); d1 = plane(A, x1, y1, z1); d2 = plane(A, x2, y2, z2); d3 = plane(A, x3, y3, z3); s1 = (sign(d1*d2) == -1); s2 = (sign(d2*d3) == -1); s3 = (sign(d3*d1) == -1); // bool(i) = s1|s2|s3; if s1 then //points = [points ; 0.5*([x1, y1, z1] + [x2, y2, z2])]; points = [points ; intercept(A, x1, y1, z1, x2, y2, z2)]; end if s2 then //points = [points ; 0.5*([x2, y2, z2] + [x3, y3, z3])]; points = [points ; intercept(A, x2, y2, z2, x3, y3, z3)]; end if s3 then //points = [points ; 0.5*([x3, y3, z3] + [x1, y1, z1])]; points = [points ; intercept(A, x3, y3, z3, x1, y1, z1)]; end end // plot scf(0); clf(); plot3d(x, y, feval(x, y, saddle)); surf = gce(); param3d(points(:, 1), points(:, 2), points(:, 3)); curve=gce(); curve.mark_mode = "on"; curve.mark_style = 0; curve.line_mode = "off"; curve.mark_foreground = 5; curve.mark_size = 1; -- Christophe Dang Ngoc Chan Mechanical calculation engineer This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christophe.Dang at sidel.com Mon Sep 10 17:14:36 2018 From: Christophe.Dang at sidel.com (Dang Ngoc Chan, Christophe) Date: Mon, 10 Sep 2018 15:14:36 +0000 Subject: [Scilab-users] A plane intersecting a surface Message-ID: Same code but a bit more comments mode(0) function [z]=saddle(x, y) z = x^2 - y^2 endfunction A = [1 2 3 4]; function [d]=plane(A, x, y, z) d = A(1)*x + A(2)*y + A(3)*z + A(4); // cartesian equation endfunction // Dichotomy search of the intercept function [X]=intercept(A, x1, y1, z1, x2, y2, z2) // P1(x1, y1, z1) ; P2(x2, y2, z2) ; [P1P2] is a triangle side epsilon = 1e-2; d1 = plane(A, x1, y1, z1); // algebraic distance to the plane d2 = plane(A, x2, y2, z2); if (abs(d1) <= epsilon) then // P1 close enough to the plane x = x1; y = y1; z = z1; elseif (abs(d2) <= epsilon) then // P2 close enough to the plane x = x2; y = y2; z = z2; else // dichotomy search of a point that is close enough cont = %t; while cont // M(x, y, z) middle point of [P1P2] x = 0.5*(x1 + x2); y = 0.5*(y1 + y2); z = 0.5*(z1 + z2); d = plane(A, x, y, z); if abs(d) <= epsilon then cont = %f // M is close enough else if (sign(d1*d) == 1) then // M is on the same side of the plane as P1 x1 = x; y1 = y; z1 = z; // replace P1 by M else x2 = x; y2 = y; z2 = z; // replace P2 by M end end end end X = [x, y, z]; endfunction // surface making ... of course in the real life the surface comes from experimental data (no Cartesian equation is attached on)) n = 50; x = linspace(-2,2,n)'; y = linspace(-1,3,n)'; tic(); // reshape [X, Y] = ndgrid(x, y); X = matrix(X, size(X, "*"), 1)'; Y = matrix(Y, size(Y, "*"), 1)'; Z = saddle(X, Y); // tesselation tri = delaunay_2(X, Y); nbtri = size(tri, "r"); points = []; // detect when the plane crosses the side of a triangle // then set the intercept point for i = 1:nbtri // extract the points of the tirangle #i x1 = X(tri(i, 1)); y1 = Y(tri(i, 1)); z1 = Z(tri(i, 1)); x2 = X(tri(i, 2)); y2 = Y(tri(i, 2)); z2 = Z(tri(i, 2)); x3 = X(tri(i, 3)); y3 = Y(tri(i, 3)); z3 = Z(tri(i, 3)); // compute the algebraic distances d1 = plane(A, x1, y1, z1); d2 = plane(A, x2, y2, z2); d3 = plane(A, x3, y3, z3); // check for each pair of points if they are in different half-spaces s1 = (sign(d1*d2) == -1); s2 = (sign(d2*d3) == -1); s3 = (sign(d3*d1) == -1); // determine the intercept point if need be if s1 then points = [points ; intercept(A, x1, y1, z1, x2, y2, z2)]; end if s2 then points = [points ; intercept(A, x2, y2, z2, x3, y3, z3)]; end if s3 then points = [points ; intercept(A, x3, y3, z3, x1, y1, z1)]; end end duration=toc(); // plot scf(0); clf(); plot3d(x, y, feval(x, y, saddle)); // plot3d(X, Y, Z); // doesn't work, don't know why surf = gce(); param3d(points(:, 1), points(:, 2), points(:, 3)); curve=gce(); curve.mark_mode = "on"; curve.mark_style = 0; curve.line_mode = "off"; curve.mark_foreground = 5; curve.mark_size = 1; disp("t = "+string(duration)+" s."); -- Christophe Dang Ngoc Chan Mechanical calculation engineer This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rouxph.22 at gmail.com Mon Sep 10 23:32:39 2018 From: rouxph.22 at gmail.com (philippe) Date: Mon, 10 Sep 2018 23:32:39 +0200 Subject: [Scilab-users] Division of uint8 matrix by a double matrix => segfault in scilab-branch-6.0 ? In-Reply-To: <93817167-82e4-b13f-1d37-3b61ddafa584@laas.fr> References: <93817167-82e4-b13f-1d37-3b61ddafa584@laas.fr> Message-ID: Le 10/09/2018 ? 14:35, antoine.monmayrant at laas.fr a ?crit?: > a=uint8(rand(2,2)*255); > b=rand(2,2); > //let's be sure not to divide by 0 > while or(b==0) > ??? b=rand(2,2); > end > //adios amigo: Segmentation fault (core dumped) > a./b I confirm scilab crash while executing this code in scilab-6.0.1 and ubuntu 18.04, in the console I have message about floating point exception and divide-by-zero*. Best regards Philippe * from console : Une erreur fatale a ?t? d?tect?e par Scilab. Veuillez v?rifier les fonctions d?finies par l'utilisateur (ou celles des modules externes), elles devraient appara?tre dans le suivi de la pile. Ou sinon, vous pouvez reporter un bug sur http://bugzilla.scilab.org/ avec : * un simple code qui reproduit le probl?me * le r?sultat de [a, b] = getdebuginfo() * l'information suivante : [jenny-a-03:10145] Signal: Exception en point flottant (8) [jenny-a-03:10145] Signal code: Integer divide-by-zero (1) [jenny-a-03:10145] Failing at address: 0x7f7f744a0293 Pile d'appel?: 1: 0x8f260b (/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so) 2: 0x8e5318 < > (/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so) 3: 0x12890 < > (/lib/x86_64-linux-gnu/libpthread.so.0) 4: 0x357293 , types::Double, types::Int >(types::Int*, types::Double*)> (/usr/lib/scilab/libsciast.so.6) 5: 0x3349f6 (/usr/lib/scilab/libsciast.so.6) 6: 0x191dfb ::visitprivate(ast::OpExp const&)> (/usr/lib/scilab/libsciast.so.6) 7: 0x1be9ff ::visitprivate(ast::SeqExp const&)> (/usr/lib/scilab/libsciast.so.6) 8: 0x1a17c2 (/usr/lib/scilab/libscilab-cli.so.6) 9: 0x19a52a (/usr/lib/scilab/libscilab-cli.so.6) 10: 0x19ac
(/usr/bin/scilab-bin) 11: 0x21b97 <__libc_start_main> (/lib/x86_64-linux-gnu/libc.so.6) 12: 0x24ca < > (/usr/bin/scilab-bin) Fin de la pile From antoine.monmayrant at laas.fr Fri Sep 14 10:22:29 2018 From: antoine.monmayrant at laas.fr (antoine.monmayrant at laas.fr) Date: Fri, 14 Sep 2018 10:22:29 +0200 Subject: [Scilab-users] xload vs load Message-ID: Hi all, am I the only one to experience that xload is completely broken an can be replaced by load? I am trying to reload slightly complex figures (that is with more than one plot per figure) and xload is almost always failing in some way. For example, one of my figure as 3 plots and I can see all three while the graphic window is being populated, but in the end, the first subplot sometimes disappears (it's not visible="off", it's gone). Anyone has experienced something similar? If I can find a way to get this to reproducible, I'll try to fill in a bug report... Antoine -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From amonmayr at laas.fr Fri Sep 14 14:54:59 2018 From: amonmayr at laas.fr (amonmayr at laas.fr) Date: Fri, 14 Sep 2018 14:54:59 +0200 Subject: [Scilab-users] xload vs load In-Reply-To: References: Message-ID: Hi all, I found a way to reproducibly trigger the bug, and reported it here : https://bugzilla.scilab.org/show_bug.cgi?id=15765 Can you try the sample script on the example graphic file? Cheers, Antoine -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From stephane.mottelet at utc.fr Fri Sep 14 18:20:42 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Fri, 14 Sep 2018 18:20:42 +0200 Subject: [Scilab-users] algebra conventions with integer types to be discussed Message-ID: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> Hello all, Integer types in Scilab are not smoothly implemented and there are still some bugs and real questions to be discussed, specifically on over/underflow, exceptions in divisions such as in int8(1)/int8(0) int8(-128)/int8(-1) type of the result of mixed double/integer operations, such as int8(1) + %pi int8(1)/0.0 and so on. Other software related to Scilab, e.g. Matlab and Julia, have different conventions and currently Scilab currently adopts a mix of them, which does not help to make one's mind. Integers types were a long-waited feature by people who needed it, so I would like to have some? developpers and user testimonies about the way they do algebra with them. Thanks in adavance, S. -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From cfuttrup at gmail.com Fri Sep 14 20:57:04 2018 From: cfuttrup at gmail.com (Claus Futtrup) Date: Fri, 14 Sep 2018 20:57:04 +0200 Subject: [Scilab-users] Frequency response Message-ID: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> Dear Scilabers I have calculated an impulse response and wish to do an FFT to achieve the frequency response. I know what to expect. In the matlab forum someone asked the same question and was recommended to use freqz ... I wonder what would be the equivalent function in Scilab? https://www.mathworks.com/matlabcentral/answers/350350-how-to-plot-loudspeaker-frequency-response-from-its-impulse-response For example, to replicate the code snippet (second answer in above link), how to do this in Scilab? h = rand(1,64); // impulse response (Matlab source code) fs = 1000; Nfft = 128; [H,F] = freqz(h,1,Nfft,fs); semilogx(F,mag2db(abs(H))); grid on; xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); Best regards, Claus --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Sat Sep 15 00:32:35 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Sat, 15 Sep 2018 00:32:35 +0200 Subject: [Scilab-users] Frequency response In-Reply-To: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> Message-ID: <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> Le 14/09/2018 ? 20:57, Claus Futtrup a ?crit : > > Dear Scilabers > > I have calculated an impulse response and wish to do an FFT to achieve > the frequency response. I know what to expect. In the matlab forum > someone asked the same question and was recommended to use freqz ... I > wonder what would be the equivalent function in Scilab? > > https://www.mathworks.com/matlabcentral/answers/350350-how-to-plot-loudspeaker-frequency-response-from-its-impulse-response > > > For example, to replicate the code snippet (second answer in above > link), how to do this in Scilab? > > h = rand(1,64); // impulse response (Matlab source code) > fs = 1000; > Nfft = 128; > [H,F] = freqz(h,1,Nfft,fs); Did you have a look around freq() or repfreq()? We have somewhat the equivalence invfreqz(H,F,m,n,W) <=> frfit(F*2*%pi, H, n, W) // Scilab So you may look for the reciprocal of Scilab's frfit() HTH Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From cfuttrup at gmail.com Sat Sep 15 22:15:08 2018 From: cfuttrup at gmail.com (Claus Futtrup) Date: Sat, 15 Sep 2018 22:15:08 +0200 Subject: [Scilab-users] Frequency response In-Reply-To: <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> Message-ID: <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> Hi Samuel and Scilabers My problem with freq and repfreq is that they require a "sys" input, which implies I need to describe a response function of some sort. For example (from the Scilab web-help): https://help.scilab.org/docs/6.0.1/en_US/freq.html (example code) s=poly (0,'s'); sys=(s+1)/(s^3-5*s+4) rep=freq(sys("num"),sys("den"),[0,0.9,1.1,2,3,10,20]) https://help.scilab.org/docs/6.0.1/en_US/repfreq.html (syntax) [ [frq,] repf]=repfreq(sys,fmin,fmax[,step]) [ [frq,] repf]=repfreq(sys[,frq]) [ frq,repf,splitf]=repfreq(sys,fmin,fmax[,step]) [ frq,repf,splitf]=repfreq(sys[,frq]) ... So, the thing with the matlab freqz (as the example repeated below shows) is just a basic FFT with sampling, etc: h = rand(1,64); // impulse response (Matlab source code) fs = 1000; Nfft = 128; [H,F] = freqz(h,1,Nfft,fs); semilogx(F,mag2db(abs(H))); grid on; xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); It may very well be that I just don't understand the help page of repfreq. For example it says about sys: "A siso or simo linear dynamical system, in state space, transfer function or zpk representations, in continuous or discrete time." - al right then, it seems pretty capable, but so, what's "zpk" for example? ... my apologies for finding the Scilab help to be cryptic and the examples insufficient for me to solve my problem, hence I ask if someone can take above matlab code and make it work in Scilab. Best regards, Claus On 15.09.2018 00:32, Samuel Gougeon wrote: > Le 14/09/2018 ? 20:57, Claus Futtrup a ?crit?: >> >> Dear Scilabers >> >> I have calculated an impulse response and wish to do an FFT to >> achieve the frequency response. I know what to expect. In the matlab >> forum someone asked the same question and was recommended to use >> freqz ... I wonder what would be the equivalent function in Scilab? >> >> https://www.mathworks.com/matlabcentral/answers/350350-how-to-plot-loudspeaker-frequency-response-from-its-impulse-response >> >> >> For example, to replicate the code snippet (second answer in above >> link), how to do this in Scilab? >> >> h = rand(1,64); // impulse response (Matlab source code) >> fs = 1000; >> Nfft = 128; >> [H,F] = freqz(h,1,Nfft,fs); > > Did you have a look around freq() or repfreq()? > > We have somewhat the equivalence invfreqz(H,F,m,n,W) <=> > frfit(F*2*%pi, H, n, W) // Scilab > > So you may look for the reciprocal of Scilab's frfit() > > HTH > Samuel > > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: From jrafaelbguerra at hotmail.com Sat Sep 15 22:47:07 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Sat, 15 Sep 2018 20:47:07 +0000 Subject: [Scilab-users] Frequency response In-Reply-To: <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr>, <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> Message-ID: Forgetting MATLAB for a second, can you define your problem ? How is your specific frequency response defined? In Laplace, Fourier, z-transform, ..., domain? ________________________________ From: users on behalf of Claus Futtrup Sent: Saturday, September 15, 2018 11:15:08 PM To: users at lists.scilab.org Subject: Re: [Scilab-users] Frequency response Hi Samuel and Scilabers My problem with freq and repfreq is that they require a "sys" input, which implies I need to describe a response function of some sort. For example (from the Scilab web-help): https://help.scilab.org/docs/6.0.1/en_US/freq.html (example code) s=poly(0,'s'); sys=(s+1)/(s^3-5*s+4) rep=freq(sys("num"),sys("den"),[0,0.9,1.1,2,3,10,20]) https://help.scilab.org/docs/6.0.1/en_US/repfreq.html (syntax) [ [frq,] repf]=repfreq(sys,fmin,fmax [,step]) [ [frq,] repf]=repfreq(sys [,frq]) [ frq,repf,splitf]=repfreq(sys,fmin,fmax [,step]) [ frq,repf,splitf]=repfreq(sys [,frq]) ... So, the thing with the matlab freqz (as the example repeated below shows) is just a basic FFT with sampling, etc: h = rand(1,64); // impulse response (Matlab source code) fs = 1000; Nfft = 128; [H,F] = freqz(h,1,Nfft,fs); semilogx(F,mag2db(abs(H))); grid on; xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); It may very well be that I just don't understand the help page of repfreq. For example it says about sys: "A siso or simo linear dynamical system, in state space, transfer function or zpk representations, in continuous or discrete time." - al right then, it seems pretty capable, but so, what's "zpk" for example? ... my apologies for finding the Scilab help to be cryptic and the examples insufficient for me to solve my problem, hence I ask if someone can take above matlab code and make it work in Scilab. Best regards, Claus On 15.09.2018 00:32, Samuel Gougeon wrote: Le 14/09/2018 ? 20:57, Claus Futtrup a ?crit : Dear Scilabers I have calculated an impulse response and wish to do an FFT to achieve the frequency response. I know what to expect. In the matlab forum someone asked the same question and was recommended to use freqz ... I wonder what would be the equivalent function in Scilab? https://www.mathworks.com/matlabcentral/answers/350350-how-to-plot-loudspeaker-frequency-response-from-its-impulse-response For example, to replicate the code snippet (second answer in above link), how to do this in Scilab? h = rand(1,64); // impulse response (Matlab source code) fs = 1000; Nfft = 128; [H,F] = freqz(h,1,Nfft,fs); Did you have a look around freq() or repfreq()? We have somewhat the equivalence invfreqz(H,F,m,n,W) <=> frfit(F*2*%pi, H, n, W) // Scilab So you may look for the reciprocal of Scilab's frfit() HTH Samuel _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users [https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif] Virus-free. www.avast.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tim at wescottdesign.com Sat Sep 15 22:50:33 2018 From: tim at wescottdesign.com (Tim Wescott) Date: Sat, 15 Sep 2018 13:50:33 -0700 Subject: [Scilab-users] Frequency response In-Reply-To: <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> Message-ID: <1537044633.19302.9.camel@wescottdesign.com> So, this is complicated. First, if you have an impulse response, in the form of a vector of samples, then you can turn it into a FIR filter, and you can find the frequency response of that with any of the available Scilab tools. ?I'm not sure if there's a more direct way, but if you had an impulse response h = [1, 1/2, 1/4, 1/8], then you can turn that into H = 1 + 0.5*%z^(-1) + 0.25*%z^(-2) + 0.125*%z^(-3) (note that %z is a built-in: %z = poly(0, 'z')). ?Then you can use techniques surrounding repfreq to get the frequency response. Assign a sampling rate to it (i.e., by setting H.dt = 0.001, for a 1kHz sampling rate) and you can just use the Bode plot function: bode(H). Second, you can take your impulse response, pad it with zeros, and then take the FFT of it -- i.e. H = fft([h zeros(1, 252)]). ?You need to pad it because the FFT is only exact for a periodic function in time -- padding it gives you an approximation of an actual impulse response (and before someone jumps in and says you need to window it -- no, you don't, windowing is for sample vectors of continuous signals, not impulse responses). ?But if you don't know WHY the method is approximate, you're going to have trouble correctly massaging the data before it's presented to the FFT, and with interpreting the results.? On Sat, 2018-09-15 at 22:15 +0200, Claus Futtrup wrote: > Hi Samuel and Scilabers > > My problem with freq and repfreq is that they require a "sys" input, > which implies I need to describe a response function of some sort. > For example (from the Scilab web-help): > > https://help.scilab.org/docs/6.0.1/en_US/freq.html (example code) > s=poly(0,'s'); > sys=(s+1)/(s^3-5*s+4) > rep=freq(sys("num"),sys("den"),[0,0.9,1.1,2,3,10,20]) > > https://help.scilab.org/docs/6.0.1/en_US/repfreq.html (syntax) > [ [frq,] repf]=repfreq(sys,fmin,fmax [,step]) > [ [frq,] repf]=repfreq(sys [,frq]) > [ frq,repf,splitf]=repfreq(sys,fmin,fmax [,step]) > [ frq,repf,splitf]=repfreq(sys [,frq]) > > ... So, the thing with the matlab freqz (as the example repeated > below shows) is just a basic FFT with sampling, etc: > > h = rand(1,64); // impulse response (Matlab source code) > fs = 1000; > Nfft = 128; > [H,F] = freqz(h,1,Nfft,fs); > semilogx(F,mag2db(abs(H))); grid on; > xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); > > It may very well be that I just don't understand the help page of > repfreq. For example it says about sys: "A siso or simo linear > dynamical system, in state space, transfer function or zpk > representations, in continuous or discrete time." - al right then, it > seems pretty capable, but so, what's "zpk" for example? ... my > apologies for finding the Scilab help to be cryptic and the examples > insufficient for me to solve my problem, hence I ask if someone can > take above matlab code and make it work in Scilab. > > Best regards, > Claus > > On 15.09.2018 00:32, Samuel Gougeon wrote: > > Le 14/09/2018 ? 20:57, Claus Futtrup a ?crit?: > > > Dear Scilabers > > > I have calculated an impulse response and wish to do an FFT to > > > achieve the frequency response. I know what to expect. In the > > > matlab forum someone asked the same question and was recommended > > > to use freqz ... I wonder what would be the equivalent function > > > in Scilab? > > > https://www.mathworks.com/matlabcentral/answers/350350-how-to-plo > > > t-loudspeaker-frequency-response-from-its-impulse-response > > > For example, to replicate the code snippet (second answer in > > > above link), how to do this in Scilab? > > > h = rand(1,64); // impulse response (Matlab source code) > > > fs = 1000; > > > Nfft = 128; > > > [H,F] = freqz(h,1,Nfft,fs); > > ? > > Did you have a look around freq() or repfreq()? > > > > We have somewhat the equivalence invfreqz(H,F,m,n,W)? <=>? > > frfit(F*2*%pi, H, n, W) // Scilab > > > > So you may look for the reciprocal of Scilab's frfit()? > > > > HTH > > Samuel > > > > > > > > _______________________________________________ > > users mailing list > > users at lists.scilab.org > > http://lists.scilab.org/mailman/listinfo/users > > Virus-free. www.avast.com > ?_______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -- Tim Wescott www.wescottdesign.com Control & Communications systems, circuit & software design. Phone: 503.631.7815 Cell: 503.349.8432 From jrafaelbguerra at hotmail.com Sun Sep 16 07:40:38 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Sun, 16 Sep 2018 05:40:38 +0000 Subject: [Scilab-users] Frequency response In-Reply-To: References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr>, <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> Message-ID: Just to refresh some definitions, for non-DSP specialists like me. For a Linear Time Invariant system with impulse response h(t) and transfer function H(f), input/output signals x(t) / y(t) and Fourier transforms X(f) / Y(f) we have: y(t) = x(t) * h(t) (convolution) ?? Y(f) = X(f).H(f) (product) When the input is a delta function *(t) the output is the impulse response h(t) itself. As indicated by Tim W., to obtain the system's transfer function H(f) ("frequency response"), padding the (time) impulse response with enough zeros will produce enough spectral resolution in the FFT, and this is the most straightforward way. Otherwise you can use for instance Scilab function's poly, syslin, and bode; which sounds like using a sledgehammer to crack a nut. Regards, Rafael -------------- next part -------------- An HTML attachment was scrubbed... URL: From cfuttrup at gmail.com Sun Sep 16 16:48:52 2018 From: cfuttrup at gmail.com (Claus Futtrup) Date: Sun, 16 Sep 2018 16:48:52 +0200 Subject: [Scilab-users] Frequency response In-Reply-To: References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> Message-ID: <50613085-e35b-fc68-ef49-3f8a09f67147@gmail.com> Hi Rafael My problem is defined as a response function, where I use contour integral to achieve the step response. Then I differentiate it to achieve the impulse response. In essense I already "know" my response function. It contains some special features (it could for example be a logarithmic term) and e.g. "syslin" or "bode" will choke on it. If I already know the response function, why bother with the FFT? Well, I'd like to ensure the time response and frequency response are correct (without errors on my part) and one way of verifying is to close-the-loop and calculate the FFT, see that input = output. I'd like to verify that the absolute levels are correct. Attached please find the script (10 kb). It's fully functional. Apologies for the comments in the script, I didn't clean it up for publishing... Best regards, Claus On 15.09.2018 22:47, Rafael Guerra wrote: > Forgetting MATLAB for a second, can you define your problem ? > > How is your specific frequency response defined? In Laplace, Fourier, > z-transform, ..., domain? > ------------------------------------------------------------------------ > *From:* users on behalf of Claus > Futtrup > *Sent:* Saturday, September 15, 2018 11:15:08 PM > *To:* users at lists.scilab.org > *Subject:* Re: [Scilab-users] Frequency response > Hi Samuel and Scilabers > > My problem with freq and repfreq is that they require a "sys" input, > which implies I need to describe a response function of some sort. For > example (from the Scilab web-help): > > https://help.scilab.org/docs/6.0.1/en_US/freq.html (example code) > s=poly (0,'s'); > sys=(s+1)/(s^3-5*s+4) > rep=freq(sys("num"),sys("den"),[0,0.9,1.1,2,3,10,20]) > https://help.scilab.org/docs/6.0.1/en_US/repfreq.html (syntax) > [ [frq,] repf]=repfreq(sys,fmin,fmax[,step]) > [ [frq,] repf]=repfreq(sys[,frq]) > [ frq,repf,splitf]=repfreq(sys,fmin,fmax[,step]) > [ frq,repf,splitf]=repfreq(sys[,frq]) > > ... So, the thing with the matlab freqz (as the example repeated below > shows) is just a basic FFT with sampling, etc: > > h = rand(1,64); // impulse response (Matlab source code) > fs = 1000; > Nfft = 128; > [H,F] = freqz(h,1,Nfft,fs); > semilogx(F,mag2db(abs(H))); grid on; > xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); > > It may very well be that I just don't understand the help page of > repfreq. For example it says about sys: "A siso or simo linear > dynamical system, in state space, transfer function or zpk > representations, in continuous or discrete time." - al right then, it > seems pretty capable, but so, what's "zpk" for example? ... my > apologies for finding the Scilab help to be cryptic and the examples > insufficient for me to solve my problem, hence I ask if someone can > take above matlab code and make it work in Scilab. > > Best regards, > Claus > > On 15.09.2018 00:32, Samuel Gougeon wrote: >> Le 14/09/2018 ? 20:57, Claus Futtrup a ?crit?: >>> >>> Dear Scilabers >>> >>> I have calculated an impulse response and wish to do an FFT to >>> achieve the frequency response. I know what to expect. In the matlab >>> forum someone asked the same question and was recommended to use >>> freqz ... I wonder what would be the equivalent function in Scilab? >>> >>> https://www.mathworks.com/matlabcentral/answers/350350-how-to-plot-loudspeaker-frequency-response-from-its-impulse-response >>> >>> >>> For example, to replicate the code snippet (second answer in above >>> link), how to do this in Scilab? >>> >>> h = rand(1,64); // impulse response (Matlab source code) >>> fs = 1000; >>> Nfft = 128; >>> [H,F] = freqz(h,1,Nfft,fs); >> >> Did you have a look around freq() or repfreq()? >> >> We have somewhat the equivalence invfreqz(H,F,m,n,W) <=> >> frfit(F*2*%pi, H, n, W) // Scilab >> >> So you may look for the reciprocal of Scilab's frfit() >> >> HTH >> Samuel >> >> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users > > > > > Virus-free. www.avast.com > > > > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- // stepresponse.sce // // This script calculates the step response of a specified bass reflex system // design based on the Weideman Contour method as described in the AES article: // "A Contour Integral Method for Transient Response Calculation" // J. Audio Eng. Soc., vol. 66, no. 5, pp. 360-368, (May 2018). // // The transducer data are from the following AES article (not the datasheet): // "An Added-Mass Measurement Technique for Transducer Parameter Estimation" // (because it includes visco-elastic parameters, classic Knudsen LOG model) // and therefore this script is using the Knudsen LOG model for simulation. // // Script by Claus Futtrup and Jeff Candy // Date created: 2018-08-05 // Last modified: 2018-09-14 clear; xdel(winsid()); clc; // Clear variables, graphics and console // ==================== // ---- USER INPUT ---- // ==================== name = "SEAS L16RNX 8 ohm in 10 liter box"; // Included in PLOT title // --- DEFINE TRANSDUCER PARAMETERS Re = 5.8; // ohm - DC resistance - world's simplest "inductance model" Bl = 7.034; // Tm (or N/A) Mms = 15.13; // gram Sd = 104; // cm2 // Instead of the classical Thiele-Small parameters of Cms, Rms, // we need three parameters, named R0, L0 and beta to describe the // viscoelastic damping and compliance of the mechanical system. R0 = 32.20; // ohm (damping) - for gbeta = 0, insert Res (T/S parameter) L0 = 60.24; // mH (compliance) - for gbeta = 0, insert Lces (T/S parameter) gbeta = 0.059; // Viscoelasticity, if gbeta = 0, then without creep (i.e. T/S) // Above three parameters describe damping (R0) and compliance (L0, gbeta). // We recommend that they are found using the dual-added-mass technique. // Notice the zero ('0') in the names of the parameters, which show that these // values are valid following Knudsen LOG model and _not_ classical T/S. // The following model equations can degenerate to the Thiele-Small model just // by setting gbeta = 0, R0 = Res = Bl^2 / Rms and L0 = Lces = Cms * Bl^2; // --- DEFINE BOX PARAMETERS Vb = 10; // liter Fp = 40; // Hz - port tuning frequency, Fp = 0 for closed box simulation // Add box damping (?) - most important are the absorption losses. // =========================== // ---- END OF USER INPUT ---- // =========================== // --- CONVERT TO SI-UNITS Mms = Mms / 1e3; // convert to kg Sd = Sd / 1e4; // convert to m2 L0 = L0 / 1e3; // convert to Henry Vb = Vb / 1e3; // convert to m3 // --- SOME CONSTANTS rho = 1.201; // Density of air, kg/m3 c = 343.7; // Speed of sound in air, m/s p0 = 2e-5; // 20 micro-Pascal, Reference pressure level (SPL = 0 dB) r = 1; // Distance 1 meter Vref = sqrt(8); // 2.83 Volt (step response signal input level) // Should this be 4 Volt (peak amplitude) instead ?? // --- CALCULATE FURTHER PARAMETERS Cm0 = L0 / Bl^2; // Compliance (mechanical) ws = 1/sqrt(Cm0*Mms); F0 = ws / (2 * %pi); // This is _not_ the resonance frequency of the complete speaker, but // only the frequency-independent part (= excluding viscoelasticity). // We do it this way because the viscoelastic compliance and damping // is added as a separate expression to the response function. Rm0 = Bl^2 / R0; // Damping (mechanical), frequency-independent part Qm0 = (Mms/Rm0) * ws; Rme = Bl^2 / Re; // Mechanical equivalent of electrical (DC) resistance Qe0 = (Mms/Rme) * ws; Qt0 = (1/Qm0 + 1/Qe0)^-1; Vas = Cm0 * Sd^2 * rho * c^2; // Volume of Air Equivalent to Cm0 lambda = gbeta * log(10) / (1-gbeta * log(ws)); // Knudsen LOG lambda // Not used, just curious // --- NORMALIZE DATA alpha = Vas / Vb; h = Fp / F0; // NOTICE: When using the LOG model, these normalizations // are in physical size quite different from Thiele/Small. // --- RESPONSE FUNCTION function y=resp(s) cs = 1 - gbeta * log( s ); // Knudsen LOG viscoelastic compliance y = s.^4 ./ ( (s.^2 + h^2) .* (1.0./cs + s/Qt0 + s.^2) + alpha * s.^2); endfunction // NOTICE: This defines a 4th order system (bass reflex), utilizing the Knudsen // LOG model with a viscoelastic compliance (i.e. the output is complex and // gives both stiffness and damping to the final response). The parameters, h, // Qt0, alpha and gbeta (greek-beta) are defined with a normalized frequency // given by the LOG model (i.e. not the resonance frequency of the complete // speaker). The only difference from the original Knudsen LOG article is that // we use the natural logarithm (not base-10 logarithm). // --- WEIDEMAN CONTOUR INTEGRAL N0 = 12; // resolution steps = 8; // steps per unit time, t_max = 16; // time (dimensionless) - t_max = 16 gives 128 data points for FFT t_step = 1/steps; // because steps * t_max = 8 * 16 = 128 t = t_step:t_step:t_max; // which means frequency-step = 14.6 Hz mu_c = max([1 h]); t_c = %pi*N0/(12*mu_c); nt = length(t); for i=1:nt do ti = t(i); // Selection defined in if ti < t_c then // Eqs (31) and (32) mu = %pi*N0/(12*ti); N = N0; d = 3/N; else mu = mu_c; N = ceil(N0*ti/t_c); d = 3/N; end xsk = 0.0; // Perform sum in Eq (24) for k=-N:N do u = k*d; s = mu * (%i*u + 1)^2; dsdu = 2.0*mu*(%i-u); xsk = xsk + imag(exp(s*ti) * resp(s)/s * dsdu); end xsk = xsk * d / (2*%pi); xs(i) = xsk; // Collect x-values (the normalized pressure response) end // --- UNDO NORMALIZATION tau = t / ws; // in seconds (x-axis) p1 = rho * Sd / (2 * %pi * r) * Vref * Bl / (Mms * Re); p = p1*xs; // in Pascal (y-axis) tau = [0 tau]; // add startpoint (row vector) p = [p1; p]; // add startpoint (column vector) // --- PLOT STEP RESPONSE g_tr = scf(); plot(tau',p,"-xr"); // Transpose X to prevent WARNING xgrid(color("grey70")); title_string = "Step (air pressure) time response, " + name; title(title_string); xlabel("Time (seconds)"); ylabel("Pressure (Pascal)"); // should I make a real GUI for this, with a table on the left and the graphs // on the right ?? // http://www.openeering.com/sites/default/files/LHY_Tutorial_Gui.pdf // Should I make an FFT to see the SPL-response? // Sample_frequency = 4096 Hz (for example = 100 * Fs) // Lower frequency limit 10 Hz - and use 10 Hz bins / steps - or too coarse? // Create sampled input vector, convert step response to impulse response // Run y = FFT(V) // Plot(f,y) // Or does it make more sense to utilize the response function directly? // - it seems BODE cannot plot functions with LOG() in it ... // --- CALCULATE AND PLOT IMPULSE RESPONSE // - take the derivative to obtain the impulse response tau_step = t_step / ws; // convert normalized time steps to time (seconds) // tau_step is our discrete differentiation step (and freq. resp resolution) H = (p(2:$) - p(1:$-1)) / tau_step; // impulse response t = tau(2:$) - tau_step/2; // redefine time intervals for impulse response // t is not used. It's for plotting the impulse response, if desired scf(); plot(t',H); // Transpose X to prevent WARNING xgrid(color("grey70")); title_string = "Impulse (air pressure) time response, " + name; title(title_string); xlabel("Time (seconds)"); ylabel("Pressure (Pascal)"); // The time scale (t) is now non-zero and a zero cannot be added simply by // extrapolation. Should I instead interpolate and re-instate the old tau // time steps, so that extrapolation to zero can be done? // Is it this time thing that f*cks up my FFT? // --- FREQUENCY RESPONSE f = 0.1:0.01:2; // This is needed only for frequency response plot, normalized w = 2 * %pi * f; // Omega, normalized iw = %i * w; // like s, but 's' variable name is already used Y = resp(iw); MAG = 20 * log10( abs(Y) ); PHS = 180 / %pi * atan(imag(Y) , real(Y)); for i=1:length(Y) // unwrap phase if PHS(i) < 0.0 then PHS(i) = PHS(i)+360.0 ; end end n0 = rho * (Sd * Bl)^2 / (Mms^2 * 2 * %pi * c * Re); SPL_ref = 10 * log10(rho * c / (2 *%pi * p0^2)); SPL = SPL_ref + 10 * log10(n0); // SPL = 20 * log10(p1 / p0); // mprintf("SPL = %3.2e dB\n",SPL); // Result = 85.7 dB scf(); subplot(2,1,1); plot(F0*w,MAG + SPL,'-b'); fm = gca(); // Get current axis fm.log_flags = "lnn"; // Set x-axis = log xgrid(color("grey70")); title_string = "Frequency response, " + name; title(title_string); xlabel("Frequency (Hz)"); ylabel("Magnitude (dB)"); subplot(2,1,2); plot(F0*w,PHS,'-b'); fp = gca(); // Get current axis fp.log_flags = "lnn"; // Set x-axis = log xgrid(color("grey70")); // title_string = "Frequency response, " + name; // title(title_string); xlabel("Frequency (Hz)"); ylabel("Phase (deg)"); // - do an FFT of the impulse response // Resp = fft(H); // Resp_magnitude = 20 * log10(abs(Resp)); // [db,phi] = dbphi(Y); // convert frequency response into magnitude and phase // f_max = 1/tau_step; // Hz // f = f_max * (0:length(Y)-1)/length(Y); //associated frequency vector // scf(); // plot(f'(2:nt/2),abs(db(2:nt/2))); // Transpose X to prevent WARNING // Only plot first half of the data (second half = mirror image) // Do not plot first value, where the frequency f = 0 Hz. // fr = gca(); // Get current axis // fr.log_flags = "lnn"; // Set x-axis = log // title_string = "Frequency response, " + name; // title(title_string); // xlabel("Frequency (Hz)"); // ylabel("Magnitude (dB)"); // Matlab Answers - https://www.mathworks.com/matlabcentral/answers/350350-how-to-plot-loudspeaker-frequency-response-from-its-impulse-response // h = rand(1,64); % impulse response // fs = 1000; // Nfft = 128; // [H,F] = freqz(h,1,Nfft,fs); // semilogx(F,mag2db(abs(H))); grid on; // xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); // What is the Scilab equivalent of Matlab 'freqz' ? // BODE PLOT - NOTICE this doesn't work because 's' cannot cooperate with log(): // s = poly(0, 's'); // num = s^4; // cs = 1 - gbeta * log( s ); // Knudsen LOG viscoelastic compliance // den = ( (s^2 + h^2) * (1/cs + s/Qt0 + s^2) + alpha * s^2); // h = syslin('c', num/den); // scf(); bode(h, 0.01, 100); From cfuttrup at gmail.com Sun Sep 16 18:15:02 2018 From: cfuttrup at gmail.com (Claus Futtrup) Date: Sun, 16 Sep 2018 18:15:02 +0200 Subject: [Scilab-users] Frequency response In-Reply-To: <1537044633.19302.9.camel@wescottdesign.com> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <1537044633.19302.9.camel@wescottdesign.com> Message-ID: <2bc68c4e-62e7-472a-7341-355b6b1995d9@gmail.com> Hi Tim >So, this is complicated. I admitted from the very beginning, it's probably just me that doesn't know how to read the Scilab manual. It cannot be complicated for someone who knows and/or understand the manual. BTW, I also notice that nobody answered the question what ZPK means? ... ZPK = Zagrepa Plivaci Klub ... at least the Scilab could spell out what it stands for. /Claus On 15.09.2018 22:50, Tim Wescott wrote: > So, this is complicated. > > First, if you have an impulse response, in the form of a vector of > samples, then you can turn it into a FIR filter, and you can find the > frequency response of that with any of the available Scilab tools. ?I'm > not sure if there's a more direct way, but if you had an impulse > response h = [1, 1/2, 1/4, 1/8], then you can turn that into H = 1 + > 0.5*%z^(-1) + 0.25*%z^(-2) + 0.125*%z^(-3) (note that %z is a built-in: > %z = poly(0, 'z')). ?Then you can use techniques surrounding repfreq to > get the frequency response. > > Assign a sampling rate to it (i.e., by setting H.dt = 0.001, for a 1kHz > sampling rate) and you can just use the Bode plot function: bode(H). > > Second, you can take your impulse response, pad it with zeros, and then > take the FFT of it -- i.e. H = fft([h zeros(1, 252)]). ?You need to pad > it because the FFT is only exact for a periodic function in time -- > padding it gives you an approximation of an actual impulse response > (and before someone jumps in and says you need to window it -- no, you > don't, windowing is for sample vectors of continuous signals, not > impulse responses). ?But if you don't know WHY the method is > approximate, you're going to have trouble correctly massaging the data > before it's presented to the FFT, and with interpreting the results. > > On Sat, 2018-09-15 at 22:15 +0200, Claus Futtrup wrote: >> Hi Samuel and Scilabers >> >> My problem with freq and repfreq is that they require a "sys" input, >> which implies I need to describe a response function of some sort. >> For example (from the Scilab web-help): >> >> https://help.scilab.org/docs/6.0.1/en_US/freq.html (example code) >> s=poly(0,'s'); >> sys=(s+1)/(s^3-5*s+4) >> rep=freq(sys("num"),sys("den"),[0,0.9,1.1,2,3,10,20]) >> >> https://help.scilab.org/docs/6.0.1/en_US/repfreq.html (syntax) >> [ [frq,] repf]=repfreq(sys,fmin,fmax [,step]) >> [ [frq,] repf]=repfreq(sys [,frq]) >> [ frq,repf,splitf]=repfreq(sys,fmin,fmax [,step]) >> [ frq,repf,splitf]=repfreq(sys [,frq]) >> >> ... So, the thing with the matlab freqz (as the example repeated >> below shows) is just a basic FFT with sampling, etc: >> >> h = rand(1,64); // impulse response (Matlab source code) >> fs = 1000; >> Nfft = 128; >> [H,F] = freqz(h,1,Nfft,fs); >> semilogx(F,mag2db(abs(H))); grid on; >> xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); >> >> It may very well be that I just don't understand the help page of >> repfreq. For example it says about sys: "A siso or simo linear >> dynamical system, in state space, transfer function or zpk >> representations, in continuous or discrete time." - al right then, it >> seems pretty capable, but so, what's "zpk" for example? ... my >> apologies for finding the Scilab help to be cryptic and the examples >> insufficient for me to solve my problem, hence I ask if someone can >> take above matlab code and make it work in Scilab. >> >> Best regards, >> Claus >> >> On 15.09.2018 00:32, Samuel Gougeon wrote: >>> Le 14/09/2018 ? 20:57, Claus Futtrup a ?crit?: >>>> Dear Scilabers >>>> I have calculated an impulse response and wish to do an FFT to >>>> achieve the frequency response. I know what to expect. In the >>>> matlab forum someone asked the same question and was recommended >>>> to use freqz ... I wonder what would be the equivalent function >>>> in Scilab? >>>> https://www.mathworks.com/matlabcentral/answers/350350-how-to-plo >>>> t-loudspeaker-frequency-response-from-its-impulse-response >>>> For example, to replicate the code snippet (second answer in >>>> above link), how to do this in Scilab? >>>> h = rand(1,64); // impulse response (Matlab source code) >>>> fs = 1000; >>>> Nfft = 128; >>>> [H,F] = freqz(h,1,Nfft,fs); >>> >>> Did you have a look around freq() or repfreq()? >>> >>> We have somewhat the equivalence invfreqz(H,F,m,n,W)? <=> >>> frfit(F*2*%pi, H, n, W) // Scilab >>> >>> So you may look for the reciprocal of Scilab's frfit() >>> >>> HTH >>> Samuel >>> >>> >>> >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> http://lists.scilab.org/mailman/listinfo/users >> Virus-free. www.avast.com >> ?_______________________________________________ >> users mailing list >> users at lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus From ajteeder at v-twin.org.uk Sun Sep 16 18:23:45 2018 From: ajteeder at v-twin.org.uk (Alan Teeder) Date: Sun, 16 Sep 2018 17:23:45 +0100 Subject: [Scilab-users] Frequency response In-Reply-To: <2bc68c4e-62e7-472a-7341-355b6b1995d9@gmail.com> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <1537044633.19302.9.camel@wescottdesign.com> <2bc68c4e-62e7-472a-7341-355b6b1995d9@gmail.com> Message-ID: -----Original Message----- From: Claus Futtrup Sent: Sunday, September 16, 2018 5:15 PM To: users at lists.scilab.org Subject: Re: [Scilab-users] Frequency response Hi Tim >So, this is complicated. I admitted from the very beginning, it's probably just me that doesn't know how to read the Scilab manual. It cannot be complicated for someone who knows and/or understand the manual. BTW, I also notice that nobody answered the question what ZPK means? ... ZPK = Zagrepa Plivaci Klub ... at least the Scilab could spell out what it stands for. /Claus -------------------------------------------- ZPK = Zagreb Swimming Club ;) From tim at wescottdesign.com Sun Sep 16 19:01:54 2018 From: tim at wescottdesign.com (Tim Wescott) Date: Sun, 16 Sep 2018 10:01:54 -0700 Subject: [Scilab-users] Frequency response In-Reply-To: <2bc68c4e-62e7-472a-7341-355b6b1995d9@gmail.com> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <1537044633.19302.9.camel@wescottdesign.com> <2bc68c4e-62e7-472a-7341-355b6b1995d9@gmail.com> Message-ID: <1537117314.19302.12.camel@wescottdesign.com> I didn't answer about ZPK because I didn't know either! It's not so much a Scilab thing as -- are you getting the signal processing right? On Sun, 2018-09-16 at 18:15 +0200, Claus Futtrup wrote: > Hi Tim > > ?>So, this is complicated. > > I admitted from the very beginning, it's probably just me that > doesn't? > know how to read the Scilab manual. It cannot be complicated for > someone? > who knows and/or understand the manual. > > BTW, I also notice that nobody answered the question what ZPK means? > ...? > ZPK = Zagrepa Plivaci Klub ... at least the Scilab could spell out > what? > it stands for. > > /Claus > > On 15.09.2018 22:50, Tim Wescott wrote: > > > > So, this is complicated. > > > > First, if you have an impulse response, in the form of a vector of > > samples, then you can turn it into a FIR filter, and you can find > > the > > frequency response of that with any of the available Scilab tools. > > ?I'm > > not sure if there's a more direct way, but if you had an impulse > > response h = [1, 1/2, 1/4, 1/8], then you can turn that into H = 1 > > + > > 0.5*%z^(-1) + 0.25*%z^(-2) + 0.125*%z^(-3) (note that %z is a > > built-in: > > %z = poly(0, 'z')). ?Then you can use techniques surrounding > > repfreq to > > get the frequency response. > > > > Assign a sampling rate to it (i.e., by setting H.dt = 0.001, for a > > 1kHz > > sampling rate) and you can just use the Bode plot function: > > bode(H). > > > > Second, you can take your impulse response, pad it with zeros, and > > then > > take the FFT of it -- i.e. H = fft([h zeros(1, 252)]). ?You need to > > pad > > it because the FFT is only exact for a periodic function in time -- > > padding it gives you an approximation of an actual impulse response > > (and before someone jumps in and says you need to window it -- no, > > you > > don't, windowing is for sample vectors of continuous signals, not > > impulse responses). ?But if you don't know WHY the method is > > approximate, you're going to have trouble correctly massaging the > > data > > before it's presented to the FFT, and with interpreting the > > results. > > > > On Sat, 2018-09-15 at 22:15 +0200, Claus Futtrup wrote: > > > > > > Hi Samuel and Scilabers > > > > > > My problem with freq and repfreq is that they require a "sys" > > > input, > > > which implies I need to describe a response function of some > > > sort. > > > For example (from the Scilab web-help): > > > > > > https://help.scilab.org/docs/6.0.1/en_US/freq.html (example code) > > > s=poly(0,'s'); > > > sys=(s+1)/(s^3-5*s+4) > > > rep=freq(sys("num"),sys("den"),[0,0.9,1.1,2,3,10,20]) > > > > > > https://help.scilab.org/docs/6.0.1/en_US/repfreq.html (syntax) > > > [ [frq,] repf]=repfreq(sys,fmin,fmax [,step]) > > > [ [frq,] repf]=repfreq(sys [,frq]) > > > [ frq,repf,splitf]=repfreq(sys,fmin,fmax [,step]) > > > [ frq,repf,splitf]=repfreq(sys [,frq]) > > > > > > ... So, the thing with the matlab freqz (as the example repeated > > > below shows) is just a basic FFT with sampling, etc: > > > > > > h = rand(1,64); // impulse response (Matlab source code) > > > fs = 1000; > > > Nfft = 128; > > > [H,F] = freqz(h,1,Nfft,fs); > > > semilogx(F,mag2db(abs(H))); grid on; > > > xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); > > > > > > It may very well be that I just don't understand the help page of > > > repfreq. For example it says about sys: "A siso or simo linear > > > dynamical system, in state space, transfer function or zpk > > > representations, in continuous or discrete time." - al right > > > then, it > > > seems pretty capable, but so, what's "zpk" for example? ... my > > > apologies for finding the Scilab help to be cryptic and the > > > examples > > > insufficient for me to solve my problem, hence I ask if someone > > > can > > > take above matlab code and make it work in Scilab. > > > > > > Best regards, > > > Claus > > > > > > On 15.09.2018 00:32, Samuel Gougeon wrote: > > > > > > > > Le 14/09/2018 ? 20:57, Claus Futtrup a ?crit?: > > > > > > > > > > Dear Scilabers > > > > > I have calculated an impulse response and wish to do an FFT > > > > > to > > > > > achieve the frequency response. I know what to expect. In the > > > > > matlab forum someone asked the same question and was > > > > > recommended > > > > > to use freqz ... I wonder what would be the equivalent > > > > > function > > > > > in Scilab? > > > > > https://www.mathworks.com/matlabcentral/answers/350350-how-to > > > > > -plo > > > > > t-loudspeaker-frequency-response-from-its-impulse-response > > > > > For example, to replicate the code snippet (second answer in > > > > > above link), how to do this in Scilab? > > > > > h = rand(1,64); // impulse response (Matlab source code) > > > > > fs = 1000; > > > > > Nfft = 128; > > > > > [H,F] = freqz(h,1,Nfft,fs); > > > > ?? > > > > Did you have a look around freq() or repfreq()? > > > > > > > > We have somewhat the equivalence invfreqz(H,F,m,n,W)? <=> > > > > frfit(F*2*%pi, H, n, W) // Scilab > > > > > > > > So you may look for the reciprocal of Scilab's frfit() > > > > > > > > HTH > > > > Samuel > > > > > > > > > > > > > > > > _______________________________________________ > > > > users mailing list > > > > users at lists.scilab.org > > > > http://lists.scilab.org/mailman/listinfo/users > > > Virus-free. www.avast.com > > > ??_______________________________________________ > > > users mailing list > > > users at lists.scilab.org > > > http://lists.scilab.org/mailman/listinfo/users > > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users -- Tim Wescott www.wescottdesign.com Control & Communications systems, circuit & software design. Phone: 503.631.7815 Cell: 503.349.8432 From cfuttrup at gmail.com Sun Sep 16 19:13:42 2018 From: cfuttrup at gmail.com (Claus Futtrup) Date: Sun, 16 Sep 2018 19:13:42 +0200 Subject: [Scilab-users] Frequency response In-Reply-To: <1537117314.19302.12.camel@wescottdesign.com> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <1537044633.19302.9.camel@wescottdesign.com> <2bc68c4e-62e7-472a-7341-355b6b1995d9@gmail.com> <1537117314.19302.12.camel@wescottdesign.com> Message-ID: <6485d137-6e1b-65fe-11f3-6521a604d3ef@gmail.com> Hi Tim ZPK can mean many things (Google Search, I suppose) ... but after search I understand it's something with Zero Pole ... don't know what the letter K stands for, though. What I like about the Matlab example is that random data is generated to represent the impulse response, so this represents "any data" ... I need that. If Scilab cannot do it, it's OK. /Claus On 16.09.2018 19:01, Tim Wescott wrote: > I didn't answer about ZPK because I didn't know either! > > It's not so much a Scilab thing as -- are you getting the signal > processing right? > > On Sun, 2018-09-16 at 18:15 +0200, Claus Futtrup wrote: >> Hi Tim >> >> ?>So, this is complicated. >> >> I admitted from the very beginning, it's probably just me that >> doesn't >> know how to read the Scilab manual. It cannot be complicated for >> someone >> who knows and/or understand the manual. >> >> BTW, I also notice that nobody answered the question what ZPK means? >> ... >> ZPK = Zagrepa Plivaci Klub ... at least the Scilab could spell out >> what >> it stands for. >> >> /Claus >> >> On 15.09.2018 22:50, Tim Wescott wrote: >>> So, this is complicated. >>> >>> First, if you have an impulse response, in the form of a vector of >>> samples, then you can turn it into a FIR filter, and you can find >>> the >>> frequency response of that with any of the available Scilab tools. >>> ?I'm >>> not sure if there's a more direct way, but if you had an impulse >>> response h = [1, 1/2, 1/4, 1/8], then you can turn that into H = 1 >>> + >>> 0.5*%z^(-1) + 0.25*%z^(-2) + 0.125*%z^(-3) (note that %z is a >>> built-in: >>> %z = poly(0, 'z')). ?Then you can use techniques surrounding >>> repfreq to >>> get the frequency response. >>> >>> Assign a sampling rate to it (i.e., by setting H.dt = 0.001, for a >>> 1kHz >>> sampling rate) and you can just use the Bode plot function: >>> bode(H). >>> >>> Second, you can take your impulse response, pad it with zeros, and >>> then >>> take the FFT of it -- i.e. H = fft([h zeros(1, 252)]). ?You need to >>> pad >>> it because the FFT is only exact for a periodic function in time -- >>> padding it gives you an approximation of an actual impulse response >>> (and before someone jumps in and says you need to window it -- no, >>> you >>> don't, windowing is for sample vectors of continuous signals, not >>> impulse responses). ?But if you don't know WHY the method is >>> approximate, you're going to have trouble correctly massaging the >>> data >>> before it's presented to the FFT, and with interpreting the >>> results. >>> >>> On Sat, 2018-09-15 at 22:15 +0200, Claus Futtrup wrote: >>>> Hi Samuel and Scilabers >>>> >>>> My problem with freq and repfreq is that they require a "sys" >>>> input, >>>> which implies I need to describe a response function of some >>>> sort. >>>> For example (from the Scilab web-help): >>>> >>>> https://help.scilab.org/docs/6.0.1/en_US/freq.html (example code) >>>> s=poly(0,'s'); >>>> sys=(s+1)/(s^3-5*s+4) >>>> rep=freq(sys("num"),sys("den"),[0,0.9,1.1,2,3,10,20]) >>>> >>>> https://help.scilab.org/docs/6.0.1/en_US/repfreq.html (syntax) >>>> [ [frq,] repf]=repfreq(sys,fmin,fmax [,step]) >>>> [ [frq,] repf]=repfreq(sys [,frq]) >>>> [ frq,repf,splitf]=repfreq(sys,fmin,fmax [,step]) >>>> [ frq,repf,splitf]=repfreq(sys [,frq]) >>>> >>>> ... So, the thing with the matlab freqz (as the example repeated >>>> below shows) is just a basic FFT with sampling, etc: >>>> >>>> h = rand(1,64); // impulse response (Matlab source code) >>>> fs = 1000; >>>> Nfft = 128; >>>> [H,F] = freqz(h,1,Nfft,fs); >>>> semilogx(F,mag2db(abs(H))); grid on; >>>> xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); >>>> >>>> It may very well be that I just don't understand the help page of >>>> repfreq. For example it says about sys: "A siso or simo linear >>>> dynamical system, in state space, transfer function or zpk >>>> representations, in continuous or discrete time." - al right >>>> then, it >>>> seems pretty capable, but so, what's "zpk" for example? ... my >>>> apologies for finding the Scilab help to be cryptic and the >>>> examples >>>> insufficient for me to solve my problem, hence I ask if someone >>>> can >>>> take above matlab code and make it work in Scilab. >>>> >>>> Best regards, >>>> Claus >>>> >>>> On 15.09.2018 00:32, Samuel Gougeon wrote: >>>>> Le 14/09/2018 ? 20:57, Claus Futtrup a ?crit?: >>>>>> Dear Scilabers >>>>>> I have calculated an impulse response and wish to do an FFT >>>>>> to >>>>>> achieve the frequency response. I know what to expect. In the >>>>>> matlab forum someone asked the same question and was >>>>>> recommended >>>>>> to use freqz ... I wonder what would be the equivalent >>>>>> function >>>>>> in Scilab? >>>>>> https://www.mathworks.com/matlabcentral/answers/350350-how-to >>>>>> -plo >>>>>> t-loudspeaker-frequency-response-from-its-impulse-response >>>>>> For example, to replicate the code snippet (second answer in >>>>>> above link), how to do this in Scilab? >>>>>> h = rand(1,64); // impulse response (Matlab source code) >>>>>> fs = 1000; >>>>>> Nfft = 128; >>>>>> [H,F] = freqz(h,1,Nfft,fs); >>>>> >>>>> Did you have a look around freq() or repfreq()? >>>>> >>>>> We have somewhat the equivalence invfreqz(H,F,m,n,W)? <=> >>>>> frfit(F*2*%pi, H, n, W) // Scilab >>>>> >>>>> So you may look for the reciprocal of Scilab's frfit() >>>>> >>>>> HTH >>>>> Samuel >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> users mailing list >>>>> users at lists.scilab.org >>>>> http://lists.scilab.org/mailman/listinfo/users >>>> Virus-free. www.avast.com >>>> ??_______________________________________________ >>>> users mailing list >>>> users at lists.scilab.org >>>> http://lists.scilab.org/mailman/listinfo/users >> >> --- >> This email has been checked for viruses by Avast antivirus software. >> https://www.avast.com/antivirus >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users From jrafaelbguerra at hotmail.com Sun Sep 16 19:27:36 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Sun, 16 Sep 2018 17:27:36 +0000 Subject: [Scilab-users] Frequency response In-Reply-To: <50613085-e35b-fc68-ef49-3f8a09f67147@gmail.com> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <50613085-e35b-fc68-ef49-3f8a09f67147@gmail.com> Message-ID: Hi Claus, In your script, the response function resp(s) is definitely not a simple LTI system, not even a ratio of polynomials, because of the logarithmic term. I am not an expert but I suspect that such highly non-linear transfer functions are not handled by the standard Scilab DSP tools such as syslin, etc. I do not see how you can "close the loop", other that testing your theoretical model against experimental data? PS: ZPK Zero pole gain system representation: zeros Z, poles P, and gain(s) K. Regards, Rafael From: users On Behalf Of Claus Futtrup Sent: Sunday, September 16, 2018 5:49 PM To: users at lists.scilab.org Subject: Re: [Scilab-users] Frequency response Hi Rafael My problem is defined as a response function, where I use contour integral to achieve the step response. Then I differentiate it to achieve the impulse response. In essense I already "know" my response function. It contains some special features (it could for example be a logarithmic term) and e.g. "syslin" or "bode" will choke on it. If I already know the response function, why bother with the FFT? Well, I'd like to ensure the time response and frequency response are correct (without errors on my part) and one way of verifying is to close-the-loop and calculate the FFT, see that input = output. I'd like to verify that the absolute levels are correct. Attached please find the script (10 kb). It's fully functional. Apologies for the comments in the script, I didn't clean it up for publishing... Best regards, Claus On 15.09.2018 22:47, Rafael Guerra wrote: Forgetting MATLAB for a second, can you define your problem ? How is your specific frequency response defined? In Laplace, Fourier, z-transform, ..., domain? ________________________________ From: users on behalf of Claus Futtrup Sent: Saturday, September 15, 2018 11:15:08 PM To: users at lists.scilab.org Subject: Re: [Scilab-users] Frequency response Hi Samuel and Scilabers My problem with freq and repfreq is that they require a "sys" input, which implies I need to describe a response function of some sort. For example (from the Scilab web-help): https://help.scilab.org/docs/6.0.1/en_US/freq.html (example code) s=poly(0,'s'); sys=(s+1)/(s^3-5*s+4) rep=freq(sys("num"),sys("den"),[0,0.9,1.1,2,3,10,20]) https://help.scilab.org/docs/6.0.1/en_US/repfreq.html (syntax) [ [frq,] repf]=repfreq(sys,fmin,fmax [,step]) [ [frq,] repf]=repfreq(sys [,frq]) [ frq,repf,splitf]=repfreq(sys,fmin,fmax [,step]) [ frq,repf,splitf]=repfreq(sys [,frq]) ... So, the thing with the matlab freqz (as the example repeated below shows) is just a basic FFT with sampling, etc: h = rand(1,64); // impulse response (Matlab source code) fs = 1000; Nfft = 128; [H,F] = freqz(h,1,Nfft,fs); semilogx(F,mag2db(abs(H))); grid on; xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); It may very well be that I just don't understand the help page of repfreq. For example it says about sys: "A siso or simo linear dynamical system, in state space, transfer function or zpk representations, in continuous or discrete time." - al right then, it seems pretty capable, but so, what's "zpk" for example? ... my apologies for finding the Scilab help to be cryptic and the examples insufficient for me to solve my problem, hence I ask if someone can take above matlab code and make it work in Scilab. Best regards, Claus On 15.09.2018 00:32, Samuel Gougeon wrote: Le 14/09/2018 ? 20:57, Claus Futtrup a ?crit : Dear Scilabers I have calculated an impulse response and wish to do an FFT to achieve the frequency response. I know what to expect. In the matlab forum someone asked the same question and was recommended to use freqz ... I wonder what would be the equivalent function in Scilab? https://www.mathworks.com/matlabcentral/answers/350350-how-to-plot-loudspeaker-frequency-response-from-its-impulse-response For example, to replicate the code snippet (second answer in above link), how to do this in Scilab? h = rand(1,64); // impulse response (Matlab source code) fs = 1000; Nfft = 128; [H,F] = freqz(h,1,Nfft,fs); Did you have a look around freq() or repfreq()? We have somewhat the equivalence invfreqz(H,F,m,n,W) <=> frfit(F*2*%pi, H, n, W) // Scilab So you may look for the reciprocal of Scilab's frfit() HTH Samuel _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users [https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif] Virus-free. www.avast.com _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From Christophe.Dang at sidel.com Mon Sep 17 09:38:27 2018 From: Christophe.Dang at sidel.com (Dang Ngoc Chan, Christophe) Date: Mon, 17 Sep 2018 07:38:27 +0000 Subject: [Scilab-users] {EXT} Re: Frequency response In-Reply-To: <6485d137-6e1b-65fe-11f3-6521a604d3ef@gmail.com> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <1537044633.19302.9.camel@wescottdesign.com> <2bc68c4e-62e7-472a-7341-355b6b1995d9@gmail.com> <1537117314.19302.12.camel@wescottdesign.com> <6485d137-6e1b-65fe-11f3-6521a604d3ef@gmail.com> Message-ID: Hello, > De : users [mailto:users-bounces at lists.scilab.org] De la part de Claus Futtrup > Envoy? : dimanche 16 septembre 2018 19:14 > > ZPK can mean many things (Google Search, I suppose) ... > but after search I understand it's something with Zero Pole ... > don't know what the letter K stands for, though. I think you got it right. My qwant-fu with "zpk zero pole" shows up as first answer mathworks.com/help/control/ref/zpk.html "continuous-time zero-pole-gain model with zeros Z, poles P, and gain(s) K." Regards -- Christophe Dang Ngoc Chan Mechanical calculation engineer This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error), please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. From chinluh at tritytech.com Mon Sep 17 09:39:41 2018 From: chinluh at tritytech.com (Tan Chin Luh) Date: Mon, 17 Sep 2018 15:39:41 +0800 Subject: [Scilab-users] Frequency response In-Reply-To: References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <50613085-e35b-fc68-ef49-3f8a09f67147@gmail.com> Message-ID: Hi, I was facing similar issue sometime ago while trying to translate from matlab to scilab, as both of them have diff way of representation. In Matlab/Octave, when we are using polynomial, we are defining them in vector/matrix form such as : num = [1 2 3 4]. The catch is here: when we use the s-domain, it represent 1*s^3 + 2*s^2+3*s+4, while if it is used in the function in z-domain, it will become 1 + 2*z^-1 + 3*z^-2 + 4*z^-3. while in Scilab, the polynomial is represented in polynomial datatype. So, consider following simple example: h = [1 2 3 4];?? % this is coefficient in 1 + 2*z^-1 + 3*z^-2 + 4*z^-3 fs = 1000; Nfft = 128; [H,F] = freqz(h,1,Nfft,fs); plot(F,H); In Scilab h = [1 2 3 4]; fs = 1000; b = poly(h($:-1:1),"z","coeff"); a = %z^(length(h)-1); Gz = syslin('d',b,a); Gz.dt = 1/fs; [F,H]=repfreq(Gz,0,500,0.01); plot(F,H); in line 3 - b = poly(h($:-1:1),"z","coeff");? we create b in poly using the coefficients, we have to take note that: --> order of h must be reversed, as poly take the coeff in ascending order --> this line will create b as 4 +3*z +2*z^2? +z^3 To match the z-domain format, our a would not be 1 anymore, but z^3 as in line 4 of the code above --> (4 +3*z +2*z^2? +z^3) / z^3? --> 1 + 2*z^-1 + 3*z^-2 + 4*z^-3 After this, the remaining codes should be straight forward. Hope this helps. p/s: help zpk will help u on the definition i guess. Thanks. rgds, Chin Luh From stephane.mottelet at utc.fr Mon Sep 17 19:03:11 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Mon, 17 Sep 2018 19:03:11 +0200 Subject: [Scilab-users] algebra conventions with integer types to be discussed In-Reply-To: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> Message-ID: Le 14/09/2018 ? 18:20, St?phane Mottelet a ?crit?: > Hello all, > > Integer types in Scilab are not smoothly implemented and there are > still some bugs and real questions to be discussed, specifically on > over/underflow, exceptions in divisions such as in > > int8(1)/int8(0) > > int8(-128)/int8(-1) > > type of the result of mixed double/integer operations, such as > > int8(1) + %pi > > int8(1)/0.0 > > and so on. Other software related to Scilab, e.g. Matlab and Julia, > have different conventions and currently Scilab currently adopts a mix > of them, which does not help to make one's mind. > > Integers types were a long-waited feature by people who needed it, so > I would like to have some? developpers and user testimonies about the > way they do algebra with them. > > Thanks in adavance, > > S. > Hello all, Do I have to conclude that the implementation is currently so incoherent that *nobody* uses integer types in Scilab (other than Scilab code itself) ? S. -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From jrafaelbguerra at hotmail.com Mon Sep 17 23:15:17 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Mon, 17 Sep 2018 21:15:17 +0000 Subject: [Scilab-users] Frequency response In-Reply-To: References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <50613085-e35b-fc68-ef49-3f8a09f67147@gmail.com> Message-ID: Chin Luh: good to know but how does that solve Claus Futtrup specific problem? From jrafaelbguerra at hotmail.com Mon Sep 17 23:19:40 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Mon, 17 Sep 2018 21:19:40 +0000 Subject: [Scilab-users] {EXT} Re: Frequency response In-Reply-To: References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <1537044633.19302.9.camel@wescottdesign.com> <2bc68c4e-62e7-472a-7341-355b6b1995d9@gmail.com> <1537117314.19302.12.camel@wescottdesign.com> <6485d137-6e1b-65fe-11f3-6521a604d3ef@gmail.com> Message-ID: Redundant qwant-fu'ing ... response was already provided From chinluh at tritytech.com Tue Sep 18 04:25:05 2018 From: chinluh at tritytech.com (Tan Chin Luh) Date: Tue, 18 Sep 2018 10:25:05 +0800 Subject: [Scilab-users] Frequency response In-Reply-To: References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <50613085-e35b-fc68-ef49-3f8a09f67147@gmail.com> Message-ID: <408ac287-70bb-9c8c-daf1-e7238a69b575@tritytech.com> On 18/9/2018 5:15 AM, Rafael Guerra wrote: > Chin Luh: good to know but how does that solve Claus Futtrup specific problem? > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > just notice that the answer similar as the one Tim provided, just a bit confused on Claus' comment on the "random" data: On 17/9/2018 1:13 AM, Claus Futtrup wrote: > What I like about the Matlab example is that random data is generated > to represent the impulse response, so this represents "any data" ... I > need that. If Scilab cannot do it, it's OK. Do you refer this "random" data to the example provided? h = rand(1,64); % impulse response <-- This? fs = 1000; Nfft = 128; [H,F] = freqz(h,1,Nfft,fs); plot(F,H); grid on; If so, the equivalent scilab code would be as below: h = rand(1,64); fs = 1000; b = poly(h($:-1:1),"z","coeff"); a = %z^(length(h)-1); Gz = syslin('d',b,a); Gz.dt = 1/fs; [F,H]=repfreq(Gz,0,500,0.01); plot(F,H); Do note that I replace the last part of semilogx plot and replace with plot for more simple codes. -- Tan Chin Luh Trity Technologies Sdn Bhd Tel : +603 80637737 HP : +6013 3691728 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jrafaelbguerra at hotmail.com Tue Sep 18 08:31:45 2018 From: jrafaelbguerra at hotmail.com (Rafael Guerra) Date: Tue, 18 Sep 2018 06:31:45 +0000 Subject: [Scilab-users] Frequency response In-Reply-To: <408ac287-70bb-9c8c-daf1-e7238a69b575@tritytech.com> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <50613085-e35b-fc68-ef49-3f8a09f67147@gmail.com> <408ac287-70bb-9c8c-daf1-e7238a69b575@tritytech.com> Message-ID: ?just notice that the answer similar as the one Tim provided, just a bit confused on Claus' comment on the "random" data? Claus problem is defined in the script: ?stepresponse - 2018-09-16.sce? that was forwarded earlier -------------- next part -------------- An HTML attachment was scrubbed... URL: From perrichon.pierre at wanadoo.fr Tue Sep 18 15:42:04 2018 From: perrichon.pierre at wanadoo.fr (perrichon) Date: Tue, 18 Sep 2018 15:42:04 +0200 Subject: [Scilab-users] tf2ss error in Scilab, comparing Scilab and Matlab Message-ID: Dears, We here simulate on xcos and matlab/simulink platform, an oscillator to get the behavior of a hydraulic water harmmer in a penstock, following a transmittance of 2 order : b*s/(1+a*s^2). Our main reference is based on a canonic method using only two integrators and we also do some tests with a state space representation, with xcos and simulink The tfss2 function to go from transmittance state-space representation, in xcos, gives results : XCOS STATE-SPACE MATRIX A =[ 0. - 1.3782485 ; 1. 0. ] B=[ 5.2800843 ; 0.] C=[- 5.2800843 0. ] D=[ 0. ] X0[ 0. ; 0.] MATLAB STATE-SPACE MATRIX A =[ 0. - 0.7256 ; 1. 0.] B =[ 1. ; 0. ] C=[ - 20.2281 0. ] D = [ 0. ] X0 = [ 0. ; 0.] TRANSFER FUNCTIONS TRANSMITTANCE H - 20.228058s -------------- 1 + 0.7255586s ^2 TRANSMITTANCE MATLAB SYSMATLAB - 27.877756s -------------- 1 + 1.3781698s ^2 Entering in a numerical scop XY, X=canonic method, Y=State-Space method, we cleary see a correct behavior X=Y with Matlab/Simulink coefficients, and a a very strong dispersion with Scilab/Xcos computing parameters. On another way, and because we need a stable state at t=0 (no oscillation), apparently, only the canonic method runs in all modes (sequence=1 ou 2 in the script). The initial vector X0 is only able to controll the first point, but not the stability in this case, so it works only with a zero initial condition. Program Xcos/Scilab, ou Matlab/Simulink, schemes, results are available in buggzilla n?15771 Tests have been done with Scilab 5.5.2 under windows W10. To read you. Sincerely Pierre Perrichon -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.gif Type: image/gif Size: 906 bytes Desc: not available URL: From cfuttrup at gmail.com Tue Sep 18 17:23:07 2018 From: cfuttrup at gmail.com (Claus Futtrup) Date: Tue, 18 Sep 2018 17:23:07 +0200 Subject: [Scilab-users] Frequency response In-Reply-To: <408ac287-70bb-9c8c-daf1-e7238a69b575@tritytech.com> References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <50613085-e35b-fc68-ef49-3f8a09f67147@gmail.com> <408ac287-70bb-9c8c-daf1-e7238a69b575@tritytech.com> Message-ID: Hi Tan, et al. Thank you for the complete response to my initial request. This is very helpful for me to understand ... but if this is indeed the equivalent of the matlab script, I wonder about if the help I found in the matlab forum is helpful or not. The reason I'm still wondering is because the matlab forum question is exactly like mine - I wish to find the fft of a loudspeaker impulse response and I expect a loudspeaker frequency response with roll-off at low frequencies, but now that I see the result of the below script with random data for the impulse response ... I see that the generated output is a "filter" - which is not at all what I expected and I think the similar response in the matlab forum was also not helpful (I do not have access to matlab / cannot test and or verify). Sorry for this. The entire concept may not be useful in my case, but Scilab supports advanced FFT routines (FFTW) and it should be possible to do what I need. Rafael is right that the previously attached stepresponse script explains in detail my situation. If I take the "H" vector (the impulse response) in the script and apply a basic fft(H), it looks like this: Added script code: Resp = fft(H); [db,phi] = dbphi(Resp); // convert frequency response into magnitude and phase f_max = 1/tau_step; // Hz f = f_max * (0:length(H)-1)/length(H); //associated frequency vector scf(); plot(f'(2:nt/2),db(2:nt/2)); // Transpose X to prevent WARNING re = gca(); re.log_flags = "lnn"; xgrid(color("grey70")); xlabel("Frequency (Hz)"); ylabel("Magnitude (dB)"); RESULT : This is not exactly what I had in mind, the "shape" of the curve isn't right, but then again - there are some inner-workings I don't know about (like, is the dbphi function doing what I think it does?). Maybe I cannot use dbphi(), or maybe I just have an error somewhere in the calculation of the impulse response. I expected a level of approx. 86 dB with a roll-off towards the lower frequencies. Here's the expected response (from simulation based on the input response function, i.e. not based on impulse response and not by fft): Best regards, Claus On 18.09.2018 04:25, Tan Chin Luh wrote: > On 18/9/2018 5:15 AM, Rafael Guerra wrote: >> Chin Luh: good to know but how does that solve Claus Futtrup specific problem? >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> http://lists.scilab.org/mailman/listinfo/users >> > just notice that the answer similar as the one Tim provided, just a > bit confused on Claus' comment on the "random" data: > > On 17/9/2018 1:13 AM, Claus Futtrup wrote: >> What I like about the Matlab example is that random data is generated >> to represent the impulse response, so this represents "any data" ... >> I need that. If Scilab cannot do it, it's OK. > > Do you refer this "random" data to the example provided? > > h = rand(1,64); % impulse response <-- This? > fs = 1000; > Nfft = 128; > [H,F] = freqz(h,1,Nfft,fs); > plot(F,H); grid on; > > If so, the equivalent scilab code would be as below: > > h = rand(1,64); > fs = 1000; > b = poly(h($:-1:1),"z","coeff"); > a = %z^(length(h)-1); > Gz = syslin('d',b,a); > Gz.dt = 1/fs; > [F,H]=repfreq(Gz,0,500,0.01); > plot(F,H); Do note that I replace the last part of semilogx plot and > replace with plot for more simple codes. > -- > Tan Chin Luh > Trity Technologies Sdn Bhd > Tel : +603 80637737 > HP : +6013 3691728 > > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ikjflngodaplolmh.png Type: image/png Size: 10991 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hlhbjdcpfapmmdag.png Type: image/png Size: 13414 bytes Desc: not available URL: From rouxph.22 at gmail.com Tue Sep 18 19:26:39 2018 From: rouxph.22 at gmail.com (philippe) Date: Tue, 18 Sep 2018 19:26:39 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> Message-ID: Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit?: > > Do I have to conclude that the implementation is currently so incoherent > that *nobody* uses integer types in Scilab (other than Scilab code > itself) ? it's a new feature, I would have like to use it before ... I've build my own solution and now I just need time replace it with int64. For mixed int/double expression I expect to get the best floating point approximation as a result. Best regards, Philippe From stephane.mottelet at utc.fr Tue Sep 18 20:53:05 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Tue, 18 Sep 2018 20:53:05 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> Message-ID: <5bac427f-35ee-ebb9-77bc-fad3ab2f2c69@utc.fr> Hello Philippe, Great to hear from you, Le 18/09/2018 ? 19:26, philippe a ?crit?: > Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit?: >> Do I have to conclude that the implementation is currently so incoherent >> that *nobody* uses integer types in Scilab (other than Scilab code >> itself) ? > it's a new feature, I would have like to use it before ... I've build > my own solution and now I just need time replace it with int64. > > For mixed int/double expression I expect to get the best floating point > approximation as a result. and for int/int ? S. > > > Best regards, > > Philippe > > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users From amonmayr at laas.fr Wed Sep 19 09:03:18 2018 From: amonmayr at laas.fr (amonmayr at laas.fr) Date: Wed, 19 Sep 2018 09:03:18 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <5bac427f-35ee-ebb9-77bc-fad3ab2f2c69@utc.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <5bac427f-35ee-ebb9-77bc-fad3ab2f2c69@utc.fr> Message-ID: <328892ca-6e87-21bf-0b7c-ffe236d56223@laas.fr> Le 18/09/2018 ? 20:53, St?phane Mottelet a ?crit?: > Hello Philippe, > > Great to hear from you, > > Le 18/09/2018 ? 19:26, philippe a ?crit?: >> Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit?: >>> Do I have to conclude that the implementation is currently so >>> incoherent >>> that *nobody* uses integer types in Scilab (other than Scilab code >>> itself) ? >> it's a new feature, I would have like to use it? before ... I've build >> my own solution and now I just need time replace it with int64. >> >> For mixed int/double expression I expect to get the best floating point >> approximation as a result. > and for int/int ? For me, this should be int, to be consistent with most of the languages I use. So 3.0/4.0=0.75 but 3/4=0. But maybe getting a rational would make more sense? Antoine > > S. >> >> >> Best regards, >> >> Philippe >> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >> > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From chinluh at tritytech.com Wed Sep 19 09:29:15 2018 From: chinluh at tritytech.com (Tan Chin Luh) Date: Wed, 19 Sep 2018 15:29:15 +0800 Subject: [Scilab-users] Frequency response In-Reply-To: References: <49ebf3dc-f34a-7664-f9ca-47beb7daa7a4@gmail.com> <49e1b4a0-0f9c-d08b-194a-bbe166d729da@free.fr> <20e6046a-e9cf-c3ec-0cb7-e24bd9004153@gmail.com> <50613085-e35b-fc68-ef49-3f8a09f67147@gmail.com> <408ac287-70bb-9c8c-daf1-e7238a69b575@tritytech.com> Message-ID: Hi Claus, If I understand you correctly (as mentioned by Rafael "I do not see how you can ?close the loop?, other that testing your theoretical model against experimental data?" 1. you have a system which you have theoretical result (reference model) 2. you have another set of data which you want to compare with the reference model As you're the subject expert in your own code, I will leave it to you as it will take time to look into them. :) Instead, I illustrate something similar (I think) which you might be able to adopt into your own code. Codes below perform following steps: 1. Create a linear model in s domain. 2. Convert the model to z domain. 3. Get the impulse response from the z model. 4. From the impulse response data, find the frequency response (in your case, it should be the data H that you obtained somewhere?) 5. Compare the response in 4 with the model response. rgds, CL // Linear System in Time Domain s=%s; G = syslin('c', 10*s^2 , 3*s^2 + s + 2); // Discreate Model Ts = 0.05; // Sampling time for discrete model SS_z = cls2dls(tf2ss(G),Ts); tz = [0:Ts :50]'; u=ones(tz); y2_step=dsimul(SS_z,u'); //Step response u=zeros(tz);u(1)=1; y2_imp=dsimul(SS_z,u'); //Impulse response // Compute Bode plot from Impulse Response tau_step = Ts; H = y2_imp; fs = 1/tau_step; // Following part is the same code as earlier b = poly(H($:-1:1),"z","coeff"); a = %z^(length(H)-1); Gz = syslin('d',b,a); Gz.dt = 1/fs; [F,M]=repfreq(Gz,0.001,fs/2,0.01); // Comparison bode(G); // Ideal frequency response plot(F(2:10:$),20*log10(M(2:10:$)),'r.'); // generated frequency response with repfreq -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: cclnliongoiiadfi.gif Type: image/gif Size: 12775 bytes Desc: not available URL: From rouxph.22 at gmail.com Wed Sep 19 09:46:51 2018 From: rouxph.22 at gmail.com (philippe) Date: Wed, 19 Sep 2018 09:46:51 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <328892ca-6e87-21bf-0b7c-ffe236d56223@laas.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <5bac427f-35ee-ebb9-77bc-fad3ab2f2c69@utc.fr> <328892ca-6e87-21bf-0b7c-ffe236d56223@laas.fr> Message-ID: Le 19/09/2018 ? 09:03, amonmayr at laas.fr a ?crit?: > Le 18/09/2018 ? 20:53, St?phane Mottelet a ?crit?: >> and for int/int ? > For me, this should be int, to be consistent with most of the languages > I use. > So 3.0/4.0=0.75 but 3/4=0. > But maybe getting a rational would make more sense? I agree, I would expect the quotient of Euclidian division in this case. Best Regards, Philippe From stephane.mottelet at utc.fr Wed Sep 19 10:24:16 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Wed, 19 Sep 2018 10:24:16 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <328892ca-6e87-21bf-0b7c-ffe236d56223@laas.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <5bac427f-35ee-ebb9-77bc-fad3ab2f2c69@utc.fr> <328892ca-6e87-21bf-0b7c-ffe236d56223@laas.fr> Message-ID: <731fe30d-a880-67ef-098f-60a02d14a80c@utc.fr> Le 19/09/2018 ? 09:03, amonmayr at laas.fr a ?crit?: > Le 18/09/2018 ? 20:53, St?phane Mottelet a ?crit?: >> Hello Philippe, >> >> Great to hear from you, >> >> Le 18/09/2018 ? 19:26, philippe a ?crit?: >>> Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit?: >>>> Do I have to conclude that the implementation is currently so >>>> incoherent >>>> that *nobody* uses integer types in Scilab (other than Scilab code >>>> itself) ? >>> it's a new feature, I would have like to use it? before ... I've build >>> my own solution and now I just need time replace it with int64. >>> >>> For mixed int/double expression I expect to get the best floating point >>> approximation as a result. >> and for int/int ? > For me, this should be int, to be consistent with most of the > languages I use. Can you precise the languages (besides C and C++) ? > So 3.0/4.0=0.75 but 3/4=0. > But maybe getting a rational would make more sense? Here are some links to interesting discussions to help getting one : https://docs.julialang.org/en/v0.6.1/manual/conversion-and-promotion/ https://fr.mathworks.com/matlabcentral/answers/18222-arithmetic-promotion-floating-point-to-integer https://fr.mathworks.com/matlabcentral/answers/36773-why-float-no-become-integer https://stackoverflow.com/questions/2425251/how-do-i-get-real-integer-overflows-in-matlab-octave/2430278#2430278 S. > > Antoine >> >> S. >>> >>> >>> Best regards, >>> >>> Philippe >>> >>> >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >>> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >> >> > -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From sgougeon at free.fr Wed Sep 19 10:44:10 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Wed, 19 Sep 2018 10:44:10 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> Message-ID: <0120352e-3c3c-a1c8-692e-f022f65abe68@free.fr> Here is the start of this discussion. As cross-posting looks forbidden/prevented/canceled, i am afraid that only the dev@ list received both initial messages . At least, only the dev@ archives publish them . Also, setting a scilab list in CC: while the main receiver is another list looks also useless because it is silently canceled (see the dev@ online archives). Regards Samuel Le 14/09/2018 ? 18:20, St?phane Mottelet a ?crit : > Hello all, > > Integer types in Scilab are not smoothly implemented and there are > still some bugs and real questions to be discussed, specifically on > over/underflow, exceptions in divisions such as in > > int8(1)/int8(0) > > int8(-128)/int8(-1) > > type of the result of mixed double/integer operations, such as > > int8(1) + %pi > > int8(1)/0.0 > > and so on. Other software related to Scilab, e.g. Matlab and Julia, > have different conventions and currently Scilab currently adopts a mix > of them, which does not help to make one's mind. > > Integers types were a long-waited feature by people who needed it, so > I would like to have some developpers and user testimonies about the > way they do algebra with them. > > Thanks in adavance, > > S. > Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit : > [No answers] > > Hello all, > > Do I have to conclude that the implementation is currently so > incoherent that *nobody* uses integer types in Scilab (other than > Scilab code itself) ? > > S. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Wed Sep 19 11:01:52 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Wed, 19 Sep 2018 11:01:52 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> Message-ID: Le 18/09/2018 ? 19:26, philippe a ?crit : > Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit : >> Do I have to conclude that the implementation is currently so incoherent >> that *nobody* uses integer types in Scilab (other than Scilab code >> itself) ? > it's a new feature, It would not be a new feature, but a change. This means that for 30 years that Scilab and its int8 uint8 int16 uint16 int32 uint32 datatypes exist, the current algebra is used, and is used in a consistent way, even if in some aspects we may deem that this way is too rough. At least, it is predictable, and manageable. And so, changing the current algebra would break all codes implemented with encoded integers for 30 years. While introducing an actually new feature breaks nothing. Regards Samuel From stephane.mottelet at utc.fr Wed Sep 19 11:10:57 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Wed, 19 Sep 2018 11:10:57 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> Message-ID: <35da1f94-38b2-174e-81c5-9e4bf30340d6@utc.fr> Le 19/09/2018 ? 11:01, Samuel Gougeon a ?crit?: > Le 18/09/2018 ? 19:26, philippe a ?crit : >> Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit : >>> Do I have to conclude that the implementation is currently so >>> incoherent >>> that *nobody* uses integer types in Scilab (other than Scilab code >>> itself) ? >> it's a new feature, > > It would not be a new feature, but a change. This means that for 30 > years that Scilab > and its int8 uint8 int16 uint16 int32 uint32 datatypes exist, the > current algebra is used, > and is used in a consistent way, even if in some aspects we may deem > that this way > is too rough. At least, it is predictable, and manageable. > And so, changing the current algebra would break all codes implemented > with encoded > integers for 30 years. The aim of my first message was a try to clarify this point. Where are this codes ?? In scilab itself, in user codes ? To me, user codes having been untouched since 10 years are not used any more... S. > While introducing an actually new feature breaks nothing. > > Regards > Samuel > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users > -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From sgougeon at free.fr Wed Sep 19 11:17:33 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Wed, 19 Sep 2018 11:17:33 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <0120352e-3c3c-a1c8-692e-f022f65abe68@free.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <0120352e-3c3c-a1c8-692e-f022f65abe68@free.fr> Message-ID: <918396b0-8809-3333-5006-fffa1bc66555@free.fr> > Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit : >> [No answers] >> >> Hello all, >> >> Do I have to conclude that the implementation is currently so >> incoherent that *nobody* uses integer types in Scilab (other than >> Scilab code itself) ? The current implementation is not incoherent. The message was likely not published on users at . The traffic is (much?) lower on dev@ than on users at . A poor trafic about this topic could also mean that * most of Scilab users working with encoded integers are satisfied. No answer = status quo. * or almost nobody uses Scilab. So, never mind any deep changes. You can do whatever you want on a relic. Best regards Samuel -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Wed Sep 19 11:24:21 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Wed, 19 Sep 2018 11:24:21 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <918396b0-8809-3333-5006-fffa1bc66555@free.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <0120352e-3c3c-a1c8-692e-f022f65abe68@free.fr> <918396b0-8809-3333-5006-fffa1bc66555@free.fr> Message-ID: <2b97a6af-3716-2c0d-6eb0-f75afb773078@utc.fr> Le 19/09/2018 ? 11:17, Samuel Gougeon a ?crit?: > >> Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit?: >>> [No answers] >>> >>> Hello all, >>> >>> Do I have to conclude that the implementation is currently so >>> incoherent that *nobody* uses integer types in Scilab (other than >>> Scilab code itself) ? > > The current implementation is not incoherent. However, there are still bugs, and when trying to solve them, the question of incoherence raises. See e.g : --> int8(-128)/int8(-1) ?ans? = ?-128 The message was likely not published on users at . The traffic is (much?) lower on dev@ than on users at . > A poor trafic about this topic could also mean that > > * most of Scilab users working with encoded integers are satisfied. > No answer = status quo. > * or almost nobody uses Scilab. So, never mind any deep changes. You > can do whatever you want on a relic. > > Best regards > Samuel > > > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Wed Sep 19 11:46:17 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Wed, 19 Sep 2018 11:46:17 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <2b97a6af-3716-2c0d-6eb0-f75afb773078@utc.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <0120352e-3c3c-a1c8-692e-f022f65abe68@free.fr> <918396b0-8809-3333-5006-fffa1bc66555@free.fr> <2b97a6af-3716-2c0d-6eb0-f75afb773078@utc.fr> Message-ID: Le 19/09/2018 ? 11:24, St?phane Mottelet a ?crit : > Le 19/09/2018 ? 11:17, Samuel Gougeon a ?crit : >> >> The current implementation is not incoherent. > However, there are still bugs, and when trying to solve them, the > question of incoherence raises. See e.g : > > --> int8(-128)/int8(-1) > ans = > -128 There is no bug here. The division yields 128, that then is wrapped, what yields -128, since in Scilab after the int8 127, 127+1 goes to -128 instead of ceiling to 127 like in Octave: >> int8(-128)/int8(-1) ans = 127 At first sight, Octave's result does not look more consistent than Scilab's one. But following its own ceiling/flooring rules, yet it is consistent. With both possible rules, wrapping or saturating ones, results may appear as inconsistent. But for this example, it is not the case. Samuel From stephane.mottelet at utc.fr Wed Sep 19 12:02:51 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Wed, 19 Sep 2018 12:02:51 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <0120352e-3c3c-a1c8-692e-f022f65abe68@free.fr> <918396b0-8809-3333-5006-fffa1bc66555@free.fr> <2b97a6af-3716-2c0d-6eb0-f75afb773078@utc.fr> Message-ID: <4a0f73e1-a2a0-8c65-ea3a-abc84f7f0363@utc.fr> Le 19/09/2018 ? 11:46, Samuel Gougeon a ?crit?: > Le 19/09/2018 ? 11:24, St?phane Mottelet a ?crit : >> Le 19/09/2018 ? 11:17, Samuel Gougeon a ?crit : >>> >>> The current implementation is not incoherent. >> However, there are still bugs, and when trying to solve them, the >> question of incoherence raises. See e.g : >> >> --> int8(-128)/int8(-1) >> ?ans? = >> ?-128 > > There is no bug here. The division yields 128, that then is wrapped, > what yields -128, since in Scilab after the int8 127, 127+1 goes to > -128 instead of ceiling to 127 like in Octave: > >> int8(-128)/int8(-1) > ans = 127 OK > > At first sight, Octave's result does not look more consistent than > Scilab's one. > But following its own ceiling/flooring rules, yet it is consistent. What is puzzling is that Scilab implements a *mix* of rules comming from different software. I am wondering about the true reason: Scilab: --> int8(-128)/int8(0) ?ans? = ?-128 --> int8(-128)/int8(-1) ?ans? = ?-128 Matlab: >> int8(-128)/int8(0) ans = ? int8 ?? -128 >> int8(-128)/int8(-1) ans = ? int8 ?? 127 > > With both possible rules, wrapping or saturating ones, results may > appear as inconsistent. But for this example, it is not the case. > > Samuel > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users > -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From sgougeon at free.fr Wed Sep 19 12:25:35 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Wed, 19 Sep 2018 12:25:35 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <4a0f73e1-a2a0-8c65-ea3a-abc84f7f0363@utc.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <0120352e-3c3c-a1c8-692e-f022f65abe68@free.fr> <918396b0-8809-3333-5006-fffa1bc66555@free.fr> <2b97a6af-3716-2c0d-6eb0-f75afb773078@utc.fr> <4a0f73e1-a2a0-8c65-ea3a-abc84f7f0363@utc.fr> Message-ID: <9a57ac26-b16e-7ce0-4a46-37a30cd6b6ec@free.fr> Le 19/09/2018 ? 12:02, St?phane Mottelet a ?crit : > Le 19/09/2018 ? 11:46, Samuel Gougeon a ?crit : > .../... >> >> At first sight, Octave's result does not look more consistent than >> Scilab's one. >> But following its own ceiling/flooring rules, yet it is consistent. > What is puzzling is that Scilab implements a *mix* of rules comming > from different software. I am wondering about the true reason: > > Scilab: > > --> int8(-128)/int8(0) > ans = > > -128 This is in Scilab 6. In Scilab 6, int8(-%inf) has been set to the int8 floor, and int8(%inf) to the int8 ceil. It is more consistent than the 5.5 behavior (and is now documented in the 6.0 branch). Also, 6.0 uses ieee() in a consistent way for encoded integers. That was not the case with Scilab 5.5. This change would deserve being documented. So here, the sign is correct, the value as well. > > --> int8(-128)/int8(-1) > ans = > -128 > > Matlab: > > >> int8(-128)/int8(0) > > ans = > > int8 > > -128 > > >> int8(-128)/int8(-1) > > ans = > > int8 > > 127 All these results are consistent in their own referential. I don't catch where you see a mix of rules. It is anyway necessary to set a fixed value for int8(%inf) and int8(-%inf). These inputs are not "infinitely wrappable" :) To set them to the bounding values is not absurd. This is what Scilab 6.0 does now. To me, it is an improvement. Samuel From sgougeon at free.fr Wed Sep 19 12:45:46 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Wed, 19 Sep 2018 12:45:46 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <9a57ac26-b16e-7ce0-4a46-37a30cd6b6ec@free.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <0120352e-3c3c-a1c8-692e-f022f65abe68@free.fr> <918396b0-8809-3333-5006-fffa1bc66555@free.fr> <2b97a6af-3716-2c0d-6eb0-f75afb773078@utc.fr> <4a0f73e1-a2a0-8c65-ea3a-abc84f7f0363@utc.fr> <9a57ac26-b16e-7ce0-4a46-37a30cd6b6ec@free.fr> Message-ID: <3f3a8fd5-79c3-4a55-7a44-8a0706e2677c@free.fr> Le 19/09/2018 ? 12:25, Samuel Gougeon a ?crit : > Le 19/09/2018 ? 12:02, St?phane Mottelet a ?crit : >> Le 19/09/2018 ? 11:46, Samuel Gougeon a ?crit : >> .../... >>> >>> At first sight, Octave's result does not look more consistent than >>> Scilab's one. >>> But following its own ceiling/flooring rules, yet it is consistent. >> What is puzzling is that Scilab implements a *mix* of rules comming >> from different software. I am wondering about the true reason: >> >> Scilab: >> >> --> int8(-128)/int8(0) >> ans = >> >> -128 > > This is in Scilab 6. In Scilab 6, int8(-%inf) has been set to the int8 > floor, and int8(%inf) to the int8 ceil. It is more consistent than the > 5.5 behavior (and is now documented in the 6.0 branch). Here is the Scilab 6.0.0 changelog in the int8 ... iuint64 help page for 6.0.2: Would you prefer fixing int32(%inf) in order to keep all answers to 0: this would avoid any saturating behavior for the infinite values as for finite ones ; or these new settings? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: gfonagcebphepcae.png Type: image/png Size: 4823 bytes Desc: not available URL: From sgougeon at free.fr Wed Sep 19 13:04:39 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Wed, 19 Sep 2018 13:04:39 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <35da1f94-38b2-174e-81c5-9e4bf30340d6@utc.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <35da1f94-38b2-174e-81c5-9e4bf30340d6@utc.fr> Message-ID: Le 19/09/2018 ? 11:10, St?phane Mottelet a ?crit : > Le 19/09/2018 ? 11:01, Samuel Gougeon a ?crit : >> Le 18/09/2018 ? 19:26, philippe a ?crit : >>> Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit : >>>> Do I have to conclude that the implementation is currently so >>>> incoherent >>>> that *nobody* uses integer types in Scilab (other than Scilab code >>>> itself) ? >>> it's a new feature, >> >> It would not be a new feature, but a change. This means that for 30 >> years that Scilab >> and its int8 uint8 int16 uint16 int32 uint32 datatypes exist, the >> current algebra is used, >> and is used in a consistent way, even if in some aspects we may deem >> that this way >> is too rough. At least, it is predictable, and manageable. >> And so, changing the current algebra would break all codes >> implemented with encoded >> integers for 30 years. > The aim of my first message was a try to clarify this point. Where are > this codes ? In scilab itself, in user codes ? To me, user codes > having been untouched since 10 years are not used any more... I think that this position underestimates a lot users wish for stability and reproducibility. In a lab, in a design office, or even in the text book for a lesson in maths or computing, if it is not possible to get the same results when changing the Scilab version you use, then many users/authors will keep using the scilab version with which the code/book has been implemented/written. It does not prevent installing later versions. Even 10 years: It is the "official" lifetime of the whole Scilab 5 family. If we fairly assume that the community have grown a lot with Scilab 5, it represents likely almost all the existing codes. And the Scilab 5.5.2 will be still used for (10 ?) years. Killing the ATOMS server for 5.5.2 won't remove Scilab 5.5.2 where it is installed for existing codes, and won't provide time to authors to update their existing ressources. About Scilab 6.0 itself: The "[^a-zA-Z0-9_](int8|uint8|int16|uint16|int32|uint32|int64|uint64)[^a-zA-Z0-9_]" pattern gets 3876 hits in 293 *.sci *.sce and *.tst files. Not counting the *.xml ones, nor the hardcoded *.c *.cpp *.java ones in which the algebra would have to be overhauled and updated as well. Samuel From antoine.monmayrant at laas.fr Wed Sep 19 13:28:10 2018 From: antoine.monmayrant at laas.fr (antoine monmayrant) Date: Wed, 19 Sep 2018 13:28:10 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <35da1f94-38b2-174e-81c5-9e4bf30340d6@utc.fr> Message-ID: <2f8a7b20-722a-ec92-db21-15639358ac7c@laas.fr> Le 19/09/2018 ? 13:04, Samuel Gougeon a ?crit?: > Le 19/09/2018 ? 11:10, St?phane Mottelet a ?crit : >> Le 19/09/2018 ? 11:01, Samuel Gougeon a ?crit : >>> Le 18/09/2018 ? 19:26, philippe a ?crit : >>>> Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit : >>>>> Do I have to conclude that the implementation is currently so >>>>> incoherent >>>>> that *nobody* uses integer types in Scilab (other than Scilab code >>>>> itself) ? >>>> it's a new feature, >>> >>> It would not be a new feature, but a change. This means that for 30 >>> years that Scilab >>> and its int8 uint8 int16 uint16 int32 uint32 datatypes exist, the >>> current algebra is used, >>> and is used in a consistent way, even if in some aspects we may deem >>> that this way >>> is too rough. At least, it is predictable, and manageable. >>> And so, changing the current algebra would break all codes >>> implemented with encoded >>> integers for 30 years. >> The aim of my first message was a try to clarify this point. Where >> are this codes ?? In scilab itself, in user codes ? To me, user codes >> having been untouched since 10 years are not used any more... > > I think that this position underestimates a lot users wish for > stability and reproducibility. > In a lab, in a design office, or even in the text book for a lesson in > maths or computing, > if it is not possible to get the same results when changing the Scilab > version you use, > then many users/authors will keep using the scilab version with which > the code/book has > been implemented/written. It does not prevent installing later versions. > > Even 10 years: It is the "official" lifetime of the whole Scilab 5 > family. If we fairly assume that > the community have grown a lot with Scilab 5, it represents likely > almost all the existing codes. > And the Scilab 5.5.2 will be still used for (10 ?) years. Killing the > ATOMS server for 5.5.2 > won't remove Scilab 5.5.2 where it is installed for existing codes, > and won't provide time > to authors to update their existing ressources. I second that! I started using scilab with version 2.6 and no later than this year, I had to rerun a bunch of scripts dating back from 2004/2005 so most probably created using scilab 3.x. Some of them ran without any modification and some others required minor updates to give exactly the same old result (most changes being in the cosmetic of the graphics, not on the core results of the simulation). Last week, I gave to one of my colleagues a code I wrote in 2008, so exactly 10 years ago. So reusing a 10-years-old code that have not been used during a decade is quite common for us ... Cheers, Antoine > > About Scilab 6.0 itself: > The > "[^a-zA-Z0-9_](int8|uint8|int16|uint16|int32|uint32|int64|uint64)[^a-zA-Z0-9_]" > pattern > gets 3876 hits in 293 *.sci *.sce and *.tst files. > Not counting the *.xml ones, nor the hardcoded *.c *.cpp *.java ones > in which the algebra > would have to be overhauled and updated as well. > > Samuel > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > From stephane.mottelet at utc.fr Wed Sep 19 13:43:06 2018 From: stephane.mottelet at utc.fr (=?utf-8?Q?St=C3=A9phane_Mottelet?=) Date: Wed, 19 Sep 2018 13:43:06 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <2f8a7b20-722a-ec92-db21-15639358ac7c@laas.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <35da1f94-38b2-174e-81c5-9e4bf30340d6@utc.fr> <2f8a7b20-722a-ec92-db21-15639358ac7c@laas.fr> Message-ID: <5984AC85-5E59-4C68-9E3B-8808A691B5E4@utc.fr> Hello Antoine > Le 19 sept. 2018 ? 13:28, antoine monmayrant a ?crit : > > > >> Le 19/09/2018 ? 13:04, Samuel Gougeon a ?crit : >>> Le 19/09/2018 ? 11:10, St?phane Mottelet a ?crit : >>>> Le 19/09/2018 ? 11:01, Samuel Gougeon a ?crit : >>>>> Le 18/09/2018 ? 19:26, philippe a ?crit : >>>>>> Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit : >>>>>> Do I have to conclude that the implementation is currently so incoherent >>>>>> that *nobody* uses integer types in Scilab (other than Scilab code >>>>>> itself) ? >>>>> it's a new feature, >>>> >>>> It would not be a new feature, but a change. This means that for 30 years that Scilab >>>> and its int8 uint8 int16 uint16 int32 uint32 datatypes exist, the current algebra is used, >>>> and is used in a consistent way, even if in some aspects we may deem that this way >>>> is too rough. At least, it is predictable, and manageable. >>>> And so, changing the current algebra would break all codes implemented with encoded >>>> integers for 30 years. >>> The aim of my first message was a try to clarify this point. Where are this codes ? In scilab itself, in user codes ? To me, user codes having been untouched since 10 years are not used any more... >> >> I think that this position underestimates a lot users wish for stability and reproducibility. >> In a lab, in a design office, or even in the text book for a lesson in maths or computing, >> if it is not possible to get the same results when changing the Scilab version you use, >> then many users/authors will keep using the scilab version with which the code/book has >> been implemented/written. It does not prevent installing later versions. >> >> Even 10 years: It is the "official" lifetime of the whole Scilab 5 family. If we fairly assume that >> the community have grown a lot with Scilab 5, it represents likely almost all the existing codes. >> And the Scilab 5.5.2 will be still used for (10 ?) years. Killing the ATOMS server for 5.5.2 >> won't remove Scilab 5.5.2 where it is installed for existing codes, and won't provide time >> to authors to update their existing ressources. > I second that! > I started using scilab with version 2.6 and no later than this year, > I had to rerun a bunch of scripts dating back from 2004/2005 so most probably created using scilab 3.x. > Some of them ran without any modification and some others required minor updates to give exactly the same old result (most changes being in the cosmetic of the graphics, not on the core results of the simulation). > Last week, I gave to one of my colleagues a code I wrote in 2008, so exactly 10 years ago. > So reusing a 10-years-old code that have not been used during a decade is quite common for us ... > > Cheers, > > Antoine >> >> About Scilab 6.0 itself: >> The "[^a-zA-Z0-9_](int8|uint8|int16|uint16|int32|uint32|int64|uint64)[^a-zA-Z0-9_]" pattern >> gets 3876 hits in 293 *.sci *.sce and *.tst files. >> Not counting the *.xml ones, nor the hardcoded *.c *.cpp *.java ones in which the algebra >> would have to be overhauled and updated as well. >> >> Samuel >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >> > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users From stephane.mottelet at utc.fr Wed Sep 19 14:36:29 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Wed, 19 Sep 2018 14:36:29 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <2f8a7b20-722a-ec92-db21-15639358ac7c@laas.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <35da1f94-38b2-174e-81c5-9e4bf30340d6@utc.fr> <2f8a7b20-722a-ec92-db21-15639358ac7c@laas.fr> Message-ID: <09629586-c1cf-ca5b-edfc-5a516caf5d9c@utc.fr> Hello Antoine, Le 19/09/2018 ? 13:28, antoine monmayrant a ?crit?: > > > Le 19/09/2018 ? 13:04, Samuel Gougeon a ?crit?: >> Le 19/09/2018 ? 11:10, St?phane Mottelet a ?crit : >>> Le 19/09/2018 ? 11:01, Samuel Gougeon a ?crit : >>>> Le 18/09/2018 ? 19:26, philippe a ?crit : >>>>> Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit : >>>>>> Do I have to conclude that the implementation is currently so >>>>>> incoherent >>>>>> that *nobody* uses integer types in Scilab (other than Scilab code >>>>>> itself) ? >>>>> it's a new feature, >>>> >>>> It would not be a new feature, but a change. This means that for 30 >>>> years that Scilab >>>> and its int8 uint8 int16 uint16 int32 uint32 datatypes exist, the >>>> current algebra is used, >>>> and is used in a consistent way, even if in some aspects we may >>>> deem that this way >>>> is too rough. At least, it is predictable, and manageable. >>>> And so, changing the current algebra would break all codes >>>> implemented with encoded >>>> integers for 30 years. >>> The aim of my first message was a try to clarify this point. Where >>> are this codes ?? In scilab itself, in user codes ? To me, user >>> codes having been untouched since 10 years are not used any more... >> >> I think that this position underestimates a lot users wish for >> stability and reproducibility. >> In a lab, in a design office, or even in the text book for a lesson >> in maths or computing, >> if it is not possible to get the same results when changing the >> Scilab version you use, >> then many users/authors will keep using the scilab version with which >> the code/book has >> been implemented/written. It does not prevent installing later versions. >> >> Even 10 years: It is the "official" lifetime of the whole Scilab 5 >> family. If we fairly assume that >> the community have grown a lot with Scilab 5, it represents likely >> almost all the existing codes. >> And the Scilab 5.5.2 will be still used for (10 ?) years. Killing the >> ATOMS server for 5.5.2 >> won't remove Scilab 5.5.2 where it is installed for existing codes, >> and won't provide time >> to authors to update their existing ressources. > I second that! > I started using scilab with version 2.6 and no later than this year, I > had to rerun a bunch of scripts dating back from 2004/2005 so most > probably created using scilab 3.x. > Some of them ran without any modification and some others required > minor updates to give exactly the same old result (most changes being > in the cosmetic of the graphics, not on the core results of the > simulation). > Last week, I gave to one of my colleagues a code I wrote in 2008, so > exactly 10 years ago. > So reusing a 10-years-old code that have not been used during a decade > is quite common for us ... Please include me into "us" :-D I started using Scilab when it was Basile, in 1989. Like you, I have a bunch of old code that I am happy to be able to run with minor glitches. What I meant is that too much conservatism is no good for Scilab. Have you ever tried to put yourself into the position of a true Scilab newcomer ? Not that easy. The long-term users who we are have developped a particular abnegation that newcomers do not have. Each year I meet some people who try Scilab for a while and just move on (sometimes my own students). Take the example of the "new graphics". The core of it is solid (SciRenderer, and so on), but at the Scilab level... Even changing french-inspired command names seems to be a problem (champ, fec, ...), different interpretations of foreground/background depending on the context, hard-wired color numbers, figure canvases denoted as "Axes", and so on. Please don't mistake yourself about my intentions: I am not just playing with Scilab, I just want that people really use it instead of Matlab (for example in my university, people teaching Signal processing and Automatic Control still use Matlab. They just tried a little bit, then moved on). The particular point on integers was probably not the good point to start with, but just an example of our reactions to eventual changes aiming a better? compatibility of Scilab with other software. S. > > Cheers, gcf > > Antoine >> >> About Scilab 6.0 itself: >> The >> "[^a-zA-Z0-9_](int8|uint8|int16|uint16|int32|uint32|int64|uint64)[^a-zA-Z0-9_]" >> pattern >> gets 3876 hits in 293 *.sci *.sce and *.tst files. >> Not counting the *.xml ones, nor the hardcoded *.c *.cpp *.java ones >> in which the algebra >> would have to be overhauled and updated as well. >> >> Samuel >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >> >> > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users > -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From antoine.monmayrant at laas.fr Wed Sep 19 14:55:18 2018 From: antoine.monmayrant at laas.fr (antoine monmayrant) Date: Wed, 19 Sep 2018 14:55:18 +0200 Subject: [Scilab-users] Scilab takes forever to boot ... because of http://news.scilab.io/feed ??? Message-ID: Hi all, A recent nightly-build of scilab-6.0 just took more than a minute to start. It seems due to a problem of connection to http://news.scilab.io/feed . Here is the error I get on the terminal: ??? java.io.IOException: Server returned HTTP response code: 500 for URL: http://news.scilab.io/feed It raises 3 questions: 1) How do I disable this? Is closing the news feed docking window enough to prevent scilab from trying to connect to this server? 2) Am I this only one experiencing this problem? 3) Shouldn't this be considered a bug? Scilab should startup as fast possible even if there is a connection issue, right? Cheers, Antoine From stephane.mottelet at utc.fr Wed Sep 19 15:03:40 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Wed, 19 Sep 2018 15:03:40 +0200 Subject: [Scilab-users] Scilab takes forever to boot ... because of http://news.scilab.io/feed ??? In-Reply-To: References: Message-ID: Hi Antoine, I just tried to start teh latest Scilab-branch-6.0 build? after deactivating my network connection and had the usual startup time. I just have the following text appearing in the Newsfeed pane: " News feed unavailable. " S. Le 19/09/2018 ? 14:55, antoine monmayrant a ?crit?: > Hi all, > > A recent nightly-build of scilab-6.0 just took more than a minute to > start. > It seems due to a problem of connection to > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/news.scilab.io/feed > . > Here is the error I get on the terminal: > > ??? java.io.IOException: Server returned HTTP response code: 500 for > URL: > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/news.scilab.io/feed > > It raises 3 questions: > > 1) How do I disable this? Is closing the news feed docking window > enough to prevent scilab from trying to connect to this server? > > 2) Am I this only one experiencing this problem? > > 3) Shouldn't this be considered a bug? Scilab should startup as fast > possible even if there is a connection issue, right? > > Cheers, > > Antoine > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users > -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From antoine.monmayrant at laas.fr Wed Sep 19 15:20:11 2018 From: antoine.monmayrant at laas.fr (antoine monmayrant) Date: Wed, 19 Sep 2018 15:20:11 +0200 Subject: [Scilab-users] Scilab takes forever to boot ... because of http://news.scilab.io/feed ??? In-Reply-To: References: Message-ID: <15c00304-355a-cf96-58f4-81daaffd5965@laas.fr> Le 19/09/2018 ? 15:03, St?phane Mottelet a ?crit?: > Hi Antoine, > > I just tried to start teh latest Scilab-branch-6.0 build? after > deactivating my network connection and had the usual startup time. I > just have the following text appearing in the Newsfeed pane: " News > feed unavailable. " Well, I just installed the latest nighly and managed to reproduce this bug at least once (ie on the first startup after install). It seems that I cannot reach http://news.scilab.io/feed whereas my connection to other websites is OK. Antoine > > S. > > Le 19/09/2018 ? 14:55, antoine monmayrant a ?crit?: >> Hi all, >> >> A recent nightly-build of scilab-6.0 just took more than a minute to >> start. >> It seems due to a problem of connection to >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/news.scilab.io/feed >> . >> Here is the error I get on the terminal: >> >> ??? java.io.IOException: Server returned HTTP response code: 500 for >> URL: >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/news.scilab.io/feed >> >> It raises 3 questions: >> >> 1) How do I disable this? Is closing the news feed docking window >> enough to prevent scilab from trying to connect to this server? >> >> 2) Am I this only one experiencing this problem? >> >> 3) Shouldn't this be considered a bug? Scilab should startup as fast >> possible even if there is a connection issue, right? >> >> Cheers, >> >> Antoine >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >> > > From antoine.monmayrant at laas.fr Wed Sep 19 15:36:23 2018 From: antoine.monmayrant at laas.fr (antoine monmayrant) Date: Wed, 19 Sep 2018 15:36:23 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <09629586-c1cf-ca5b-edfc-5a516caf5d9c@utc.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <35da1f94-38b2-174e-81c5-9e4bf30340d6@utc.fr> <2f8a7b20-722a-ec92-db21-15639358ac7c@laas.fr> <09629586-c1cf-ca5b-edfc-5a516caf5d9c@utc.fr> Message-ID: <951794c3-683e-25ec-456d-c0194e3e7a03@laas.fr> Another one of my favorites, that highlights the fact that scilab needs a lot of polishing (in particular in the documentation & naming) to help new or non-specialist users: Compare the choice of name for matlab? poylval() and scilab horner(). How could I know that to evaluate a polynomial I should call horner()? If you don't know the name in advance, trying to use the help system for "polynomial evaluation" or similar strings is not going to help you much?. As I can never remember the name of the horner() function, I always end up opening the help system, browsing manually down to the Polynomials page and parse the listing of the functions to find the one mentioning "evaluate". Arrrrgghhhhh.... Antoine ? "help polynomial" brings you to the legacy scilab API example on polynomial! Spot on ! :-) Le 19/09/2018 ? 14:36, St?phane Mottelet a ?crit?: > Hello Antoine, > > Le 19/09/2018 ? 13:28, antoine monmayrant a ?crit?: >> >> >> Le 19/09/2018 ? 13:04, Samuel Gougeon a ?crit?: >>> Le 19/09/2018 ? 11:10, St?phane Mottelet a ?crit : >>>> Le 19/09/2018 ? 11:01, Samuel Gougeon a ?crit : >>>>> Le 18/09/2018 ? 19:26, philippe a ?crit : >>>>>> Le 17/09/2018 ? 19:03, St?phane Mottelet a ?crit : >>>>>>> Do I have to conclude that the implementation is currently so >>>>>>> incoherent >>>>>>> that *nobody* uses integer types in Scilab (other than Scilab code >>>>>>> itself) ? >>>>>> it's a new feature, >>>>> >>>>> It would not be a new feature, but a change. This means that for >>>>> 30 years that Scilab >>>>> and its int8 uint8 int16 uint16 int32 uint32 datatypes exist, the >>>>> current algebra is used, >>>>> and is used in a consistent way, even if in some aspects we may >>>>> deem that this way >>>>> is too rough. At least, it is predictable, and manageable. >>>>> And so, changing the current algebra would break all codes >>>>> implemented with encoded >>>>> integers for 30 years. >>>> The aim of my first message was a try to clarify this point. Where >>>> are this codes ?? In scilab itself, in user codes ? To me, user >>>> codes having been untouched since 10 years are not used any more... >>> >>> I think that this position underestimates a lot users wish for >>> stability and reproducibility. >>> In a lab, in a design office, or even in the text book for a lesson >>> in maths or computing, >>> if it is not possible to get the same results when changing the >>> Scilab version you use, >>> then many users/authors will keep using the scilab version with >>> which the code/book has >>> been implemented/written. It does not prevent installing later >>> versions. >>> >>> Even 10 years: It is the "official" lifetime of the whole Scilab 5 >>> family. If we fairly assume that >>> the community have grown a lot with Scilab 5, it represents likely >>> almost all the existing codes. >>> And the Scilab 5.5.2 will be still used for (10 ?) years. Killing >>> the ATOMS server for 5.5.2 >>> won't remove Scilab 5.5.2 where it is installed for existing codes, >>> and won't provide time >>> to authors to update their existing ressources. >> I second that! >> I started using scilab with version 2.6 and no later than this year, >> I had to rerun a bunch of scripts dating back from 2004/2005 so most >> probably created using scilab 3.x. >> Some of them ran without any modification and some others required >> minor updates to give exactly the same old result (most changes being >> in the cosmetic of the graphics, not on the core results of the >> simulation). >> Last week, I gave to one of my colleagues a code I wrote in 2008, so >> exactly 10 years ago. >> So reusing a 10-years-old code that have not been used during a >> decade is quite common for us ... > Please include me into "us" :-D I started using Scilab when it was > Basile, in 1989. Like you, I have a bunch of old code that I am happy > to be able to run with minor glitches. > > What I meant is that too much conservatism is no good for Scilab. Have > you ever tried to put yourself into the position of a true Scilab > newcomer ? Not that easy. The long-term users who we are have > developped a particular abnegation that newcomers do not have. Each > year I meet some people who try Scilab for a while and just move on > (sometimes my own students). > > Take the example of the "new graphics". The core of it is solid > (SciRenderer, and so on), but at the Scilab level... Even changing > french-inspired command names seems to be a problem (champ, fec, ...), > different interpretations of foreground/background depending on the > context, hard-wired color numbers, figure canvases denoted as "Axes", > and so on. > > Please don't mistake yourself about my intentions: I am not just > playing with Scilab, I just want that people really use it instead of > Matlab (for example in my university, people teaching Signal > processing and Automatic Control still use Matlab. They just tried a > little bit, then moved on). > > The particular point on integers was probably not the good point to > start with, but just an example of our reactions to eventual changes > aiming a better? compatibility of Scilab with other software. > > S. > >> >> Cheers, gcf >> >> Antoine >>> >>> About Scilab 6.0 itself: >>> The >>> "[^a-zA-Z0-9_](int8|uint8|int16|uint16|int32|uint32|int64|uint64)[^a-zA-Z0-9_]" >>> pattern >>> gets 3876 hits in 293 *.sci *.sce and *.tst files. >>> Not counting the *.xml ones, nor the hardcoded *.c *.cpp *.java ones >>> in which the algebra >>> would have to be overhauled and updated as well. >>> >>> Samuel >>> >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >>> >>> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >> > > From sgougeon at free.fr Wed Sep 19 15:58:41 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Wed, 19 Sep 2018 15:58:41 +0200 Subject: [Scilab-users] [Scilab-Dev] algebra conventions with integer types to be discussed In-Reply-To: <951794c3-683e-25ec-456d-c0194e3e7a03@laas.fr> References: <6ca39921-b002-731b-7631-b730254ae8b9@utc.fr> <35da1f94-38b2-174e-81c5-9e4bf30340d6@utc.fr> <2f8a7b20-722a-ec92-db21-15639358ac7c@laas.fr> <09629586-c1cf-ca5b-edfc-5a516caf5d9c@utc.fr> <951794c3-683e-25ec-456d-c0194e3e7a03@laas.fr> Message-ID: Le 19/09/2018 ? 15:36, antoine monmayrant a ?crit : > Another one of my favorites, that highlights the fact that scilab > needs a lot of polishing (in particular in the documentation & naming) > to help new or non-specialist users: > > Compare the choice of name for matlab poylval() and scilab horner(). > How could I know that to evaluate a polynomial I should call horner()? > If you don't know the name in advance, trying to use the help system > for "polynomial evaluation" or similar strings is not going to help > you much?. > As I can never remember the name of the horner() function, I always > end up opening the help system, browsing manually down to the > Polynomials page and parse the listing of the functions to find the > one mentioning "evaluate". > > Arrrrgghhhhh.... This is why uman() has a redirection list: --> uman polyval w brings you to the horner page and more than 200 other redirections that could be easily included in help(), with a switch in the Preferences (to use the automatic redirection or not). horner() is also applicable to rationals. I am happy to use -- and have to document and maintain -- a single same function to evaluate both polynomials and rationals. So, this example shows that a generic polynomials page is missing, or/and that the polynomial tag could be added to the currently existing most appropriated page. Anyone is welcome to write this page, or/and to indicate which existing one would be the best hook to polynomial features. Samuel From stephane.mottelet at utc.fr Fri Sep 21 11:18:42 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Fri, 21 Sep 2018 11:18:42 +0200 Subject: [Scilab-users] eigs is SLOW Message-ID: <65908de7-e55b-cc43-2a36-b899652d44a2@utc.fr> Hello, Please have a look at http://bugzilla.scilab.org/show_bug.cgi?id=15777, if you can make the comparison,? please give your timings. S. -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From rouxph.22 at gmail.com Fri Sep 21 14:27:00 2018 From: rouxph.22 at gmail.com (philippe) Date: Fri, 21 Sep 2018 14:27:00 +0200 Subject: [Scilab-users] metanet for scilab 6.0.1 ? Message-ID: Hi, is there any metanet user here ? I would like to install metanet in scilab 6.0.1, I tried to compile master branch from scilab-forge but it fails , see : http://forge.scilab.org/index.php/p/metanet/issues/1772/#preview metanet has been bugged from a long time but problems where solved recently in scilab 5.5.* so it's a shame to see it again bugged :-\ Best regards, Philippe From stephane.mottelet at utc.fr Fri Sep 21 14:31:27 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Fri, 21 Sep 2018 14:31:27 +0200 Subject: [Scilab-users] metanet for scilab 6.0.1 ? In-Reply-To: References: Message-ID: <475fe5cd-e9ec-747a-a6ff-d9eca64b0c42@utc.fr> Le 21/09/2018 ? 14:27, philippe a ?crit?: > Hi, > > is there any metanet user here ? I would like to install metanet in > scilab 6.0.1, I tried to compile master branch from scilab-forge but it > fails , see : > > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/forge.scilab.org/index.php/p/metanet/issues/1772/#preview > > metanet has been bugged from a long time but problems where solved > recently in scilab 5.5.* so it's a shame to see it again bugged :-\ > > Best regards, > > Philippe > > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users Hello Philippe, After looking at the final lines of the log, I have the feeling that the low-level gateway still uses the stack. This could explains why it does not compile with Scilab 6.0.1. S. -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From rouxph.22 at gmail.com Fri Sep 21 16:54:07 2018 From: rouxph.22 at gmail.com (philippe) Date: Fri, 21 Sep 2018 16:54:07 +0200 Subject: [Scilab-users] metanet for scilab 6.0.1 ? In-Reply-To: <475fe5cd-e9ec-747a-a6ff-d9eca64b0c42@utc.fr> References: <475fe5cd-e9ec-747a-a6ff-d9eca64b0c42@utc.fr> Message-ID: Le 21/09/2018 ? 14:31, St?phane Mottelet a ?crit?: > > After looking at the final lines of the log, I have the feeling that the > low-level gateway still uses the stack. This could explains why it does > not compile with Scilab 6.0.1. yes that's what I get, all fortran files in : metanet-master/sci_gateway/fortran/ have the line : include 'stack.h' but the toolbox call sci_malloc.h in many other files, which the new api for scilab6 (introduced since scilab 5.3?). So do you think that removing the line "include 'stack.h' " from all *.f files while solve the problem ? Best regards Philippe From stephane.mottelet at utc.fr Fri Sep 21 17:12:03 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Fri, 21 Sep 2018 17:12:03 +0200 Subject: [Scilab-users] metanet for scilab 6.0.1 ? In-Reply-To: References: <475fe5cd-e9ec-747a-a6ff-d9eca64b0c42@utc.fr> Message-ID: <2a6735f9-38dc-7944-aede-73736d0eab2d@utc.fr> Le 21/09/2018 ? 16:54, philippe a ?crit?: > Le 21/09/2018 ? 14:31, St?phane Mottelet a ?crit?: >> After looking at the final lines of the log, I have the feeling that the >> low-level gateway still uses the stack. This could explains why it does >> not compile with Scilab 6.0.1. > yes that's what I get, all fortran files in : > > metanet-master/sci_gateway/fortran/ > > have the line : include 'stack.h' > > but the toolbox call sci_malloc.h in many other files, which the new > api for scilab6 (introduced since scilab 5.3?). > > So do you think that removing the line "include 'stack.h' " from all > *.f files while solve the problem ? No. Fortran gateways disappeared with Scilab 6.... S. > > Best regards > > Philippe > > > > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From arvid at softube.com Mon Sep 24 11:20:06 2018 From: arvid at softube.com (=?utf-8?B?QXJ2aWQgUm9zw6lu?=) Date: Mon, 24 Sep 2018 09:20:06 +0000 Subject: [Scilab-users] metanet for scilab 6.0.1 ? In-Reply-To: References: <475fe5cd-e9ec-747a-a6ff-d9eca64b0c42@utc.fr> Message-ID: <0C1E7E07-8A79-4DEA-A7D5-402E2E39E5A1@softube.com> Hi, I use the NARVAL package in scilab 6. I think it is basically the same as the old metanet stuff. It is not supported directly though, and I believe I had to do some hacking to get it working. Cheers, Arvid -- Arvid Ros?n VP Research & Development m: +46 73 25 12347 p: + 46 13 21 16 23 softube.com ?On 2018-09-21, 16:54, "users on behalf of philippe" wrote: Le 21/09/2018 ? 14:31, St?phane Mottelet a ?crit : > > After looking at the final lines of the log, I have the feeling that the > low-level gateway still uses the stack. This could explains why it does > not compile with Scilab 6.0.1. yes that's what I get, all fortran files in : metanet-master/sci_gateway/fortran/ have the line : include 'stack.h' but the toolbox call sci_malloc.h in many other files, which the new api for scilab6 (introduced since scilab 5.3?). So do you think that removing the line "include 'stack.h' " from all *.f files while solve the problem ? Best regards Philippe _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users From amonmayr at laas.fr Mon Sep 24 13:41:23 2018 From: amonmayr at laas.fr (amonmayr at laas.fr) Date: Mon, 24 Sep 2018 13:41:23 +0200 Subject: [Scilab-users] metanet for scilab 6.0.1 ? In-Reply-To: <2a6735f9-38dc-7944-aede-73736d0eab2d@utc.fr> References: <475fe5cd-e9ec-747a-a6ff-d9eca64b0c42@utc.fr> <2a6735f9-38dc-7944-aede-73736d0eab2d@utc.fr> Message-ID: Le 21/09/2018 ? 17:12, St?phane Mottelet a ?crit?: > Le 21/09/2018 ? 16:54, philippe a ?crit?: >> Le 21/09/2018 ? 14:31, St?phane Mottelet a ?crit?: >>> After looking at the final lines of the log, I have the feeling that >>> the >>> low-level gateway still uses the stack. This could explains why it does >>> not compile with Scilab 6.0.1. >> yes that's what I get, all fortran files in : >> >> metanet-master/sci_gateway/fortran/ >> >> have the line :? include 'stack.h' >> >> but the toolbox call sci_malloc.h? in many other files, which the new >> api for scilab6 (introduced since scilab 5.3?). >> >> So do you think that removing? the line "include 'stack.h' " from all >> *.f files while solve the problem ? > No. Fortran gateways disappeared with Scilab 6.... You mean Fortran gateways are no longer supported in 6.x? Is there any plan to reintroduce this feature? Antoine > > S. >> >> Best regards >> >> Philippe >> >> >> >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >> > > -- +++++++++++++++++++++++++++++++++++++++++++++++++++++++ Antoine Monmayrant LAAS - CNRS 7 avenue du Colonel Roche BP 54200 31031 TOULOUSE Cedex 4 FRANCE Tel:+33 5 61 33 64 59 email : antoine.monmayrant at laas.fr permanent email : antoine.monmayrant at polytechnique.org +++++++++++++++++++++++++++++++++++++++++++++++++++++++ From rouxph.22 at gmail.com Wed Sep 26 09:08:42 2018 From: rouxph.22 at gmail.com (philippe) Date: Wed, 26 Sep 2018 09:08:42 +0200 Subject: [Scilab-users] metanet for scilab 6.0.1 ? In-Reply-To: <0C1E7E07-8A79-4DEA-A7D5-402E2E39E5A1@softube.com> References: <475fe5cd-e9ec-747a-a6ff-d9eca64b0c42@utc.fr> <0C1E7E07-8A79-4DEA-A7D5-402E2E39E5A1@softube.com> Message-ID: Hi, Le 24/09/2018 ? 11:20, Arvid Ros?n a ?crit?: > Hi, > > I use the NARVAL package in scilab 6. I think it is basically the same as the old metanet stuff. It is not supported directly though, and I believe I had to do some hacking to get it working. > > Yes I remember a presentation of NARVAL, but I would like to refactorize a lot of old scilab code created with metanet for scilab4. This is possible with few work with a new version of metanet, but not with NARVAL. Best regards, Philippe. From stephane.mottelet at utc.fr Wed Sep 26 09:38:55 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Wed, 26 Sep 2018 09:38:55 +0200 Subject: [Scilab-users] metanet for scilab 6.0.1 ? In-Reply-To: References: <475fe5cd-e9ec-747a-a6ff-d9eca64b0c42@utc.fr> <2a6735f9-38dc-7944-aede-73736d0eab2d@utc.fr> Message-ID: Le 24/09/2018 ? 13:41, amonmayr at laas.fr a ?crit?: > Le 21/09/2018 ? 17:12, St?phane Mottelet a ?crit?: >> Le 21/09/2018 ? 16:54, philippe a ?crit?: >>> Le 21/09/2018 ? 14:31, St?phane Mottelet a ?crit?: >>>> After looking at the final lines of the log, I have the feeling >>>> that the >>>> low-level gateway still uses the stack. This could explains why it >>>> does >>>> not compile with Scilab 6.0.1. >>> yes that's what I get, all fortran files in : >>> >>> metanet-master/sci_gateway/fortran/ >>> >>> have the line :? include 'stack.h' >>> >>> but the toolbox call sci_malloc.h? in many other files, which the new >>> api for scilab6 (introduced since scilab 5.3?). >>> >>> So do you think that removing? the line "include 'stack.h' " from all >>> *.f files while solve the problem ? >> No. Fortran gateways disappeared with Scilab 6.... > You mean Fortran gateways are no longer supported in 6.x? > Is there any plan to reintroduce this feature? No. The "stack" is definitively gone. However, this is just a gateway problem. You can still use Fortran code, and actually there are a lot of Scilab functions which still rely on sources written in this language BUT gateways have to be coded with the "new Scilab API", either the "transitionnal" C API which appeared with Scilab 5.2.0, and preferably the new? C++ API of Scilab 6. But I know that migrating API for a stuff like Metanet is not an easy task.? As far as I am concerned, I have to rewrite the gateway for the FSQP optimization code of A. Tits and until now I didn't write one line of code... S. > > Antoine >> >> S. >>> >>> Best regards >>> >>> Philippe >>> >>> >>> >>> >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >>> >> >> > -- St?phane Mottelet Ing?nieur de recherche EA 4297 Transformations Int?gr?es de la Mati?re Renouvelable D?partement G?nie des Proc?d?s Industriels Sorbonne Universit?s - Universit? de Technologie de Compi?gne CS 60319, 60203 Compi?gne cedex Tel : +33(0)344234688 http://www.utc.fr/~mottelet From arvid at softube.com Wed Sep 26 17:11:59 2018 From: arvid at softube.com (=?Windows-1252?Q?Arvid_Ros=E9n?=) Date: Wed, 26 Sep 2018 15:11:59 +0000 Subject: [Scilab-users] metanet for scilab 6.0.1 ? In-Reply-To: References: <475fe5cd-e9ec-747a-a6ff-d9eca64b0c42@utc.fr> <0C1E7E07-8A79-4DEA-A7D5-402E2E39E5A1@softube.com>, Message-ID: Hi, Yeah, I know the pain. We had to do exactly that when metanet was dropped from being part of scilab. Actually, it wasn?t quite as bad as I first thought, but NARVAL changed a couple of times initially, which was annoying. However, the functionality (that we use) is exactly the same as metanat. Cheers, Arvid -- Arvid Ros?n VP Research and Development Softube AB S:t Larsgatan 9D S-582 24 Link?ping Sweden Phone: (+46) 13 21 16 23 Mobile: (+46) 73 25 12 34 7 Mail: arvid at softube.se URL: www.softube.se ________________________________ From: users on behalf of philippe Sent: Wednesday, September 26, 2018 9:08:42 AM To: users at lists.scilab.org Subject: Re: [Scilab-users] metanet for scilab 6.0.1 ? Hi, Le 24/09/2018 ? 11:20, Arvid Ros?n a ?crit : > Hi, > > I use the NARVAL package in scilab 6. I think it is basically the same as the old metanet stuff. It is not supported directly though, and I believe I had to do some hacking to get it working. > > Yes I remember a presentation of NARVAL, but I would like to refactorize a lot of old scilab code created with metanet for scilab4. This is possible with few work with a new version of metanet, but not with NARVAL. Best regards, Philippe. _______________________________________________ users mailing list users at lists.scilab.org http://lists.scilab.org/mailman/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.s.strom at hslmg.de Wed Sep 26 20:09:37 2018 From: j.s.strom at hslmg.de (Jens Simon Strom) Date: Wed, 26 Sep 2018 20:09:37 +0200 Subject: [Scilab-users] Notches in thick polyline Message-ID: <5BABCB61.8030409@hslmg.de> Hello Scilab afficionados, Can the notches be avoided? Cheers Jens phi=0:360; param3d(cosd(phi),zeros(phi),sind(phi)) ce=gce(); ce.thickness=20; -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.mottelet at utc.fr Wed Sep 26 20:50:05 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Wed, 26 Sep 2018 20:50:05 +0200 Subject: [Scilab-users] Notches in thick polyline In-Reply-To: <5BABCB61.8030409@hslmg.de> References: <5BABCB61.8030409@hslmg.de> Message-ID: <59e63665-4411-2cde-e4ac-0356416d0afd@utc.fr> Hello Jens, In 3d the thickness parameter is not very relevant, i.e. a 2D concept mapped to a 3D object. 3D polylines with large thickness should be rendered as in Geogebra, see e.g. https://www.geogebra.org/m/bMjuKxEj S. Le 26/09/2018 ? 20:09, Jens Simon Strom a ?crit?: > phi=0:360; > param3d(cosd(phi),zeros(phi),sind(phi)) > ce=gce();ce.thickness=20; -------------- next part -------------- An HTML attachment was scrubbed... URL: From rouxph.22 at gmail.com Thu Sep 27 10:22:03 2018 From: rouxph.22 at gmail.com (philippe) Date: Thu, 27 Sep 2018 10:22:03 +0200 Subject: [Scilab-users] metanet for scilab 6.0.1 ? In-Reply-To: References: <475fe5cd-e9ec-747a-a6ff-d9eca64b0c42@utc.fr> <0C1E7E07-8A79-4DEA-A7D5-402E2E39E5A1@softube.com> Message-ID: Le 26/09/2018 ? 17:11, Arvid Ros?n a ?crit?: > Hi, > > Yeah, I know the pain. We had to do exactly that when metanet was > dropped from being part of scilab. Actually, it wasn?t quite as bad as I > first thought, but NARVAL changed a couple of times initially, which was > annoying. However, the functionality (that we use) is exactly the same > as metanat. there was another solution : using scicoslab to run old metanet code! Up to 2014 it worked for me . Please don't kill me ! Philippe From antoine.monmayrant at laas.fr Fri Sep 28 21:00:25 2018 From: antoine.monmayrant at laas.fr (antoine monmayrant) Date: Fri, 28 Sep 2018 21:00:25 +0200 Subject: [Scilab-users] bug when setting gcbo field in a callback function ? Message-ID: <3c4c2a81-a832-842c-4ce6-cde22922317f@laas.fr> Hi all, In a callback function, gcbo is a handle to the calling uicontrol. There are 2 ways to set one of the fields of this handle (let's take "callback_type" as an example): ??? (1) ?? gcbo.callback_type=-1; or equivalently ??? (2)??? set(gcbo, "callback_type",-1); In theory, both are perfectly equivalent. In practice however, (1) leads to recurrent issues where gcbo is no longer a handle, but a structure! See below? an example script showing the difference: - two slides with equivalent callback functions funcb1 and funcb2, but for the different syntactic sugar (1) or (2). - if you play with the top slider in the figure, everything's fine, gcbo remains a handle (see output on the console). - if you play with the bottom slider in the figure, gcbo turns into a struct (see output on the console). Needless to say, this kind of issue made my GUI debugging session really fun. To make things even more fun, if you "pause" then execute "funcb1()" step by step, you don't necessarily trigger the bug, it's quite random and fairly unfrequent. Can you try to reproduce this bug on your computer? Cheers, Antoine // BUG_gcbo_set.sce // h=scf(); hs1=uicontrol(h, ... ??? "style", "slider", ... ??? "tag", "slide1", ... ??? "backgroundcolor", [1 1 1], ... ??? "value", 0, ... ??? "min", -100, ... ??? "max", 100, ... ??? "sliderstep", [1, 10], ... ??? "position", [20,40,200,20], ... ??? "constraints", createConstraints("border", "top"), ... ??? "callback", "funcb1"); function? funcb1() ??? disp(typeof(gcbo)); ??? gcbo.callback_type=-1; ??? disp(typeof(gcbo)); ??? gcbo.callback_type=0; endfunction hs2=uicontrol(h, ... ??? "style", "slider", ... ??? "tag", "slide1", ... ??? "backgroundcolor", [1 1 1], ... ??? "value", 0, ... ??? "min", -100, ... ??? "max", 100, ... ??? "sliderstep", [1, 10], ... ??? "position", [20,80,200,20], ... ??? "constraints", createConstraints("border", "top"), ... ??? "callback", "funcb2"); function? funcb2() ??? disp(typeof(gcbo)); ??? set(gcbo, "callback_type",-1); ??? disp(typeof(gcbo)); ??? set(gcbo, "callback_type",0) endfunction From stephane.mottelet at utc.fr Sat Sep 29 00:04:08 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Sat, 29 Sep 2018 00:04:08 +0200 Subject: [Scilab-users] bug when setting gcbo field in a callback function ? In-Reply-To: <3c4c2a81-a832-842c-4ce6-cde22922317f@laas.fr> References: <3c4c2a81-a832-842c-4ce6-cde22922317f@laas.fr> Message-ID: <07b1519a-328d-947c-5968-ca3d7746df51@utc.fr> Hello Antoine, Never trust the life time of gcbo, and first copy the value of gcbo like this: function? funcb1() ??? h=gcbo ??? disp(typeof(h)); ??? h.callback_type=-1; ??? disp(typeof(h)); ??? h.callback_type=0; endfunction With this trick the type of h is always a handle. However, I cannot explain why the second syntax using set() always works... S. Le 28/09/2018 ? 21:00, antoine monmayrant a ?crit?: > Hi all, > > In a callback function, gcbo is a handle to the calling uicontrol. > There are 2 ways to set one of the fields of this handle (let's take > "callback_type" as an example): > ??? (1) ?? gcbo.callback_type=-1; > or equivalently > ??? (2)??? set(gcbo, "callback_type",-1); > > In theory, both are perfectly equivalent. > In practice however, (1) leads to recurrent issues where gcbo is no > longer a handle, but a structure! > > See below? an example script showing the difference: > - two slides with equivalent callback functions funcb1 and funcb2, but > for the different syntactic sugar (1) or (2). > - if you play with the top slider in the figure, everything's fine, > gcbo remains a handle (see output on the console). > - if you play with the bottom slider in the figure, gcbo turns into a > struct (see output on the console). > > Needless to say, this kind of issue made my GUI debugging session > really fun. > To make things even more fun, if you "pause" then execute "funcb1()" > step by step, you don't necessarily trigger the bug, it's quite random > and fairly unfrequent. > > Can you try to reproduce this bug on your computer? > > Cheers, > > Antoine > > > // BUG_gcbo_set.sce // > h=scf(); > > hs1=uicontrol(h, ... > ??? "style", "slider", ... > ??? "tag", "slide1", ... > ??? "backgroundcolor", [1 1 1], ... > ??? "value", 0, ... > ??? "min", -100, ... > ??? "max", 100, ... > ??? "sliderstep", [1, 10], ... > ??? "position", [20,40,200,20], ... > ??? "constraints", createConstraints("border", "top"), ... > ??? "callback", "funcb1"); > > function? funcb1() > ??? disp(typeof(gcbo)); > ??? gcbo.callback_type=-1; > ??? disp(typeof(gcbo)); > ??? gcbo.callback_type=0; > endfunction > > > hs2=uicontrol(h, ... > ??? "style", "slider", ... > ??? "tag", "slide1", ... > ??? "backgroundcolor", [1 1 1], ... > ??? "value", 0, ... > ??? "min", -100, ... > ??? "max", 100, ... > ??? "sliderstep", [1, 10], ... > ??? "position", [20,80,200,20], ... > ??? "constraints", createConstraints("border", "top"), ... > ??? "callback", "funcb2"); > > function? funcb2() > ??? disp(typeof(gcbo)); > ??? set(gcbo, "callback_type",-1); > ??? disp(typeof(gcbo)); > ??? set(gcbo, "callback_type",0) > endfunction > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users > From antoine.monmayrant at laas.fr Sat Sep 29 00:31:08 2018 From: antoine.monmayrant at laas.fr (antoine monmayrant) Date: Sat, 29 Sep 2018 00:31:08 +0200 Subject: [Scilab-users] bug when setting gcbo field in a callback function ? In-Reply-To: <07b1519a-328d-947c-5968-ca3d7746df51@utc.fr> References: <3c4c2a81-a832-842c-4ce6-cde22922317f@laas.fr> <07b1519a-328d-947c-5968-ca3d7746df51@utc.fr> Message-ID: Hello St?phane, Well, I tried exactly this trick with mixed results: it kind of works most of the time, but sometimes it fails. I did not manage to reproduce the issue with my minimum working example though. It's weird, no? Why would gcbo behave differently than h? As for why "set" is working, while "gcbo.whatever=something" is failing, I think it's because something goes wrong when scilab is parsing "gcbo.whatever=something". It is as if scilab forgot about the fact that gcbo exists and does what we expect when creating a struct: ??? doesnotexists.whatever=something; creates a "doesnotexists" struct with one field==something. Antoine Le 29/09/2018 ? 00:04, St?phane Mottelet a ?crit?: > Hello Antoine, > > Never trust the life time of gcbo, and first copy the value of gcbo > like this: > > function? funcb1() > ??? h=gcbo > ??? disp(typeof(h)); > ??? h.callback_type=-1; > ??? disp(typeof(h)); > ??? h.callback_type=0; > endfunction > > With this trick the type of h is always a handle. However, I cannot > explain why the second syntax using set() always works... > > S. > > Le 28/09/2018 ? 21:00, antoine monmayrant a ?crit?: >> Hi all, >> >> In a callback function, gcbo is a handle to the calling uicontrol. >> There are 2 ways to set one of the fields of this handle (let's take >> "callback_type" as an example): >> ??? (1) ?? gcbo.callback_type=-1; >> or equivalently >> ??? (2)??? set(gcbo, "callback_type",-1); >> >> In theory, both are perfectly equivalent. >> In practice however, (1) leads to recurrent issues where gcbo is no >> longer a handle, but a structure! >> >> See below? an example script showing the difference: >> - two slides with equivalent callback functions funcb1 and funcb2, >> but for the different syntactic sugar (1) or (2). >> - if you play with the top slider in the figure, everything's fine, >> gcbo remains a handle (see output on the console). >> - if you play with the bottom slider in the figure, gcbo turns into a >> struct (see output on the console). >> >> Needless to say, this kind of issue made my GUI debugging session >> really fun. >> To make things even more fun, if you "pause" then execute "funcb1()" >> step by step, you don't necessarily trigger the bug, it's quite >> random and fairly unfrequent. >> >> Can you try to reproduce this bug on your computer? >> >> Cheers, >> >> Antoine >> >> >> // BUG_gcbo_set.sce // >> h=scf(); >> >> hs1=uicontrol(h, ... >> ??? "style", "slider", ... >> ??? "tag", "slide1", ... >> ??? "backgroundcolor", [1 1 1], ... >> ??? "value", 0, ... >> ??? "min", -100, ... >> ??? "max", 100, ... >> ??? "sliderstep", [1, 10], ... >> ??? "position", [20,40,200,20], ... >> ??? "constraints", createConstraints("border", "top"), ... >> ??? "callback", "funcb1"); >> >> function? funcb1() >> ??? disp(typeof(gcbo)); >> ??? gcbo.callback_type=-1; >> ??? disp(typeof(gcbo)); >> ??? gcbo.callback_type=0; >> endfunction >> >> >> hs2=uicontrol(h, ... >> ??? "style", "slider", ... >> ??? "tag", "slide1", ... >> ??? "backgroundcolor", [1 1 1], ... >> ??? "value", 0, ... >> ??? "min", -100, ... >> ??? "max", 100, ... >> ??? "sliderstep", [1, 10], ... >> ??? "position", [20,80,200,20], ... >> ??? "constraints", createConstraints("border", "top"), ... >> ??? "callback", "funcb2"); >> >> function? funcb2() >> ??? disp(typeof(gcbo)); >> ??? set(gcbo, "callback_type",-1); >> ??? disp(typeof(gcbo)); >> ??? set(gcbo, "callback_type",0) >> endfunction >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >> > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > From ludovic.wagner31 at gmail.com Sat Sep 29 11:53:37 2018 From: ludovic.wagner31 at gmail.com (Orbeaman) Date: Sat, 29 Sep 2018 02:53:37 -0700 (MST) Subject: [Scilab-users] Scilab 6.0.1 extremely slow on new (high-end) laptop Message-ID: <1538214817520-0.post@n3.nabble.com> Hello, I received my new laptop a few days ago and found out that Scilab 6.0.1 is extremely slow. I would say that it takes about twice the time in comparison to my previous laptop - New laptop (available since since June 2018) I9-8950HK GTX 1080 with 1 x 16GB RAM SSD RAID 0 Windows 10 Home Version 1803 - Old laptop (purcharsed in 2009) I7-720QM GT 240M with 2 x 2GB RAM Linux 19.1 Mint Basically, I would expect my new laptop to run Scilab much faster (it is also almost 4 times more expensive).. I'm really disappointed!! Is it possible that Scilab is not optimised for I9 CPU or Windows 10? Does anyone encounter similar issues? Many thanks -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html From sgougeon at free.fr Sat Sep 29 12:10:16 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Sat, 29 Sep 2018 12:10:16 +0200 Subject: [Scilab-users] bug when setting gcbo field in a callback function ? In-Reply-To: References: <3c4c2a81-a832-842c-4ce6-cde22922317f@laas.fr> <07b1519a-328d-947c-5968-ca3d7746df51@utc.fr> Message-ID: <17fd9bd0-d569-48df-5104-51c53c45f06f@free.fr> Le 29/09/2018 ? 00:31, antoine monmayrant a ?crit : > Hello St?phane, > > Well, I tried exactly this trick with mixed results: it kind of works > most of the time, but sometimes it fails. > I did not manage to reproduce the issue with my minimum working > example though. > > It's weird, no? > Why would gcbo behave differently than h? > > As for why "set" is working, while "gcbo.whatever=something" is > failing, I think it's because something goes wrong when scilab is > parsing "gcbo.whatever=something". > It is as if scilab forgot about the fact that gcbo exists and does > what we expect when creating a struct: > doesnotexists.whatever=something; > creates a "doesnotexists" struct with one field==something. This bug exists at least since Scilab 5.3.3 (not tested with older versions) and is not yet reported. Samuel From antoine.monmayrant at laas.fr Sat Sep 29 12:47:40 2018 From: antoine.monmayrant at laas.fr (antoine monmayrant) Date: Sat, 29 Sep 2018 12:47:40 +0200 Subject: [Scilab-users] bug when setting gcbo field in a callback function ? In-Reply-To: <17fd9bd0-d569-48df-5104-51c53c45f06f@free.fr> References: <3c4c2a81-a832-842c-4ce6-cde22922317f@laas.fr> <07b1519a-328d-947c-5968-ca3d7746df51@utc.fr> <17fd9bd0-d569-48df-5104-51c53c45f06f@free.fr> Message-ID: <85583a4c-6299-a848-dc19-28a851502370@laas.fr> Le 29/09/2018 ? 12:10, Samuel Gougeon a ?crit?: > Le 29/09/2018 ? 00:31, antoine monmayrant a ?crit : >> Hello St?phane, >> >> Well, I tried exactly this trick with mixed results: it kind of works >> most of the time, but sometimes it fails. >> I did not manage to reproduce the issue with my minimum working >> example though. >> >> It's weird, no? >> Why would gcbo behave differently than h? >> >> As for why "set" is working, while "gcbo.whatever=something" is >> failing, I think it's because something goes wrong when scilab is >> parsing "gcbo.whatever=something". >> It is as if scilab forgot about the fact that gcbo exists and does >> what we expect when creating a struct: >> ??? doesnotexists.whatever=something; >> creates a "doesnotexists" struct with one field==something. > > This bug exists at least since Scilab 5.3.3 (not tested with older > versions) and is not yet reported. u He, he, I assume that we are all guilty here, right? ;-) So here it is: http://bugzilla.scilab.org/show_bug.cgi?id=15786 Could some of you try it on their preferred platform/scilab_version and comment on the bug report accordingly? I also got this problem (a handle turning into a struct) when updating a graphic handle field quickly inside a loop. It's less frequent and I never managed to reproduce the bug in a deterministic way so I never reported it. Of course, whenever I faced this bug, trying to pause and run the code step-by-step does not show any bug. Could there be some sort of race condition here, like when you access the handle fields too many times too quickly, scilab does as if the handle does not exists and interpret your code as the creation of a new struct with a given field? Cheers, Antoine > > Samuel > > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > From antoine.monmayrant at laas.fr Sat Sep 29 12:54:11 2018 From: antoine.monmayrant at laas.fr (antoine monmayrant) Date: Sat, 29 Sep 2018 12:54:11 +0200 Subject: [Scilab-users] Scilab 6.0.1 extremely slow on new (high-end) laptop In-Reply-To: <1538214817520-0.post@n3.nabble.com> References: <1538214817520-0.post@n3.nabble.com> Message-ID: Hello Ludovic, No, I've never seen something like that. But it's sure you won't get the same build under Win10 and a vanilla linux install. On Windows, I know you can choose between Intel optimized libraries and base ones, and on linux, it depends on whether you rebuild for your machine or use the default binaries from the repos. If you use a version that was optimized for a different CPU, you might not get the best performance. Here is what you can try:? you can boot the very same usb linux live session (recent Ubuntu for example), install scilab and run a test script on both your old and new laptop. That way we could try to compare two situations where only the machine is changing (not the os, not the scilab build). If you want, I can try to run the same script on different machines ranging from really old to fairly new... Cheers, Antoine Le 29/09/2018 ? 11:53, Orbeaman a ?crit?: > Hello, > > I received my new laptop a few days ago and found out that Scilab 6.0.1 is > extremely slow. I would say that it takes about twice the time in comparison > to my previous laptop > > - New laptop (available since since June 2018) > I9-8950HK GTX 1080 with 1 x 16GB RAM SSD RAID 0 Windows 10 Home Version 1803 > > - Old laptop (purcharsed in 2009) > I7-720QM GT 240M with 2 x 2GB RAM Linux 19.1 Mint > > Basically, I would expect my new laptop to run Scilab much faster (it is > also almost 4 times more expensive).. I'm really disappointed!! Is it > possible that Scilab is not optimised for I9 CPU or Windows 10? > > Does anyone encounter similar issues? > > Many thanks > > > > -- > Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html > _______________________________________________ > users mailing list > users at lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users > From stephane.mottelet at utc.fr Sat Sep 29 13:05:22 2018 From: stephane.mottelet at utc.fr (=?utf-8?Q?St=C3=A9phane_Mottelet?=) Date: Sat, 29 Sep 2018 13:05:22 +0200 Subject: [Scilab-users] bug when setting gcbo field in a callback function ? In-Reply-To: <85583a4c-6299-a848-dc19-28a851502370@laas.fr> References: <3c4c2a81-a832-842c-4ce6-cde22922317f@laas.fr> <07b1519a-328d-947c-5968-ca3d7746df51@utc.fr> <17fd9bd0-d569-48df-5104-51c53c45f06f@free.fr> <85583a4c-6299-a848-dc19-28a851502370@laas.fr> Message-ID: <1E0A4216-7B9A-4CBC-8113-441051DF9B8D@utc.fr> Hello Antoine There are multiple other problems like this one, solved when inserting a pause or a sleep. They are java synchronization problems, likely.... S. > Le 29 sept. 2018 ? 12:47, antoine monmayrant a ?crit : > > > >> Le 29/09/2018 ? 12:10, Samuel Gougeon a ?crit : >>> Le 29/09/2018 ? 00:31, antoine monmayrant a ?crit : >>> Hello St?phane, >>> >>> Well, I tried exactly this trick with mixed results: it kind of works most of the time, but sometimes it fails. >>> I did not manage to reproduce the issue with my minimum working example though. >>> >>> It's weird, no? >>> Why would gcbo behave differently than h? >>> >>> As for why "set" is working, while "gcbo.whatever=something" is failing, I think it's because something goes wrong when scilab is parsing "gcbo.whatever=something". >>> It is as if scilab forgot about the fact that gcbo exists and does what we expect when creating a struct: >>> doesnotexists.whatever=something; >>> creates a "doesnotexists" struct with one field==something. >> >> This bug exists at least since Scilab 5.3.3 (not tested with older versions) and is not yet reported. u > He, he, I assume that we are all guilty here, right? ;-) > So here it is: https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=15786 > Could some of you try it on their preferred platform/scilab_version and comment on the bug report accordingly? > > I also got this problem (a handle turning into a struct) when updating a graphic handle field quickly inside a loop. > It's less frequent and I never managed to reproduce the bug in a deterministic way so I never reported it. > Of course, whenever I faced this bug, trying to pause and run the code step-by-step does not show any bug. > Could there be some sort of race condition here, like when you access the handle fields too many times too quickly, scilab does as if the handle does not exists and interpret your code as the creation of a new struct with a given field? > > Cheers, > > Antoine >> >> Samuel >> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >> > > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users From sgougeon at free.fr Sat Sep 29 13:10:14 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Sat, 29 Sep 2018 13:10:14 +0200 Subject: [Scilab-users] Scilab 6.0.1 extremely slow on new (high-end) laptop In-Reply-To: <1538214817520-0.post@n3.nabble.com> References: <1538214817520-0.post@n3.nabble.com> Message-ID: <745953e3-9a81-9e6f-0ecf-c8e40279db26@free.fr> Le 29/09/2018 ? 11:53, Orbeaman a ?crit : > Hello, > > I received my new laptop a few days ago and found out that Scilab 6.0.1 is > extremely slow. I would say that it takes about twice the time in comparison > to my previous laptop > > - New laptop (available since since June 2018) > I9-8950HK GTX 1080 with 1 x 16GB RAM SSD RAID 0 Windows 10 Home Version 1803 > > - Old laptop (purcharsed in 2009) > I7-720QM GT 240M with 2 x 2GB RAM Linux 19.1 Mint > > Basically, I would expect my new laptop to run Scilab much faster (it is > also almost 4 times more expensive).. I'm really disappointed!! Is it > possible that Scilab is not optimised for I9 CPU or Windows 10? > > Does anyone encounter similar issues? Somewhat yes. On my PC/win7, it occurs when i use a new Scilab version for the first time. Then, my antivirus scans newly called DLL, what takes some time. But it occurs only the first time a DLL is required and called. Next calls are performed with no special delay. BR Samuel From stephane.mottelet at utc.fr Sat Sep 29 18:16:20 2018 From: stephane.mottelet at utc.fr (=?UTF-8?Q?St=c3=a9phane_Mottelet?=) Date: Sat, 29 Sep 2018 18:16:20 +0200 Subject: [Scilab-users] bug when setting gcbo field in a callback function ? In-Reply-To: <1E0A4216-7B9A-4CBC-8113-441051DF9B8D@utc.fr> References: <3c4c2a81-a832-842c-4ce6-cde22922317f@laas.fr> <07b1519a-328d-947c-5968-ca3d7746df51@utc.fr> <17fd9bd0-d569-48df-5104-51c53c45f06f@free.fr> <85583a4c-6299-a848-dc19-28a851502370@laas.fr> <1E0A4216-7B9A-4CBC-8113-441051DF9B8D@utc.fr> Message-ID: Another example of such weirdness: consider (fixed) bug #13359. Its non-regression test fail (at least on my OSX and Linux machines) systematicaly when run by --> test_run cacsd bug_13359 When run interactively by --> exec SCI/modules/cacsd/tests/nonreg_tests/bug_13359.tst it sometimes succeed and sometimes fail, this completely random. However, if you insert a sleep line 25 (...) d1 = datatipCreate(pl, 200); sleep(10) // line inserted txt_datatip = d1.text; assert_checkequal(strindex(txt_datatip(2), "-"), 1); Then the test, executed by exec SCI/... above, always succeed. However, even with a bigger duration of sleep, even sleep(1000), then "test_run cacsd bug_13359" always fail. S. Le 29/09/2018 ? 13:05, St?phane Mottelet a ?crit?: > Hello Antoine > > There are multiple other problems like this one, solved when inserting a pause or a sleep. They are java synchronization problems, likely.... > > S. > >> Le 29 sept. 2018 ? 12:47, antoine monmayrant a ?crit : >> >> >> >>> Le 29/09/2018 ? 12:10, Samuel Gougeon a ?crit : >>>> Le 29/09/2018 ? 00:31, antoine monmayrant a ?crit : >>>> Hello St?phane, >>>> >>>> Well, I tried exactly this trick with mixed results: it kind of works most of the time, but sometimes it fails. >>>> I did not manage to reproduce the issue with my minimum working example though. >>>> >>>> It's weird, no? >>>> Why would gcbo behave differently than h? >>>> >>>> As for why "set" is working, while "gcbo.whatever=something" is failing, I think it's because something goes wrong when scilab is parsing "gcbo.whatever=something". >>>> It is as if scilab forgot about the fact that gcbo exists and does what we expect when creating a struct: >>>> doesnotexists.whatever=something; >>>> creates a "doesnotexists" struct with one field==something. >>> This bug exists at least since Scilab 5.3.3 (not tested with older versions) and is not yet reported. u >> He, he, I assume that we are all guilty here, right? ;-) >> So here it is: https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=15786 >> Could some of you try it on their preferred platform/scilab_version and comment on the bug report accordingly? >> >> I also got this problem (a handle turning into a struct) when updating a graphic handle field quickly inside a loop. >> It's less frequent and I never managed to reproduce the bug in a deterministic way so I never reported it. >> Of course, whenever I faced this bug, trying to pause and run the code step-by-step does not show any bug. >> Could there be some sort of race condition here, like when you access the handle fields too many times too quickly, scilab does as if the handle does not exists and interpret your code as the creation of a new struct with a given field? >> >> Cheers, >> >> Antoine >>> Samuel >>> >>> _______________________________________________ >>> users mailing list >>> users at lists.scilab.org >>> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users >>> >> _______________________________________________ >> users mailing list >> users at lists.scilab.org >> https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users > _______________________________________________ > users mailing list > users at lists.scilab.org > https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users From christian_gabriel3 at yahoo.es Sat Sep 29 18:41:29 2018 From: christian_gabriel3 at yahoo.es (Gabriel Calderon) Date: Sat, 29 Sep 2018 16:41:29 +0000 (UTC) Subject: [Scilab-users] Portability References: <1031464627.1279576.1538239289621.ref@mail.yahoo.com> Message-ID: <1031464627.1279576.1538239289621@mail.yahoo.com> ?? I have made a working? simulator with XCOS in Scilab 5.5.2, on MacOS. I've try to run it on the same Scilab version on WindowsXP and the plots appear distorted. ?? What could be the reason? ????? Thanks in advance,?? ????????? Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Sat Sep 29 21:38:57 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Sat, 29 Sep 2018 21:38:57 +0200 Subject: [Scilab-users] bug when setting gcbo field in a callback function ? In-Reply-To: References: <3c4c2a81-a832-842c-4ce6-cde22922317f@laas.fr> <07b1519a-328d-947c-5968-ca3d7746df51@utc.fr> <17fd9bd0-d569-48df-5104-51c53c45f06f@free.fr> <85583a4c-6299-a848-dc19-28a851502370@laas.fr> <1E0A4216-7B9A-4CBC-8113-441051DF9B8D@utc.fr> Message-ID: <30097509-49fe-7c68-7e22-cae0c27daf08@free.fr> Le 29/09/2018 ? 18:16, St?phane Mottelet a ?crit : > Another example of such weirdness: consider (fixed) bug #13359. Its > non-regression test fail (at least on my OSX and Linux machines) > systematicaly when run by > > --> test_run cacsd bug_13359 > > When run interactively by > > --> exec SCI/modules/cacsd/tests/nonreg_tests/bug_13359.tst > > it sometimes succeed and sometimes fail, this completely random. > However, if you insert a sleep line 25 > > (...) > d1 = datatipCreate(pl, 200); > sleep(10) // line inserted > txt_datatip = d1.text; > assert_checkequal(strindex(txt_datatip(2), "-"), 1); > > Then the test, executed by exec SCI/... above, always succeed. > However, even with a bigger duration of sleep, even sleep(1000), then > "test_run cacsd bug_13359" always fail. A follow-up is proposed on dev@ starting at http://mailinglists.scilab.org/Re-Scilab-users-bug-when-setting-gcbo-field-in-a-callback-function-tp4038626.html Samuel From sgougeon at free.fr Sat Sep 29 21:52:52 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Sat, 29 Sep 2018 21:52:52 +0200 Subject: [Scilab-users] Portability In-Reply-To: <1031464627.1279576.1538239289621@mail.yahoo.com> References: <1031464627.1279576.1538239289621.ref@mail.yahoo.com> <1031464627.1279576.1538239289621@mail.yahoo.com> Message-ID: Le 29/09/2018 ? 18:41, Gabriel Calderon a ?crit : > I have made a working simulator with XCOS in Scilab 5.5.2, on > MacOS. I've try to run it on the same Scilab version on WindowsXP and > the plots appear distorted. > > What could be the reason? Hello Gabriel, Would you mind trying with the most recent Scilab version, available there, and tell us if it's OK?: http://www.scilab.org/en/development/nightly_builds/branch60 Thanks Samuel PS : installing it does not demand uninstalling your current Scilab version. You may use both in parallel. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cfuttrup at gmail.com Sun Sep 30 20:59:58 2018 From: cfuttrup at gmail.com (Claus Futtrup) Date: Sun, 30 Sep 2018 20:59:58 +0200 Subject: [Scilab-users] Fetching the script path Message-ID: Hi Scilabers I have almost always included a neat piece of code in my Scilab scripts, so that I can later dump the plots into e.g.? SVG or PNG files (script path is not write-protected). The code doesn't work anymore: // Extract the filename and path of this script: [units,typs,nams]=file(); // nams(1) = script file name incl. path fpathname=strsplit(nams(1), [filesep()]); // disp(b($-1)); scriptpath = get_absolute_file_path(fpathname($)); chdir(scriptpath); The above code returns an empty string in scriptpath. I'm using Scilab 6.0.1 (Windows 10) and I wonder what I should do instead? /Claus --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: From sgougeon at free.fr Sun Sep 30 22:03:55 2018 From: sgougeon at free.fr (Samuel Gougeon) Date: Sun, 30 Sep 2018 22:03:55 +0200 Subject: [Scilab-users] Fetching the script path In-Reply-To: References: Message-ID: Le 30/09/2018 ? 20:59, Claus Futtrup a ?crit : > > Hi Scilabers > > I have almost always included a neat piece of code in my Scilab > scripts, so that I can later dump the plots into e.g. SVG or PNG > files (script path is not write-protected). The code doesn't work anymore: > > // Extract the filename and path of this script: > [units,typs,nams]=file(); // nams(1) = script file name incl. path > fpathname=strsplit(nams(1), [filesep()]); // disp(b($-1)); > scriptpath = get_absolute_file_path(fpathname($)); > chdir(scriptpath); > > The above code returns an empty string in scriptpath. I'm using Scilab > 6.0.1 (Windows 10) and I wonder what I should do instead? > The following should work. In Scilab 6, file() additionally lists stderr as unit #0. Samuel [units,typs, nams]= file(); nams(find(units==0 | units==5 | units==6)) = []; scriptpath = fileparts(nams($),"path"); chdir(scriptpath); -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.s.strom at hslmg.de Sun Sep 30 23:17:38 2018 From: j.s.strom at hslmg.de (Jens Simon Strom) Date: Sun, 30 Sep 2018 23:17:38 +0200 Subject: [Scilab-users] Punch a hole into a facet Message-ID: <5BB13D72.8060308@hslmg.de> Hallo Scilab friends, Is there a way to punch a*peak through* hole into a rectangle? The result below looks like a hole but it is just white intransparent color. xdel(); xf=[1;-1;-1;1]; yf=[1;1;-1;-1]; zf=[0;0;0;0]; plot3d(xf,yf,list(zf,5))//Facet ce=gce(); ce.hiddencolor = 5; xf=0.5*[1;-1;-1;1]; yf=0.5*[1;1;-1;-1]; zf=[0;0;0;0]; plot3d(xf,yf,list(zf,8))//Hole ce=gce(); ce.hiddencolor = 8; Cheers Jens -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.s.strom at hslmg.de Sun Sep 30 23:35:52 2018 From: j.s.strom at hslmg.de (Jens Simon Strom) Date: Sun, 30 Sep 2018 23:35:52 +0200 Subject: [Scilab-users] Punch a hole into a facet In-Reply-To: <5BB13D72.8060308@hslmg.de> References: <5BB13D72.8060308@hslmg.de> Message-ID: <5BB141B8.1060505@hslmg.de> Hallo Scilab friends, Is there a way to punch a*peak through* hole into a rectangle? The result below looks like a hole but it is just white intransparent color. xdel(); xf=[1;-1;-1;1]; yf=[1;1;-1;-1]; zf=[0;0;0;0]; plot3d(xf,yf,list(zf,5))//Facet ce=gce(); ce.hiddencolor = 5; xf=0.5*[1;-1;-1;1]; yf=0.5*[1;1;-1;-1]; zf=[0;0;0;0]; plot3d(xf,yf,list(zf,8))//Hole ce=gce(); ce.hiddencolor = 8; Cheers Jens -------------- next part -------------- An HTML attachment was scrubbed... URL: