comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » curve fitting: works badly?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: curve fitting: works badly? [message #3676 is a reply to message #3672] Mon, 06 March 1995 15:49 Go to previous messageGo to previous message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
feil@prl.philips.nl (Hans Feil) writes:


> I try to use CURVEFIT to get some simple data fitted to an harmonic
> oscillator.

> Somehow things don't work very good.

(stuff deleted)

> pro FUNCT,x,a,f,pder


> f = a(0) + a(1)*(x-a(2))^2


> PDER = FLTARR(N_ELEMENTS(X),3) ;YES, MAKE ARRAY.
>
> PDER(*,0) = 1.0 ;COMPUTE PARTIALS
> PDER(*,1) = (x-a(2))^2
> PDER(*,2) = 2*a(1)*(x-a(2))
^^^^^^^^^^^^^^^
> end

> RETURN

> end

I think that your problem is here. I believe that the sign of this partial
derivative should be negative.

I've often had this problem with this technique. If the partial derivatives
are calculated wrong, you can compute till doomsday and it'll never converge.
I often just don't bother to try to figure it out anymore, and just do the
derivatives numerically.

Bill Thompson
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: New User seeks book
Next Topic: widget_button

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Nov 30 14:16:02 PST 2025

Total time taken to generate the page: 1.76261 seconds