Re: Warning Message wrt NMinimize function

• To: mathgroup at smc.vnet.net
• Subject: [mg69762] Re: Warning Message wrt NMinimize function
• From: p-valko at tamu.edu
• Date: Fri, 22 Sep 2006 01:04:42 -0400 (EDT)
• References: <eeu01h\$b83\$1@smc.vnet.net>

```As it is written right now, you are minimizing a list that consists of
two elements,
each of them being a list itself. NMinimize really does not know what
to do with such an object.
(Very often in Mathematica - and in any software - the error messages are
difficult to understand because they are logical only within a given
context, but the user misses the context itself, not the particulars
within the context. I think the next generation of softwares will have
some AI built-in to recognize the real root of the misunderstanding and
will offer more help. Today softwares, like Mathematica, still look like a bit
autistic persons, but soon they will have more empathy for the user. )

> Hello Everyone,
>
> I want to use NMinimize to solve an optimization problem. In essence, I'm
> trying to numerically minimize the "sum of a square of errors" for two
> lists, aa and bb (earlier generated lists of n elements or points), using
> the below syntax:
>
>  NMinimize[{Plus @@ Table[(aa[[i]] - bb[[i]])^2, {i, n}], {y> 0}}, y,
> Method -> "DifferentialEvolution"]
> This does not yield the intended result of, say, {minimumvalue, y->10.012}.
> I have been getting an expression (unevaluated "result" ) with a warning
> message such as:
>
> NMinimize::nnum : The function value {336.381} is not a number at {y}=
> {0.063703}. More...
>
> I then clicked on 'More' for help. I got the below message from the help
> browser:
>
> "General::nnum
>
> function::nnum: The function value `3` is not a number at `2` = `1`.
>
> Notes for this message have not yet been added."
>
> Has anyone experienced this before? Is anything wrong with my syntax above?
>