Re: [Scilab-users] interpreting showprofile results
Hi Samuel, Thank you for your reply. I am using SciLab 5.5.1. I will try to multiply the results by 1000; in the meantime, since this bug should be fixed in the version I downloaded, please let me know if there's something else I can do. Candio -- View this message in context: http://mailinglists.scilab.org/interpreting-showprofile-results-tp4031384p4031409.html Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com. ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] interpreting showprofile results
In the meantime, I did try to multiply by 1000, but it appears that the results are identically equal to 0 - not just off an order of magnitude. format(20); profile(myfun) ans = 0.0.0. 0.0.0. 0.0.4. 0.0.4. 0.0.4. 0.0.4. 0.0.4. ans(:,2) = ans(:,2)*1000 ans = 0.0.0. 0.0.0. 0.0.4. 0.0.4. 0.0.4. 0.0.4. 0.0.4. 0.0.4. --ans(:,1) ans = 0. 0. 0. 0. 0. 0. 0. Candio On Tue, Oct 21, 2014 at 8:55 AM, Candio [via Scilab / Xcos - Mailing Lists Archives] ml-node+s994242n4031409...@n3.nabble.com wrote: Hi Samuel, Thank you for your reply. I am using SciLab 5.5.1. I will try to multiply the results by 1000; in the meantime, since this bug should be fixed in the version I downloaded, please let me know if there's something else I can do. Candio -- If you reply to this email, your message will be added to the discussion below: http://mailinglists.scilab.org/interpreting-showprofile-results-tp4031384p4031409.html To unsubscribe from interpreting showprofile results, click here http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4031384code=c29tZXBoYW50YXN0aWtAZ21haWwuY29tfDQwMzEzODR8LTEwNTE1ODU5MA== . NAML http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context: http://mailinglists.scilab.org/interpreting-showprofile-results-tp4031384p4031415.html Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Problems using save
Thanks Ezequiel! Samuel, you were totally right, so many thanks ;-) Upgrading to 5.5.2 it solved the graphical window and it now allows me to save matrices in the files. Saving work relatively fast and loading afterwards takes quite long (the saved file that is produced is aprox 50MB), but it doesn't seem to be leaking memory any more. Thanks again! Matias On Tue, Oct 21, 2014 at 9:45 PM, Samuel GOUGEON [via Scilab / Xcos - Mailing Lists Archives] ml-node+s994242n4031413...@n3.nabble.com wrote: Hello, Le 21/10/2014 18:24, Matiasb a écrit : Hi, After executing a script that creates a lot of variables and big matrices, I'm trying to make a backup of what it created. A good option would be to save all variables to a file, as the save https://help.scilab.org/docs/5.4.1/en_US/save.html function allows when a list of variables is not specified. Something like: save('backup.dat') But when I use this function I found 2 problems: 1) Very strangely, it opens a graph window with some plots. Screenshot: Selection_420.png http://mailinglists.scilab.org/file/n4031410/Selection_420.png 2) when there are a lot of variables it takes veeery long, the scilab process uses 2GB of mem. If there are big matrices the scilab process hangs completely. *For 1)* I tried to track it and I could reproduce with a simple example: the problem occurs when I define a function that uses some graph function. For example, creating a test.sce file with the following function: // test.sce function []=MyTest() xtitle(Testing save); endfunction Then in the console: clear; // just to start from scratch This leads lower than scratch, rather to ground. exec('test.sce', -1); save('backup.dat'); // this opens the graph window! Which Scilab version are you using? If 5.5.0, i guess that this is due to this bug: http://bugzilla.scilab.org/show_bug.cgi?id=10243, that was fixed in november 2013. In this case, upgrading your Scilab should fix the case you met. .../... Is there a way for me to store all this created variables in a file without these problems? Maybe solving 1) will fix it. Indeed, may be. Many memory leaks were fixed between Scilab 5.4.1 5.5.0 PD: I'm using scilab 5.4.1 in Linux. Aa! So: upgrade to 5.5.1! Regards Samuel ___ users mailing list [hidden email] http://user/SendEmail.jtp?type=nodenode=4031413i=0 http://lists.scilab.org/mailman/listinfo/users -- If you reply to this email, your message will be added to the discussion below: http://mailinglists.scilab.org/Problems-using-save-tp4031410p4031413.html To unsubscribe from Problems using save, click here http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4031410code=bWF0aWFzYkBnbWFpbC5jb218NDAzMTQxMHwtNTQ0MzM3NTk2 . NAML http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml -- View this message in context: http://mailinglists.scilab.org/Problems-using-save-tp4031410p4031417.html Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
[Scilab-users] Creating lists in API_Scilab
Hi! I am writing a C extension to Scilab which recursively should create a nested list and return it. How can I achieve this? I have read the documentation here: http://help.scilab.org/docs/5.5.1/en_US/section_281790c19f32a08419bf50d192e51020.html? And I still don't understand if I can use these functions to recursively add elements to a list as the program runs. Or should I instead use some kind of internal C representation and just call those list functions just before returning the end result back to Scilab? Best Regards, Arvid ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
[Scilab-users] Saving and Loading big data
Hi, Just yesterday I solved some issues I was experiencing with the save function by upgrading to scilab 5.5.1 as suggested by Samuel in this thread http://mailinglists.scilab.org/Problems-using-save-td4031410.html . Now, being able to save all the environment variables, I'm experiencing the next problem when there is a lot of data to be saved/loaded. The first one to have problems is the load function. My script created several (aprox 200) big matrices and when they are saved they produce a 850MB file. The save function works well in this case, but when I try to load the variables back again scilab runs out of memory as shown below. If the scripts creates even bigger matrices, scilab can handle them, but when I try calling save it does not work (also the problematic code below). Scilab can handle these big matrices, but is there anything I can do to make a reliable backup of them? For example increasing scilab's stacksize even more (which it states its maximum is 268435455, but my PC has more RAM can be used). Or using save/load in a more efficient way so that they don't require so much extra memory in the stack. Any help would be appreciated. Thanks you very much! Code samples *Load* I make the backup as follows: -- stacksize('max') // increase scilab memory -- save('bigFile.sod') And when I load the backup again I get the following error: -- stacksize('max') // increase scilab memory -- load('bigFile.sod) * !--error 17 stack size exceeded! Use stacksize function to increase it. Memory used for variables: 90307998 Intermediate memory needed: 180528916 Total memory available: 268435455 at line 971 of function %_sodload called by : load('ScilabLogs/local_39DCM_100HZ_20141022_142845.sod')* Just to get an idea of the amout of variables and sizes: -- [names, typs, dims, vols] = listvarinfile('ScilabLogs/local_39DCM_100HZ_20141022_142845.sod'); -- size(names) -- 237 -- sum(vols) -- 8.920D+08 Some of the matrices are big: Name Type SizeBytes CoreSwitchQueueR_discard constant 9 by 113654681831328 CoreSwitchQueueR_queueLe constant 9 by 113654681831328 CoreSwitchQueueR_t constant 9 by 113654681831328 CoreSwitchQueueR_waittim constant 9 by 113654681831328 *save* When make the backup I get the following error : -- stacksize('max') // increase scilab memory -- save('bigFile.sod') *stack size exceeded! Use stacksize function to increase it. Memory used for variables: 235237999 Intermediate memory needed: 44657871 Total memory available: 268435455 at line 71 of function evstr called by : at line1003 of function %_save called by : save(backupDirectory + logFileName + '.sod'); // saving all variables !--error 4 Undefined variable: %val* The output from 'whos' shows that there are huge matrices, but I can manipulate them without problem as long as I dont call save. -- whos Name Type Size Bytes . RejectedEv_arrived constant 15 by 299353592216 RejectedEv_evBuiltLatenc constant 15 by 299353592216 RejectedEv_L2Latency constant 15 by 299353592216 RejectedEv_packetLatency constant 15 by 299353592216 RejectedEv_roundTripLate constant 15 by 299353592216 RejectedEv_t constant 15 by 299353592216 HLTSV_idlePUsconstant 15 by 598727184656 HLTSV_queuedEventsToSend constant 15 by 598727184656 HLTSV_sent constant 15 by 598727184656 HLTSV_t constant 15 by 598727184656 coreSwitchQueueCapacity constant 1 by 1 24 CoreSwitchQueueR_discard constant 8 by 5582233 3.573D+08 CoreSwitchQueueR_queueLe constant 8 by 5582233 3.573D+08 CoreSwitchQueueR_t constant 9 by 5582233 4.019D+08 CoreSwitchQueueR_waittim constant 8 by 5582233 3.573D+08 . -- View this message in context: http://mailinglists.scilab.org/Saving-and-Loading-big-data-tp4031419.html Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com. ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] interpreting showprofile results
Hello Candio, I just caught it: add_profile() prepares the function to profiling. But then, the profile is really set when calling the function. Each new call cumulates the execution time and occurrence numbers for each line. In your case, you did not call the function at all before asking to display its profile. After add_profile, and before any profile display (profile, showprofile, ..), just call the function ; actually execute it. Then, you will see its profile actualized with non-null results. Regards Samuel - Mail original - De: Candio somephantas...@gmail.com À: users@lists.scilab.org Envoyé: Mardi 21 Octobre 2014 22:42:42 Objet: Re: [Scilab-users] interpreting showprofile results In the meantime, I did try to multiply by 1000, but it appears that the results are identically equal to 0 - not just off an order of magnitude. format(20); profile(myfun) ans = 0. 0. 0. 0. 0. 0. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. ans(:,2) = ans(:,2)*1000 ans = 0. 0. 0. 0. 0. 0. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. 0. 0. 4. --ans(:,1) ans = 0. 0. 0. 0. 0. 0. 0. Candio On Tue, Oct 21, 2014 at 8:55 AM, Candio [via Scilab / Xcos - Mailing Lists Archives] [hidden email] wrote: Hi Samuel, Thank you for your reply. I am using SciLab 5.5.1. I will try to multiply the results by 1000; in the meantime, since this bug should be fixed in the version I downloaded, please let me know if there's something else I can do. Candio If you reply to this email, your message will be added to the discussion below: http://mailinglists.scilab.org/interpreting-showprofile-results-tp4031384p4031409.html To unsubscribe from interpreting showprofile results, click here . NAML View this message in context: Re: interpreting showprofile results Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com. ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Problem with partial fraction decomposition (dfss)
Now you are using a too big value for rmax --pf = pfss(h) pf = pf(1) 0.75 - 0.25s 2 1 - 2s + s pf(2) 0.25 1 + s Some explanation pfss converts the transfer function to state space representation and then trie to diagonalize the state matrix using the bdiag function --S=tf2ss(h); --bdiag(S.A) ans = 1.000 - 1.22474490. 0. 1. 0. 0. 0. - 1. You can see with result above that there is a 2 by 2 jordan block (for the eigenvalue 1) which exhibits a coupling between the two states Now with --bdiag(S.A,1/%eps) ans = 1.0000.0. 0. 1.0. 0. 0. - 1. The Jordan block has been broken [Ab,X]=bdiag(S.A,1/%eps);cond(X) ans = 5.074D+14 bdiag has broken the jordan block using a singular base change so the decomposition is a non-sense. Serge Steer Le 21/10/2014 12:07, Tin Nguyen a écrit : Dear Serge Steer, Thank you very much for your response. Your code works fine. However, I still have some problem with this pfss function. For example, I try to decompose a fractional polynomial that has multi-order poles. H(z) = 1 / { (1-s)^2 * (1+s) } You can find following from my console: --s = poly(0,'s'); --h = 1 / ( (1 + s) * (1 - s)^2) h = 1 - 2 3 1 - s - s + s --pf = pfss(h, 1/%eps) pf = pf(1) - 9420237.9 - - 1.000 + s pf(2) 9420237.6 - - 1 + s pf(3) 0.25 1 + s I also checked: --pf(1)+pf(2) ans = 0.75 - 0.25s 2 1 - 2s + s I have no idea about this situation. Can you help me out! Thank you in advance! --Tin Nguyen -Original Message- From: users [mailto:users-boun...@lists.scilab.org] On Behalf Of Serge Steer Sent: Tuesday, October 14, 2014 6:36 PM To: users@lists.scilab.org Subject: Re: [Scilab-users] Problem with partial fraction decomposition (dfss) You just need to tune the rmax optionnal parameter pf = pfss(tf2ss(hz),5);length(pf) Serge Steer Le 13/10/2014 10:12, tinnguyen a écrit : Hi guys, I'm having trouble using scilab's function pfss to decompose a polynomial in order to do inverse Z transform. Following is my code: -- z = poly(0,'z') -- hz = z^2 / (1 - 6*z + 11*z^2 - 6*z^3) pf = pfss(tf2ss(hz)) -- length(pf) The fourth command returns '1'. However, I believe it should be 3. I also did the decomposition manually and got the result as: hz = 0.5/(1-z) + -1 / (1-2*z) + 0.5/(1-3*z). Nevertheless, if I change the numerator of hz from z^2 to z or z^3, pfss works correctly. I definitely have no idea!!!? :D Please take a look and correct me if i'm wrong. Thank you so much! -- View this message in context: http://mailinglists.scilab.org/Problem-with-partial-fraction-decomposi tion-dfss-tp4031331.html Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com. ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users