Group Abstract Group Abstract

Message Boards Message Boards

FindMinimum problem with Interpolated curve

Posted 1 year ago
POSTED BY: David Golber
9 Replies
Posted 1 year ago

Thanks for this. I think I am beginning to understand this.

POSTED BY: David Golber

Update: Henrik's suggestion to use Threaded is also a good solution. Perhaps contrary to its name, Threaded prevents the threading of Plus in such cases as Threaded[a] + {1, 2}, when a is not a list. Threaded was introduced in version 13.1 and is stille experimental.

This is rather subtle stuff.

POSTED BY: Gianluca Gorni
POSTED BY: Gianluca Gorni
Posted 1 year ago

Thanks again. I am running Mathematica 12. It does not have "Threaded", but it does have "Thread".

POSTED BY: David Golber
Posted 1 year ago

I think (the Mathematica priests will say) that c is a function whose values are 2-lists. It is not two functions. As i say, this is too subtle for me ...

POSTED BY: David Golber
POSTED BY: Henrik Schachner
Posted 1 year ago
POSTED BY: David Golber

The problem is that when faced with c[t] - {2, -1} symbolically, it treats c[t] as a number, so that the result is {c[t]-2,c[t]+1}.

POSTED BY: Gianluca Gorni
Posted 1 year ago

OK ... if instead of

FindMinimum[dsq[c[t],q],{t,.3,.301}]

we define

f[t_?NumberQ] := dsq[c[t], q];

Then

FindMinimum[f[t], {t, .3,.301}];

works.

I can't say that i understand why it shouldn't work in the original. But I guess

f[t_?NumberQ] 

for the function to be minimized avoids all sorts of stuff I don't understand. It just tells FindMinimum "Just do the numbers". ... and we both understand numbers in the same way.

POSTED BY: David Golber
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard