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

Home » Public Forums » archive » Re: Another MPFIT question
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: Another MPFIT question [message #62829 is a reply to message #62828] Sat, 11 October 2008 19:02 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Oct 11, 4:35 pm, MichaelT <michael.theus...@googlemail.com> wrote:
> Today I discovered MPFIT and I am so excited how well it works (many
> thanks Craig!).
>
> I ran into one problem, however, which I was not able to solve. Maybe,
> there is a simple solution.
> Among all the parameters I have four whose sum must not be larger than
> a certain value:
>
> 0 < c1+c2+c3+c4 < 1.
>
> All four parameters may vary between zero and one which I implemented
> using .limits and .limited. But, how do I implement the additional
> constraint? Any ideas? It may be too obvious for me to see...
>
> Thanks, Michael

How's this
re-parameterize our problem to -
p[0]=c1, p[1]=c1+c2, p[2]=c1+c2+c3 and p[3]=c1+c2+c3+c4
then limit all these to [0,1]

so in the function:
function myfunc, x, p
c1 = p[0]
c2 = p[1]-p[0]
c3 = p[2]-p[1]
c4 = p[3]-p[2]
return, somefunctionof(c1,c2,c3,c4)
end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to obtain pixel location
Next Topic: Re: Transpose(A)*P*A

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

Current Time: Sat Oct 11 12:27:15 PDT 2025

Total time taken to generate the page: 1.68016 seconds