Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Why do some variable names work and others fail?' topicStudent Support Forum > General > Archives > "Why do some variable names work and others fail?"

Next Comment >Help | Reply To Topic
Author Comment/Response
MOS was 71331
06/02/13 00:05am

This code works:
Clear[a, b, c, d]
N[Minimize[{(a - c)^2 + (b - d)^2, (a - .5)^2 + (b - 1)^2 == .25, c^2 - d^2 == 1}, {a, b, c,d}]]
giving
{0.07606709, {a -> 0.9408055, b -> 0.7640117, c -> 1.183956,
d -> 0.6338393}}

This code doesn't:
Clear[x1, y1, x2, y2]
Minimize[{(x1 - x2)^2 + (y1 - y2)^2 , (x1 - .5)^2 + (y1 - 1)^2 == .25,x2^2 - y2^2 == 1}, {x1, y1, x2, y2}]
giving
NMinimize::nnum:
"\"The function value \!\(\(\(0.01525129760789266`\)\( \)\) + \
0.4684858199790163`\\\\\\ \*InterpretationBox[Cell[\\\"\\\"],\n\
TextCell[" "]]\) is not a number at \!\({x1, x2, y1, y2}\) = \
{\!\(0.6434757731582851`, 0.7669719172595997`, 0.28030267285728516`, \
0.9647629127390597`\)}.\""

URL: ,

Subject (listing for 'Why do some variable names work and others fail?')
Author Date Posted
Why do some variable names work and others fail? MOS was 71331 06/02/13 00:05am
Re: Why do some variable names work and others ... Forum Modera... 06/02/13 6:27pm
Re: Why do some variable names work and others ... MOS was 71331 06/05/13 4:08pm
Re: Re: Why do some variable names work and oth... Forum Modera... 06/05/13 5:27pm
Next Comment >Help | Reply To Topic