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     70    80     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 <fmiy...@fceia.unr.edu.ar> 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 <stephane.motte...@utc.fr> wrote:
>>> Hello Heinz,
>>>
>>> See https://gitlab.com/scilab/scilab/-/issues/17285
>> I have the same Scilab breakdown with "datafit"
>> Heinz
>>
>>
>> Data=[   10     50     70    80     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 - 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/

Reply via email to