Re: [Scilab-users] [Scilab-Dev] Scilab releases schedule / End of Windows 32-bit support

2023-02-20 Thread Claus Futtrup

Dear Scilabers

I'm not a professional software developer, but a user of Scilab for more
than 10 years.

I am positive to a 6-month release schedule. I am also a bit surprised,
since last Scilab release was almost two years ago and I'm wondering how
the planned frequent release schedule can be kept.

I am in favor of keeping the versioning the way it has been for many
years, such that a version 7 is only expected for a major release, and
it might be many years in the future before it happens.

Personally I would like to see some releases that make major steps
(leaps) forward, not only bug fixes and minor updates. Incompatible
updates is allowed with major releases, if it serves a purpose.

Best regards,
Claus Futtrup

P.S. I haven't received any email from this mailing list since end of
April 2022.

___
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/



[Scilab-users] Next release?

2022-04-17 Thread Claus Futtrup

Dear Scilab team

Last release was 9 months ago and I was wondering if a new release is 
planned?


What is the target for improvements to be included in the next release?

Best regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Combinatorics

2022-04-15 Thread Claus Futtrup

Hi Mikhail and Scilabers

Thank you Mikhail for the equation with factorials, the URL to 
Wikipedia, and confirming my findings are OK (I really wasn't sure).
Although the specifics of my case (with codes on a lock) seems very 
constrained and 'special' - I suppose it is common after all.

It is interesting to see the math is quite simple.
It is also interesting to see the 'distribution' of combinations:

Buttons pushed  0   1   2   3   4   5   6   7   
8   9   10  Sum =
Combinations1   10  45  120 210 252 210 120 
45  10  1   1024


It is not that 'safe' of a lock because someone can decode it within an 
hour or so. If you take e.g. 5 seconds for trying each combo, we're 
talking about 1,4 hours to try all of them and maybe you hit jackpot 
somewhere in the middle.


It is not advisable to choose 0 or 1 buttons for the code. Coding 5 
random numbers to be pushed on the lock will give the highest number of 
combinations, but 4-6 buttons gives a suitable range of codes, 7 could 
also be OK. Although more buttons pushed gives fewer combinations, it's 
unlikely that e.g. a thief will start with a high number of buttons 
pushed (pure psychology).


From a decoding point of view, the most interesting part of the lock is 
that it isn't as simple as decoding a combination lock with 3 dials 
where you can easily keep track of how far you are. It becomes 
complicated and one kinda needs a look-up table to try all the 
combinations and it requires more concentration to go through all the 
combinations.


Cheers,
Claus

On 15-04-2022 17:59, Mikhail Urusov wrote:

Dear Claus,

Just in case you have not got an answer yet:

> I can 'invent' a calculation, which could be : =10*9*8/(3*2*1) = 120 
... if this indeed shows the internal workings, I'd like to know why. 
Sorry my combinatorics is so bad ... I


This is right. In general, the formula for the number of 
k-combinations of n elements is

n! / ( k! (n-k)! ).
Alternatively, you can write this as
n*(n-1)**(n-k+1) / (k!).
(This is the way you have written it above for n = 10 and k = 3.)
The explanation in general is quite similar to this case:

> Two buttons pushed. There's 10 * 9 / 2 = 45 combinations. Each 
button can only be pushed once, so once you've selected the first 
button, there's only 9 left, but also we divide by two because the 
combination are doubled, I mean for example the combination 1-2 = 2-1 
... the lock doesn't know the difference. If you spread out the 
possibilities in a 2D plane, it's like ignoring the diagonal (like 
pushing the same button twice) and also we either ignore the upper or 
lower triangle. Makes sense?


For example, for n=10 and k=4:
If you consider "arrangements", i.e., the combinations, where the 
order matters (e.g., 1-2-5-7 and 2-7-5-1 are different), then you have 
10*9*8*7 such arrangements (for the first button you have 10 variants, 
for the second one 9 variants, etc), but each "combination" (that is, 
where the order does not matter) is counted 4! (=1*2*3*4) times 
(number of permutations of 4 elements), so you need to divide: 
(10*9*8*7)/(4!).

For more information, see https://en.wikipedia.org/wiki/Combination

Best regards,
Mikhail


Am Do., 14. Apr. 2022 um 13:51 Uhr schrieb Claus Futtrup 
:


Dear Scilabers

I hope you can help me out. My combinatorics is a bit rusty.

So, the spouse has purchased a lock and I wondered how many
combinations are available?

The lock has 10 push buttons, they are numbered 1-2-3-4-5-6-7-8-9-0.

From a programming point of view, any of the numbers can be set on
or off, meaning there are 2^10 = 1024 combinations, as far as I
can see.

I wonder how they are distributed, and how many of the numbers I
should activate in the lock to maximize the number of combinations?

Let's see, we have:

None (none of the buttons are activated), there's exactly 1
combination for this situation. The lock is delivered from the
manufacturer in this state.

All (all of the buttons are activated), there's exactly 1
combination for this situation as well (no variability).

One button pushed. There's obviously 10 possible combinations
(push any one of the 10 buttons).

Two buttons pushed. There's 10 * 9 / 2 = 45 combinations. Each
button can only be pushed once, so once you've selected the first
button, there's only 9 left, but also we divide by two because the
combination are doubled, I mean for example the combination 1-2 =
2-1 ... the lock doesn't know the difference. If you spread out
the possibilities in a 2D plane, it's like ignoring the diagonal
(like pushing the same button twice) and also we either ignore the
upper or lower triangle. Makes sense?

Here starts my trouble. Three buttons pushed. Instead of looking
at a 2D plane, I guess you spread out in 3D. The diag

[Scilab-users] Combinatorics

2022-04-14 Thread Claus Futtrup

Dear Scilabers

I hope you can help me out. My combinatorics is a bit rusty.

So, the spouse has purchased a lock and I wondered how many combinations 
are available?


The lock has 10 push buttons, they are numbered 1-2-3-4-5-6-7-8-9-0.

From a programming point of view, any of the numbers can be set on or 
off, meaning there are 2^10 = 1024 combinations, as far as I can see.


I wonder how they are distributed, and how many of the numbers I should 
activate in the lock to maximize the number of combinations?


Let's see, we have:

None (none of the buttons are activated), there's exactly 1 combination 
for this situation. The lock is delivered from the manufacturer in this 
state.


All (all of the buttons are activated), there's exactly 1 combination 
for this situation as well (no variability).


One button pushed. There's obviously 10 possible combinations (push any 
one of the 10 buttons).


Two buttons pushed. There's 10 * 9 / 2 = 45 combinations. Each button 
can only be pushed once, so once you've selected the first button, 
there's only 9 left, but also we divide by two because the combination 
are doubled, I mean for example the combination 1-2 = 2-1 ... the lock 
doesn't know the difference. If you spread out the possibilities in a 2D 
plane, it's like ignoring the diagonal (like pushing the same button 
twice) and also we either ignore the upper or lower triangle. Makes sense?


Here starts my trouble. Three buttons pushed. Instead of looking at a 2D 
plane, I guess you spread out in 3D. The diagonal line is more than that 
- we have several planes where two of the three numbers are the same 
(and which are not allowed).


To help myself out, I've tried to write all combinations where one of 
the push buttons is number 1. We select all combinations with the second 
button being either 2-3-4 and so on, and how many combinations do we 
then have for the third option? See table below:


1-2-x   8
1-3-x   7
1-4-x   6
1-5-x   5
1-6-x   4
1-7-x   3
1-8-x   2
1-9-0   1

36

We can then do the same for the first button = number 2, and we get : 7 
+ 6 + 5 + 4 + 3 + 2 + 1 = 28 combinations and so on. We get:


1-x-y   36
2-x-y   28
3-x-y   21
4-x-y   15
5-x-y   10
6-x-y   6
7-x-y   3
8-9-0   1

120

OK, so that was with three buttons pushed. It's always good to know the 
answer (if it's correct :-/ I hope it is), but it's a tedious process 
and I was wondering if you could point me to an easy calculation 
instead? ... Ideally something that expands to 4 and 5 buttons.


I can 'invent' a calculation, which could be : =10*9*8/(3*2*1) = 120 ... 
if this indeed shows the internal workings, I'd like to know why. Sorry 
my combinatorics is so bad ... I haven't played in this field for a while.


Best regards,

Claus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Sundials module, macOS preview

2022-04-06 Thread Claus Futtrup

Hi Stéphane

This looks very good!

Cheers,
Claus

On 06-04-2022 19:35, Stéphane Mottelet wrote:

Hi all,

The next version of scilab will include a new module "Sundials". This 
module provides new full featured  ODE solvers: arkode(), cvode() and 
DAE solver ida(), all handling complex numbers and dense/sparse/banded 
Jacobians. Each solver has specific features, e.g. ida() handles DAE, 
arkode() handles mixed implicit/explicit Runge-Kutta methods and 
cvode() can do forward sensitivity computation.


The module also includes a general-purpose nonlinear system solver: 
kinsol(), who takes advantage of the module architecture (parsing, 
computation engine and SUNDIALS abstraction of various linear solvers).


Current help pages can be found @ 
https://www.utc.fr/~mottelet/scilab/sundials/ and a macOS build 
including the new module is available at


https://www.utc.fr/~mottelet/scilab_for_macOS.html

I hope that a Windows build will be available in a near future, but in 
the meantime, comments from macOS users are welcome !


Enjoy !



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] please help, I have just a mental blockade

2022-02-07 Thread Claus Futtrup

Hi Samuel, and all Scilabers

Entertaining response from Samuel!

It's about knowing that the cumsum function exist. :-)

I googled Scilab cumsum and found old docs that it was part of 
elementary matrix operations 
(https://help.scilab.org/doc/6.0.0/en_US/cumsum.html), but in Scilab 
6.1.1 this is part of a XCOS matrix palette.


Hmm.

The documentation for cumsum is now found under XCOS. What is the 
motivation behind this choice?


I wonder if this could be confusing - making us believe the module 
requires XCOS to be running.


Cheers,
Claus

On 07-02-2022 20:17, Samuel Gougeon wrote:

Hello Heinz,

Le 07/02/2022 à 18:35, Heinz Nabielek a écrit :

Sorry, colleagues  -   please help, I have just a mental blockade.

Given vector EE= [3 5 8]

I want to create a stepwise increasing vector E= [0 0 1 1 2 2 2 3 3 3 3]

And would need a system that works for much larger numbers

Probably dead easy?



--> v = zeros(1,15);
--> v([3 5 8]) = 1;
--> cumsum(v)
 ans  =
   0.   0.   1.   1.   2.   2.   2.   3.   3.   3.   3.   3. 3. 3.   3.


HTH
Samuel

___
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] please help, I have just a mental blockade

2022-02-07 Thread Claus Futtrup

Hi Heinz

I notice that the E-vector is longer than the largest numberin the 
EE-vector. What decides the length of the E-vector?


I was thinking length(EE) = 3 gives the highest number in the E-vector, 
and that e.g. max(EE) = 8 would be the length of the E-vector (but it's 
not ...), such that E = zeros(1:maxE) could be your initialization. This 
is why I ask, what decides the length of the E-vector?


How large are the numbers going to be? ... are we talking 
graphics/pictures in the mega-pixel range as input?


Best regards,
Claus

On 07-02-2022 18:35, Heinz Nabielek wrote:

Sorry, colleagues  -   please help, I have just a mental blockade.

Given vector EE= [3 5 8]

I want to create a stepwise increasing vector E= [0 0 1 1 2 2 2 3 3 3 3]

And would need a system that works for much larger numbers

Probably dead easy?
Heinz

___
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] xdel replaced by close()

2022-01-22 Thread Claus Futtrup

Hi Stephane

Good news, thank you.
Thank you to the other list members for the other responses as well.

Best regards,
Claus

On 22-01-2022 14:24, Stéphane Mottelet wrote:

Hi,

This is fixed for the next release:

https://codereview.scilab.org/#/c/21803/

In the meantime, if you really need it you can download the patched 
version of findobj.


S.


Le 21 janv. 2022 à 23:54, Samuel Gougeon  a écrit :


Hello Claus,

Le 21/01/2022 à 20:58, Claus Futtrup a écrit :

Hi Scilabers

Today I tried to replace xdel(winsid()) in one of my scripts with 
close(winsid()) because Scilab shows a warning in the console:


Warning: Feature xdel(...) is obsolete and will be permanently 
removed in Scilab 6.2


Warning: Please use close(...) instead.

I am negatively surprised that the close() command takes a long time 
to execute with 5-10 windows open (a few seconds per window). The 
xdel() command can do it in a split second.




The issue comes not from close() but from the change offindobj() that 
it calls <http://bugzilla.scilab.org/show_bug.cgi?id=13738#c4>, 
noticeably to perform findobj("figure_id",id) in 6.1.1.
It does not impact only <http://bugzilla.scilab.org/16734> close() 
for this case, that was processed as a special accelerated case 
<https://codereview.scilab.org/#/c/20953/6/scilab/modules/gui/macros/findobj.sci> 
in the former findobj().


This downgradingwas reported 
<http://bugzilla.scilab.org/show_bug.cgi?id=7117#c6> 7 months before 
releasing 6.1.1, and knowingly ignored, while it is perfectly fixable 
by restoring the fast special case.





What is the motivation for replacing xdel with close?


Both do the same thing. Scilab does not need duplicates.

Regards
Samuel

___
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


[Scilab-users] xdel replaced by close()

2022-01-21 Thread Claus Futtrup

Hi Scilabers

Today I tried to replace xdel(winsid()) in one of my scripts with 
close(winsid()) because Scilab shows a warning in the console:


Warning: Feature xdel(...) is obsolete and will be permanently removed 
in Scilab 6.2


Warning: Please use close(...) instead.

I am negatively surprised that the close() command takes a long time to 
execute with 5-10 windows open (a few seconds per window). The xdel() 
command can do it in a split second.


What is the motivation for replacing xdel with close?

Are there any plans to speed up the close() function?

Best regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] uman 3.1 is released

2021-12-22 Thread Claus Futtrup

Hi Samuel

Thank you for the update on uman. Good documentation and help is one of 
the most important essentials of any software.


BTW, Merry Christmas to everybody.

Cheers,
Claus

On 22-12-2021 12:21, Samuel Gougeon wrote:

uman 3.1 is released.

User manual in console. Advanced multimodal and multilingual Scilab 
documentation


  * https://atoms.scilab.org/toolboxes/uman/3.1
https://atoms.scilab.org/toolboxes/uman/3.1#leave_a_comment

  * Changes:
https://atoms.scilab.org/toolboxes/uman/3.1/files/changelog.txt

  * Manuals:
https://atoms.scilab.org/toolboxes/uman/3.1/files/uman_3.1_en.pdf
https://atoms.scilab.org/toolboxes/uman/3.1/files/uman_3.1_fr.pdf

Crashes on Scilab 6.1.1 are fixed.
@ mode: New mailing list archives are used. @d will search on dev@lists.
w mode (web): Version 6.1.0 is used for missing online pages v.6.1.1.
The user manual is now available as well in PDF (english, french).
16 improvements & bugs fixed.
26 references added.

Since Scilab 6.1.0, uman can be used in the Advanced console 
(supporting extended characters).


!-!-!-!
If you are installing uman 3.1 while you were already using uman on 
your computer,
please delete your SCIHOME/uman directory before the first run of uman 
3.1.

--

Best regards

Samuel


___
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] Reimann Zeta function

2021-11-29 Thread Claus Futtrup

Hi Lester

Please be reminded of the correct spelling : Riemann

Cheers,
Claus

On 29-11-2021 18:23, Lester Anderson wrote:

Hi all,

Found a bit of Matlab/Octave code to solve the Reimann Zeta function 
for values >= 0, not perfect but it's a start. Need to figure out how 
to deal with negative values.


Lester

// Reimann Zeta function: valid for t >= 0

function  f=F(x)
 f  =  1./(gamma(t(j))).*x.^(t(j)-1)./(exp(x)-1);
endfunction

function  [z]=zeta(t)
 global  x
   z  =  zeros(size(t));
   for  j  =  1:prod(size(t))
 if(real(t(j))  >=  0)
   if(imag(t(j))  ==  0  &&  real(t(j))  >  1)
 z(j)  =  intg(0,200,F)
   elseif(t(j)  ==  0)
 z(j)  =  -0.5;
   elseif(t(j)  ==  1)
 z(j)  =  %inf;
   else
 for  k  =  1:1:100
   z(j)  =  (-1).^(k-1)./(k.^t(j));
 end
 z(j)  =  1./(1-2.^(1-t(j))).*z(j);
   end
 else
   z(j)  =  
2.^t(j).*%pi.^(t(j)-1).*sin(%pi.*t(j)./2).*gamma(1-t(j)).*zeta(1-t(j));
   end
end

endfunction

On Mon, 29 Nov 2021 at 08:51, Heinz Nabielek  wrote:

Riemann zeta function !

Georg Friedrich Bernhard Riemann (17 September 1826 – 20 July
1866) was a German mathematician who made contributions to
analysis, number theory, and differential geometry.

Heinz



> On 29.11.2021, at 09:39, Lester Anderson 
wrote:
>
> Hello all,
>
> I am interested in the Reimann Zeta function, but it does not
appear as an option directly with Scilab (v6.1.1).
>
> Has anyone already prepared a function for this?
>
> Lester
> ___
> 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


Re: [Scilab-users] turn scilab theme into dark

2021-11-21 Thread Claus Futtrup


I share the concern.

Scilab 6.1.1 was released in July (a few months back).

Could we make a target for the next release (e.g. next spring or 
summer), maybe a wish list? ... something to work towards.


Best regards,
Claus

On 18-11-2021 11:48, Chin Luh Tan wrote:
It has been a while since I was away from the Scilab mailing list, in 
fact, I am of the opinion that the Scilab Developer Community seems to 
be reducing over time...


I was a half-cooked developer (maybe not even half-cooked) who had 
been playing around with Scilab for quite some time. I have to agree 
that after the ESI taking over, the Scilab team focus seems to be less 
on the "Community Version", and the enthusiasm of the Community 
Developers just could not heat up, as there are none official 
activities initiated from the ESI as per my understanding.


I do like Scilab, alot, but seeing this pace of moving, sooner or 
later, I worry that Scilab will eventually disappear... sorry to say 
that.


Regards,
Chin Luh




On Thu, 18 Nov 2021 at 18:32, Stéphane Mottelet 
 wrote:


Hi David,

Sorry for being rude but who in the (zombie) Scilab community
would have some time to develop such fancy stuff, when so many
basic things such as a decent html redering of help pages is
missing ? BTW you ask for a dark mode but Scilab is slowly but
irremediably sliding to darkness...

I was recently interviewed by students of a french engineering
school (not mine) on my feeling about the past, present and future
of Scilab, and one of the points I mentioned is the death of the
aforementioned community. First by its size then by its age
distribution and finally by its lack of investment in the
development of Scilab itself. The only newcomming users I have met
this year on StackOverflow are students who were told to do some
homework by their math teacher. None of the brilliant students I
meet each year in my course (which uses Scilab) are interested in
developping Scilab. Recently one of them was hired as a research
engineer at Inria to work in the Scikit-learn consortium hence
Python stuff !

When I read such (legitimate) demands as the one formulated by
David, I am not sure that actual Scilab users are aware of the
situation. One the one hand ESI hosts the rest of the Scilab team,
which has its own business plan and spends its time on
developments  which are not available to the community (e.g. the
Scilab Cloud), and on the other hand some (dumb ?) guys which
still spend (waste ?) their time to fix what they can fix or
consider to be fixed. I have to say that the Scilab team does help
us when we ask some help, but the initiative to fix this or that
must come from us.

As far as I am concerned I consider that working on solvers
(nonlinear equations, differential equations, optimization, ...)
is a priority of higher level than gui stuff. I met so many people
trying (and failing) to solve real/big problems with Scilab that I
could not just give up and tell them to use Matlab. That's why I
rewrote from scratch sci-ipopt in order to allow Scilab to solve
efficiently nonlinear optimization problems. That's why I am
currently interfacing the SUNDIALS ode/dae solvers (which are
already used in XCos). The Kinsol equation solver (also from
SUNDIALS) could also be interfaced, in order to provide an
alternative to the very poor lsqrsolve (missing features like
positivity constraints and sparse jacobian). However, when I write
help pages I realize the very poor rendering of them in Scilab
help browser (this is due to the very poor css support of actual
(Swing) html viewer). I have some helpfull hints for the
(unconscious) person who would want to spend some time on this
issue, provided that she/he knows Java.

If you think you can contribute to the debate just express yourself.

S.

Le 18/11/2021 à 09:20, CHEZE David 227480 a écrit :


Hi all,

I‘m wondering if anyone already looked for developing a “dark
mode” for Scilab look and feel, following dark mode or dark theme
selected in the OS. If not linked automatically to the OS theme,
then it might be custom colour and code colorization
configuration in this perspective that could be shared ?

Thank you for any hint,

David


___
users mailing list
users@lists.scilab.org

https://antispam.utc.fr/proxy/v3?i=MUo0RzFIRTVvbFhYVGloQoloZQj6tvqyhpERsn5z8Z4=cFdGNHFjVENnWDEzUVliSZqa92Ij_tTjl26kvR1TKYhrACGUUvf07czFMIQsHOTl=ODlJNFRJTjZBcWFlaWxQaCWHfP5TwO6tLcRB8udwSmRu_YmmB5TAisRDyjlFqOMc=http%3A//lists.scilab.org/mailman/listinfo/users=b1p5
  

Re: [Scilab-users] find all files of specific type on hard drive

2021-09-27 Thread Claus Futtrup

Hi Philipp

To extend on the proposal by Denis, for Windows there is the DOS 
commands, like:


DIR /S /B path\*.txt > result.lst

It will traverse all subdirectories and with the pipe generate a text 
file with the result (replace 'path' with your real-name parent folder 
path). The result.lst contains a list of all files (one per line) with 
their complete file-path-names.


Best regards,
Claus

On 27-09-2021 20:37, P M wrote:

@ Denis:
- I forgot to mention: The files are under windows.

@ Claus:
- [...] I create a list of all files in that directory and read all of 
them []


Yes , this is what I see when using "listfiles"
What I am searching for would be:
- choose a directory
- choose a file extension

--> create a list of all files with that extension in :
-> the directory
-> in all sub-directories

I do doubt that there is a ready-to-use-function for that, so my 
question is: How to do it the most elegant way?


I do not have a full aproach for this, yet.
However I feel, that the first thing to do is, to get absolut 
pathnames to all folders,

Afterwards I would scan each folder for the specifi file type.


Mh...still thinking.
Philipp






Am Mo., 27. Sept. 2021 um 17:52 Uhr schrieb Claus Futtrup 
mailto:cfutt...@gmail.com>>:


Hi Philipp

This piece of code used to work (haven't checked with Scilab
6.1.1). First I ask the user to select one file in the directory,
then I create a list of all files in that directory and read all
of them:

[units,typs,nams]=file();  // nams(1) = script file name incl. path
fpathname=strsplit(nams(1),  [filesep()]);
scriptpath  =  get_absolute_file_path(fpathname($));

printf("Please select a .txt measurement file\n");
[filetoread  pathtofile]  =  uigetfile("*.txt",scriptpath,"Choose measurement 
file");
 // For a start, assume script file is in the same directory as the
data,
 // but don't be sure, read pathtofile and use it instead.
readfile  =  pathtofile  +  "\"  +  filetoread;
if  length(filetoread)>4  then  // one char + .txt expected, i.e. length>4
 // If user doesn't select any file, the above check prevents a crash
 chdir(pathtofile);
 if  verbose  then  printf("MSG: File found, thanks!\n");  end

...

// Analyze - find all files in the path, who's filename is an
// integer, which means - we expect it to be an angle.
filelist=listfiles(pathtofile  +  "\*.txt");


...

imax=max(size(filelist));

...

printf("Loop %i times: ",imax);
for  i=1:imax  do
 printf("%i ",i)  // Show progress
 [path  fname  extension]  =  fileparts(filelist(i));
 if  isnum(fname)  then // check if fname (a string) contains
 d=evstr(fname);   // a number, and convert to number


I hope this is inspiring.

Cheers,
Claus

On 27-09-2021 16:50, P M wrote:

Dear All,

I need to find and list all files of a specific type on my hard
driveHow to do that in the most elegant way?

E.g.:

- find all *.txt files in "D:\"
- also find all '*.txt' files in each sub - directory,
sub-sub-directory, ..etc
- create a list that stores the absolute path names to the *.txt
files.

I am aware of
- dir
- findfiles
- listfiles
- ls

But they only seem to list the files in a dedicated folder.

Is there a function, that also searches all sub-folders
automatically?

Thank you,
Philipp




___
users mailing list
users@lists.scilab.org  <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users  
<http://lists.scilab.org/mailman/listinfo/users>



___
users mailing list
users@lists.scilab.org <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users
<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


Re: [Scilab-users] find all files of specific type on hard drive

2021-09-27 Thread Claus Futtrup

Hi Philipp

This piece of code used to work (haven't checked with Scilab 6.1.1). 
First I ask the user to select one file in the directory, then I create 
a list of all files in that directory and read all of them:


[units,typs,nams]=file();  // nams(1) = script file name incl. path
fpathname=strsplit(nams(1),  [filesep()]);
scriptpath  =  get_absolute_file_path(fpathname($));

printf("Please select a .txt measurement file\n");
[filetoread  pathtofile]  =  uigetfile("*.txt",scriptpath,"Choose measurement 
file");
// For a start, assume script file is in the same directory as the data,
// but don't be sure, read pathtofile and use it instead.
readfile  =  pathtofile  +  "\"  +  filetoread;
if  length(filetoread)>4  then  // one char + .txt expected, i.e. length>4
// If user doesn't select any file, the above check prevents a crash
chdir(pathtofile);
if  verbose  then  printf("MSG: File found, thanks!\n");  end

...

// Analyze - find all files in the path, who's filename is an
// integer, which means - we expect it to be an angle.
filelist=listfiles(pathtofile  +  "\*.txt");


...

imax=max(size(filelist));

...

printf("Loop %i times: ",imax);
for  i=1:imax  do
printf("%i ",i)  // Show progress
[path  fname  extension]  =  fileparts(filelist(i));
if  isnum(fname)  then // check if fname (a string) contains
d=evstr(fname);   // a number, and convert to number


I hope this is inspiring.

Cheers,
Claus

On 27-09-2021 16:50, P M wrote:

Dear All,

I need to find and list all files of a specific type on my hard 
driveHow to do that in the most elegant way?


E.g.:

- find all *.txt files in "D:\"
- also find all '*.txt' files in each sub - directory, 
sub-sub-directory, ..etc

- create a list that stores the absolute path names to the *.txt files.

I am aware of
- dir
- findfiles
- listfiles
- ls

But they only seem to list the files in a dedicated folder.

Is there a function, that also searches all sub-folders automatically?

Thank you,
Philipp




___
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] Scilab 6.1.1 release

2021-07-20 Thread Claus Futtrup

Dear Scilab team

Thank you for the wonderful news.

Cheers,
Claus

On 20-07-2021 15:35, Clément David wrote:

Dear Scilab users,

We are pleased to announce the release of Scilab 6.1.1 as a joint effort 
between Scilab contributors and the Scilab team at ESI Group.

Scilab 6.1.1 is the first revision of the 6.1 development branch and is 
compatible with the 6.1.0 release. It fixes 156 bugs and implements missing 
features from the 6.1.0 version especially:

* Improve readability on plot's title and displayed values
* Fix crashes and slow behaviors on functions
* Add missing arguments and behaviors to existing functions
* Reword and add examples on many help pages

For the complete list of changes and bugs fixed, please take a look at the 
CHANGES file https://help.scilab.org/CHANGES

Download this brand new version at https://www.scilab.org/download/6.1.1

--
Clément DAVID on behalf of the Scilab team.
___
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] spectrogram

2021-07-12 Thread Claus Futtrup

Hi all

An Amplitude(time,frequency) plot should be named Spectrogram. That's 
the official name for it.


>mapsound(), which plots a spectrogram without numerical information

I didn't check, but if this is true, then an improvement as proposed by 
Federico would be good.


Best regards,
Claus

On 12-07-2021 11:38, Samuel Gougeon wrote:

Hello Federico,

As reported at http://bugzilla.scilab.org/16530 , mapsound() could not 
really be used.

It has been rewritten in Scilab 6.1.1.
It's help page in PDF is available at 
http://bugzilla.scilab.org/attachment.cgi?id=5178
To be compared to the last 6.1.0 former version 
https://help.scilab.org/docs/6.1.0/fr_FR/mapsound.html


It could be still improved later with additional suggested features.

Regards

Samuel

PS : A redirection mechanism to be set in user's preferences has been 
implemented in Scilab 6.1.1
to automatically redirect help queries in the help browser toward the 
most relevant page, as uman() does.
It has been designed first to help scilab newbies coming from other 
languages, but can also be used

for other common terms.
Even if it is not "standard", mapsound is explicit enough, in the 
right help section,  and OK to me.

So we could redirect spectrogram to mapsound.

Le 12/07/2021 à 01:21, Federico Miyara a écrit :


Dear All,

I noticed there is no spectrogram function in Scilab that provides 
both graphic and numerical output. There is a function mapsound(), 
which plots a spectrogram without numerical information and without 
control over important aspects such has FFT length or windowing 
function. By the way, in the field of digital sound processing the 
usual name for this is spectrogram, not mapsound, which is a bit 
confusing.


I created a spectrogram() function. Even if it doesn't yet comply 
with the recommended style for Scilab functions (particularly 
regarding error handling or manual page), I think it might be useful 
for some users. I attach the function and a test script.


Regards,

Federico Miyara



___
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] spectrogram

2021-07-12 Thread Claus Futtrup


Thank you. :-)
BTW, Wikipeda has a nice (short) explanation of spectrogram:
https://en.wikipedia.org/wiki/Spectrogram

/Claus

On 12-07-2021 01:21, Federico Miyara wrote:


Dear All,

I noticed there is no spectrogram function in Scilab that provides 
both graphic and numerical output. There is a function mapsound(), 
which plots a spectrogram without numerical information and without 
control over important aspects such has FFT length or windowing 
function. By the way, in the field of digital sound processing the 
usual name for this is spectrogram, not mapsound, which is a bit 
confusing.


I created a spectrogram() function. Even if it doesn't yet comply with 
the recommended style for Scilab functions (particularly regarding 
error handling or manual page), I think it might be useful for some 
users. I attach the function and a test script.


Regards,

Federico Miyara



 
	Libre de virus. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
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] fmincon toolbox update

2021-04-19 Thread Claus Futtrup


It sounds great!

:-D

/Claus


On 19-04-2021 10:43, Stéphane Mottelet wrote:

Hi all,

I would like to inform you that the fmincon toolbox has been updated 
(https://atoms.scilab.org/toolboxes/fmincon/1.0.2) and now includes a 
major feature:  the Efficient Computation of Sparse Hessian using 
Coloring algorithm (scicolpack is now a  dependency of fmincon). This 
feature was missing and now allows fmincon to consider really big 
problems. A example of such is given in the "minimal surface demo" 
which compares 3 different approaches of the problem: one with finite 
differences gradient, and BFGS Hessian, one with exact gradient and 
BFGS Hessian, and the last with exact gradient and finite differences 
sparse Hessian. The time factor between the first and the third 
approchach is around 200 for a 21x21 square but you can edit the demo 
file and increase this value. For a 51x51 square the third approach 
takes only 0.45 seconds and is 2500 times faster. For a 101x101 square 
the first approach takes forever and the third ones takes less than 2 
seconds and is still 10 times faster than the second one.


If some of you still use other softwares for large scale optimization, 
maybe you can now give Scilab a try. If you need a better control on 
parameters and/or if you are not a former/actual user of Matlab's 
fmincon, I recommend using directly ipopt (from sci_ipopt toolbox). 
But the fmincon api is quite easy to use. Don't hesitate to took at 
the code of the several new demos.


Don't hesitate to contact me if you have some problems using fmincon 
of just to say that you are using it with success !


Regards,



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Why window() provides only symmetric weighting?

2021-04-12 Thread Claus Futtrup

Hi Federico

Thank you for being open to finding the right word.
I think other members of our small group should also be open.

For me the plurality is not so important - but let's say it's the 
wording used in all our educational books (in English) ... just dig into 
any Signal Analysis book, etc., and what we're trying to name here is 
exactly that, then it would be bad for Scilab to give it a different 
name. Renaming something that is universally defined otherwise is an 
uphill battle we cannot win.


Asymmetric window functions is new to me.I googled about window 
functions and found (stumbled upon):

https://journals.sagepub.com/doi/pdf/10.1260/1748-3018.9.4.389
Conclusion: Asymmetric window functions have a purpose. When there's 
asymmetric windows, then there must also be symmetric windows.
Here's a short list of symmetric window functions: 
https://mathworld.wolfram.com/ApodizationFunction.html


Best regards,
Claus

On 12-04-2021 17:19, Federico Miyara wrote:


Samuel:

As a general concept, you are right ... but with nuances. The problem 
is deciding when something is really wrong and when it is just a 
question of opinion or personal preference. It is wrong to say the 
Earth is flat, no matter how many people say it. But is it right or 
wrong to call something just a conventional name?


For instance: Is it right to call the derivative of a function 
"derivative"? Probably not, because "derivative" is a general concept 
which seems to have no relationship with its meaning in math. Probably 
in its origins it was more related to grammar than to math. But once 
established for centuries, it wouldn't be convenient to change it on 
the basis that it is "wrong".


By the same token, calling "periodic" a window function obtained from 
periodic functions (cosines) whose period is equal to its length 
doesn't seem intrinsically wrong to me. Calling it "closed" would be 
worse since one immediately thinks either of a closed set, which is 
not, or a closed curve, which isn't either.


But even if we found a better word, changing it would very likely 
create an unnecessary cognitive dissonance to thousands or millions of 
practitioners.


Anyway, if a much better and cristal-clear word (i.e., whose meaning 
would be immediately obvious in its context) were found and gained 
consensus, no problem to use it instead of "periodic". The important 
thing in my proposal was to include in the window() function the 
feature, not how we call it.


Regards,

Federico Miyara



On 12/04/2021 04:22, Dang Ngoc Chan, Christophe wrote:

Hello,


De : Federico Miyara
Envoyé : dimanche 11 avril 2021 02:08

Like it or not, I guess these keywords come from Matlab, and as Matlab
still seems to dominate the market, many people, including those
willing to quit Matlab (as I did several years ago), are quite used to
those keywords

I don't agree with this argument.
If a way of doing is wrong, then just keep on going because "everybody does so" 
is just an argumentum ad populum

https://en.wikipedia.org/wiki/Argumentum_ad_populum

which is a fallacious argument.

Regards.


--
Christophe Dang Ngoc Chan
Mechanical calculation engineer


General
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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





 
	Libre de virus. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
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] Why window() provides only symmetric weighting?

2021-04-12 Thread Claus Futtrup

Dear friends

I believe the initial question is related to giving more options to the 
window functions, such that it can continue how it is today (aka 
'symmetric') but also offer alternatives. If these additional options 
makes sense, and can default such that they are not required (existing 
code continues to work unaffected), and the additional options are 
useful and meaningful in a mathematical sense, then I'm all for adding 
these options.


When it comes to naming schemes, then Scilab is not required to strictly 
follow the Matlab regime. We can choose what we find most correct and 
concise. In some cases Scilab is 'better' than our competition, which is 
a pleasure. It is true that some users come from Matlab and sometimes we 
read Matlab code to convert its functionality into Scilab - in these 
cases it works perfectly good for me to make a Matlab-to-Scilab 
translation somewhere in the documentation.


Therefore, I hope we can have a good discussion about which name is the 
most meaningful.


With kind regards,
Claus

On 12-04-2021 09:22, Dang Ngoc Chan, Christophe wrote:

Hello,


De : Federico Miyara
Envoyé : dimanche 11 avril 2021 02:08

Like it or not, I guess these keywords come from Matlab, and as Matlab
still seems to dominate the market, many people, including those
willing to quit Matlab (as I did several years ago), are quite used to
those keywords

I don't agree with this argument.
If a way of doing is wrong, then just keep on going because "everybody does so" 
is just an argumentum ad populum

https://en.wikipedia.org/wiki/Argumentum_ad_populum

which is a fallacious argument.

Regards.


--
Christophe Dang Ngoc Chan
Mechanical calculation engineer


General
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@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] plotplots() in Scilab

2021-04-09 Thread Claus Futtrup


I think cutaxes() will be a great extension of capabilities in Scilab.

/Claus

On 09-04-2021 17:19, Samuel Gougeon wrote:

Hello,

Le 02/04/2021 à 17:15, Samuel Gougeon a écrit :

Dear all,

Thanks for your first feedbacks. I am somewhat answering in the body 
of this message:


Le 02/04/2021 à 14:49, Antoine Monmayrant a écrit :

On 02/04/2021 12:16, CRETE Denis wrote:


Hello,

I am also in favour of including this function in Scilab, with an 
“improved” name. However, as far as I know, an inset has very 
frequently its own pair of axes, as opposed to a ticks-switching in 
(only one of) the axes. Thus, I would not recommend a name with 
“inset” and reserve it for a function more closely implementing an 
inset.


Zoom is quite appealing.

I was wondering about “non-linear”_something…


Hello Denis,

I'm with you here: this should be included, but the name is not well 
matching the features of the function.

Indeed, 'inset' is not at all what 'plot_plot' is offering.
I was also thinking about "non-linear-axis" or something like that, 
but I am not sure such a name will improve discoverability of the 
function.

But you are right: this is about having non-regular or non-linear axis.

nonlinear-plot ? non-regular-plot ? All this is not convincing for me...

You know, i thought very hard about the plotplots() naming before 
finding and choosing this one and first publishing it ;-))


Indeed, plotplots() is not at all about insets, although an actually 
zooming inset plotting separate function could also be useful (with 
the zooming box and possibly rays linking it to the inset).


plotplots() is *not* about zooming or non-linear axis either: it can 
be used with different and only linear scales, without mixing log and 
lin ones.
So why "plotplots"? Typing "plot" in /Google Translate/ (from english 
to french), i've got and we still get:




So *"plots" is very frequently used with the meanings "parcels, 
pieces, patches, particles, shreds"*.
To me, this is just the right one, close to what the function 
actually addresses: plotting several parcels/pieces/patches of some 
given graphics.
This led me to this compact -- and i think talkative and meaningful 
-- plotplots() name, that's not (only) a word game.


Other names i thought about were with "multiscaled", or thinks like 
"plot_multiscale". But to me, this could lead to some confusion with 
multiple axes covering the same whole graphic, as documented @ 
https://help.scilab.org/docs/6.1.0/en_US/plot_multiscaled.html.


That's (almost) the whole story about this plotplots() name.
Is it more meaningful to you?



Apparently, the current plotplots() name used for 3 years is not so 
bad. I agree with Denis in private mail that it could be a bit more 
specific. Here are some other name suggestions:


cutaxes
plotcutaxes
plotslicedaxes
slicedaxes
slice_axes
sliceaxes
plotfractional

cutaxes() would have my own preferences:

  * the "plot" prefix is not really required, as "axes" already
clearly refers to graphics. Moreover, plotplots() works as well on
an already plotted axes, to somewhat post-process it by cutting
and presenting it in another way. Actually, that's the main job of
the function, even when data to plot are provided instead of an
already plotted axes.

  * it's short, and it clearly tells what it does and the result


By the way, "cutaxes" almost means "cute axes" (with a french accent :-)

After including the function in Scilab, the current plotplots as 
external ATOMS module will no longer be maintained. If plotplots() is 
renamed into cutaxes(), current plotplots() users will have to rename 
it in their existing codes. This should not be a big deal, since a 
find/replace will be able to detect occurrences and replace them.


Final comments, suggestions and other feedbacks are still welcome!

Samuel


___
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] find and locate local maxima

2021-03-16 Thread Claus Futtrup

Hi Stéphane

It looks very nice and I hope it will be added to Scilab as proposed by 
your code review. Why does it say in red print "Cannot Merge" ?


/Claus

On 16-03-2021 17:45, Stéphane Mottelet wrote:


Hi

For real life signals you should rather use something like this 
(Savitsky-Golay filters)


https://codereview.scilab.org/#/c/21499/

S.

Le 16/03/2021 à 17:09, CHEZE David 227480 a écrit :


Hi Clément,

Thank you for your quick reply and solution ! Actually it’s working 
for simple data but with noisy experimental timeseries, some 
filtering is required to get perfect regular signal (between the 
‘true’ extrema) that could be then managed by the routine. I suppose 
this is something the Matlab/Octave is handling internally, with some 
parameters as function’s argument to tune it, maybe it’s not the case .


Regards,

David

*De :* users  *De la part de* Clément 
David

*Envoyé :* mardi 16 mars 2021 16:27
*À :* Users mailing list for Scilab 
*Objet :* Re: [Scilab-users] find and locate local maxima

Hello David,

After reading the Matlab documentation page, it seems pretty simple 
to implement using Scilab : and $ symbols:


function[*pks*, *locs*]=_findpeaks_(*data*)

ii = find(d(1:$-2) < d(2:$-1) & d(2:$-1) >= d(3:$));

*pks* = *data*(ii+2);

*locs* = ii + 2;

endfunction

data= [25 8 15 5 6 10 10 3 1 20 7];

_plot_(data)

[pks,locs]= _findpeaks_(data);

_plot_(locs,pks, 'xr');

Note: using oct2py and pims might also be an option for simple cases 
but these wrappers are complex to use and data need to be copied at 
language boundaries.


Regards,

Clément

*From:*users > *On Behalf Of *CHEZE David 
227480

*Sent:* Tuesday, March 16, 2021 2:53 PM
*To:* Users mailing list for Scilab >

*Subject:* [Scilab-users] find and locate local maxima

Hi all,

I’m looking for function that could find and locate every local 
maxima of any discrete time signal (timeseries), similar to Matlab or 
Octave function findpeaks(), scipy find_peaks(). Is anyone aware if 
something similar is already available in Scilab ? (I already browsed 
a little bit and it don’t seem so…)


If not in Scilab macros, any hint to use the Octave or scipy function 
directly from Scilab?


More globally it seems that Octave Forge could be linked with Python 
(from oct2py import octave


# Load the Octage-Forge signal package.

octave.eval("pkg load signal")), does someone ever tried to bridge 
similarly in Scilab ? oct2sci


Kind regards,

David


___
users mailing list
users@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

___
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] convert vector to list

2021-02-18 Thread Claus Futtrup


He he

Sometimes the answer is so 'obvious' ... it's just that the user never 
heard about it before. Myself included.


/Claus

On 18-02-2021 19:37, Stéphane Mottelet wrote:


vec2list() ?

Le 18/02/2021 à 19:34, Federico Miyara a écrit :


Dear All,

Is there a Scilab function to convert a vector to a list?

If x is a vector, this code

L = list();
for n=1:length(x)
    L(n) = x(n);
end

seems to work, but it would be nice to have a primitive doing this 
more efficiently. I don't seem to be able to find it.


Regards,

Federico Miyara

 
	Libre de virus. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
users mailing list
users@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

___
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] Default grid color = grey? Increase the zoom factor (per wheel step)?

2021-02-12 Thread Claus Futtrup

Hi Scilabers and Samuel

I normally don't have good luck with zoom or rotate functions, so I 
don't use this feature, but I also rarely am plotting in 3D - and in 
classic 2D I just continue until I have the right plot size (no need to 
zoom).


P.S. For grid color, it's OK to keep it black and avoid trouble with 
colormaps.


P.P.S. Regarding the size of the plot window (figure.size), it's 
standard [626,587] and I find it a bit small. Maybe it's a good size if 
your screen is 1024 x 768 (?), but I think most computers these days are 
with 1366 x 768 or larger screens (mine is 1920 x 1080 on a 14 inch 
screen). We should avoid the plot window to be too big for anybody (that 
would be frustrating), but could the plot be rescaled depending on 
screen resolution? I find myself typically increasing figure.size by 50%.


Best regards,
Claus

On 13-02-2021 00:14, Samuel Gougeon wrote:


Dear all,

*1)*
After 
http://mailinglists.scilab.org/Scilab-users-Default-x-y-z-labels-and-title-font-size-2-tp4041291p4041297.html 
:


Le 02/02/2021 à 17:02, Claus Futtrup a écrit :

.../...
You mention grid. I always do xgrid(color("grey70"));


So do i.


... is this default now, to have the grid a bit greyed?


The issue with a non black or white color is that, if the current 
colormap does not have it, then the color is automatically appended to 
the colormap.
With the current colormap implementation as a figure's property, this 
may have some side effects for plotting functions like grayplot() 
whose rendering in "scaled" mode spans the whole colormap, including 
the appended gray that we do not wish to include in the plot rendering...


This is why carefully tuning the default grid style /density/ was 
required, as discussed in the description of the report #15421 
<http://bugzilla.scilab.org/15421>, implemented in Scilab 6.0.2 (so 
even before 6.1.0).



*2)* Too small zoom factor
On any graphic, zooming by a factor 2 (in size) requires 11 wheel steps!
To me, this is too slow. In another similar software, /each/ wheel 
step increases the scale by the same factor 2.
This is likely too much, but don't you think we could increase a bit 
the Scilab zoom factor?


Hope reading you soon.

Regards
Samuel


___
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] Default x|y|z labels and title font size = 2?

2021-02-02 Thread Claus Futtrup

Hi Samuel

I agree. The font is always too small. The font = 2 seems to be the 
smallest feasible increment and it sounds like a good one (i.e. without 
overdoing it).


You mention grid. I always do xgrid(color("grey70")); ... is this 
default now, to have the grid a bit greyed?


Cheers,
Claus

On 01-02-2021 23:26, Samuel Gougeon wrote:


Dear all,

After having changed the default grid style in Scilab 6.1.0, i propose 
to go on, tuning more carefully the default font size of axes labels.


Each time that i define a xlabel, ylabel or sometimes zlabel, and a 
title, i have also to set explicitly their fontsize property, because 
i find the default size=1 always too small.

Is it also your usage?
Indeed, the font size = 1 is fine for ticks labels. From here, axes 
labels must be displayed with a bigger font size.
Sometime size=2 is still not enough, noticeably with a LaTeX content. 
But well, then we can actually use an explicit fontsize setting.


This proposal impacts everybody and frequently, because making plots 
is a basic task in Scilab

Every comment is welcome, before implementing this simple change.

Hope reading you soon.

Samuel Gougeon

clf
subplot(1,3,1)
plot2d
xlabel  "Title for abscissas"
ylabel  "Title for ordinates"

subplot(1,3,2)
xlabel  "Title for abscissas"  fontsize  2
ylabel  "Title for ordinates"  fontsize  2
plot2d

subplot(1,3,3)
xlabel  "$\alpha\text{ coefficient }[m^{-1}]$"  fontsize  2
ylabel  "$\beta\text{ result }[lm^{-1}]$"  fontsize  2
plot2d



___
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] Impossibility to open a scg file with datatips recorded with scilab 5.5.2 - Bugzilla #16374

2021-01-31 Thread Claus Futtrup

Hi Scilabers

>fixed for Scilab 6.1.1

The latest edition of Scilab is 6.1.0 online at https://www.scilab.org/

Does anyone know when the next Scilab will be released? The last edition 
was released on 15th February 2020. Maybe Scilab is updated annually? 
... with the next one in a few short weeks?


Cheers,
Claus

On 31-01-2021 07:39, Samuel Gougeon wrote:

Le 16/03/2020 à 08:10, Perrichon a écrit :


Hello,

It's no more possible to open a scg file with datatips recorded 
coming from Scilab 5.5.2 to Scilab 6.1.0



This is fortunately fixed for Scilab 6.1.1
Thanks for having reported this issue.
Samuel


___
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] Can't get current directory

2021-01-24 Thread Claus Futtrup

Hi Gerard

Can you be a little bit more specific? What are you trying to do while 
this message pops up? - Are you using the GUI, or are you running a 
script? If a script - could you share a few lines of code that 
reproduces the error at your end?


Best regards,
Claus

On 24-01-2021 21:03, Gerard Awanou wrote:

Hi

I am running Scilab 6.1 on mac OS Catalina and I am getting the 
annoying message

"Can't get current directory".

How do I fix this?


___
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] users@ interruptions?

2021-01-23 Thread Claus Futtrup


Same here

/Claus

On 22-01-2021 21:38, Federico Miyara wrote:


Samuel,

I haven't received it either, but I did receive yours, seemingly from 
the users list.


Regards,

Federico

On 22/01/2021 17:04, Samuel Gougeon wrote:

Hello,
Has anyone received the recent message archived @ 
http://mailinglists.scilab.org/Scilab-users-Update-library-and-help-tt4041262.html 
?

I have not.
BR
Samuel

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




 
	Libre de virus. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
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] IPCV upscaling of image

2020-12-22 Thread Claus Futtrup

Hi Philipp

Interesting ... I think this should be part of the help available.
I hope Chin Lun Tan sees this and feel inspired...

Cheers,
Claus

On 21-12-2020 21:54, P M wrote:

Hi Claus,

this works for me:

imgList  =  list();
imgList(1)  =  imread(fullpath(getIPCVpath()  +  
"/images/superres/input001.png"));
imgOut   =  imsuperres(imgList);
figure();
imshow(imgOut);
outPath_1  =  'd:\testIn.png';
outPath_2  =  'd:\testOut.png';
res  =  imwrite(imgList(1),  outPath_1);
res  =  imwrite(imgOut,  outPath_2);
xdel();
The input file is saved as a 64x64 image.
The superresolution image is saved as a 256 x 256 image.

Interestingly enough:
If the output paths are set to "c:\testOut.png", imwrite would not 
work...unsure why.


Regards, Philipp

Am Mo., 21. Dez. 2020 um 11:37 Uhr schrieb Claus Futtrup 
mailto:cfutt...@gmail.com>>:


Hi Philipp

The file was saved automatically. I don't think you can set what
to save, or even the name of the file.
I also did a xs2png, but that only saves the current figure. In my
case a 610 x 460 pixel image (=the screen figure).

Cheers,
Claus

On 21-12-2020 11:21, P M wrote:

Dear Claus,

the example did not include saving the image as a file.

Best guesses:
- use imwrite
- use one of the xs2...-functions (e.g.: xs2bmp)

BR
Philipp


Am Mo., 21. Dez. 2020 um 09:20 Uhr schrieb Claus Futtrup
mailto:cfutt...@gmail.com>>:

Hi Philipp

I see, thank you for explaining it to me. I also see that the
upscale is not 2x2 = 4, but it is 4x4 so the upscaled image
is huge. The output file is saved - I believe - in wherever
your Scilab file browser is currently active.

Best regards,
Claus

On 20-12-2020 22:55, P M wrote:

Dear Claus,

you need to feed a list into imsuperres()not directly
the image.
Following should work.
imgList  =  list();
imgList(1)  =  imread('path_to_image');
imgOut   =  imsuperres(imgList);figure(); imshow(imgList(1)); figure();
imshow(imgOut); BR Philipp


Am So., 20. Dez. 2020 um 19:42 Uhr schrieb Claus Futtrup
mailto:cfutt...@gmail.com>>:

Hi there

I have a 4K picture, which I thought I'll try to upscale
with the
imsuperres in the IPCV toolbox. The code simply looks
like this:

imagefile =
'D:\Userdata\Claus\Pictures\Think_Global_4K.png';
im = imread(imagefile);
imout  = imsuperres(im);

The file is read and I get the following response:
Unsigned Integer 8
bits (2160 x 3840). Then Scilab crashes. I'm running
Scilab 6.1.0 (the
original release) on Windows 10 - in a MS Windows dialog
box I get:

 >Scilab 6.1.0 (Desktop) has stopped working

 >A problem caused the program to stop working
correctly. Windows will
close the program and notify you if a solution is available.

I am not sure that I've understood how to use imsuperres
correctly. I
see in the _params that rfactor = 4 is the default, so I
was expecting
the image to be scaled by a factor 4 (maybe that's 2 x 2
= I get an 8K
image = 4320 x 7680 pixels). The way I understand the
documentation, I
don't need to run imsuperres_params if I'm satisified
with the defaults.

Kind regards,

Claus

___
users mailing list
users@lists.scilab.org <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users
<http://lists.scilab.org/mailman/listinfo/users>


___
users mailing list
users@lists.scilab.org  <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users  
<http://lists.scilab.org/mailman/listinfo/users>



___
users mailing list
users@lists.scilab.org <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users
<http://lists.scilab.org/mailman/listinfo/users>


___
users mailing list
users@lists.scilab.org  <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users  
<http://lists.scilab.org/mailman/listinfo/users>



___
users mailing list
users@lists.scilab.org <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users
<http://lists.scilab.org/mailman/listinfo/us

Re: [Scilab-users] IPCV upscaling of image

2020-12-21 Thread Claus Futtrup

Hi Philipp

The file was saved automatically. I don't think you can set what to 
save, or even the name of the file.
I also did a xs2png, but that only saves the current figure. In my case 
a 610 x 460 pixel image (=the screen figure).


Cheers,
Claus

On 21-12-2020 11:21, P M wrote:

Dear Claus,

the example did not include saving the image as a file.

Best guesses:
- use imwrite
- use one of the xs2...-functions (e.g.: xs2bmp)

BR
Philipp


Am Mo., 21. Dez. 2020 um 09:20 Uhr schrieb Claus Futtrup 
mailto:cfutt...@gmail.com>>:


Hi Philipp

I see, thank you for explaining it to me. I also see that the
upscale is not 2x2 = 4, but it is 4x4 so the upscaled image is
huge. The output file is saved - I believe - in wherever your
Scilab file browser is currently active.

Best regards,
Claus

On 20-12-2020 22:55, P M wrote:

Dear Claus,

you need to feed a list into imsuperres()not directly the image.
Following should work.
imgList  =  list();
imgList(1)  =  imread('path_to_image');
imgOut   =  imsuperres(imgList);figure(); imshow(imgList(1)); figure();
imshow(imgOut); BR Philipp


Am So., 20. Dez. 2020 um 19:42 Uhr schrieb Claus Futtrup
mailto:cfutt...@gmail.com>>:

Hi there

I have a 4K picture, which I thought I'll try to upscale with
the
imsuperres in the IPCV toolbox. The code simply looks like this:

imagefile = 'D:\Userdata\Claus\Pictures\Think_Global_4K.png';
im = imread(imagefile);
imout  = imsuperres(im);

The file is read and I get the following response: Unsigned
Integer 8
bits (2160 x 3840). Then Scilab crashes. I'm running Scilab
6.1.0 (the
original release) on Windows 10 - in a MS Windows dialog box
I get:

 >Scilab 6.1.0 (Desktop) has stopped working

 >A problem caused the program to stop working correctly.
Windows will
close the program and notify you if a solution is available.

I am not sure that I've understood how to use imsuperres
correctly. I
see in the _params that rfactor = 4 is the default, so I was
expecting
the image to be scaled by a factor 4 (maybe that's 2 x 2 = I
get an 8K
image = 4320 x 7680 pixels). The way I understand the
documentation, I
don't need to run imsuperres_params if I'm satisified with
the defaults.

Kind regards,

Claus

___
users mailing list
users@lists.scilab.org <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users
<http://lists.scilab.org/mailman/listinfo/users>


___
users mailing list
users@lists.scilab.org  <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users  
<http://lists.scilab.org/mailman/listinfo/users>



___
users mailing list
users@lists.scilab.org <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users
<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


Re: [Scilab-users] IPCV upscaling of image

2020-12-21 Thread Claus Futtrup

Hi Philipp

I see, thank you for explaining it to me. I also see that the upscale is 
not 2x2 = 4, but it is 4x4 so the upscaled image is huge. The output 
file is saved - I believe - in wherever your Scilab file browser is 
currently active.


Best regards,
Claus

On 20-12-2020 22:55, P M wrote:

Dear Claus,

you need to feed a list into imsuperres()not directly the image.
Following should work.
imgList  =  list();
imgList(1)  =  imread('path_to_image');
imgOut   =  imsuperres(imgList);figure(); imshow(imgList(1)); figure(); 
imshow(imgOut); BR Philipp



Am So., 20. Dez. 2020 um 19:42 Uhr schrieb Claus Futtrup 
mailto:cfutt...@gmail.com>>:


Hi there

I have a 4K picture, which I thought I'll try to upscale with the
imsuperres in the IPCV toolbox. The code simply looks like this:

imagefile = 'D:\Userdata\Claus\Pictures\Think_Global_4K.png';
im = imread(imagefile);
imout  = imsuperres(im);

The file is read and I get the following response: Unsigned Integer 8
bits (2160 x 3840). Then Scilab crashes. I'm running Scilab 6.1.0
(the
original release) on Windows 10 - in a MS Windows dialog box I get:

 >Scilab 6.1.0 (Desktop) has stopped working

 >A problem caused the program to stop working correctly. Windows
will
close the program and notify you if a solution is available.

I am not sure that I've understood how to use imsuperres correctly. I
see in the _params that rfactor = 4 is the default, so I was
expecting
the image to be scaled by a factor 4 (maybe that's 2 x 2 = I get
an 8K
image = 4320 x 7680 pixels). The way I understand the
documentation, I
don't need to run imsuperres_params if I'm satisified with the
defaults.

Kind regards,

Claus

___
users mailing list
users@lists.scilab.org <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users
<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


[Scilab-users] IPCV upscaling of image

2020-12-20 Thread Claus Futtrup

Hi there

I have a 4K picture, which I thought I'll try to upscale with the 
imsuperres in the IPCV toolbox. The code simply looks like this:


imagefile = 'D:\Userdata\Claus\Pictures\Think_Global_4K.png';
im = imread(imagefile);
imout  = imsuperres(im);

The file is read and I get the following response: Unsigned Integer 8 
bits (2160 x 3840). Then Scilab crashes. I'm running Scilab 6.1.0 (the 
original release) on Windows 10 - in a MS Windows dialog box I get:


>Scilab 6.1.0 (Desktop) has stopped working

>A problem caused the program to stop working correctly. Windows will 
close the program and notify you if a solution is available.


I am not sure that I've understood how to use imsuperres correctly. I 
see in the _params that rfactor = 4 is the default, so I was expecting 
the image to be scaled by a factor 4 (maybe that's 2 x 2 = I get an 8K 
image = 4320 x 7680 pixels). The way I understand the documentation, I 
don't need to run imsuperres_params if I'm satisified with the defaults.


Kind regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Atoms Modules

2020-12-19 Thread Claus Futtrup

Hi there

I am personally not the most vivid user of the IPCV, but I can see among 
my scripts that I was playing around with it in October 2018. I have 
used IPCV to manipulate a piece of graphics that I made, and in a 
programmatic way (something totally impractical in any other way). The 
results: https://www.cfuttrup.com/blogspot.html#think_global


I think the IPCV belongs in the toolbox for Scilab.

When it comes to ATOMS, I think the concept is fundamentally good. I am 
not qualified to give feedback to any of the specifics within ATOMS as I 
found it very difficult to read up on how to create an ATOMS module, so 
what I say is that as a tool for community driven development, it needs 
a lot better support.


With kind regards,
Claus

On 18-12-2020 19:22, Samuel Gougeon wrote:

Dear Chin Luh,

Thank you so much for addressing the critical topic of external 
modules maintenance.

While IPCV is the most downloaded module, your fair question
>So should IPCV continue to be maintained ...?
sounds desperate to me. I rather share the same feeling: Almost 5 days 
after your message, not a single answer from users...!


So, apparently, the answer is likely: No, it's not worth maintaining 
the most downloaded module, and therefore No, it's not worth 
maintaining any other external module.
Let's stop maintaining ATOMS for 2021. The ghosts of silent users are 
certainly rich enough to pay commercial equivalent tools.


Since there are 12 days left before 2021, i will answer for particular 
cases in separate (sub-)threads.


Best regards
Samuel

Le 14/12/2020 à 05:44, Chin Luh Tan a écrit :
Sometimes it is hard to decide whether to continue maintaining an 
atoms module or not So I did "snapshots" of downloads on 
9/11/2020 21:44 and 14/12/2020 12:20 respectively to see which 
modules are in the actual top downloads.


Still, this is not a fair result, such as IPCV having some "patches" 
which will increase the download number, and some other factors as well.


So should IPCV continue to be maintained ...?

Here's the results.

Image Processing and Computer Vision Toolbox4620
CPGE3176
MinGw toolbox   2946
Arduino 2936
CelestLab   2841
iodelay toolbox 2429
Coselica1812
SIMM1800
Image Processing Design Toolbox 1394
Fuzzy Logic Toolbox 1186
Scilab Computer Vision Module   1129
GUI Builder 972
Scilab Image and Video Processing toolbox   860
Distfun 855
Apifun  804
Serial Communication Toolbox781
Time Frequency Toolbox  776
Free Access Chemometric Toolbox 770
Autoelem Toolbox768
Specfun 738




___
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] ipcv vs scicv

2020-12-03 Thread Claus Futtrup

Hi Tan

I agree. The proposal, is it something we can do ourselves now, or will 
it require implementation into Scilab first? Thank you for resending.


/Claus

On 03-12-2020 02:10, TanCL wrote:

Hi, my previous message seems like not able to get posted due to some reason,
just to add some comment on this, I think the functions with same name under
2 different modules could be possibly called by:

moduleA.myfunc

moduleB.myfunc


__

Start Toolbox A
Load macros

Start Toolbox B
Load macros


--> toolboxAlib.scilab_sum(2,1)

   "This is function from ToolboxA"
  ans  =

3.

--> toolboxBlib.scilab_sum(2,1)

   "This is function from ToolboxB"
  ans  =

3.





--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
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] fft

2020-11-27 Thread Claus Futtrup

Hi Federico

Thank you for your advice. I guess reinstalling Scilab is what I need to do.

Best regards,
Claus

On 26-11-2020 23:17, Federico Miyara wrote:


Claus,

I recall that I had had a similar problem in certain occasion. The 
reason was that when installing Scilab I had selected an option to use 
a version of the FFT which, since it was much larger, I thought would 
be more complete, or faster... but it didn't work. Try to re-install 
Scilab and choose the default version of the FFT engine. It is good 
enough... and works!


Regards,

Federico Miyara

On 26/11/2020 15:24, Claus Futtrup wrote:

Hi there

The 2D example from the help pages also crashes Scilab.

Maybe my Scilab installation is broken - the FFT part? I can't 
remember, but I think I installed the Intel Math Kernel with 
everything. My computer is a Lenovo T480 with Intel Core i7 
processor. I have the following installed:


C:\Program Files\scilab-6.1.0>dir /S /B fft*.*
C:\Program Files\scilab-6.1.0\bin\fftw
C:\Program Files\scilab-6.1.0\bin\fftw.dll
C:\Program Files\scilab-6.1.0\bin\fftw\fftw-readme.txt
C:\Program Files\scilab-6.1.0\modules\fftw
C:\Program Files\scilab-6.1.0\modules\fftw\etc\fftw.quit
C:\Program Files\scilab-6.1.0\modules\fftw\etc\fftw.start

Cheers,
Claus

On 26-11-2020 19:19, Claus Futtrup wrote:


Hi Scilabers

I'm trying to understand how to use the FFT function in Scilab. I'm 
using v. 6.1.0 on a Windows 10 machine.


This crashes Scilab:
y =  linspace(1,256,256) x = fft(y)

BTW, the example in the online help 
(https://help.scilab.org/docs/6.1.0/en_US/fft.html) also crashes Scilab:

sample_rate=1000; t = 0:1/sample_rate:0.6; N=size 
<https://help.scilab.org/docs/6.1.0/en_US/size.html>(t,'*'); 
//number of samples s=sin 
<https://help.scilab.org/docs/6.1.0/en_US/sin.html>(2*%pi*50*t)+sin 
<https://help.scilab.org/docs/6.1.0/en_US/sin.html>(2*%pi*70*t+%pi/4)+grand 
<https://help.scilab.org/docs/6.1.0/en_US/grand.html>(1,N,'nor',0,1); 
y=fft <https://help.scilab.org/docs/6.1.0/en_US/fft.html>(s);

Cheers,
Claus




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 
	Libre de virus. www.avast.com 
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
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] fft

2020-11-26 Thread Claus Futtrup

Hi there

The 2D example from the help pages also crashes Scilab.

Maybe my Scilab installation is broken - the FFT part? I can't remember, 
but I think I installed the Intel Math Kernel with everything. My 
computer is a Lenovo T480 with Intel Core i7 processor. I have the 
following installed:


C:\Program Files\scilab-6.1.0>dir /S /B fft*.*
C:\Program Files\scilab-6.1.0\bin\fftw
C:\Program Files\scilab-6.1.0\bin\fftw.dll
C:\Program Files\scilab-6.1.0\bin\fftw\fftw-readme.txt
C:\Program Files\scilab-6.1.0\modules\fftw
C:\Program Files\scilab-6.1.0\modules\fftw\etc\fftw.quit
C:\Program Files\scilab-6.1.0\modules\fftw\etc\fftw.start

Cheers,
Claus

On 26-11-2020 19:19, Claus Futtrup wrote:


Hi Scilabers

I'm trying to understand how to use the FFT function in Scilab. I'm 
using v. 6.1.0 on a Windows 10 machine.


This crashes Scilab:
y =  linspace(1,256,256) x = fft(y)

BTW, the example in the online help 
(https://help.scilab.org/docs/6.1.0/en_US/fft.html) also crashes Scilab:

sample_rate=1000; t = 0:1/sample_rate:0.6; N=size 
<https://help.scilab.org/docs/6.1.0/en_US/size.html>(t,'*'); //number 
of samples s=sin 
<https://help.scilab.org/docs/6.1.0/en_US/sin.html>(2*%pi*50*t)+sin 
<https://help.scilab.org/docs/6.1.0/en_US/sin.html>(2*%pi*70*t+%pi/4)+grand 
<https://help.scilab.org/docs/6.1.0/en_US/grand.html>(1,N,'nor',0,1); 
y=fft <https://help.scilab.org/docs/6.1.0/en_US/fft.html>(s);

Cheers,
Claus



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] fft

2020-11-26 Thread Claus Futtrup

Hi Scilabers

I'm trying to understand how to use the FFT function in Scilab. I'm 
using v. 6.1.0 on a Windows 10 machine.


This crashes Scilab:

y =  linspace(1,256,256) x = fft(y)

BTW, the example in the online help 
(https://help.scilab.org/docs/6.1.0/en_US/fft.html) also crashes Scilab:


sample_rate=1000; t = 0:1/sample_rate:0.6; N=size 
(t,'*'); //number of 
samples s=sin 
(2*%pi*50*t)+sin 
(2*%pi*70*t+%pi/4)+grand 
(1,N,'nor',0,1); 
y=fft (s);

Cheers,
Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ipcv vs scicv

2020-11-24 Thread Claus Futtrup

Hi all

I imagine naming conflicts can occur across different ATOMS.

How about a change where one has to specify which ATOMS module you're 
using when calling a function, such that both can coexist side-by-side ?


I'm thinking Pythonic here, like if you import for example numpy, you 
can write import numpy as np ... from hereon, you write np.pi for the 
definition of pi (=3.14159 ... ), and so on.


Maybe something for Scilab 7 (?)

Cheers,
Claus

On 24-11-2020 14:15, P M wrote:

Dear developers,

as I have many scripts with "imread" I wonder if some time in the 
future duplicate functions names from IPCV and SCICV are going to be 
removed/changed.


It's kind of disturbing to have to use atomsInstall/atomsRemove when 
using different scripts.


I think this was discussed already in the past, though an update would 
be nice.


Thank you,
Philipp


___
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] bvode example broken?

2020-07-15 Thread Claus Futtrup
I confirm the last example in 
https://help.scilab.org/docs/6.1.0/en_US/bvode.html returns the 
following error - on a Windows 10 machine:


--> exec('D:\Userdata\Claus\Documents\Scilab\bvode_example.sce', -1)
 VERSION *COLNEW* OF COLSYS .
 THE MAXIMUM NUMBER OF SUBINTERVALS IS MIN ( 117 (ALLOWED FROM FSPACE), 
124 (ALLOWED FROM ISPACE) )
 THE NEW MESH (OF    4 SUBINTERVALS), 0.00    0.50 
1.00    1.45    1.90

 CONVERGENCE AFTER  3 ITERATIONS
 THE NEW MESH (OF    8 SUBINTERVALS), 0.00    0.25 
0.50    0.75    1.00    1.225000    1.45 1.675000    
1.90

 CONVERGENCE AFTER  1 ITERATIONS
 VERSION *COLNEW* OF COLSYS .
 THE MAXIMUM NUMBER OF SUBINTERVALS IS MIN ( 117 (ALLOWED FROM FSPACE), 
124 (ALLOWED FROM ISPACE) )
 THE FORMER MESH (OF    4 SUBINTERVALS),    0.00 0.00    
0.00    0.00    0.00

 THE NEW MESH (OF    2 SUBINTERVALS), 0.00    0.00 1.90
 ** DOMAIN ERROR IN APPROX ** X =    0.2141331642D+00 ALEFT 
=    0.00D+00   ARIGHT =    0.00D+00
 ** DOMAIN ERROR IN APPROX ** X =    0.95D+00 ALEFT 
=    0.00D+00   ARIGHT =    0.00D+00
 ** DOMAIN ERROR IN APPROX ** X =    0.1685866836D+01 ALEFT 
=    0.00D+00   ARIGHT =    0.00D+00

 THE GLOBAL BVP-MATRIX IS SINGULAR
at line   122 of executed file 
D:\Userdata\Claus\Documents\Scilab\bvode_example.sce


bvode: The collocation matrix is singular.



... Line 122 is of course the execution of bvode:

sol=bvodex|(res,ncomp,m,aleft,aright,zeta,ipar,ltol,tol,fixpnt,...
fsub,dfsub,gsub,dgsub,guess);

/Claus

On 15-07-2020 19:39, Rene Djack wrote:

Hello,
I' m new to this list and to scilab too!
Working on bvode, I try the example "Quantum Neumann equation" found 
in the scilab help and i get the error message

"Collocation matrix is singular"
Is this example broken?
Somebody have the same message?

I'm using scilab 6.10 from scilab-6.10.bin.linux-x86-64.tar.gz on 
Ubuntu 20.4


Tanks for reading
Regards


___
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] Pong contest

2020-06-07 Thread Claus Futtrup

Hi Rafael

...SCALAR RESULT:  Mflops= 2.737 ;  Pi ~ 3.141592
...ARRAY RESULT:  Mflops= 1.284 ;  Pi ~ 3.141592

The machine is a two-year old Lenovo T480, Core i7 8th Gen. Built-in 
Intel Graphics (no external card)


/Claus

On 07-06-2020 09:54, Rafael Guerra wrote:


Hello Stéphane et al.,

Would it make sense in this “Pong contest”, in addition to the OS 
used, to also provide some sort of benchmarking of machine CPU?


Fyi, find below simple test by Gershenfeld (1999), it computes 
Pi=4*atan(1) by two methods:


Scalar test:  Pi(N)~Sum{i=1:N; 0.5/((i-0.75)*(i-0.25))}

Array test:   Pi(N)= Pi(N-1) + 0.5/((N-0.75)*(N-0.25))

/// Based on benchmarking test in Gershenfeld Mathematical modeling 
book (1999)/


/// There are 5 floating point operations per step, total 5 Mflop with 
N=1e6/


N=1e6;

tic();

ps=0;

fori=1:N

ps=ps + 0.5/((i-0.75)*(i-0.25));

end

dt=toc();

printf('...SCALAR RESULT:  Mflops= %4.3f ;  Pi ~ %7.6f \n',5.0/dt,ps);

tic();

pv(1)=0.5/((1-0.75)*(1-0.25));

fori=2:N

pv(i)= pv(i-1) + 0.5/((i-0.75)*(i-0.25));

end

dt=toc();

printf('...ARRAY RESULT:  Mflops= %4.3f ;  Pi ~ %7.6f \n',5.0/dt,pv(N));

PS:

...SCALAR RESULT:  Mflops= 3.489

...ARRAY RESULT:  Mflops= 1.367

Regards,

Rafael

On 05-06-2020 14:48, Stéphane Mottelet wrote:

Hello all,

As you may have noticed, there is now a little game in the
Gaphics/Animation section of the demonstrations. As the speed and
responsiveness seems to be similar under all platforms, it would
be funny to launch a little contest. In the next Scilab version it
would be interesting to implement a high score online record, but
until then, you can answer this message with the same kind of
screenshot I joined, showing you score and just taken after the
game end with and with the last dialog on the figure.

Cheers,


___
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] Pong contest

2020-06-06 Thread Claus Futtrup

Hello all

Here's my first attempt (Microsoft Windows 10). Attached.

/Claus

On 05-06-2020 14:48, Stéphane Mottelet wrote:

Hello all,

As you may have noticed, there is now a little game in the 
Gaphics/Animation section of the demonstrations. As the speed and 
responsiveness seems to be similar under all platforms, it would be 
funny to launch a little contest. In the next Scilab version it would 
be interesting to implement a high score online record, but until 
then, you can answer this message with the same kind of screenshot I 
joined, showing you score and just taken after the game end with and 
with the last dialog on the figure.


Cheers,


___
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] Covid19 model

2020-04-30 Thread Claus Futtrup

Hi Stéphane

Thank you for showing me how to work ODE.

P.S. about Corona modeling, the model by Risbo is nice in that you can 
implement a lockdown of some sort. It's a simple one-step lockdown, 
where you have to tune the R-value ... in reality each geographic area 
is different, related to how much of a lockdown is executed, how dense 
the population is, etc.


Cheers,
Claus

On 4/30/2020 4:51 PM, Stéphane Mottelet wrote:


Hi Clauss,

Just modify the following lines :

t1  =  0:0.1:60;
y1  =  ode(y0,  0,  t1,  odefun);  // [t1,y1] = ode45(@odefun,[0 60],y0); // 
run 1st scernario
idx=[3:6];
scf();
a  =  gca();
plot(Begin+t1,y1(idx,:),'-');  // 
semilogy(Begin+t1,y1(:,idx),'-','LineWidth',3) And you will be fine. ode() 
needs a vector of time values and the output is oriented transposed w.r.t 
Matlab output.

S.

Le 30/04/2020 à 16:40, Claus Futtrup a écrit :
functiondydt=odefun(t, y)iftreproductive rate after 
lockdownendA=[00-delta*R*y(1)/Npop000;...0-gamdelta*R*y(1)/Npop000;...0gam-delta000;...00delta*(1-Fhosp)000;...00delta*Fhosp0-1/Thosp0;...00delta*R*y(1)/Npop000];dydt=A*y;endBegin=datenum(2020,02,20,0,0,0);// 
begin dateDlock=datenum(2020,03,12,0,0,0);// date of 
lockdowndays=Dlock-Begin;R0=2.6;// inital R valuegam=1/3;// gamma, 
the inverse of average latent timedelta=1/5;// inv time constant 
which infectious people either recover or enter hospitalFhosp=0.16;// 
fraction of recovering people going to hospitalThosp=14;// average 
time of hospitalisationNpop=6e6;// total initial population of 
sensitivey0=[Npop;50;50;0;0;0];// [S E I R Hosp ] intial 
cond.t1=0:60;y1=ode(y0,0,60,odefun);// [t1,y1] = ode45(@odefun,[0 
60],y0); // run 1st 
scernarioidx=[3:6];scf();a=gca();plot(Begin+t1,y1(:,idx),'-');// 
semilogy(Begin+t1,y1(:,idx),'-','LineWidth',3)a.log_flags="nln";xlabel('Date')ylabel('Number 
of cases')xgrid();// ax=gca;// ax.YLim=[10 
max(max(y2(:,idx)))];xtitle({'Danish Corona lock down on 20.03.12, vs 
14 days later','R goes from 2.6 to 0.6 at 
lockdown'});legend('Infected','Recovered','Hospitalised','Total Cases');

--
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

___
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


[Scilab-users] Covid19 model

2020-04-30 Thread Claus Futtrup

Hi Scilabers

On 17. April I sent an email, but I think it wasn't released to the 
mailing list, I only find it online here:


http://mailinglists.scilab.org/Scilab-users-Covid19-model-td4040626.html

Here's the email again (without attachment, see above link if you'd like 
to view the attachment)


A friend (Lars Risbo) published some MATLAB code in LinkedIn for 
simulating the infection with a company lockdown after some time. I 
figured I'd try to convert it to Scilab.


The code usesODE45and I'm not sure that I understand how to convert this 
MATLAB code to Scilab. I hope you can explain what I need to do to make 
the code work. Some of the original MATLAB code is found in the comments.


// covid19risbo.sce SEIRsim1// 
Susceptible-Exposed-Infectious-Recovered (SEIR)functiondydt=odefun(t, 
y)iftlockdownendA=[00-delta*R*y(1)/Npop000;...0-gamdelta*R*y(1)/Npop000;...0gam-delta000;...00delta*(1-Fhosp)000;...00delta*Fhosp0-1/Thosp0;...00delta*R*y(1)/Npop000];dydt=A*y;endBegin=datenum(2020,02,20,0,0,0);// 
begin dateDlock=datenum(2020,03,12,0,0,0);// date of 
lockdowndays=Dlock-Begin;R0=2.6;// inital R valuegam=1/3;// gamma, the 
inverse of average latent timedelta=1/5;// inv time constant which 
infectious people either recover or enter hospitalFhosp=0.16;// fraction 
of recovering people going to hospitalThosp=14;// average time of 
hospitalisationNpop=6e6;// total initial population of 
sensitivey0=[Npop;50;50;0;0;0];// [S E I R Hosp ] intial 
cond.t1=0:60;y1=ode(y0,0,60,odefun);// [t1,y1] = ode45(@odefun,[0 
60],y0); // run 1st 
scernarioidx=[3:6];scf();a=gca();plot(Begin+t1,y1(:,idx),'-');// 
semilogy(Begin+t1,y1(:,idx),'-','LineWidth',3)a.log_flags="nln";xlabel('Date')ylabel('Number 
of cases')xgrid();// ax=gca;// ax.YLim=[10 
max(max(y2(:,idx)))];xtitle({'Danish Corona lock down on 20.03.12, vs 14 
days later','R goes from 2.6 to 0.6 at 
lockdown'});legend('Infected','Recovered','Hospitalised','Total Cases');


P.S. Attached a simple graph of what the output should look like (file 
covid19risbo.jpg < 50 kb), at least partially - because I deleted an 
alternative case with a later lockdown date = dashed lines.


Best regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Covid19 model

2020-04-17 Thread Claus Futtrup

Hi Scilabers

A friend (Lars Risbo) published some MATLAB code in LinkedIn for 
simulating the infection with a company lockdown after some time. I 
figured I'd try to convert it to Scilab.


The code uses ODE45 and I'm not sure that I understand how to convert 
this MATLAB code to Scilab. I hope you can explain what I need to do to 
make the code work. Some of the original MATLAB code is found in the 
comments.


// covid19risbo.sce
//
// SEIRsim1
// Susceptible-Exposed-Infectious-Recovered (SEIR)

function  dydt=odefun(t, y)
if  tdelta=  1/5;  // inv time constant which infectious people either recover or enter 
hospital

Fhosp=0.16;  // fraction of recovering people going to hospital
Thosp=14;   // average time of hospitalisation
Npop=6e6;   // total initial population of sensitive
y0=[Npop;50;50;0;0;0];// [S E I R Hosp ] intial cond.
t1  =  0:60;
y1  =  ode(y0,  0,  60,  odefun);  // [t1,y1] = ode45(@odefun,[0 60],y0); // 
run 1st scernario
idx=[3:6];
scf();
a  =  gca();
plot(Begin+t1,y1(:,idx),'-');  // semilogy(Begin+t1,y1(:,idx),'-','LineWidth',3)
a.log_flags  =  "nln";
xlabel('Date')
ylabel('Number of cases')
xgrid();
// ax=gca;
// ax.YLim=[10 max(max(y2(:,idx)))];
xtitle({'Danish Corona lock down on 20.03.12, vs 14 days later','R goes 
from 2.6 to 0.6 at lockdown'});

legend('Infected','Recovered','Hospitalised','Total Cases');

P.S. Attached a simple graph of what the output should look like (file 
covid19risbo.jpg < 50 kb), at least partially - because I deleted an 
alternative case with a later lockdown date = dashed lines.


Best regards,

Claus



--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Incorrect color in function

2020-04-10 Thread Claus Futtrup


HA HA :-D ... it's funny!

Cheers,
Claus

On 10.04.2020 16:09, Antoine Monmayrant wrote:

OK, I think I nailed it:

function a()
 if % then
 end()
 end
endfunction

It's the "end()" in "legend()" that sends the parser off the trail: it thinks that the if block is over (as it has found 
"if", "then" & leg"end"() ) and then treats the next "end" as matching the "function"

Antoine
  
  
Le Vendredi, Avril 10, 2020 15:28 CEST, Federico Miyara  a écrit:
  

Dear all,

When writing the following script in SciNotes (v. 6.1):

function y = testcolor(t)
      if 1==1
      y = sinc(t)
      plot(t, y)
      legend("sinc")
      else
      y = 1
      end
endfunction

the end of the if structure appears with the same brownish color as the
endfunction. Strangely, if copying and pasting here or into a word
processor document, the color is the expected purple (that's why I
removed all colors in this message).

It seems that the culprit is the legend clause.

Regards,

Federico Miyara

___
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




--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] question non datafit

2020-04-07 Thread Claus Futtrup

Hi guys

Since I'm interested in the topic, I decided to look up the link 
(https://help.scilab.org/datafit) on my phone.


I was unable to see the majority of the graphs on the right and I was 
unable to zoom out.


I am able to 'replicate' it on the PC by narrowing the browser window, 
by which the pictures disappear to the right, and there's no scroll bar 
at the bottom.


I there any chance we could make the help pages phone-friendly?

Best regards,
Claus

On 07.04.2020 10:54, Clément David wrote:

Hello Federico, hello all,

Thanks for pointing this, it looks like there is some missing URL redirect 
somewhere.

google "help scilab datafit" on a private navigation tab redirect to the 5.3.3 
help page whereas https://help.scilab.org/datafit looks OK. I will try to update the 
index to improve that, a related bug is #12746. See 
https://bugzilla.scilab.org/show_bug.cgi?id=12746 for more information and discussion on 
that topic, do not hesitate to contribute if you have some SEO knowledge.

Thanks,

--
Clément


-Original Message-
From: users  On Behalf Of Federico
Miyara
Sent: Tuesday, April 7, 2020 2:28 AM
To: users@lists.scilab.org
Subject: Re: [Scilab-users] question non datafit


Samuel:

Oh, this is embarrasing... I did a web search on non-linear fit and
somehow the top results always point at an outdated version (5.5.2) of
Scilab's documentation. I wonder why

Thanks, the new documentation is much better!

Regerds,

Federico Miyara




On 04/04/2020 06:58, Samuel Gougeon wrote:


Le 04/04/2020 à 09:26, Federico Miyara a écrit :



Dear All,

I'm trying to understand the function datafit.

The documentation says:



datafit is used for fitting data to a model. For a 
given function
G(p,z), this function finds the best vector of parameters p for
approximating G(p,z_i)=0 for a set of measurement vectors z_i. Vector
p is found by minimizing
G(p,z_1)'WG(p,z_1)+G(p,z_2)'WG(p,z_2)+...+G(p,z_n)'WG(p,z_n)



I don't quite understand what is G(p,z_1)'WG(p,z_1). Are some
product signs * missing? Shouldn't it be G(p,z_1)'*W*G(p,z_1)? Are
these signs implied as in regular algebra notation?





Hello Federico,
Please see the documentation of the latest scilab release:
https://help.scilab.org/docs/6.1.0/en_US/datafit.html
Regards






___
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




--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?==?utf-8?q? Error in parameters determined in non-linear least-squares fitting

2020-04-06 Thread Claus Futtrup

Hi Scilabers

Good examples are worth a lot. Maybe this one could be part of the 
Scilab documentation?


Best regards,
Claus

On 06.04.2020 08:17, Antoine Monmayrant wrote:

Hello Heinz,

See below the small example I built and I refer to whenever I need to do some 
data fitting with confidence intervals for the parameters of the model.
It is far from perfect but it might help you untangle the Jacobian and 
covariance matrix thingy.
Just two words of caution: (1) I am clearly less versed in applied maths than 
Stéphane or Samuel, so take this with a grain of salft; (2) I built this 
example ages ago, before Samuel improved datafit.

Good luck

Antoine

//
// REFERENCE:
//
//Least Squares Estimation
//SARA A. VAN DE GEER
//Volume 2, pp. 1041–1045
//in
//Encyclopedia of Statistics in Behavioral Science
//ISBN-13: 978-0-470-86080-9
//ISBN-10: 0-470-86080-4
//Editors Brian S. Everitt & David C. Howell
//John Wiley & Sons, Ltd, Chichester, 2005
//

//This is a short and definetly incomplete tutorial on data fitting in Scilab 
using leastsq.
//
// Basic assumption: this tutorial is for scientists that face this simple 
problem:
// they have an experimental dataset x_epx,y_exp and a certain model 
y=Model(x,p) to fit thie dataset.
//  This tutorial will try to answer the folowing questions:
//  1) how do you do that (simply)
//  2) how do you do that (more reliably and more quickly)
//  a) let's go faster with a Jacobian
//  b) how good is your fit? How big is the "error bar" associated with 
each parameter of your Model?
//  c) Can we bullet proof it?

//1) How do you do curve fitting in Scilab
//
//  We need a) a model function b) a dataset c) some more work
//  1)a) Let's start with the model function: a sinewave
//  here is the formula: y=A*sin(k*(x-x0))+y0;
//  here is the function prototypr [y]=SineModel(x,p) with  p=[x0,k,A,y0]'
function [y]=SineModel(x,p)
//INPUTS:   x 1D vector
//  p parameter vector of size [4,1] containing
//  x0  : sine origin
//  k   : sine spatial frequency ie k=2%pi/Xp with Xp the period
//  A   : sine amplitude
//  y0  : sine offset
//OUTPUTS:   y 1D vector of same size than x such that y=A*sin(k*(x-x0))+y0;
   x0=p(1);
   k=p(2);
   A=p(3);
   y0=p(4);
   y=y0+A*sin((x-x0)*k);
endfunction

//  1)b) Let's now have a fake dataset: a sine wave with some noise
//  We reuse the Model function we have just created to make this fake dataset

x_exp=[-10:0.1:10]';
x0=1.55;
k=1*%pi/3;
A=4.3;
y0=1.1
y_exp=SineModel(x_exp,[x0,k,A,y0])+(2*rand(x_exp)-1)*6/10;

//let's check and see what it looks like:
scf();
plot(x_exp,y_exp,'k.-');
xlabel('Exparimental X');
ylabel('Exparimental Y');
xtitle('Our fake experimental dataset to fit');

//  1)c) we are not done yet, we need some more work
//  First we need an error function that return for a given parameter set param 
the difference
//  between the experimental dataset and the model one:
//  Note that this function returns the difference at each point, not the 
square of the difference,
//  nor the sum over each point of the square of the differences
function e = ErrorFitSine(param, x_exp, y_exp)
e = SineModel(x_exp,param)-y_exp;
endfunction
// Now we need a starting point that is not too far away from the solution
// Let's just fo it by hand for the moment we'll see later how to make it 
programmatically
// Just go and have a look at the previous plot and "guess", here is mine:
p0=[1,2*%pi/6,4,1];

//Ready to go:
[f,popt, gropt] = leastsq(list(ErrorFitSine,x_exp,y_exp),p0);
//popt contains the optimal parameter set that fits our dataset
//
scf();
plot(x_exp,y_exp,'k.');
plot(x_exp,SineModel(x_exp,popt),'r-');
xlabel('Experimental X')
ylabel('Experimental Y and best fit');
xtitle([...
 "x0="+msprintf('%1.3f fit value: \t%1.3f',x0,popt(1));...
 "k ="+msprintf('%1.3f fit value: \t%1.3f',k,popt(2));...
 "A ="+msprintf('%1.3f fit value: \t%1.3f',A,popt(3));...
 "y0="+msprintf('%1.3f fit value: \t%1.3f',y0,popt(4))...
]);

//Yep we are done popt is the optimal parameter set that fits our dataset 
x_exp,y_exp with our
// model SineModel
// How to assert the quality of our fit? We can use fopt and gropt for that. 
They should be both as small as possible.
// Ideally, the gradient should be zeros for each parameter, otherwise it means 
we have not found an optimum.

//2) How to go beyond that simple example?
// Namely:
//  a) how to go faster?
//  b) how to estimate how good our fit is (aka get error bars on our 
parameters)?
//  c) how to make thinks more reliable with less human guessing and more 
bulletproofing?


//2)a) and also 2)b)
//  We need the same extra function in order to speed things up and to estimate
//  how the "noise" on the experimental dataset translates in 

Re: [Scilab-users] Scilab 6.1.0 is available!

2020-02-25 Thread Claus Futtrup


Congratulations!

Don't forget to announce on LinkedIn, so I can give it a thumbs up.
https://www.linkedin.com/groups/3688414/

Cheers,
Claus

On 25.02.2020 14:10, Clément David wrote:


Dear Scilab-ers,

A brand new Scilab 6.1.0  is 
released today!


This version includes further improvement atop Scilab 6.0 for better 
stability and increased algorithm performance. It also includes a 
reworked display for more compact and meaningful value printing; web 
tools for HTTP, JSON support; better debug support and various 
algorithm rewrite/extension.


This first iteration of the 6.1 branch fixes up to 245 bugs and 
implements missing features from the 6.0.2 version. We would like to 
give a special thanks to Samuel and Stephane who have been very active 
this year.


If you find any critical issue or instability that might need a 6.1.x 
release please alert us . If you are a 
toolbox maintainer, please rebuild your code, upgrade it when needed 
and publish it to atoms.scilab.org .


For the complete list of changes and bugs fixed, please take a look at 
the CHANGES   file.


--

Clément on behalf of the Scilab team


___
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] FEA in Scilab

2020-01-30 Thread Claus Futtrup

Hi Michael

I'm the thread starter. Good point that one could look in MATLAB for 
inspiration.


I am not so much interested in creating a FEA program (or API) myself in 
Scilab, but if anything exist today which to some extent is in 
development or service (maintenance), then I'd be inclined to try this.


... Conclusion seems to be, this is not the case.

Best regards,
Claus

On 30.01.2020 14:59, Michael J. McCann wrote:

Federico,
This isn't really an answer but I have in hand a book;

"Introduction to  Finite and Spectral Element Methods Using MATLAB",
 C.Pozrikidis, CRC Press,    2014     ISBN978.1.4822.0915.0
It might provide models for coding even if the dialect is different.

Mike.

On 1/28/2020 7:14 PM, Federico Miyara wrote:


Claus,

I'm interested.

Regards,

Federico Miyara


On 27/01/2020 07:25, Claus Futtrup wrote:

Dear fellow Scilabers

There are various initiatives and possibly demonstration projects 
for implementing Finite Element algorithms and Analysis in Scilab. 
Please help me by providing pointers.


What I'd like to simulate is the suspension of a loudspeaker (the 
cloth spider which essentially centers the voice coil in the air 
gap), in particular I wish to calculate a force-deflection curve.


In my particular case, I'd like to describe the spider as a 
collection of line segments (straight lines as well as circular 
sections). This description represents a cross section view of the 
spider. For proper modeling, this is an axisymmetric model of the 
spider.


I have a simple description of what I'd like to do in Scilab, but 
done in a software named Mecway. The PDF is 650 kb (4 pages). I am 
worried about attaching such a document to the User Group here in 
general, but I can of course send it on request. In Mecway the 
axisymmetric model is expanded into 3D with hex8 elements (it looks 
like a basic cubic element). The force-function is applied in 40 
time steps. It looks like 40 x basic static analysis.


Please let me know what you think would be suitable for solving this 
problem. Is there a suitable ATOMS library?


Best regards,
Claus

___
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


--
Note: Email address is now 'mjmcc...@ieee.org' not 'iee.org'

___
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] FEA in Scilab

2020-01-27 Thread Claus Futtrup

Hi Samuel

Ah yes. This would be a great way to load a module and work on a FEA 
problem in Scilab. Is the maintainer (Yann Collette) still somewhere in 
the Scilab-sphere?


Best regards,
Claus

On 27.01.2020 20:18, Samuel Gougeon wrote:

Le 27/01/2020 à 11:25, Claus Futtrup a écrit :

Dear fellow Scilabers

There are various initiatives and possibly demonstration projects for 
implementing Finite Element algorithms and Analysis in Scilab. Please 
help me by providing pointers.


What I'd like to simulate is the suspension of a loudspeaker (the 
cloth spider which essentially centers the voice coil in the air 
gap), in particular I wish to calculate a force-deflection curve.


In my particular case, I'd like to describe the spider as a 
collection of line segments (straight lines as well as circular 
sections). This description represents a cross section view of the 
spider. For proper modeling, this is an axisymmetric model of the 
spider.


I have a simple description of what I'd like to do in Scilab, but 
done in a software named Mecway. The PDF is 650 kb (4 pages). I am 
worried about attaching such a document to the User Group here in 
general, but I can of course send it on request. In Mecway the 
axisymmetric model is expanded into 3D with hex8 elements (it looks 
like a basic cubic element). The force-function is applied in 40 time 
steps. It looks like 40 x basic static analysis.


Please let me know what you think would be suitable for solving this 
problem. Is there a suitable ATOMS library?



sciFreeFEM, but it is not ported to Scilab 6: 
https://atoms.scilab.org/toolboxes/SciFreeFEM


Samuel


___
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] FEA in Scilab

2020-01-27 Thread Claus Futtrup

Hi Denis

I did a search in their documentation (it's offered on their web pages) 
for Scilab, and only found one hit which explains their arrays are set 
like matlab or scilab.


Searching their modules library for "scilab" returned empty.

I did a google search "scilab site:freefem.org" ... but nothing hints 
that freefem is somehow supporting integration with Scilab. Am I wrong? 
(Any pointers?)


Best regards,
Claus

On 27.01.2020 18:35, CRETE Denis wrote:

Hello,
You can try freefem.org
HTH
Denis

-Message d'origine-
De : users [mailto:users-boun...@lists.scilab.org] De la part de Claus Futtrup
Envoyé : lundi 27 janvier 2020 18:32
À : users@lists.scilab.org
Objet : Re: [Scilab-users] FEA in Scilab

Hi

I've searched for FreeFEM and found https://wiki.scilab.org/FreeFem ...
but the wiki returns that the page no longer exist. Do you know of
another link?

Best regards,
Claus

On 27.01.2020 16:01, Heinz Nabielek wrote:

I would have no idea, if the report

"Finite Elements in Scilab: Solution of partial differential equations supported by 
the FreeFEM toolbox"

is any help. Dr van Seggern is long retired from the Forschungszentrum Jülich.
Greetings
Heinz




FORSCHUNGSZENTRUM JÜLICH GmbH
Zentralinstitut für Angewandte Mathematik
D-52425 Jülich, Tel. (02461) 61-6402
Interner Bericht
Finite Elemente in Scilab:Das Lösen partieller Differentialgleichungen mit 
Hilfe der FreeFEM-Toolbox

Rainer von Seggern
FZJ-ZAM-IB-2001-03
April 2001


On 27.01.2020, at 11:25, Claus Futtrup  wrote:

Dear fellow Scilabers

There are various initiatives and possibly demonstration projects for 
implementing Finite Element algorithms and Analysis in Scilab. Please help me 
by providing pointers.

What I'd like to simulate is the suspension of a loudspeaker (the cloth spider 
which essentially centers the voice coil in the air gap), in particular I wish 
to calculate a force-deflection curve.

In my particular case, I'd like to describe the spider as a collection of line 
segments (straight lines as well as circular sections). This description 
represents a cross section view of the spider. For proper modeling, this is an 
axisymmetric model of the spider.

I have a simple description of what I'd like to do in Scilab, but done in a 
software named Mecway. The PDF is 650 kb (4 pages). I am worried about 
attaching such a document to the User Group here in general, but I can of 
course send it on request. In Mecway the axisymmetric model is expanded into 3D 
with hex8 elements (it looks like a basic cubic element). The force-function is 
applied in 40 time steps. It looks like 40 x basic static analysis.

Please let me know what you think would be suitable for solving this problem. 
Is there a suitable ATOMS library?

Best regards,
Claus
___
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



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] FEA in Scilab

2020-01-27 Thread Claus Futtrup

Hi

I've searched for FreeFEM and found https://wiki.scilab.org/FreeFem ... 
but the wiki returns that the page no longer exist. Do you know of 
another link?


Best regards,
Claus

On 27.01.2020 16:01, Heinz Nabielek wrote:

I would have no idea, if the report

"Finite Elements in Scilab: Solution of partial differential equations supported by 
the FreeFEM toolbox"

is any help. Dr van Seggern is long retired from the Forschungszentrum Jülich.
Greetings
Heinz




FORSCHUNGSZENTRUM JÜLICH GmbH
Zentralinstitut für Angewandte Mathematik
D-52425 Jülich, Tel. (02461) 61-6402
Interner Bericht
Finite Elemente in Scilab:Das Lösen partieller Differentialgleichungen mit 
Hilfe der FreeFEM-Toolbox

Rainer von Seggern
FZJ-ZAM-IB-2001-03
April 2001


On 27.01.2020, at 11:25, Claus Futtrup  wrote:

Dear fellow Scilabers

There are various initiatives and possibly demonstration projects for 
implementing Finite Element algorithms and Analysis in Scilab. Please help me 
by providing pointers.

What I'd like to simulate is the suspension of a loudspeaker (the cloth spider 
which essentially centers the voice coil in the air gap), in particular I wish 
to calculate a force-deflection curve.

In my particular case, I'd like to describe the spider as a collection of line 
segments (straight lines as well as circular sections). This description 
represents a cross section view of the spider. For proper modeling, this is an 
axisymmetric model of the spider.

I have a simple description of what I'd like to do in Scilab, but done in a 
software named Mecway. The PDF is 650 kb (4 pages). I am worried about 
attaching such a document to the User Group here in general, but I can of 
course send it on request. In Mecway the axisymmetric model is expanded into 3D 
with hex8 elements (it looks like a basic cubic element). The force-function is 
applied in 40 time steps. It looks like 40 x basic static analysis.

Please let me know what you think would be suitable for solving this problem. 
Is there a suitable ATOMS library?

Best regards,
Claus
___
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


[Scilab-users] FEA in Scilab

2020-01-27 Thread Claus Futtrup
Dear fellow Scilabers

There are various initiatives and possibly demonstration projects for
implementing Finite Element algorithms and Analysis in Scilab. Please help
me by providing pointers.

What I'd like to simulate is the suspension of a loudspeaker (the cloth
spider which essentially centers the voice coil in the air gap), in
particular I wish to calculate a force-deflection curve.

In my particular case, I'd like to describe the spider as a collection of
line segments (straight lines as well as circular sections). This
description represents a cross section view of the spider. For proper
modeling, this is an axisymmetric model of the spider.

I have a simple description of what I'd like to do in Scilab, but done in a
software named Mecway. The PDF is 650 kb (4 pages). I am worried about
attaching such a document to the User Group here in general, but I can of
course send it on request. In Mecway the axisymmetric model is expanded
into 3D with hex8 elements (it looks like a basic cubic element). The
force-function is applied in 40 time steps. It looks like 40 x basic static
analysis.

Please let me know what you think would be suitable for solving this
problem. Is there a suitable ATOMS library?

Best regards,
Claus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] {EXT} density in a graph

2020-01-23 Thread Claus Futtrup

Hi Jean-Philippe

To me it sounds like you are trying to fill a set of polygons in Scilab, 
i.e. that what you wish to do can be done with xfpolys ...


https://help.scilab.org/docs/6.0.2/en_US/xfpolys.html

I doubt there is an automagic way to do it in Scilab. Probably it will 
require some manual labor and or thinking up some function on your own. (?)


Best regards,
Claus

On 23.01.2020 17:50, Jean-Philippe Grivet wrote:

Le 23/01/2020 à 17:24, Dang Ngoc Chan, Christophe a écrit :

Hello,


De : Jean-Philippe Grivet
Envoyé : jeudi 23 janvier 2020 16:36

I am drawing a graph in a gray scale (say from 1 to 32), using lines 
of different
density. I would like that, in the region of intersection of two 
lines, the shade

of gray be the sum of the densities of each line.
How can I manage that ?

I'm affraid I can't figure out what you're trying to do.

Maybe a small drawing or a small sample of data?

Do you have lines with a linear density and try to draw a surface 
density or?


--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

General
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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Sorry that I haven't been clear enough. Suppose that I want to draw a 
figure X made up of two strips. Strip 1 (SW_NE) has gray level 3; 
strip 2 (NW-SE) is drawn at gray level 7. The region of overlap of 
these strips (roughly a parallelogram) should display a density of 7 
(darker than either strip). Is that possible within Scilab ?


___
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


[Scilab-users] Next Scilab releaes?

2020-01-22 Thread Claus Futtrup

Hi there

Last Scilab release was 6.0.2, February last year. I wonder if there's 
another release coming soon?


Will it be a minor patch release (6.0.3) or is there something bigger 
coming?


Any roadmap? - What is the next big thing? (even if it's not coming soon)

There was a conference in October, but is there anywhere I can read a 
summary? 
(https://www.esi-group.com/company/events/2019/scilab-conference-2019)


Actually I wonder if there is anywhere I could read about recent 
activities in Scilab and future plans?


Best regards,

Claus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] ?= GUI hel

2019-11-29 Thread Claus Futtrup

Hi Stéphane

Lazy = not pretty.

... but you didn't answer my question. Which way do you personally 
prefer? ... and why?


Cheers,
Claus

On 29.11.2019 21:13, Stéphane Mottelet wrote:

Hello again,


Le 29 nov. 2019 à 19:55, Claus Futtrup  a écrit :


Hi Stéphane

>In "ge_fs=ge_fs" the lhs is a local copy and the rhs the variable in 
the calling context.


I figured something like this was going on, but I don't find it 
logical. I read this as follows: The ge_r is a global handle, for 
which the function doesn't have write access. When you assign it to a 
local variable (it can be the same name, or a new name, I suppose), 
then suddenly this opens up for writing to it (so you can set the 
properties). Strange. I don't think even a hardcore programmer can 
find this to be "pretty code" ... it looks like a hack / a workaround 
to me.




No hack here. Please 
see https://wiki.scilab.org/howto/global%20and%20local%20variables 
<https://wiki.scilab.org/howto/global%20and%20local%20variables>


Even the very orthodoxic Julia uses in some similar context  lazy 
global variables.


S.


I read your response just as - this is another way to do it - but 
which way do you personally prefer? ... and why? (maybe execution 
speed? ... or is there a benefit in flexibility that I cannot see?).


Best regards,
Claus

On 29.11.2019 19:21, Stéphane Mottelet wrote:



Le 29/11/2019 à 19:17, Claus Futtrup a écrit :

Hi Stéphane

Hm, you're right. This actually fixes the problem, but I do find it 
to be a strange "solution" that you write each of them to be equal 
with itself ... I prefer calling the set() function.


In "ge_fs=ge_fs" the lhs is a local copy and the rhs the variable in 
the calling context.




Cheers,
Claus

On 29.11.2019 19:05, Stéphane Mottelet wrote:

To makeit work, just insert

ge_r=ge_r;
ge_fs=ge_fs;
ge_hz=ge_hz;

at the begining of function calc.

My two cents...

S.


Le 29/11/2019 à 18:58, Claus Futtrup a écrit :

Hi Antoine

>Not much progress because I never managed to get a minimal working example
I can repeat my example again and again. It never works. Please 
see it below.


Do you agree. This consistently fails if you run it from Scinotes 
editor ... but if I copy e.g. ge_r.visible = "on" to the command 
line (not from within the calc function), then it shows up.


/Claus

// BAD_GUI_EXAMPLE.SCE
//
// Demo of how _NOT_ to build a simple GUI in Scilab.

// Initialize variables
m  =  1;  // Moving mass 'm'(kilogram)
k  =  1;  // Stiffness, spring constant 'k'(Newton per meter)
fres  =  1;  // Resonance frequency (Hertz)

function  calc()
 m  =  evstr(get(ge_m,"string"));  // get content in uicontrol ge_m
 k  =  evstr(get(ge_k,"string"));  // get content in uicontrol ge_k
 fres=sqrt(k/m)/(2*%pi);
 // putting GUI updates inside the calculation routine is not 
pretty code.

 ge_r.visible  =  "on";
 ge_fs.visible  =  "on";// THIS DOESN'T WORK
 ge_hz.visible  =  "on";
// set(ge_r,"Visible","on"); // THIS WORKS
// set(ge_fs,"Visible","on");
// set(ge_hz,"Visible","on");
 // update global variables
 [m,k,fres]=return(m,k,fres);
endfunction

function  goodbye()
 close(ge);  // Close GUI window
 printf("Resulting fres: %f Hertz\n",fres);
 abort  // Print result in console (e.g. for copy/paste), then kill the app
endfunction

ge  =  scf();  // GUI Example, Initialize and 'set current figure'
as  =  ge.axes_size;  // read size of window, as = [width height]
ge.figure_name  =  "GUI Example";  // Change window header

uicontrol("style","text","string","Moving mass :","position",  ..
   [10  as(2)-35  80  20],"background",[1  1  1]);  // white background
   // position properties has four parameters = x,y,width,height
   // y-position counts from lower left corner, so we subtract from 'as'
ge_m  =  uicontrol("style","edit","string",string(m),  ..
   "position",[100  as(2)-35  80  20]);
uicontrol("style","text","string","kg ","position",  ..
   [200  as(2)-35  30  20],"background",[1  1  1]);

uicontrol("style","text","string","Stiffness :","position",  ..
   [10  as(2)-60  80  20],"background",[1  1  1]);
ge_k  =  uicontrol("style","edit","string",string(k),  ..
   "position",[100  as(2)-60  80  20]);
uicontrol("style","text","string","N/m ","position",  ..
   [200  as(2)-60  30  20],"background",[1  1  1]);

uicontrol("style","pushbutton","strin

Re: [Scilab-users] ?= GUI hel

2019-11-29 Thread Claus Futtrup

Hi Stéphane

>In "ge_fs=ge_fs" the lhs is a local copy and the rhs the variable in 
the calling context.


I figured something like this was going on, but I don't find it logical. 
I read this as follows: The ge_r is a global handle, for which the 
function doesn't have write access. When you assign it to a local 
variable (it can be the same name, or a new name, I suppose), then 
suddenly this opens up for writing to it (so you can set the 
properties). Strange. I don't think even a hardcore programmer can find 
this to be "pretty code" ... it looks like a hack / a workaround to me.


I read your response just as - this is another way to do it - but which 
way do you personally prefer? ... and why? (maybe execution speed? ... 
or is there a benefit in flexibility that I cannot see?).


Best regards,
Claus

On 29.11.2019 19:21, Stéphane Mottelet wrote:



Le 29/11/2019 à 19:17, Claus Futtrup a écrit :

Hi Stéphane

Hm, you're right. This actually fixes the problem, but I do find it 
to be a strange "solution" that you write each of them to be equal 
with itself ... I prefer calling the set() function.


In "ge_fs=ge_fs" the lhs is a local copy and the rhs the variable in 
the calling context.




Cheers,
Claus

On 29.11.2019 19:05, Stéphane Mottelet wrote:

To makeit work, just insert

ge_r=ge_r;
ge_fs=ge_fs;
ge_hz=ge_hz;

at the begining of function calc.

My two cents...

S.


Le 29/11/2019 à 18:58, Claus Futtrup a écrit :

Hi Antoine

>Not much progress because I never managed to get a minimal working example
I can repeat my example again and again. It never works. Please see 
it below.


Do you agree. This consistently fails if you run it from Scinotes 
editor ... but if I copy e.g. ge_r.visible = "on" to the command 
line (not from within the calc function), then it shows up.


/Claus

// BAD_GUI_EXAMPLE.SCE
//
// Demo of how _NOT_ to build a simple GUI in Scilab.

// Initialize variables
m  =  1;  // Moving mass 'm'(kilogram)
k  =  1;  // Stiffness, spring constant 'k'(Newton per meter)
fres  =  1;  // Resonance frequency (Hertz)

function  calc()
 m  =  evstr(get(ge_m,"string"));  // get content in uicontrol ge_m
 k  =  evstr(get(ge_k,"string"));  // get content in uicontrol ge_k
 fres=sqrt(k/m)/(2*%pi);
 // putting GUI updates inside the calculation routine is not pretty 
code.

 ge_r.visible  =  "on";
 ge_fs.visible  =  "on";// THIS DOESN'T WORK
 ge_hz.visible  =  "on";
// set(ge_r,"Visible","on"); // THIS WORKS
// set(ge_fs,"Visible","on");
// set(ge_hz,"Visible","on");
 // update global variables
 [m,k,fres]=return(m,k,fres);
endfunction

function  goodbye()
 close(ge);  // Close GUI window
 printf("Resulting fres: %f Hertz\n",fres);
 abort  // Print result in console (e.g. for copy/paste), then kill the app
endfunction

ge  =  scf();  // GUI Example, Initialize and 'set current figure'
as  =  ge.axes_size;  // read size of window, as = [width height]
ge.figure_name  =  "GUI Example";  // Change window header

uicontrol("style","text","string","Moving mass :","position",  ..
   [10  as(2)-35  80  20],"background",[1  1  1]);  // white background
   // position properties has four parameters = x,y,width,height
   // y-position counts from lower left corner, so we subtract from 'as'
ge_m  =  uicontrol("style","edit","string",string(m),  ..
   "position",[100  as(2)-35  80  20]);
uicontrol("style","text","string","kg ","position",  ..
   [200  as(2)-35  30  20],"background",[1  1  1]);

uicontrol("style","text","string","Stiffness :","position",  ..
   [10  as(2)-60  80  20],"background",[1  1  1]);
ge_k  =  uicontrol("style","edit","string",string(k),  ..
   "position",[100  as(2)-60  80  20]);
uicontrol("style","text","string","N/m ","position",  ..
   [200  as(2)-60  30  20],"background",[1  1  1]);

uicontrol("style","pushbutton","string","Calculate",  ..
   "position",[10  as(2)-85  80  20],"callback","calc");

ge_r  =  uicontrol("style","text","string","Result :","position",  ..
   [10  as(2)-110  80  20],"visible","off");  // keep these hidden for 
a start
ge_fs  =  uicontrol("style","text","string",string(fres),  ..
   "position",[100  as(2)-110  80  20],"visible&quo

Re: [Scilab-users] ?= GUI hel

2019-11-29 Thread Claus Futtrup

Hi Antoine, et al - anybody feel free to chime in.

I see the below example uses f=figure() ... instead of f=scf().

What's the reason for this preference?

From my side, the only difference I can see, is that figure() generates 
a place for a GUI with a grey background (background = 33) ... whereas 
when I call scf() the background is white (background =  -2). I see the 
same list of handles, and all other are also initialized to the same values.


Is there a difference, maybe an invisible one?

Best regards,
Claus

On 29.11.2019 18:34, Antoine Monmayrant wrote:

4) I will also look into this. My problem is the steep learning curve.
If you look at the Scilab tutorials you have the good-old Openeering
LHY_Tutorial - it's incredibly complicated and long. Is LHY_Tutorial
using the Model-Viewer-Controller approach? - Maybe the
Model-Viewer-Controller could be presented in a _simple_ tutorial - is
it possible?

Hmm, that would be a good idea.
I'll see whether I can put something together.
The thing is, MVC approach looks rather silly and overengineered on a small 
example.

I have not tried to follow a MWC approach, but here is my attempt at making a 
really simple GUI to just show the basics (see below).
It take numbers from two different types of uicontrols (a slider and an edit) 
and display the sum in a text uicontrol.
To keep things simple, I positioned and sized the uicontrols manually instead 
of using a gridbag.
I also tried to use the fancy syntax for get() and set() that do not require 
calling findobj(), as suggested by Samuel.

Hope it helps,

Antoine


f=figure();

/*  First number from slider   */
//values
nmin=-5;
nmax=10;
nini=7;
nsmallstep=1;
nsbigstep=2;
//slider position and size
x=10;
y=20;
w=100;
h=25;
//slider uicontrol creation in figure f
hslider=uicontrol(f, ...
 "style", "slider", ...
 "tag", "slider1", ...
 "backgroundcolor", [1 1 1], ...
 "position", [x y w h], ...
 "value", nini, ...
 "min", nmin, ...
 "max", nmax, ...
 "sliderstep", [nsmallstep, nsbigstep], ...
 "callback", "update_values");

/* - Second number from an editable text -  */
// initial value
editini="3.14";
//edit position and size
x2=x;
y2=y+h+5;
w2=w;
h2=h;
//edit uicontrol creation in figure f
hedit=uicontrol(f, ...
 "style", "edit", ...
 "tag", "edit2", ...
 "backgroundcolor", [1 1 1], ...
 "position", [x2 y2 w2 h2], ...
 "string", editini, ...
 "callback", "update_values");
 
/* - Sum displayed in a text uicontrol -  */

// initial value
textini="Nothing"
//edit position and size
x3=x+w+5;
y3=y;
w3=w;
h3=2*h+5;
//slider uicontrol creation
htext=uicontrol(f, ...
 "style", "text", ...
 "tag", "text3", ...
 "backgroundcolor", [1 1 1], ...
 "position", [x3 y3 w3 h3], ...
 "string", textini);

/*  callback function for slider and edit uicontrols   */
//Whenever user interacts with the slider or the edit uicontrols
//  show the sum of both numbers in the text field
function update_values()
 //temporarily deactivate the callback (don't want callback calls to stack 
up while processing the current one
 set(gcbo,"callback_type",-1);
 /*
   Using the unique tag chosen at the creation time of the uicontrols
   to set/get the uicontrol properties
 */
 //get both numbers from the slider and the edit uicontrols
 number1=get("slider1", "value");
 string2=get("edit2", "string");
 //do your maths & conversion
 string3=string(number1+evstr(string2));
 //change the string displayed in the text uicontrol
 set("text3", "string", string3);
 //reactivate callback
 set(gcbo,"callback_type",0);
endfunction

___
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] ?= GUI hel

2019-11-29 Thread Claus Futtrup

Hi Antoine

Thank you, with just 82 lines (incl. comments) it's within reason and 
I'm thinking it could be a suitable example for Scilab documentation. I 
shall study the details and see how it works out in my application (that 
I'm doing for work).


Cheers,
Claus

On 29.11.2019 18:34, Antoine Monmayrant wrote:

4) I will also look into this. My problem is the steep learning curve.
If you look at the Scilab tutorials you have the good-old Openeering
LHY_Tutorial - it's incredibly complicated and long. Is LHY_Tutorial
using the Model-Viewer-Controller approach? - Maybe the
Model-Viewer-Controller could be presented in a _simple_ tutorial - is
it possible?

Hmm, that would be a good idea.
I'll see whether I can put something together.
The thing is, MVC approach looks rather silly and overengineered on a small 
example.

I have not tried to follow a MWC approach, but here is my attempt at making a 
really simple GUI to just show the basics (see below).
It take numbers from two different types of uicontrols (a slider and an edit) 
and display the sum in a text uicontrol.
To keep things simple, I positioned and sized the uicontrols manually instead 
of using a gridbag.
I also tried to use the fancy syntax for get() and set() that do not require 
calling findobj(), as suggested by Samuel.

Hope it helps,

Antoine


f=figure();

/*  First number from slider   */
//values
nmin=-5;
nmax=10;
nini=7;
nsmallstep=1;
nsbigstep=2;
//slider position and size
x=10;
y=20;
w=100;
h=25;
//slider uicontrol creation in figure f
hslider=uicontrol(f, ...
 "style", "slider", ...
 "tag", "slider1", ...
 "backgroundcolor", [1 1 1], ...
 "position", [x y w h], ...
 "value", nini, ...
 "min", nmin, ...
 "max", nmax, ...
 "sliderstep", [nsmallstep, nsbigstep], ...
 "callback", "update_values");

/* - Second number from an editable text -  */
// initial value
editini="3.14";
//edit position and size
x2=x;
y2=y+h+5;
w2=w;
h2=h;
//edit uicontrol creation in figure f
hedit=uicontrol(f, ...
 "style", "edit", ...
 "tag", "edit2", ...
 "backgroundcolor", [1 1 1], ...
 "position", [x2 y2 w2 h2], ...
 "string", editini, ...
 "callback", "update_values");
 
/* - Sum displayed in a text uicontrol -  */

// initial value
textini="Nothing"
//edit position and size
x3=x+w+5;
y3=y;
w3=w;
h3=2*h+5;
//slider uicontrol creation
htext=uicontrol(f, ...
 "style", "text", ...
 "tag", "text3", ...
 "backgroundcolor", [1 1 1], ...
 "position", [x3 y3 w3 h3], ...
 "string", textini);

/*  callback function for slider and edit uicontrols   */
//Whenever user interacts with the slider or the edit uicontrols
//  show the sum of both numbers in the text field
function update_values()
 //temporarily deactivate the callback (don't want callback calls to stack 
up while processing the current one
 set(gcbo,"callback_type",-1);
 /*
   Using the unique tag chosen at the creation time of the uicontrols
   to set/get the uicontrol properties
 */
 //get both numbers from the slider and the edit uicontrols
 number1=get("slider1", "value");
 string2=get("edit2", "string");
 //do your maths & conversion
 string3=string(number1+evstr(string2));
 //change the string displayed in the text uicontrol
 set("text3", "string", string3);
 //reactivate callback
 set(gcbo,"callback_type",0);
endfunction

___
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] ?= GUI hel

2019-11-29 Thread Claus Futtrup

Hi Antoine


Not much progress because I never managed to get a minimal working example


I can repeat my example again and again. It never works. Please see it 
below.


Do you agree. This consistently fails if you run it from Scinotes editor 
... but if I copy e.g. ge_r.visible = "on" to the command line (not from 
within the calc function), then it shows up.


/Claus

// BAD_GUI_EXAMPLE.SCE
//
// Demo of how _NOT_ to build a simple GUI in Scilab.

// Initialize variables
m  =  1;  // Moving mass 'm'(kilogram)
k  =  1;  // Stiffness, spring constant 'k'(Newton per meter)
fres  =  1;  // Resonance frequency (Hertz)

function  calc()
m  =  evstr(get(ge_m,"string"));  // get content in uicontrol ge_m
k  =  evstr(get(ge_k,"string"));  // get content in uicontrol ge_k
fres=sqrt(k/m)/(2*%pi);
// putting GUI updates inside the calculation routine is not pretty code.
ge_r.visible  =  "on";
ge_fs.visible  =  "on";// THIS DOESN'T WORK
ge_hz.visible  =  "on";
// set(ge_r,"Visible","on"); // THIS WORKS
// set(ge_fs,"Visible","on");
// set(ge_hz,"Visible","on");
// update global variables
[m,k,fres]=return(m,k,fres);
endfunction

function  goodbye()
close(ge);  // Close GUI window
printf("Resulting fres: %f Hertz\n",fres);
abort  // Print result in console (e.g. for copy/paste), then kill the app
endfunction

ge  =  scf();  // GUI Example, Initialize and 'set current figure'
as  =  ge.axes_size;  // read size of window, as = [width height]
ge.figure_name  =  "GUI Example";  // Change window header

uicontrol("style","text","string","Moving mass :","position",  ..
  [10  as(2)-35  80  20],"background",[1  1  1]);  // white background
  // position properties has four parameters = x,y,width,height
  // y-position counts from lower left corner, so we subtract from 'as'
ge_m  =  uicontrol("style","edit","string",string(m),  ..
  "position",[100  as(2)-35  80  20]);
uicontrol("style","text","string","kg ","position",  ..
  [200  as(2)-35  30  20],"background",[1  1  1]);

uicontrol("style","text","string","Stiffness :","position",  ..
  [10  as(2)-60  80  20],"background",[1  1  1]);
ge_k  =  uicontrol("style","edit","string",string(k),  ..
  "position",[100  as(2)-60  80  20]);
uicontrol("style","text","string","N/m ","position",  ..
  [200  as(2)-60  30  20],"background",[1  1  1]);

uicontrol("style","pushbutton","string","Calculate",  ..
  "position",[10  as(2)-85  80  20],"callback","calc");

ge_r  =  uicontrol("style","text","string","Result :","position",  ..
  [10  as(2)-110  80  20],"visible","off");  // keep these hidden for a 
start
ge_fs  =  uicontrol("style","text","string",string(fres),  ..
  "position",[100  as(2)-110  80  20],"visible","off");
ge_hz  =  uicontrol("style","text","string","Hz ","position",  ..
  [200  as(2)-110  30  20],"visible","off");

uicontrol("style","pushbutton","string","Exit",  ..
  "position",[10  as(2)-135  80  20],"callback","goodbye");


On 29.11.2019 10:20, Antoine Monmayrant wrote:

Le Jeudi, Novembre 28, 2019 19:40 CET, Claus Futtrup  a 
écrit:
  

Hi Antoine

Also, you should better use get(a, 'propertyName') or set(a, 'propertyName', 
value) instead of a.propertyName and a.propertyName=value in your callbacks.


I see what you mean. I just now had trouble turning visibility on/off,
but using set(), it works fine. Thanks for the tip.

It's something quite weird, maybe a race condition.
I've seen it when using 'a.prop' or 'a.prop=value' syntax in either a callback 
function or in a for loop.
When you repeatedly use this syntax, scilab tends to forget that 'a' exists and 
that it's a handle with different properties.
The initial bug report is here: http://bugzilla.scilab.org/show_bug.cgi?id=15786
Not much progress because I never managed to get a minimal working example 
(it's an Heisenbug).

Antoine


Best regards,
Claus

On 28.11.2019 17:47, Antoine Monmayrant wrote:

Le Jeudi, Novembre 28, 2019 17:05 CET, Claus Futtrup  a 
écrit:
   

Hi Antoine, et al.

Your reply is very helpful, so I think you got the right question :-)

1

Re: [Scilab-users] ?= GUI hel

2019-11-28 Thread Claus Futtrup

Hi Antoine

Also, you should better use get(a, 'propertyName') or set(a, 'propertyName', 
value) instead of a.propertyName and a.propertyName=value in your callbacks.


I see what you mean. I just now had trouble turning visibility on/off, 
but using set(), it works fine. Thanks for the tip.


Best regards,
Claus

On 28.11.2019 17:47, Antoine Monmayrant wrote:

Le Jeudi, Novembre 28, 2019 17:05 CET, Claus Futtrup  a 
écrit:
  

Hi Antoine, et al.

Your reply is very helpful, so I think you got the right question :-)

1) Good point that I can use callback on every uicontrol. This would be
suitable for a simple example (like gui_example.sce) ... but for heavy
calculations, it might be more practical with a CALC button. P.S. The
correct equation for the resonance frequency is fres=sqrt(k/m)/(2*%pi);

You are right.
Also, the trick to disable the callback function/ reenable it is key for 
sliders that tend to generate an avalanche of call to the function when one 
moves the cursor.


2) I see what you mean, so not having an empty space, but "show" the
whole she-bang from the beginning. I didn't want to do that (just
deleting the IF-statement), but it could be the best solution in the end
(rather than the inline GUI updates), if nothing better shows up. This
was somehow the "core" of my question. Maybe I ask for too much.

I think you can achieve what you want by setting ".visible='off'" for all the uicontrols 
you don't want to show initialy. You can then set  ".visible='on'" after the first call 
to the callback (or at each call if you are lazy).


3) I will look into this. Thanks for the tip.

Also, you should better use get(a, 'propertyName') or set(a, 'propertyName', 
value) instead of a.propertyName and a.propertyName=value in your callbacks.
I have found that this latter syntax is causing a lot of bug if your callback 
get called really often. I still don't know why.


4) I will also look into this. My problem is the steep learning curve.
If you look at the Scilab tutorials you have the good-old Openeering
LHY_Tutorial - it's incredibly complicated and long. Is LHY_Tutorial
using the Model-Viewer-Controller approach? - Maybe the
Model-Viewer-Controller could be presented in a _simple_ tutorial - is
it possible?

Hmm, that would be a good idea.
I'll see whether I can put something together.
The thing is, MVC approach looks rather silly and overengineered on a small 
example.


I appreciate gui_example.sce with just about 70 lines of code, two
inputs and one output. I think something like it could help a lot of
people ... and it's not 250 lines of code to get a GUI up and running,
if you know what I mean. The gui_example shows a few differences, like
white versus grey background, editable boxes, etc. In the outputs,
because of the default grey background, you can see the dimensions of
the grid / text-boxes, and gui_example has two buttons. It looks
operational and easy to expand for new users.

Cheers,
Claus

On 28.11.2019 08:57, Antoine Monmayrant wrote:

Hello Claus,

I've been playing a bit with GUIs for teaching, so maybe I can help.
The issue is that I don't get what your problem is exactly here, so I my answer 
might be a bit off-topic.
Do not hesitate to rephrase your issue, I'll try a more focused answer.

Anywya, here is how I think your code could be improved:

(1) You can use 'calc' as the callback for all of the editable text field so 
that your result gets shown right away, without having to press a button.
(2) You should populate all the uicontrols of your gui first, then only update 
the displayed values, the visibility of the uicontrols, etc inside your calc 
function. (ie no more creating a uicontrol inside a callback)
(3) The 'tag' property of any uicontrol together with 'findobj()' are really 
nice to get/set the properties of each existing uicontrol.
(4) You can rely on a proper Model-View-Controler approach (or any other well 
established method to avoid mixing gui stuff with calculation stuff).

I attached a small gui I use to illustrate optical anti-reflection coating.
It is far from perfect (I did not implement a proper model-view-controler for 
example).
But you can see how I tried to separate the different parts of the code an how 
I use findobj/tag/get/set,  etc.

Hope it helps,

Antoine
   
Le Mercredi, Novembre 27, 2019 19:21 CET, Claus Futtrup  a écrit:
   

Hi there

I'm trying to build a GUI. For simplicity on the forum, I've built a
really simple example of what I'm trying to do. How can I make the
"conditional" GUI output work and not have it inside the calc function?
... or, how would you do it? Thanks.

Best regards, Claus.

// GUI_EXAMPLE.SCE
//
// Demo of how to build a simple GUI in Scilab.
// Real simple, with two input variables and one output.
// The example uses the basic mechanical example of a mass and a spring as
// input parameters and calculates the resonance frequency of the mechanical
// system.

/

Re: [Scilab-users] ?= GUI hel

2019-11-28 Thread Claus Futtrup

Hi Stefan

>save my GUI data in a struct() in the "user_data"

I don't understand. Can you show me an example to explain this?

Best regards,
Claus

On 28.11.2019 18:54, Stefan Du Rietz wrote:
Le Jeudi, Novembre 28, 2019 17:05 CET, Claus Futtrup 
 a écrit:
  I think you can achieve what you want by setting ".visible='off'" 
for all the uicontrols you don't want to show initialy. You can then 
set  ".visible='on'" after the first call to the callback (or at each 
call if you are lazy).


I do that and it is very convenient. I also save my GUI data in a 
struct() in the "user_data" of the parent figure of the GUI. Then I 
don't need global variables or even findobj().


Regards
Stefan
___
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] ?= GUI hel

2019-11-28 Thread Claus Futtrup

Hi Antoine and Stefan

Thanks for the tip using visible='off' ... it looks like a better way.

Regards,
Claus

On 28.11.2019 18:54, Stefan Du Rietz wrote:
Le Jeudi, Novembre 28, 2019 17:05 CET, Claus Futtrup 
 a écrit:
  I think you can achieve what you want by setting ".visible='off'" 
for all the uicontrols you don't want to show initialy. You can then 
set  ".visible='on'" after the first call to the callback (or at each 
call if you are lazy).


I do that and it is very convenient. I also save my GUI data in a 
struct() in the "user_data" of the parent figure of the GUI. Then I 
don't need global variables or even findobj().


Regards
Stefan
___
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] ?==?utf-8?q? GUI help

2019-11-28 Thread Claus Futtrup

Hi Philipp, et al.

Thanks for the (long) email. I appreciate it.

Way 1 - I already do.
Way 2 - Yes, the established part of the GUI updates, no problem. The 
big question was if I could turn certain parts of the GUI on (and maybe 
off again)?
Way 3 - interesting idea, to use a "handles" container for all 
variables. I'll think about it. Is this "only" an easy way to pass 
around lots of variables, or is there something more internal with the 
GUI that is smart with this solution?


Best regards,
Claus

On 28.11.2019 10:53, P M wrote:

Hallo Claus,

from what I understand the question is: How can GUI updated outside of 
the function "calc" ?


In other words:
right now "calc" updates the GUI.
I guess the aim is that "calc" only returns output values, which will 
be used to update the GUI .


Way 1:
Use global variables, which can be used in every function of the GUI.
The return value of the function will change this global variable.

Way 2
Give the calc() function output variables, such as:
function [out_var1, out_var2] = calc(arg1, arg2)
    out_var1 = arg1 + ...
    out_var2 = arg2 +
endfunction
With this it should be possible to update the GUI outside of a 
callback function.


Way 3.similar to way 1...and the way I did in the past
use a single global variable, called: handles

handles is more a structure, than a single variable.
It contains all uicontrols aswell as all variables necessary to update 
the GUI.

e.g.:

handles.f1 = figure()  // that would be the main GUI
handles.f2 = figure()      // that would be a sub GUI
handles.pb1 = uicontrol()   // that would be a push button of the GUI
handles.var1 =  // that would be a variable, necessary 
to keep available to all uicontrols
handles.var2 =  // that would be another variable, 
necessary to keep available to all uicontrols



When definig the callback function it would look like this:

function calc(handles)
  locVar1 = handles.var1
  locVar2 = handles.var2
  //...do the calculations...to change locVar1, locVar2
  //...update the handle variable(s)
  handles.var1 = locVar1
  handles.var2 = locVar2
  handles = resume(handles)
endfunction

one would call the function just as: calc(handles)


A general note:
It helps to put all callback functions into a separate subfolder
The main function (that only defines the GUI) will call and load all 
callback functions from that subfolder.


I give callback function scripts the extension:  *.sci
I give the main GUI script the extension: *.sce
This is all not mandatory, but increases the overview.

To create the global variable "handles" I define a separate function:

function handles = Init(handles)
  handles.var1 = 0  // init value of var1
  handles.var2 = 0  // init value of var2
  handles.cmap = graycolormap(255)  // init GUI colormap
  handles.statusSlider = 0    // can be a status variable for a 
slider..if it has been used or not
  handles.statusPB = 0   // can be a status variable for a push 
bitton ..such as: has been pressed or not

  // etc...

  handles = resume(handles)
endfunction

sorry for the long Mail,
Best regards,
Philipp









Am Do., 28. Nov. 2019 um 08:57 Uhr schrieb Antoine Monmayrant 
mailto:amonm...@laas.fr>>:


Hello Claus,

I've been playing a bit with GUIs for teaching, so maybe I can help.
The issue is that I don't get what your problem is exactly here,
so I my answer might be a bit off-topic.
Do not hesitate to rephrase your issue, I'll try a more focused
answer.

Anywya, here is how I think your code could be improved:

(1) You can use 'calc' as the callback for all of the editable
text field so that your result gets shown right away, without
having to press a button.
(2) You should populate all the uicontrols of your gui first, then
only update the displayed values, the visibility of the
uicontrols, etc inside your calc function. (ie no more creating a
uicontrol inside a callback)
(3) The 'tag' property of any uicontrol together with 'findobj()'
are really nice to get/set the properties of each existing uicontrol.
(4) You can rely on a proper Model-View-Controler approach (or any
other well established method to avoid mixing gui stuff with
calculation stuff).

I attached a small gui I use to illustrate optical anti-reflection
coating.
It is far from perfect (I did not implement a proper
model-view-controler for example).
But you can see how I tried to separate the different parts of the
code an how I use findobj/tag/get/set,  etc.

Hope it helps,

Antoine

Le Mercredi, Novembre 27, 2019 19:21 CET, Claus Futtrup
mailto:cfutt...@gmail.com>> a écrit:

> Hi there
>
> I'm trying to build a GUI. For simplicity on the forum, I've
built a
> really simple example of what I'm trying to do. How can I make 

Re: [Scilab-users] ?==?utf-8?q? GUI help

2019-11-28 Thread Claus Futtrup

Hi Antoine, et al.

Your reply is very helpful, so I think you got the right question :-)

1) Good point that I can use callback on every uicontrol. This would be 
suitable for a simple example (like gui_example.sce) ... but for heavy 
calculations, it might be more practical with a CALC button. P.S. The 
correct equation for the resonance frequency is fres=sqrt(k/m)/(2*%pi);


2) I see what you mean, so not having an empty space, but "show" the 
whole she-bang from the beginning. I didn't want to do that (just 
deleting the IF-statement), but it could be the best solution in the end 
(rather than the inline GUI updates), if nothing better shows up. This 
was somehow the "core" of my question. Maybe I ask for too much.


3) I will look into this. Thanks for the tip.

4) I will also look into this. My problem is the steep learning curve. 
If you look at the Scilab tutorials you have the good-old Openeering 
LHY_Tutorial - it's incredibly complicated and long. Is LHY_Tutorial 
using the Model-Viewer-Controller approach? - Maybe the 
Model-Viewer-Controller could be presented in a _simple_ tutorial - is 
it possible?


I appreciate gui_example.sce with just about 70 lines of code, two 
inputs and one output. I think something like it could help a lot of 
people ... and it's not 250 lines of code to get a GUI up and running, 
if you know what I mean. The gui_example shows a few differences, like 
white versus grey background, editable boxes, etc. In the outputs, 
because of the default grey background, you can see the dimensions of 
the grid / text-boxes, and gui_example has two buttons. It looks 
operational and easy to expand for new users.


Cheers,
Claus

On 28.11.2019 08:57, Antoine Monmayrant wrote:

Hello Claus,

I've been playing a bit with GUIs for teaching, so maybe I can help.
The issue is that I don't get what your problem is exactly here, so I my answer 
might be a bit off-topic.
Do not hesitate to rephrase your issue, I'll try a more focused answer.

Anywya, here is how I think your code could be improved:

(1) You can use 'calc' as the callback for all of the editable text field so 
that your result gets shown right away, without having to press a button.
(2) You should populate all the uicontrols of your gui first, then only update 
the displayed values, the visibility of the uicontrols, etc inside your calc 
function. (ie no more creating a uicontrol inside a callback)
(3) The 'tag' property of any uicontrol together with 'findobj()' are really 
nice to get/set the properties of each existing uicontrol.
(4) You can rely on a proper Model-View-Controler approach (or any other well 
established method to avoid mixing gui stuff with calculation stuff).

I attached a small gui I use to illustrate optical anti-reflection coating.
It is far from perfect (I did not implement a proper model-view-controler for 
example).
But you can see how I tried to separate the different parts of the code an how 
I use findobj/tag/get/set,  etc.

Hope it helps,

Antoine
  
Le Mercredi, Novembre 27, 2019 19:21 CET, Claus Futtrup  a écrit:
  

Hi there

I'm trying to build a GUI. For simplicity on the forum, I've built a
really simple example of what I'm trying to do. How can I make the
"conditional" GUI output work and not have it inside the calc function?
... or, how would you do it? Thanks.

Best regards, Claus.

// GUI_EXAMPLE.SCE
//
// Demo of how to build a simple GUI in Scilab.
// Real simple, with two input variables and one output.
// The example uses the basic mechanical example of a mass and a spring as
// input parameters and calculates the resonance frequency of the mechanical
// system.

// Initialize variables
m  =  1;  // Moving mass 'm'(kilogram)
k  =  1;  // Stiffness, spring constant 'k'(Newton per meter)
fres  =  1;  // Resonance frequency (Hertz)
show_result  =  %f;

function  calc()
  m  =  evstr(get(ge_m,"string"));  // get content in uicontrol ge_m
  k  =  evstr(get(ge_k,"string"));  // get content in uicontrol ge_k
  fres  =  sqrt(m  *  k);
  // putting GUI updates inside the calculation routine is not pretty code.
  uicontrol("style","text","string","Result :","position",  ..
[10  as(2)-110  80  20]);
  uicontrol("style","text","string",string(fres),  ..
"position",[100  as(2)-110  80  20]);
  uicontrol("style","text","string","Hz ","position",  ..
[200  as(2)-110  30  20]);
  show_result  =  %t;
  // update global variables
  [m,k,fres,show_result]=return(m,k,fres,show_result);
endfunction

function  goodbye()
  close(ge);  // Close GUI window
  printf("Resulting fres: %f Hertz\n",fres);
  abort  // Print result in console (e.g. for copy/paste), then kill the app
endfunction

ge  =  scf();  /

[Scilab-users] GUI help

2019-11-27 Thread Claus Futtrup

Hi there

I'm trying to build a GUI. For simplicity on the forum, I've built a 
really simple example of what I'm trying to do. How can I make the 
"conditional" GUI output work and not have it inside the calc function? 
... or, how would you do it? Thanks.


Best regards, Claus.

// GUI_EXAMPLE.SCE
//
// Demo of how to build a simple GUI in Scilab.
// Real simple, with two input variables and one output.
// The example uses the basic mechanical example of a mass and a spring as
// input parameters and calculates the resonance frequency of the mechanical
// system.

// Initialize variables
m  =  1;  // Moving mass 'm'(kilogram)
k  =  1;  // Stiffness, spring constant 'k'(Newton per meter)
fres  =  1;  // Resonance frequency (Hertz)
show_result  =  %f;

function  calc()
m  =  evstr(get(ge_m,"string"));  // get content in uicontrol ge_m
k  =  evstr(get(ge_k,"string"));  // get content in uicontrol ge_k
fres  =  sqrt(m  *  k);
// putting GUI updates inside the calculation routine is not pretty code.
uicontrol("style","text","string","Result :","position",  ..
  [10  as(2)-110  80  20]);
uicontrol("style","text","string",string(fres),  ..
  "position",[100  as(2)-110  80  20]);
uicontrol("style","text","string","Hz ","position",  ..
  [200  as(2)-110  30  20]);
show_result  =  %t;
// update global variables
[m,k,fres,show_result]=return(m,k,fres,show_result);
endfunction

function  goodbye()
close(ge);  // Close GUI window
printf("Resulting fres: %f Hertz\n",fres);
abort  // Print result in console (e.g. for copy/paste), then kill the app
endfunction

ge  =  scf();  // GUI Example, Initialize and 'set current figure'
as  =  ge.axes_size;  // read size of window, as = [width height]
ge.figure_name  =  "GUI Example";  // Change window header

uicontrol("style","text","string","Moving mass :","position",  ..
  [10  as(2)-35  80  20],"background",[1  1  1]);  // white background
  // position properties has four parameters = x,y,width,height
  // y-position counts from lower left corner, so we subtract from 'as'
ge_m  =  uicontrol("style","edit","string",string(m),  ..
  "position",[100  as(2)-35  80  20]);
uicontrol("style","text","string","kg ","position",  ..
  [200  as(2)-35  30  20],"background",[1  1  1]);

uicontrol("style","text","string","Stiffness :","position",  ..
  [10  as(2)-60  80  20],"background",[1  1  1]);
ge_k  =  uicontrol("style","edit","string",string(k),  ..
  "position",[100  as(2)-60  80  20]);
uicontrol("style","text","string","N/m ","position",  ..
  [200  as(2)-60  30  20],"background",[1  1  1]);

uicontrol("style","pushbutton","string","Calculate",  ..
  "position",[10  as(2)-85  80  20],"callback","calc");

// How do I make this "conditional"output show up in my GUI?
if  show_result  then  // If "Calculate"button was pushed at least once ...
uicontrol("style","text","string","Result :","position",  ..
  [10  as(2)-110  80  20]);
uicontrol("style","text","string",string(fres),  ..
  "position",[100  as(2)-110  80  20]);
uicontrol("style","text","string","Hz ","position",  ..
  [200  as(2)-110  30  20]);
end

uicontrol("style","pushbutton","string","Exit",  ..
  "position",[10  as(2)-135  80  20],"callback","goodbye");

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Accessing sound device using java api from scilab

2019-10-30 Thread Claus Futtrup

Hi Samuel

>FYI : i am currently supervising a students project about this

I  work in an industry with audio, and I'm very interested in this. 
Please let us know how it ends. If there's any output midways, please 
post links. :-)


Best regards,
Claus

On 30.10.2019 13:18, Samuel Gougeon wrote:

Hello Antoine,

Le 30/10/2019 à 10:14, Antoine Monmayrant a écrit :

Hi all,

For a small demo project, I am trying to show both the temporal 
signal and the spectrum of the sound recorded by the microphone of my 
laptop.
I managed to hack together a proof of principle that relies on the 
linux command "arecord" and uses "unix_g" scilab function.
I would be happy to go for a more portable way of recording the sound 
from scilab.
I know there is a java api for sound: As anyone here ever worked with 
it or tried to call it from scilab?


I've never tried to call a java api from within scilab.
If you have any ressource and/or tutorial on the sound java api or on 
calling a java api from scilab, it would be of great help.



FYI : i am currently supervising a students project about this, for 
the whole academic year.
I submitted this project planning to enhance and extend Scilab sound 
capabilities, and it

was actually assigned to a group of 5 students in School of engineering.

Implementing a sound recorder through the standard microphone is one 
of the addressed topics.
It is set as a priority for the mid-term evaluation of the project, in 
january.
The priority is also to get a fully portable solution, and without 
C/C++ code and compilation
using any Scilab API, that would require to be reviewed and recompiled 
for each new Scilab 6.x release.

We know how this makes external modules quickly obsolete and unusable.
On this aspect, porting the portaudio and sndfile modules to Scilab 6 
has been considered.
But after being assessed, it looks too hard to do. BTW, it would not 
remedy to the need to

recompile. So, it is not a priority of the project.

Using Java in open source projects requires more care today than one 
year ago, due to
major changes in Oracle Licenses policy since early 2019. But java is 
still a first way to be

explored, indeed.
Scilab help pages of JIMS have nice examples to start using the JVM 
from Scilab:
https://help.scilab.org/docs/6.0.2/en_US/section_158670c44b251b5b028c4e3178ff4ed0.html 



Regards
Samuel


___
users mailing list
users@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Analytic models for empirical 3D data

2019-09-23 Thread Claus Futtrup

Hi Federico

>It is 1) the difficult part.

Is it allowed to give answer outside of Scilab? I have successfully used 
Curve Expert for finding the most suitable analytical function.


https://www.curveexpert.net/

... highly recommended.

Best regards,
Claus

On 24.09.2019 02:50, Federico Miyara wrote:


Dear all,

This is a tough one, and I'm aware it may not be directly related to 
Scilab, so sorry if it is off-topic. I post it anyway because it could 
lead in a future to a toolbox.


I'm looking for general methods for obtaining analytic models for 
empirical data such as a variable which depends on two independent 
variables (i.e., a double entry table). The aim isn't just to 
interpolate but to find a sort of analytical law that approximates the 
data. This has two steps:


1) Finding an analytic function, of two independent variables with as 
few parameters as possible that can likely approximate the data.


2) Optimizing the parameters for the best approximation to the data

2) Is relatively easy by least-squares or other optimization 
techniques. It is 1) the difficult part.


Any help as to literature or known mehods will be welcome

Federico Miyara






 
	Libre de virus. www.avast.com 
 



<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

___
users mailing list
users@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] animaGIF 1.0 is released

2019-07-23 Thread Claus Futtrup

Hi Samuel

Thanks. That's such a useful feature. You're a Scilab genius!

Cheers,
Claus

On 22.07.2019 21:39, Samuel Gougeon wrote:

Hello,

I am glad to announce the first release of the animaGIF package :
https://atoms.scilab.org/toolboxes/animaGIF

animaGIF() aims to be a stand-alone function (no thirdparty), easy to 
use and easy to maintain

(no hard code to recompile from a Scilab version to next ones).

It is fully documented (with animated examples displayed in the Scilab 
help :-)


Enjoy.
Samuel

PS : Scilab pointers about the topic :
http://bugzilla.scilab.org/5569
http://mailinglists.scilab.org/Scilab-users-animation-of-multiple-plots-tt4032828.html#a4032836
http://mailinglists.scilab.org/Scilab-users-animation-of-multiple-plots-tp4032841p4032845.html

---


  animated GIF creator

stand-alone creation of an animated GIF image from images files or 
from a live figure


Description :

animaGIF() builds an animated GIF from png | jpg | bmp images files, or directly
from a live graphical figure.

It uses the JVM embedded in Scilab and is stand-alone. No external thirdparty
application (like ImageMagic or Gimp, etc) is required.

SYNTAXES

animaGIF(filemask, outgif)
animaGIF(imagefiles, outgif)
animaGIF(.., delay)
animaGIF(.., delay, loops)

idGif = animaGIF(idFig, outgif) // opens the GIF stream
idGif = animaGIF(idFig, outgif, delay)
idGif = animaGIF(idFig, outgif, delay, loops)
idGif = animaGIF(idFig, idGif)  // adds a snapshot of the figure
animaGIF(idGif) // closes the GIF stream


___
users mailing list
users@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] {EXT} Can you suggest a more efficient procedure for generating random variables?

2019-03-18 Thread Claus Futtrup

Hi there

Interesting ...

If this is excellent for Monte-Carlo simulations, I wish that such an 
example is put into the documentation. Lots of people (who need 
Monte-Carlo) would then accidentally fall over it and take advantage of it.


Cheers,
Claus

On 18.03.2019 11:06, Heinz Nabielek wrote:

Ingenious. Works with precision. Gigantically fast for a million random 
deviates. Ideal for Monte-Carlo simulations.

I had never heard of dsearch* before..
Thanks a lot
Heinz


* I wished the Scilab help files would be more readable.


On 18.03.2019, at 09:50, Dang Ngoc Chan, Christophe  
wrote:

Hello Heinz,


De : Heinz Nabielek
Envoyé : dimanche 17 mars 2019 23:50

I need to generate random deviates x according to a given cumulative
distribution y that is available only in tabular form.
[...]
for i=1:N;
x=[x find(y>z(i),1)];
end;

y is a previously defined table with values monotonically increasing from zero

I guess these are quantiles.

I think you can vectorise with something like

x = dsearch(z, y)

I tried a little bit and it seems to work but I don't know the exact 
application so...

HTH

--
Christophe Dang Ngoc Chan
Mechanical calculation engineer

Public
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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

___
users mailing list
users@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Where is the best place for Scilab - xcos / ScicosLab - scicos questions and bug report?

2019-02-23 Thread Claus Futtrup

Hi Farimani

You've found it - this mailing list seems to be the best place.

Best regards,
Claus

On 22.02.2019 09:51, farimani wrote:

Lately I have been using SciLab - xcos / ScicosLab - scicos and have had
several bugs and questions. Have tried the relevant StackOverFlow tag:

  *  SciLab 
  *  ScicosLab 
  *  scicos 
  *  xcos 

but it seems deserted, ended up answering my own questions. :) Also  the
twitter account    is not responsive. The forums
I have found here and  here
   are
also not working properly. I have posted several questions, none
published/answered.  This subreddit    is
also almost empty :(   the IRC channel 
is also empty. I was wondering if you could help me know where is the best
place to ask questions and also report bugs? maybe you have a
Slack/Discord/Gitter chat rooms?




--
Sent from: 
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
___
users mailing list
users@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] need a little help

2019-02-18 Thread Claus Futtrup

Hi Philipp

>problem solved.I had to think differently than before.

Heh!

It helps to know what you actually want to do (and also the size of the 
problem).


Cheers,
Claus

On 18.02.2019 18:08, P M wrote:

problem solved.I had to think differently than before.

Actually my goal was to compare point coordinates to map coordinates 
and find the points on the map which are closest to the given point 
coordinates.


The map is of width:    900    // in reality the map is based on an 
image with 900x1500 pixels

The map is of height: 1500

The points are building a line on the map...e.g: the line consists of 
1076 points

So from the map I have build:

x = map(1,:);   // contains all x coordinates of the map
y = map(2,:);   // contains all y coordinates of the map

points = [ lineX, lineY];  // points contain the X-Y-coordinates 
of the line


for i = 1:n
     actPoint = points(i,:);
     [nearestX xInd]   = min(abs(actPoint(1)-x));
     [nearestY yInd]  = min(abs(actPoint(2)-y));
     nearestPoint(i,:) = [x(xInd) y(yInd)];
end


This is what works for now, though it is still slow.

For searching 100 points of the line it needs about 10 seconds.
For searching 200 points of the line it needs about 19 seconds.
For searching 500 points of the line it needs about 45 seconds.
For searching 1000 points of the line it needs about 98 seconds.







Am Mo., 18. Feb. 2019 um 16:39 Uhr schrieb P M >:


Ok, thanks for your help..

Actually the sizes I gave where just for demonstation.

If I use the real array sizes, I get a message: can not allocate 
7469.60MB memory...which maybe is true.
available RAM after starting Scilab is 3701 MB

actual array sizes:

A has 1076 elements
B has 1'350'000 elements, with a lot of Nan's in it

if I use thrownan(B) I can reduce the array size of B to 867751
elements but still get the Message above.

(without thrownan() the memory scilab wants to allocate is even
bigger)




Am Fr., 15. Feb. 2019 um 23:25 Uhr schrieb Samuel Gougeon
mailto:sgoug...@free.fr>>:

... and even clearer, with respect to your own notations:

--> A = rand(1,1000);  // test's data
--> B = rand(1,1);
--> [a, b] = ndgrid(A, B);
--> size(a)  // same for b
 ans  =
   1000.   1.
--> [v, i] = min(abs(a-b), *"c"*);

___
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





---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Unable to update ATOMS packages - Scilab 6.0.1

2018-10-11 Thread Claus Futtrup

Dear Scilabers

On 11.10.2018 11:08, Stéphane Mottelet wrote:

>It took already a lot of time to officially package Scilab 6.0.1 
instead of Scilab 5.5.2  in Ubuntu.
>I am not sure that 6.0.2 will be the next (6.1, likely). These 
problems really don't serve the reputation of Scilab...


In the big scheme I agree and wish that installing Scilab would be 
straightforward. Maybe pack for a version of Ubuntu that supports 
Flatpacks ? (I use the latest Linux Mint).


Best regards,
Claus

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Fetching the script path

2018-10-01 Thread Claus Futtrup

Hi Samuel

Thank you. It works ... (of course :-) ).

Best regards,
Claus

On 30.09.2018 22:03, Samuel Gougeon wrote:

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);



___
users mailing list
users@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Fetching the script path

2018-09-30 Thread Claus Futtrup

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
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Frequency response

2018-09-18 Thread Claus Futtrup

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@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@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Frequency response

2018-09-16 Thread Claus Futtrup

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@lists.scilab.org
http://lists

Re: [Scilab-users] Frequency response

2018-09-16 Thread Claus Futtrup

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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Virus-free. www.avast.com
  ___
users mailing list
users@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Frequency response

2018-09-16 Thread Claus Futtrup

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@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 <https://help.scilab.org/docs/6.0.1/en_US/poly.html>(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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users




<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 
	Virus-free. www.avast.com 
<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient> 





___
users mailing list
users@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
// 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 vis

Re: [Scilab-users] Frequency response

2018-09-15 Thread Claus Futtrup

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 <https://help.scilab.org/docs/6.0.1/en_US/poly.html>(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@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Frequency response

2018-09-14 Thread Claus Futtrup

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
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Removing elements of one vector from another vector

2018-08-16 Thread Claus Futtrup

Hi Iza

Yes, as Dang says ... I think what you're doing is one of several 
"set-operations" you can do in Scilab. Others may also come in handy for 
you:


https://help.scilab.org/doc/5.5.2/en_US/section_b26c1facefdb399710752631e1bfb765.html

/Claus

On 16.08.2018 16:55, Izabela Wójcik-Grząba wrote:

Hello,

Is there any simple way to remove from one vector elements which are 
in another vector. For example:

a=[1 2 3 4 5 6 7 8]
b=[1 3 5]
resulting vector: c=[2 4 6 7 8].
I wonder if this can be done without a "for" loop.

Thanks in advance,
Iza
___
users mailing list
users@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Toolbox for Scilab 6

2018-08-06 Thread Claus Futtrup

Hi Samuel

Thank you very much for reaching out and providing constructive 
feedback. It is what I need.


Best regards,
Claus

On 05.08.2018 00:05, Samuel Gougeon wrote:

Le 04/08/2018 à 21:54, Claus Futtrup a écrit :

Hi there

Is there anyone who could help me with the CMA-ES optimization 
toolbox for Scilab 6?


I wasn't successful in creating a functioning toolbox for Scilab 5 in 
the first place.


Yet, you have published some binaries...

What are the problems?
Since there is no unit test, we could expect that examples work. But 
they don't.

And they can't. Examples:

  * cma_ask, cma_new: the examples include
  o a call to cma_stop(), but there is no page for it. => Please
document it, or remove it from the example..
  o some calls to undefined fitfun()...
  * cma_optim:
  o the first line uses getf(), that was removed from Scilab 5.3.0
(2010-12-16..) << 5.5
  o again, fitfun is called without being defined. Now we
understand its meaning.
  * cma_tell:
  o y(i) = costf(X(i)); // costf needs to be defined   ==> ??

If there are no unit tests, not a single complete runnable example, no 
code up-to-date with at least Scilab 5.4 (for which the first release 
was published), your question is not just about getting help to port 
the module from Scilab 5.4 to 5.5 and 6.0...


About the macros: some advices to make the code usable on Scilab 6.0 
(and 5):
Most of functions are defined in a single file: cma.sci. In Scilab 6, 
only the first function of the file (or the one having the name of the 
file) is public. Other ones are private, and can be called only by the 
public one.

So, in pratical,

  * split the file cma.sci in as many files .sci as needed. internal
functions (not documented) that are shared by several separate
(public or internal) functions must also be defined separately.

Cheers
Samuel




___
users mailing list
users@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@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Toolbox for Scilab 6

2018-08-04 Thread Claus Futtrup

Hi there

Is there anyone who could help me with the CMA-ES optimization toolbox 
for Scilab 6?


I wasn't successful in creating a functioning toolbox for Scilab 5 in 
the first place.


Best regards,

Claus


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Installing Scilab under Linux (Mint / aka Ubuntu)

2018-07-25 Thread Claus Futtrup

Hi Antoine and Nikolay

Thank you for your help. I see that the easiest way is, as Antoine 
wrote, to execute a shell and execute scilab from the shell (and for 
sure, keep the shell open).


I tried to create a desktop "launcher" in Linux Mint, executing a 
scilab.sh script and containing 'nohup scilab.sh & disown' ... to 
release scilab from the terminal, but at no luck.


I also tried to follow advice from askubuntu (below), including creating 
desktop files, etc. (see near the bottom), but still no luck.


Best regards,
Claus

On 25.07.2018 15:40, Nikolay Strelkov wrote:

Dear Claus!

As a temporarily fix you can read this solution on AskUbuntu - 
https://askubuntu.com/a/1029164/66509 
<https://askubuntu.com/a/1029164/66509> . I have tested it. Unpacking 
to home folder works as expected (and as before).


Dear Scilab developers!

As long-time Scilab user I can't completely understand how this may 
happen. Please take a look to the mentioned bugs in the linked answer 
above and make real actions to fix these problems. Scilab is 
completely broken in Ubuntu 18.04 LTS (so without real actions it will 
be broken until 2023) and does not work on development version 18.10 
too. Also it does not work on Debian 10. Please contact Debian and/or 
Ubuntu maintainers directly.


Scilab is very often used in educational purposes. For example we use 
it on Ubuntu 16.04 LTS in our university to teach students.
It will be very bad if we lose such a convenient and useful 
software-tool.


---
/With best regards,
Ph.D., //associate professor at MPEI 
<http://mpei.ru/lang/en/Pages/default.aspx>,

IEEE member,
maintainer of Mathieu functions toolbox for Scilab 
<http://atoms.scilab.org/toolboxes/Mathieu/>,

Nikolay Strelkov./

2018-07-25 15:44 GMT+03:00 Claus Futtrup <mailto:cfutt...@gmail.com>>:


Hi there

I've installed Linux Mint 19 (MATE) and installing Scilab using
the Software Manager doesn't work. I cannot get the GUI to show up
(CLI works fine). There are several bug reports out there, but
AFAIK no remedy. P.S. Upon first installation I did check and see
that the GUI worked, but it never worked since and uninstalling +
installing (incl. the CLI, and BTW also including reboots) doesn't
work.

Therefore I decided to download the Linux 64-bit package from
scilab.org <http://scilab.org> ... when unpacked, I see there's
not an installer ... but as the README says, launching
./bin/scilab gives me the GUI (yaayh!)

The question is - from unpacking the software, how am I supposed
to install this already compiled scilab in my Linux? ... Am I
supposed to leave it in my /home directory? ... Sorry for my lack
of knowledge here. I hope for some kind help.

Best regards,

Claus


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus <https://www.avast.com/antivirus>

___
users mailing list
users@lists.scilab.org <mailto:users@lists.scilab.org>
http://lists.scilab.org/mailman/listinfo/users
<http://lists.scilab.org/mailman/listinfo/users>




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Installing Scilab under Linux (Mint / aka Ubuntu)

2018-07-25 Thread Claus Futtrup

Hi there

I've installed Linux Mint 19 (MATE) and installing Scilab using the 
Software Manager doesn't work. I cannot get the GUI to show up (CLI 
works fine). There are several bug reports out there, but AFAIK no 
remedy. P.S. Upon first installation I did check and see that the GUI 
worked, but it never worked since and uninstalling + installing (incl. 
the CLI, and BTW also including reboots) doesn't work.


Therefore I decided to download the Linux 64-bit package from scilab.org 
... when unpacked, I see there's not an installer ... but as the README 
says, launching ./bin/scilab gives me the GUI (yaayh!)


The question is - from unpacking the software, how am I supposed to 
install this already compiled scilab in my Linux? ... Am I supposed to 
leave it in my /home directory? ... Sorry for my lack of knowledge here. 
I hope for some kind help.


Best regards,

Claus


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] [Scicos] - Need advice in creation of Super Blocks via script

2018-06-19 Thread Claus Futtrup

Hi Pierre, et al (attention: Serge Steer).

Is there  a chance we can have that book translated into English, please?

Best regards,
Claus

On 6/19/2018 9:44 AM, perrichon wrote:

Hello Yves,

Book "Tome 2 - SCILAB - Modéliser et Simuler avec XCOS" gives all
explainations to build SuperBlocks

Sincerely

Pierre


-Message d'origine-
De : users  De la part de Yves Rambi
Envoyé : mardi 19 juin 2018 06:34
À : users@lists.scilab.org
Objet : Re: [Scilab-users] [Scicos] - Need advice in creation of Super
Blocks via script

It's a pity that no one can answer.

Have a good day!



--
Sent from:
http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.
html
___
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




---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Simulating phase modulation

2018-05-27 Thread Claus Futtrup
Hi Gary

Thanks for your input. I went the analytic route for now, and simplified a
bit (as you often do with analytic solutions). You're right that from an
electro-mechanical point of view, superposition applies, but as the waves
transmit in acoustics in air - not, I'm afraid, this is where we see the
distortion, simply because the speaker cone moves several millimeter.

Best regards,
Claus

On Sat, May 26, 2018 at 10:55 PM Gary Nelson <porpoisesee...@gmail.com>
wrote:

> Claus,
>
> Back in the late 60s, I did my PhD research using analytic signal. Yes,it
> works, and the implementation details are more complex that we find on the
> link. A few years ago, I implemented a system for analyzing harbor porpoise
> vocalizations using scilab. For example, instantaneous phase(t) wants to be
> differentiable if instantaneous frequency is to be positive. I found that
> octave bands are the widest that preserves this feature. Yes, you can
> calculate phase(t) = atan(imaginary/real), but you have to add 2PI when
> atan wraps around in order to make phase monotonically increase.
>
>
>
> Also, I am not convinced that a loudspeaker does phase modulation.
> Certainly, if the speaker is linear, then superposition applies. If phase
> modulation occurs, it is a non-linear effect. Perhaps that effect is real,
> but we need to see a model to show how it comes to be.
>
>
>
> I might be able to help you write analytic signal  code.
>
>
>
> Good wishes
>
> Gary Nelson
>
>
>
>
>
> Sent from my Windows 10 phone
>
>
>
> *From: *Claus Futtrup <cfutt...@gmail.com>
> *Sent: *Saturday, May 26, 2018 7:41 AM
> *To: *International users mailing list for Scilab.
> <users@lists.scilab.org>
> *Subject: *Re: [Scilab-users] Simulating phase modulation
>
>
>
> Hi Rafael
>
>
>
> Thank you, I shall print and study. :-)
>
>
>
> Cheers,
>
> Claus
>
>
>
> On Fri, May 25, 2018 at 8:42 PM Rafael Guerra <jrafaelbgue...@hotmail.com>
> wrote:
>
> Hi Claus,
>
>
>
> I am not aware of such function. However, you can find simple code here
> below for both phase modulation and demodulation, which is straightforward
> to translate in Scilab:
>
>
> https://www.gaussianwaves.com/2017/06/phase-demodulation-using-hilbert-transform-application-of-analytic-signal/
>
>
>
> Note that the phase modulation is coded differently from you snippet below.
>
>
>
> Regards,
>
> Rafael
>
>
>
> *From:* users [mailto:users-boun...@lists.scilab.org] *On Behalf Of *Claus
> Futtrup
> *Sent:* Friday, May 25, 2018 7:17 PM
> *To:* International users mailing list for Scilab. <users@lists.scilab.org
> >
> *Subject:* [Scilab-users] Simulating phase modulation
>
>
>
> Hi there
>
>
>
> In a loudspeaker the driver can move several millimeter in an attempt to
> reproduce a low-frequency note. If the speaker also at the same time
> produce a higher tone, this second tone is phase modulated by the first
> one. This is a distortion of the original signal which I'd like to simulate
> / illustrate with some simple Scilab code, if possible.
>
>
>
> In Matlab this can be simulated with pmmod.
>
> https://matlabandsimulink.wordpress.com/2013/03/12/phase-modulation/
>
>
>
> Is there a similar function in Scilab? (name - please ?)
>
>
>
> Here's the code I have written so far - this is the part that shows the
> input signal (the un-distorted signal):
>
>
>
> sample_rate=2;
>
> t = 0:1/sample_rate:0.6;
>
> N=size(t,'*'); *//number of samples*
>
> y1 = sin(2*%pi*50*t);
>
> y2 = 0.5*sin(2*%pi*500*t);
>
> *// y2 = 0.5*sin(2*%pi*500*t+%pi/4);*
>
> s=y1+y2+grand(1,N,'nor',0,1);
>
>
>
> *// Plot time-domain*
>
> endplot = round(N/15);
>
> twoplots = scf(); *// Set Current Figure (Graphics Window)*
>
> subplot(211);
>
> plot(t(1:endplot),y1(1:endplot),t(1:endplot),y2(1:endplot));
>
> subplot(212);
>
> plot(t(1:endplot),y1(1:endplot)+y2(1:endplot));
>
>
>
> y=fft(s);
>
> ymax = max(abs(y));
>
> y = y ./ ymax; *// Normalize*
>
>
>
> *// s is real so the fft response is conjugate symmetric*
>
> *// and we retain only the first N/2 points*
>
> f=sample_rate*(0:(N/2))/N; *//associated frequency vector*
>
> n=size(f,'*');
>
> fftplots = scf();
>
> plot(f(2:$),abs(y(2:n))); *// drop first datapoint, f = 0 (it prevents 
> log-plot)*
>
> a = gca();
>
> a.log_flags = "lnn";
>
>
>
> Best regards,
>
> Claus
>
> ___
> 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


Re: [Scilab-users] Simulating phase modulation

2018-05-26 Thread Claus Futtrup
Hi Rafael

Thank you, I shall print and study. :-)

Cheers,
Claus

On Fri, May 25, 2018 at 8:42 PM Rafael Guerra <jrafaelbgue...@hotmail.com>
wrote:

> Hi Claus,
>
>
>
> I am not aware of such function. However, you can find simple code here
> below for both phase modulation and demodulation, which is straightforward
> to translate in Scilab:
>
>
> https://www.gaussianwaves.com/2017/06/phase-demodulation-using-hilbert-transform-application-of-analytic-signal/
>
>
>
> Note that the phase modulation is coded differently from you snippet below.
>
>
>
> Regards,
>
> Rafael
>
>
>
> *From:* users [mailto:users-boun...@lists.scilab.org] *On Behalf Of *Claus
> Futtrup
> *Sent:* Friday, May 25, 2018 7:17 PM
> *To:* International users mailing list for Scilab. <users@lists.scilab.org
> >
> *Subject:* [Scilab-users] Simulating phase modulation
>
>
>
> Hi there
>
>
>
> In a loudspeaker the driver can move several millimeter in an attempt to
> reproduce a low-frequency note. If the speaker also at the same time
> produce a higher tone, this second tone is phase modulated by the first
> one. This is a distortion of the original signal which I'd like to simulate
> / illustrate with some simple Scilab code, if possible.
>
>
>
> In Matlab this can be simulated with pmmod.
>
> https://matlabandsimulink.wordpress.com/2013/03/12/phase-modulation/
>
>
>
> Is there a similar function in Scilab? (name - please ?)
>
>
>
> Here's the code I have written so far - this is the part that shows the
> input signal (the un-distorted signal):
>
>
>
> sample_rate=2;
>
> t = 0:1/sample_rate:0.6;
>
> N=size(t,'*'); *//number of samples*
>
> y1 = sin(2*%pi*50*t);
>
> y2 = 0.5*sin(2*%pi*500*t);
>
> *// y2 = 0.5*sin(2*%pi*500*t+%pi/4);*
>
> s=y1+y2+grand(1,N,'nor',0,1);
>
>
>
> *// Plot time-domain*
>
> endplot = round(N/15);
>
> twoplots = scf(); *// Set Current Figure (Graphics Window)*
>
> subplot(211);
>
> plot(t(1:endplot),y1(1:endplot),t(1:endplot),y2(1:endplot));
>
> subplot(212);
>
> plot(t(1:endplot),y1(1:endplot)+y2(1:endplot));
>
>
>
> y=fft(s);
>
> ymax = max(abs(y));
>
> y = y ./ ymax; *// Normalize*
>
>
>
> *// s is real so the fft response is conjugate symmetric*
>
> *// and we retain only the first N/2 points*
>
> f=sample_rate*(0:(N/2))/N; *//associated frequency vector*
>
> n=size(f,'*');
>
> fftplots = scf();
>
> plot(f(2:$),abs(y(2:n))); *// drop first datapoint, f = 0 (it prevents 
> log-plot)*
>
> a = gca();
>
> a.log_flags = "lnn";
>
>
>
> Best regards,
>
> Claus
> ___
> 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


[Scilab-users] Scilab code published in scientific article

2018-05-26 Thread Claus Futtrup
Dear Scilabers

Just FYI, I had a scientific article published this weekend. You can see
it  here:
http://www.aes.org/e-lib/browse.cfm?elib=19566

I'm not allowed to freely copy the article, but I hope nobody minds that I
show the Scilab code included in the article. Here it is:

Qts = 0.5;alpha = 0; // alpha = Vas/Vb
   // alpha = 0, open baffleh = 0; // bass reflex system tuning ratio
   // h = 0 for closed box systemsfunction y=resp(s)y =
s^2/(s^2+s/Qts+1+alpha);endfunction // Eq (15)
N0= 12; // resolutionsteps = 8;  // steps per unit time,t_max = 5;
 // time (dimensionless)t_step = 1/steps;t = t_step:t_step:t_max;
mu_c = max([1 h]);t_c = %pi*N0/(12*mu_c);nt = length(t);
mprintf("   t  -  Contour");mprintf(" method  -  Exact\n");for i=1:nt do
ti = t(i);
// Selection defined in
// Eqs (31) and (32)
if ti < t_c then
mu = %pi*N0/(12*ti);
N = N0;
d = 3/N;
else
mu = mu_c;
N = ceil(N0*ti/t_c);
d = 3/N;
end

// Perform sum in Eq (24)
xsk = 0.0;
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
exact(i) = exp(-ti)*(1-ti);
// Collect exact result, compare
mprintf("%5.4e ",ti);
mprintf("%+12.11e ",xsk);
mprintf("%+12.11e\n",exact(i));end
g_tr = scf(); // Graph Time Responseplot([0 t],[1;
xs],"-xr");xgrid(color("grey70"));// Plot contour method numerical
errorerr = abs(xs - exact);g_e = scf(); // Graph Errorplot([0 t],[0;
err],"-r");xgrid(color("grey70"));



Best regards,
Claus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Simulating phase modulation

2018-05-25 Thread Claus Futtrup
Hi there

In a loudspeaker the driver can move several millimeter in an attempt to
reproduce a low-frequency note. If the speaker also at the same time
produce a higher tone, this second tone is phase modulated by the first
one. This is a distortion of the original signal which I'd like to simulate
/ illustrate with some simple Scilab code, if possible.

In Matlab this can be simulated with pmmod.
https://matlabandsimulink.wordpress.com/2013/03/12/phase-modulation/

Is there a similar function in Scilab? (name - please ?)

Here's the code I have written so far - this is the part that shows the
input signal (the un-distorted signal):

sample_rate=2;t = 0:1/sample_rate:0.6;N=size(t,'*'); //number of
samplesy1 = sin(2*%pi*50*t);y2 = 0.5*sin(2*%pi*500*t);// y2 =
0.5*sin(2*%pi*500*t+%pi/4);s=y1+y2+grand(1,N,'nor',0,1);
// Plot time-domainendplot = round(N/15);twoplots = scf(); // Set
Current Figure (Graphics
Window)subplot(211);plot(t(1:endplot),y1(1:endplot),t(1:endplot),y2(1:endplot));subplot(212);plot(t(1:endplot),y1(1:endplot)+y2(1:endplot));
y=fft(s);ymax = max(abs(y));y = y ./ ymax; // Normalize
// s is real so the fft response is conjugate symmetric// and we
retain only the first N/2 pointsf=sample_rate*(0:(N/2))/N;
//associated frequency vectorn=size(f,'*');fftplots =
scf();plot(f(2:$),abs(y(2:n))); // drop first datapoint, f = 0 (it
prevents log-plot)a = gca();a.log_flags = "lnn";


Best regards,
Claus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] GSOC 2018

2018-05-07 Thread Claus Futtrup
Hi there

Can Scilab confirm that there are four GSOC projects this year? I read from:

https://summerofcode.withgoogle.com/organizations/4726304075677696/#!

1. About Machine Learning
2. MacOS signed app
3. Code Quality
4. Working demo for Matlab MEX modules

... and will anyone post any news about it? Maybe here:
https://www.scilab.org/en/projects/gsoc

Best regards,
Claus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] FEA and geometry

2018-03-28 Thread Claus Futtrup
Hi there

It's Easter soon and I thought, maybe I could play around a bit with Scilab
and figure out how to read a geometry and do some Finite Element Analysis?
Maybe not finished during Easter ... first step would be to read a geometry
from e.g. a CAD file and I wonder if Scilab supports this?

I found this ATOMS module for reading STL files:
https://fileexchange.scilab.org/toolboxes/49

Are there any other options out there? ... or, how would you approach such
a task?

Second I found CGLab, which interfaces to CGAL (Computational Geometry
Algorithms Library) which seems like it could analyze and define a mesh...
but then again, an STL file in itself is like a mesh.

I'm curious for input, to get started in the right direction.

Best regards,
Claus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Xcos Loudspeaker simulation Algebraic loop and Bode plot

2018-03-10 Thread Claus Futtrup
Hi Florent (CC Scilab Users)

I cannot run the zcos model with my current Scilab 6.0.1 setup (and I
haven't installed CPGE 1.6.3 either - is there a way you could simulate a
loudspeaker without the need for CPGE??).

The bode plots you get is a function of the input + the loudspeaker model.
We know that in principle the accelaration is equivalent to Loudspeaker
Sound Pressure Level (SPL) response and it should show a flat area + roll
off at both ends. I see that your plots don't do this.

The velocity is like an integration and should "shift" (or "tilt") the
response by 6 dB.

The position is also like an integration and should further shift/tilt the
reponse additionally 6 dB so that in the bandpass you get a 12 dB/octave
slope.

Your current loudspeaker model looks OK (I haven't dug into the details of
each block), so my guess is - the output depends on the input. Now that you
presumably have a working loudspeaker model - would it then maybe make
sense to generate a very simple model - e.g. just a resistor (i.e. not a
bandpass - but something that behaves from DC to lightning as a flat curve)
- play around with the input and get it to behave correctly?

Best regards,
Claus

On Sat, Mar 10, 2018 at 9:51 AM, Claus Futtrup <cfutt...@gmail.com> wrote:

> Hi Florent
>
> Thank you for sharing your experiences with us. I don't speak but maybe
> 100 words in French and can't string together a sentence (but maybe the
> most elementary tourist-french). I looked up the CPGE in Atoms, but it
> looks French to me... https://atoms.scilab.org/toolboxes/CPGE/1.6.3/
>
> You give the result but no details to replicate, etc. I'm afraid I can't
> help.
>
> Best regards,
> Claus
>
>
> On Fri, Mar 9, 2018 at 10:29 PM, Florent <florent.halga...@gmail.com>
> wrote:
>
>> Good morning,
>>
>> Here is an update of my "problem".
>>
>> First of all I had a problem of compatibility between Scilab/Xcos and the
>> toolbox CPGE.
>>
>> Before I was using Scilab 6.0.1 and CPGE Version: 1.6.0.
>> Now, with Scilab 5.4.1 and CPGE Version: 1.5.2, the Bode plot works. But
>> it
>> doesn't give the result expected...
>>
>> For the Displacement vs Frequency, a Low Pass behavior is expected.
>> For the Velocity vs Frequency, a Band Pass behavior is expected.
>> For the Acceleration vs Frequency, a High Pass behavior is expected
>> (similar
>> to the pressure response).
>>
>> And here is what is get:
>>
>> <http://mailinglists.scilab.org/file/t497760/bode_out.png>
>>
>>
>>
>> --
>> Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-
>> Archives-f2602246.html
>> ___
>> 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] Xcos Loudspeaker simulation Algebraic loop and Bode plot

2018-03-10 Thread Claus Futtrup
Hi Florent

Thank you for sharing your experiences with us. I don't speak but maybe 100
words in French and can't string together a sentence (but maybe the most
elementary tourist-french). I looked up the CPGE in Atoms, but it looks
French to me... https://atoms.scilab.org/toolboxes/CPGE/1.6.3/

You give the result but no details to replicate, etc. I'm afraid I can't
help.

Best regards,
Claus


On Fri, Mar 9, 2018 at 10:29 PM, Florent  wrote:

> Good morning,
>
> Here is an update of my "problem".
>
> First of all I had a problem of compatibility between Scilab/Xcos and the
> toolbox CPGE.
>
> Before I was using Scilab 6.0.1 and CPGE Version: 1.6.0.
> Now, with Scilab 5.4.1 and CPGE Version: 1.5.2, the Bode plot works. But it
> doesn't give the result expected...
>
> For the Displacement vs Frequency, a Low Pass behavior is expected.
> For the Velocity vs Frequency, a Band Pass behavior is expected.
> For the Acceleration vs Frequency, a High Pass behavior is expected
> (similar
> to the pressure response).
>
> And here is what is get:
>
> 
>
>
>
> --
> Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-
> Lists-Archives-f2602246.html
> ___
> 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] Xcos Loudspeaker simulation Algebraic loop and Bode plot

2018-03-07 Thread Claus Futtrup
Hi Florian

Yes, because of the integration. I'm comparing to the source (the thesis),
Fig. 2.5.

Best regards,
Claus

On Wed, Mar 7, 2018 at 5:56 PM, Florent  wrote:

> Hi Claus,
>
> I multiplied i(t) by Re in order to match with the equation:
> 
> Or in an other form:
> 
>
> What do you mean be omega-dependent?
> Is it because in the integration 1/s, s=jw?
>
> Best regards,
> Florent
>
>
>
> --
> Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-
> Lists-Archives-f2602246.html
> ___
> 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] Xcos Loudspeaker simulation Algebraic loop and Bode plot

2018-03-06 Thread Claus Futtrup
Hi Florian

I loaded the zcos file this morning and compared it to Fig. 2.5 in the
Master Thesis. It looks like your Re-box is connected before the
integrator, which means it becomes omega-dependent. This is not what we
normally do. Did you intend it to be this way? I'm not sure this is
actually your problem - I'm just trying to help - and clear the path.

Best regards,
Claus

On Tue, Mar 6, 2018 at 8:40 PM, Claus Futtrup <cfutt...@gmail.com> wrote:

> Hi Florian
>
> I see it's a zcos file, but GMAIL downloads it as a zip file. I just
> rename it from zip to zcos, and it loads into Scilab. I'll look at it
> tomorrow. :-)
>
> Best regards,
> Claus
>
>
> On Tue, Mar 6, 2018 at 8:36 PM, Florent <florent.halga...@gmail.com>
> wrote:
>
>> Hi Claus,
>>
>> No, unfortunately I didn't get the Simulink files. And we don't have
>> Simulink where I'm working.
>>
>> Here is the zcos file  linear_LS.zcos
>> <http://mailinglists.scilab.org/file/t497760/linear_LS.zcos>  .
>>
>> I'm new to Xcos too, I started last week.
>>
>> Best regards,
>> Florent
>>
>>
>>
>> --
>> Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-
>> Archives-f2602246.html
>> ___
>> 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] Xcos Loudspeaker simulation Algebraic loop and Bode plot

2018-03-06 Thread Claus Futtrup
Hi Team Scilab

I wish I could buy this book in English:
https://www.d-booker.fr/scilab-2-xcos/112-scilab-xcos.html

/Claus

I'm new to Xcos too, I started last week.
>
> Best regards,
> Florent
>
>
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Xcos Loudspeaker simulation Algebraic loop and Bode plot

2018-03-06 Thread Claus Futtrup
Hi Florian

I see it's a zcos file, but GMAIL downloads it as a zip file. I just rename
it from zip to zcos, and it loads into Scilab. I'll look at it tomorrow. :-)

Best regards,
Claus


On Tue, Mar 6, 2018 at 8:36 PM, Florent  wrote:

> Hi Claus,
>
> No, unfortunately I didn't get the Simulink files. And we don't have
> Simulink where I'm working.
>
> Here is the zcos file  linear_LS.zcos
>   .
>
> I'm new to Xcos too, I started last week.
>
> Best regards,
> Florent
>
>
>
> --
> Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-
> Lists-Archives-f2602246.html
> ___
> 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] Xcos Loudspeaker simulation Algebraic loop and Bode plot

2018-03-06 Thread Claus Futtrup
Hi Florent

I'm interested in the loudspeaker rmodel (I work in the loudspeaker
industry). The Master Thesis you're referencing to, it uses Matlab. Did you
get hold of the Matlab files? ... Are you simply taking some inspiration
from this Thesis and experimenting with XCOS?

I tried to download your zcos file, but it came as a ZIP file. When
extracted it contains a few files, but no ZCOS file. Appologies if I'm a
lost cause here, since I have no experience with XCOS, even basic stuff
might throw me off. Please explain.

Best regards,
Claus
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


  1   2   3   >