Re: [Scilab-users] leastsq kills Scilab

2024-09-12 Thread Heinz Nabielek
Silly me. Thanks for the corrections.



> On 02.09.2024, at 06:00, Federico Miyara  wrote:
>
>
> Heinz,
>
> In the definition of G in your example, don't you mean Model instead of FF?
> And shouldn't the parameters and the argument be reversed?
>
> With those changes I get the script working and yielding an accurate fit
> to within 3,6 %
>
> Federico Miyara
>
> On 1/9/2024 22:50, Heinz Nabielek wrote:
>> On 29.08.2024, at 08:42, Stéphane Mottelet  wrote:
>>> Hello Heinz,
>>>
>>> See https://gitlab.com/scilab/scilab/-/issues/17285
>> I have the same Scilab breakdown with "datafit"
>> Heinz
>>
>>
>> Data=[   10 50 7080 100.170.200.
>>   0.09   0.49   0.6   0.68   0.71   0.89   0.91];
>> function YP=Model(p,x)
>>  YP=p(1) +p(2)*(1-exp(-x/p(3)))
>> endfunction
>> function e=G(p, Data)
>> e = Data(2,:) - FF(Data(1,:), p);  // vertical distance
>> endfunction
>> p0=[0;1;80];
>> [p, dmin] = datafit(G, Data, p0)
>> ___
>> users mailing list - [email protected]
>> Click here to unsubscribe: 
>> 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/
>>
>>
>
>
> --
> Este correo electrónico ha sido analizado en busca de virus por el software 
> antivirus de Avast.
> www.avast.com
> ___
> users mailing list - [email protected]
> Click here to unsubscribe: 
> 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/
>

___
users mailing list - [email protected]
Click here to unsubscribe: 
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/



Re: [Scilab-users] leastsq kills Scilab

2024-09-02 Thread Heinz Nabielek
Dear Federico:

but what is going wrong with code fragment below? It kills Scilab on the Mac 
and gives error message on the PC.
Would datafit do any better?
Heinz

function YP=Model2(p,xc)
  x=1:300; df2=(exp(-x/p))/p;f2=cumsum(df2)
  YP=f2(xc)
endfunction
time=[10 50 7080 100  170  200];
value= [   0.09   0.49   0.6   0.68   0.71   0.89   0.91];
function DV=cost(pv, xv, yv); DV= Model2(pv,xv)-yv; endfunction;
[time; value; Model2(80,time); cost(80,time,value)]
p=80.8; [fopt,xopt,gopt]=leastsq(list(cost,time,value),p)

> On 02.09.2024, at 06:00, Federico Miyara  wrote:
>
>
> Heinz,
>
> In the definition of G in your example, don't you mean Model instead of FF?
> And shouldn't the parameters and the argument be reversed?
>
> With those changes I get the script working and yielding an accurate fit
> to within 3,6 %
>
> Federico Miyara
>
> On 1/9/2024 22:50, Heinz Nabielek wrote:
>> On 29.08.2024, at 08:42, Stéphane Mottelet  wrote:
>>> Hello Heinz,
>>>
>>> See https://gitlab.com/scilab/scilab/-/issues/17285
>> I have the same Scilab breakdown with "datafit"
>> Heinz
>>
>>
>> Data=[   10 50 7080 100.170.200.
>>   0.09   0.49   0.6   0.68   0.71   0.89   0.91];
>> function YP=Model(p,x)
>>  YP=p(1) +p(2)*(1-exp(-x/p(3)))
>> endfunction
>> function e=G(p, Data)
>> e = Data(2,:) - FF(Data(1,:), p);  // vertical distance
>> endfunction
>> p0=[0;1;80];
>> [p, dmin] = datafit(G, Data, p0)

___
users mailing list - [email protected]
Click here to unsubscribe: 
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/



Re: [Scilab-users] leastsq kills Scilab

2024-09-01 Thread Federico Miyara


Heinz,

In the definition of G in your example, don't you mean Model instead of FF?
And shouldn't the parameters and the argument be reversed?

With those changes I get the script working and yielding an accurate fit
to within 3,6 %

Federico Miyara

On 1/9/2024 22:50, Heinz Nabielek wrote:

On 29.08.2024, at 08:42, Stéphane Mottelet  wrote:

Hello Heinz,

See https://gitlab.com/scilab/scilab/-/issues/17285

I have the same Scilab breakdown with "datafit"
Heinz


Data=[   10 50 7080 100.170.200.
   0.09   0.49   0.6   0.68   0.71   0.89   0.91];
function YP=Model(p,x)
  YP=p(1) +p(2)*(1-exp(-x/p(3)))
endfunction
function e=G(p, Data)
 e = Data(2,:) - FF(Data(1,:), p);  // vertical distance
endfunction
p0=[0;1;80];
[p, dmin] = datafit(G, Data, p0)
___
users mailing list - [email protected]
Click here to unsubscribe: 
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/





--
Este correo electrónico ha sido analizado en busca de virus por el software 
antivirus de Avast.
www.avast.com
___
users mailing list - [email protected]
Click here to unsubscribe: 
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/



Re: [Scilab-users] leastsq kills Scilab

2024-09-01 Thread Heinz Nabielek
On 29.08.2024, at 08:42, Stéphane Mottelet  wrote:
>
> Hello Heinz,
>
> See https://gitlab.com/scilab/scilab/-/issues/17285

I have the same Scilab breakdown with "datafit"
Heinz


Data=[   10 50 7080 100.170.200.
  0.09   0.49   0.6   0.68   0.71   0.89   0.91];
function YP=Model(p,x)
 YP=p(1) +p(2)*(1-exp(-x/p(3)))
endfunction
function e=G(p, Data)
e = Data(2,:) - FF(Data(1,:), p);  // vertical distance
endfunction
p0=[0;1;80];
[p, dmin] = datafit(G, Data, p0)
___
users mailing list - [email protected]
Click here to unsubscribe: 
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/



Re: [Scilab-users] leastsq kills Scilab

2024-09-01 Thread Heinz Nabielek
On 29.08.2024, at 08:42, Stéphane Mottelet  wrote:
>
> Hello Heinz,
>
> See https://gitlab.com/scilab/scilab/-/issues/17285


I have seen the error messsages, but I am still desperately looking for help 
because ‘leastsq’ causes an error message on the PC or crashes on the Mac. I 
have tried all possible code variations to no avail. The array listings all 
look perfectly OK!
Heinz.

Code fragment:
function YP=Model2(p,xc)
  x=1:300; df2=(exp(-x/p))/p;f2=cumsum(df2);
  YP=f2(xc)
endfunction
time=[10 50 7080 100  170  200];
value= [   0.09   0.49   0.6   0.68   0.71   0.89   0.91];
function DV=cost(pv, xv, yv); DV= Model2(pv,xv)-yv; endfunction;
p=80; [time; value; Model2(p,time); cost(p,time,value)]
p=80.8; [fopt,xopt,gopt]=leastsq(list(cost,time,value),p)
___
users mailing list - [email protected]
Click here to unsubscribe: 
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/



Re: [Scilab-users] leastsq kills Scilab

2024-08-29 Thread Stéphane Mottelet
As said in the issue, you can run your script with the x86_64 version to see 
the error.

S.

> Le 29 août 2024 à 18:51, Heinz Nabielek  a écrit :
>
> I need the "`[fopt,xopt,gopt]=leastsq(list(cost,time,value),p)" command for 
> obtaining the necessary model parameters. What can we do? Heinz
>
>
>
>
>> On 29.08.2024, at 08:42, Stéphane Mottelet  wrote:
>>
>> Hello Heinz,
>>
>> See 
>> https://antiphishing.vadesecure.com/v4?f=SnpNUUNxek1BTWh6ZFZjaWS-plicgKLgGmvGdUxygz8_UWQ9sL3me9buN1NHKIg5&i=cHp0TkJvdm11bGhoR250SmgzWyo_pLShMtUzEpeQLkU&k=6xq5&r=Z1RORVRCV0NEb2hhaDhMZMIPJZSFwvTaK32dfs4n6-2Ca_dADhE1rjNSBcQz5I0U&s=4126bbd5157541b6eca40f6d6071ac5b7c90ccc41c42ccdbb55bc41cc8e3c10e&u=https%3A%2F%2Fgitlab.com%2Fscilab%2Fscilab%2F-%2Fissues%2F17285
>>
>> S.
>>
 On Aug 29, 2024, at 03:55, Heinz Nabielek  wrote:
>>>
>>> My last line of code (below) forces Scilab to quit unexpectedly. Why? And 
>>> how can I avoid it?
>>> Heinz
>>>
>>> PS Code and data are massively simplified from my "real" problems.
>>>
>>> // Functional behaviour obtained from integration
>>> function YP=Model2(p,xc)
>>> x=1:300; df2=(exp(-x/p))/p;f2=cumsum(df2);
>>> YP=f2(xc)
>>> endfunction
>>> // Measurements
>>> time=[10 50 7080 100  170  200];
>>> value= [   0.09   0.49   0.6   0.68   0.71   0.89   0.91];
>>> // Cost function
>>> function DV=cost(pv, xv, yv)
>>> DV= Model2(pv,xv)-yv;
>>> endfunction
>>> // Nonlinear least squares fit
>>> p=77; [fopt,xopt,gopt]=leastsq(list(cost,time,value),p);pfit=xopt
>
>
> __
> Dr Heinz Nabielek
> Park Residenz Döbling
> Seniorenheim, App. 134
> Hartäckerstraße 45, 1190 Wien, Österreich
> Tel +43 1 476 20 134
> cell +43 677 616 349 22
> [email protected]
___
users mailing list - [email protected]
Click here to unsubscribe: 
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/



Re: [Scilab-users] leastsq kills Scilab

2024-08-29 Thread Heinz Nabielek
I need the "`[fopt,xopt,gopt]=leastsq(list(cost,time,value),p)" command for 
obtaining the necessary model parameters. What can we do? Heinz




> On 29.08.2024, at 08:42, Stéphane Mottelet  wrote:
>
> Hello Heinz,
>
> See https://gitlab.com/scilab/scilab/-/issues/17285
>
> S.
>
>> On Aug 29, 2024, at 03:55, Heinz Nabielek  wrote:
>>
>> My last line of code (below) forces Scilab to quit unexpectedly. Why? And 
>> how can I avoid it?
>> Heinz
>>
>> PS Code and data are massively simplified from my "real" problems.
>>
>> // Functional behaviour obtained from integration
>> function YP=Model2(p,xc)
>> x=1:300; df2=(exp(-x/p))/p;f2=cumsum(df2);
>> YP=f2(xc)
>> endfunction
>> // Measurements
>> time=[10 50 7080 100  170  200];
>> value= [   0.09   0.49   0.6   0.68   0.71   0.89   0.91];
>> // Cost function
>> function DV=cost(pv, xv, yv)
>> DV= Model2(pv,xv)-yv;
>> endfunction
>> // Nonlinear least squares fit
>> p=77; [fopt,xopt,gopt]=leastsq(list(cost,time,value),p);pfit=xopt


__
Dr Heinz Nabielek
Park Residenz Döbling
Seniorenheim, App. 134
Hartäckerstraße 45, 1190 Wien, Österreich
Tel +43 1 476 20 134
cell +43 677 616 349 22
[email protected]
___
users mailing list - [email protected]
Click here to unsubscribe: 
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/



Re: [Scilab-users] leastsq kills Scilab

2024-08-28 Thread Stéphane Mottelet
Hello Heinz,

See https://gitlab.com/scilab/scilab/-/issues/17285

S.

> On Aug 29, 2024, at 03:55, Heinz Nabielek  wrote:
>
> My last line of code (below) forces Scilab to quit unexpectedly. Why? And how 
> can I avoid it?
> Heinz
>
> PS Code and data are massively simplified from my "real" problems.
>
> // Functional behaviour obtained from integration
> function YP=Model2(p,xc)
>  x=1:300; df2=(exp(-x/p))/p;f2=cumsum(df2);
>  YP=f2(xc)
> endfunction
> // Measurements
> time=[10 50 7080 100  170  200];
> value= [   0.09   0.49   0.6   0.68   0.71   0.89   0.91];
> // Cost function
> function DV=cost(pv, xv, yv)
>  DV= Model2(pv,xv)-yv;
> endfunction
> // Nonlinear least squares fit
> p=77; [fopt,xopt,gopt]=leastsq(list(cost,time,value),p);pfit=xopt

___
users mailing list - [email protected]
Click here to unsubscribe: 
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/