Re: [Scilab-users] Is cond([]) 0 or 1 ? (bug 15579)

2018-05-27 Thread Samuel Gougeon

Le 27/05/2018 à 23:49, Rafael Guerra a écrit :


You guys may have missed the paper sent before on the algebra of empty 
matrices by Carl de Boor (Emeritus Professor in Mathematics and 
Computer Science), so I am sending it again:


https://pdfs.semanticscholar.org/0f3b/c36f19d5c6a761c19fbc3c4ebde2f31b0a10.pdf

He argues that the condition number of the square empty matrix [] = 0 
and its det([]) = 1




No no, i did not miss it. His argument is that norm([]) is 0:

/Any norm of an empty matrix is zero, as the supremum of the empty set 
of nonnegative numbers. This implies that the condition number of the 
square empty matrix [] is 0./


This does not prevent asking to Philippe why he proposes 1, noticeably 
if he also considers that norm([])==0, or not.


The De Boor argument "/as the supremum of the empty set of nonnegative 
numbers."/ is not clear to me./


/Is it clear for you? Would you have a second convergent independent 
reference?


Samuel

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


Re: [Scilab-users] Is cond([]) 0 or 1 ? (bug 15579)

2018-05-27 Thread Rafael Guerra
You guys may have missed the paper sent before on the algebra of empty matrices 
by Carl de Boor (Emeritus Professor in Mathematics and Computer Science), so I 
am sending it again:

https://pdfs.semanticscholar.org/0f3b/c36f19d5c6a761c19fbc3c4ebde2f31b0a10.pdf



He argues that the condition number of the square empty matrix [] = 0 and its 
det([]) = 1



Regards,

Rafael



-Original Message-
From: users [mailto:users-boun...@lists.scilab.org] On Behalf Of philippe
Sent: Sunday, May 27, 2018 11:24 PM
To: users@lists.scilab.org
Subject: Re: [Scilab-users] Is cond([]) 0 or 1 ? (bug 15579)



Le 27/05/2018 à 19:51, Samuel Gougeon a écrit :

> [...]

>

> Please let us know more about your proposal for 1 instead of 0.



I can't say it now, the best value also depends on the compatibility of this 
value with others assigned to matrix functions with argument [].  I would like 
to check it before, but with the example you mention 0 looks a better choice.



Philippe








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


Re: [Scilab-users] Is cond([]) 0 or 1 ? (bug 15579)

2018-05-27 Thread philippe
Le 27/05/2018 à 19:51, Samuel Gougeon a écrit :
> [...]
> 
> Please let us know more about your proposal for 1 instead of 0.

I can't say it now, the best value also depends on the compatibility of
this value with others assigned to matrix functions with argument [].  I
would like to check it before, but with the example you mention 0 looks
a better choice.

Philippe

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


Re: [Scilab-users] Is cond([]) 0 or 1 ? (bug 15579)

2018-05-27 Thread Samuel Gougeon

Hello Philippe,

Le 24/05/2018 à 23:20, philippe a écrit :

Le 21/05/2018 à 15:46, Samuel Gougeon a écrit :

There are at least two way to do it :

   * either keep *cond([])* to *1* and set all *cond([], p)* to 1 instead
 of 0
   * or set *cond([])* to *0*.

I don't see any clear reason enforcing a choice rather than the other.
Do you?

from a mathematical point of view  the Condition number of a matrix A is
defined by

cond(A)=||A|| . ||A^(-1)||
its interest is that when solving A*x=y rounding errors on y (eps) are
amplified to be cond(A)*eps. The optimal value of cond(A) is 1 (for
identity matrix) so for me it looks natural that cond([])=1 .


I must confess that, unless claiming that *norm([])***is NOT 0,  i do 
not catch clearly the logical of your conclusion


 * /"The optimal value of cond(A) is 1 (for identity matrix) so for me
   it looks natural that cond([])=1"/

Indeed, cond([]) = norm([])*norm(inv([])) = 0*norm([]) = 0*0 = 0

By the way, according to the clear explanation you give about the 
meaning of the condition number, the value 0 is even more optimal: it 
says that small variations are not getting amplified, but killed.


Please let us know more about your proposal for 1 instead of 0.

Regards
Samuel

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


Re: [Scilab-users] Exclamation mark in variable names

2018-05-27 Thread Samuel Gougeon

Le 26/05/2018 à 14:10, Samuel Gougeon a écrit :

Le 25/05/2018 à 11:02, Samuel Gougeon a écrit :

Hello,

Le 25/05/2018 à 10:45, Clément David a écrit :

Hi,

Thanks for your experimental work on that topic. I guess we could 
merge the parser fix easily
however the `!` usage to recall a previous command will remain 
problematic. This usage does not seem
to be documented somewhere in the help page, maybe we could discard 
it. What's your opinion on that

?


It is an historical and standard feature, used not only in Scilab 
language.

Please see the entry http://bugzilla.scilab.org/10776

The only issue is that it is still undocumented. It could be 
described in the Console's page.


"The only issue" : hmm, not really. Even if the missing documentation 
is the main one, IMO this (already) very handy feature could be 
improved in at least two ways:


  * when no match is found in the history, nothing happens. For people
who does not know the feature (or who has forgotten that it is
available), this could be easily puzzling and felt as a bug.
=> when no match is found, Scilab shall print a message "No match
found in history"

  * A listbox listing matches could be displayed, to select the only
entry searched for.
This might be done in two ways :

  o either typing "!" + one char as the very first characters
would enter a completion mode based on the history, with
matches listed in a listbox as described hereabove

  o or this could be done only after validating with , or
CTRL+space as for the feature completion (but here targeted to
the history with the leading "!")

If a completion mode is implemented, then the message "no match found 
in history" could be displayed in the listbox instead of in the 
console (note that the general feature completion triggered with 
CTRL+space displays nothing when no match is found).


This request for improvements is now reported here: 
http://bugzilla.scilab.org/15592


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


Re: [Scilab-users] Exclamation mark in variable names

2018-05-27 Thread Rafael Guerra
Another two cents.
Allowing a leading exclamation mark in variable names seems to be, IMHO, a bad 
idea because (1) most computer languages do not seem to allow it and (2) some 
when encountering it, will interpret as logical negation.

Regards,
Rafael

From: users [mailto:users-boun...@lists.scilab.org] On Behalf Of Samuel Gougeon
Sent: Sunday, May 27, 2018 5:14 PM
To: Users mailing list for Scilab 
Subject: Re: [Scilab-users] Exclamation mark in variable names

Le 27/05/2018 à 16:30, Wozai a écrit :

Dear Samuel,



my point is, it wasn't possible to execute "!A=1" in Scilab 5.x (without 
prepending

a space) and IMHO one should really *improve* the situation in Scilab 6,

rather than just restoring the status quo.

Thank you Wozai for having confirmed my reading of your messages.

What Jens and i see is that Scilab 6 has not kept a status quo: by removing "!" 
from allowed characters, and by not fixing this, Scilab 6 is downgraded now for 
almost 3 years it is released. Unfortunately, this is not a status quo.

I definitively agree that improving Scilab is necessary. This is why i am 
involved in it. But i definitely disagree about the fact that what is 
considered as an improvement or a downgrade is the decision of one person or a 
very few people just declaring that "This is better than existing features. It 
must be changed!" (with a frequent trailing exclamation mark).

Other users than you and me, more numerous than you alone, could easily 
consider that keeping the usage of "!" as the history call is preferable, 
because they use to use it in other environments, and then would consider this 
change as a regression, not an improvement.

You seem to consider that using very occasionally a leading space to address a 
variable is really a big deal. But how many coders name preferably their 
variables with a leading "!" such that having to prepend a space actually 
becomes a big deal? I am sorry, but in all the external codes i had to work on 
for 20 years, variables with a leading "!" were rare enough that i don't 
remember having met a single one.

The usual way to propose an improvement is to post a wish on Bugzilla. Yours is 
welcome!

I let Clement pushing the fix for the parser, and i hope it will be 
straightforwardly merged.

I will wait 2-3 weeks before documenting the history recall and CTRL+Space 
completion
features in the Console page. If within this time it is decided to change for 
":", the page won't
have to be possibly updated afterwards.

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


Re: [Scilab-users] Exclamation mark in variable names

2018-05-27 Thread Samuel Gougeon

Le 27/05/2018 à 16:30, Wozai a écrit :

Dear Samuel,

my point is, it wasn't possible to execute "!A=1" in Scilab 5.x (without 
prepending
a space) and IMHO one should really *improve* the situation in Scilab 6,
rather than just restoring the status quo.


Thank you Wozai for having confirmed my reading of your messages.

What Jens and i see is that Scilab 6 has not kept a status quo: by 
removing "!" from allowed characters, and by not fixing this, Scilab 6 
is downgraded now for almost 3 years it is released. Unfortunately, this 
is not a status quo.


I definitively agree that improving Scilab is necessary. This is why i 
am involved in it. But i definitely disagree about the fact that what is 
considered as an improvement or a downgrade is the decision of one 
person or a very few people just declaring that "This is better than 
existing features. It must be changed!" (with a frequent trailing 
exclamation mark).


Other users than you and me, more numerous than you alone, could easily 
consider that keeping the usage of "!" as the history call is 
preferable, because they use to use it in other environments, and then 
would consider this change as a *regression*, not an improvement.


You seem to consider that using very occasionally a leading space to 
address a variable is really a big deal. But how many coders name 
preferably their variables with a leading "!" such that having to 
prepend a space actually becomes a big deal? I am sorry, but in all the 
external codes i had to work on for 20 years, variables with a leading 
"!" were rare enough that i don't remember having met a single one.


The usual way to propose an improvement is to post a wish on Bugzilla. 
Yours is welcome!


I let Clement pushing the fix for the parser, and i hope it will be 
straightforwardly merged.


I will wait 2-3 weeks before documenting the history recall and 
CTRL+Space completion
features in the Console page. If within this time it is decided to 
change for ":", the page won't

have to be possibly updated afterwards.

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


Re: [Scilab-users] Exclamation mark in variable names

2018-05-27 Thread Wozai
Dear Samuel,

my point is, it wasn't possible to execute "!A=1" in Scilab 5.x (without
prepending
a space) and IMHO one should really *improve* the situation in Scilab 6,
rather than
just restoring the status quo.

Cheers,

Wozai




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


Re: [Scilab-users] Exclamation mark in variable names

2018-05-27 Thread Samuel Gougeon

Le 27/05/2018 à 13:45, Wozai a écrit :

Hi,

In theory they are "completely independent", but currently as a matter of
fact there is a clash wrt. to the semantics of the "!" character.


Wozai, i am afraid i don't catch your point.
Your point is not specifically about Scilab 6, is it?
You already disagreed with Scilab 5 behavior about using "!" to recall 
the history, while "!" was actually accepted in identifiers, didn't you?


If so, then, your point is clearly distinct from Jens (and any user 
using variable names including "!") urgent claim,

that is specific to a Scilab 5 => 6 change.

If "!" is reintroduced among allowed characters in identifiers -- 
including as the first one --,
and "!" is not changed into ":" to recall the history, do we get with 
the fixed Scilab 6 anything else than the Scilab < 6 behavior?


Samuel

___
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 
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 
> *Sent: *Saturday, May 26, 2018 7:41 AM
> *To: *International users mailing list for Scilab.
> 
> *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 
> 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.  >
> *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] Exclamation mark in variable names

2018-05-27 Thread Wozai
Hi,

In theory they are "completely independent", but currently as a matter of
fact there is a clash wrt. to the
semantics of the "!" character.

Does is it really make sense allowing "!" in identifier names, while keeping
the the current history
recall feature, and assuming, that the user prepends a space in front of
expressions like "!A=1" to
get them executed in the Java console?

My conclusion: if both features are going to be kept, then the clash wrt "!"
should be resolved ASAP,
anyhow.

Cheers,

Wozai




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


Re: [Scilab-users] Exclamation mark in variable names

2018-05-27 Thread Samuel Gougeon

Le 27/05/2018 à 10:52, Jens Simon Strom a écrit :

Hi,
The `!` usage to recall a previous command is discussed here in 
detail. I don't miss it.  My question was different.


I was answering to the "What's your opinion?" question by Clément.

Yes, i definitely agree on that both questions are completely 
independent, and that since the fix for variables names is deemed 
/easy/, it should be applied ASAP and fastly made available in the 
continuous built.


Regards
Samuel

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


Re: [Scilab-users] Exclamation mark in variable names

2018-05-27 Thread Jens Simon Strom

Hi,
The `!` usage to recall a previous command is discussed here in detail. 
I don't miss it.  My question was different.


How about implementing again the "!" as a valid character in variable 
names as documented? How long is the reasonable response time for fixing 
the reported bug?


Regards Jens

--




Am 26.05.2018 14:10, schrieb Samuel Gougeon:

Le 25/05/2018 à 11:02, Samuel Gougeon a écrit :

Hello,

Le 25/05/2018 à 10:45, Clément David a écrit :

Hi,

Thanks for your experimental work on that topic. I guess we could 
merge the parser fix easily
however the `!` usage to recall a previous command will remain 
problematic. This usage does not seem
to be documented somewhere in the help page, maybe we could discard 
it. What's your opinion on that

?


It is an historical and standard feature, used not only in Scilab 
language.

Please see the entry http://bugzilla.scilab.org/10776

The only issue is that it is still undocumented. It could be 
described in the Console's page.


"The only issue" : hmm, not really. Even if the missing documentation 
is the main one, IMO this (already) very handy feature could be 
improved in at least two ways:


  * when no match is found in the history, nothing happens. For people
who does not know the feature (or who has forgotten that it is
available), this could be easily puzzling and felt as a bug.
=> when no match is found, Scilab shall print a message "No match
found in history"

  * A listbox listing matches could be displayed, to select the only
entry searched for.
This might be done in two ways :

  o either typing "!" + one char as the very first characters
would enter a completion mode based on the history, with
matches listed in a listbox as described hereabove

  o or this could be done only after validating with , or
CTRL+space as for the feature completion (but here targeted to
the history with the leading "!")

If a completion mode is implemented, then the message "no match found 
in history" could be displayed in the listbox instead of in the 
console (note that the general feature completion triggered with 
CTRL+space displays nothing when no match is found).


By the way, as for this "!" history recall, the existing interactive 
usage of the completion is not documented in the Console page. Let's 
add both in the page, as they presently are.


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