Lists of equations. Again
- To: mathgroup at smc.vnet.net
- Subject: [mg56274] Lists of equations. Again
- From: Maxim <ab_def at prontomail.com>
- Date: Wed, 20 Apr 2005 05:32:50 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In version 5.0 FindRoot[{{x, y} == {1, 1}}, {x, 2}, {y, 2}] failed: it
complained about the non-numerical jacobian and just returned the starting
point. This now works in version 5.1; however, there is still exactly the
same problem with higher-dimensional lists:
FindRoot[Array[a, {2, 2}] == IdentityMatrix[2],
Evaluate[Sequence@@ (Flatten[#, 1]&)@ Array[{a[##], 0}&, {2, 2}]]]
This generates Thread::tdlen and FindRoot::njnum messages, indicating that
there is again something wrong with the processing of lists. Strangely,
FindRoot[Array[a, {2, 2}] - IdentityMatrix[2],
Evaluate[Sequence@@ (Flatten[#, 1]&)@ Array[{a[##], 0}&, {2, 2}]]]
works without a problem (another possible way to resolve this issue is to
specify Jacobian -> IdentityMatrix[4]).
If the specified form of the jacobian doesn't have the correct structure,
this often results in the kernel crash:
FindRoot[x == {1, 2}, {x, {0, 0}}, Jacobian -> {{{1}, {1}}}]
(*crashes the kernel*)
This may happen even if the structure is correct:
FindMinimum[x^2, {x, 1},
Method -> {Newton, Hessian -> {{2}}}]
(*crashes the kernel*)
Here the hessian is specified correctly, but unless the gradient is also
given explicitly as Gradient -> {2x}, all the other settings (Automatic,
Symbolic, FiniteDifference) lead to the kernel crash.
Maxim Rytin
m.r at inbox.ru