[Scilab-users] Simplify with threshold

2020-08-27 Thread Federico Miyara
Dear All, Just in case anyone finds it useful, I'm attaching a function to simplify rationals which allows, unlike the native function simp, to set a threshold below which a zero and a pole can be cancelled. Regards, Federico Miyara -- El software de antivirus Avast ha analizado este correo

Re: [Scilab-users] {EXT} Re: Weird error with leastsq()

2020-08-27 Thread Antoine Monmayrant
On 27/08/2020 17:55, Dang Ngoc Chan, Christophe wrote: Hello, De : Antoine Monmayrant Envoyé : jeudi 27 août 2020 17:25 n=real(n); Now it works. Basic. I thought about this and I know I tested some isreal(sellmeier(lambda)) stuff during the development but I did not thought it would

Re: [Scilab-users] {EXT} Re: Weird error with leastsq()

2020-08-27 Thread Dang Ngoc Chan, Christophe
Hello, > De : Antoine Monmayrant > Envoyé : jeudi 27 août 2020 17:25 > > n=real(n); > > Now it works. Basic. I thought about this and I know I tested some isreal(sellmeier(lambda)) stuff during the development but I did not thought it would happen during the regression process with some

Re: [Scilab-users] Weird error with leastsq()

2020-08-27 Thread Antoine Monmayrant
OK, forget my previous answer. Use this: function [n] = sellmeier(KL, lambda)     K1 = KL(1); K2 = KL(2); K3 = KL(3);     L1 = KL(4); L2 = KL(5); L3 = KL(6);     lambdacarre = lambda.*lambda;     foo1 = lambdacarre - L1;     foo2 = lambdacarre - L2;     foo3 = lambdacarre - L3;     foo =

Re: [Scilab-users] Weird error with leastsq()

2020-08-27 Thread Antoine Monmayrant
Hello, I can tell you what happened: for some values of lambda and some values of K(4,5,6), your function is undefined and the leastsq goes kaboom! It is never a good idea to fit a function that can become undefined for some parameters/xvalues. Try to redefine the function you fit to avoid

[Scilab-users] Weird error with leastsq()

2020-08-27 Thread Dang Ngoc Chan, Christophe
Hello all, Let's talk about optics. I have a glass, its refraction index n varies with the wavelength lamba. I have a CSV file with the corresponding data (verre_HOQ.cvs attached), 52 points. I want to model this with the Sellmeier model https://en.wikipedia.org/wiki/Sellmeier_equation and use

Re: [Scilab-users] xload doesn't work with accented letters in file names on W10

2020-08-27 Thread Antoine Monmayrant
Hello Pierre, Exactly like last time, its seems to be Windows10-specific as your script does work as expected under Linux. Antoine ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

[Scilab-users] xload doesn't work with accented letters in file names on W10

2020-08-27 Thread Perrichon
Hello, We get an error when loading a « scg » file which has accented letters in its file name Here is a script to reproduce this error //-- - Rep="TMPDIR\" chdir(Rep) NameFile1=Rep + "Test.scg";

Re: [Scilab-users] {EXT} Re: errors (uncertainties) in non-linear least-squares fitting parameters

2020-08-27 Thread Dang Ngoc Chan, Christophe
Hello Heinz, > De : Heinz Nabielek > Envoyé : lundi 24 août 2020 23:59 > > I want all three straight lines to go simultaneously through one point at the > negative x-axis. > This is why I had to use a non-linear least-squares fit. The calculation runs quite fats so it might not worth the effort

Re: [Scilab-users] simp_mode odesn't seem to work

2020-08-27 Thread antoine . elias
Hello Federico, simp_mode is a function not a variable, use : simp_mode(%f); Regards, Antoine Le 27/08/2020 à 09:50, Federico Miyara a écrit : > Dear All, > > I need to have examples of rationals with very close poles and zeros, but the > simp engine simplifies them. This is

[Scilab-users] simp_mode odesn't seem to work

2020-08-27 Thread Federico Miyara
Dear All, I need to have examples of rationals with very close poles and zeros, but the simp engine simplifies them. This is awkward, since the simp documentation says there is no threshold, so other than identical poles and zeros shouldn't be simplified. Actually this is the case with