[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about fmins!
From: |
rambovn |
Subject: |
Re: Question about fmins! |
Date: |
Tue, 12 Jun 2007 06:37:40 -0700 (PDT) |
Hi,
Thank you for your help. I tried many times but the error is still there.
And now after receiving your email, I also tried in the same you wrote,
creating one file, and put all things in in, finally running it, the error
is there. But when I changed ub = [20;20] and lb = -ub; then it worked :O.
Maybe you are right, I used an old version of samin. But can you tell me in
more details how to compile the new one? (for example, after download the
new file, where can I put it?...), I am bad at these things :(.
Thank you very much for your patience.
Regards
Anh
Michael Creel wrote:
>
> Hmm, I don't see any problem. I put the following in a file named test.m
>
> Contents of test.m:
> -------- cut here -------------
> 1;
> function a = f(x)
> a = cos(x) + 0.01*(x-pi)^2;
> endfunction
>
> # Set up the controls:
> ub = 20;
> lb = -ub;
> nt = 20;
> ns = 5;
> rt = 0.5;
> maxevals = 1e10;
> neps = 5;
> functol = 1e-10;
> paramtol = 1e-5;
> verbosity = 1;
> minarg = 1;
>
> # Put them in a cell array:
> control = {lb, ub, nt, ns, rt, maxevals, neps, functol, paramtol,
> verbosity,
> minarg};
>
> # Call the minimizer (function argument also in cell array):
> samin("f", {-8}, control)
>
> -------- cut here -------------
>
> Then I run it from octave, and I get
>
> octave:2> test
>
> ================================================
> SAMIN results
>
> Normal convergence
>
> Convergence tolerances: Func. tol. 1.000000e-10 Param. tol. 1.000000e-05
> Obj. fn. value -1.000000
>
> parameter search width
> 3.141593 0.000009
> ================================================
> ans = 3.1416
> octave:3>
>
> How did you obtain samin? If you think you might have an old version,
> please get
> the newest one from
> http://octave.cvs.sourceforge.net/*checkout*/octave/octave-forge/main/optim/src/samin.cc?revision=1.8
> and compile it using "mkoctfile samin.cc"
> Cheers, M.
>
>
--
View this message in context:
http://www.nabble.com/Question-about-fmins%21-tf3900212.html#a11078937
Sent from the Octave - General mailing list archive at Nabble.com.