Greetings,
The NUOPT User's Guide version 1.4, Chapter 4, p.36 gives the following example
of changing the value of a Parameter in an already created System:
function()
{
a <- Set(1:10)
i <- Element(set=a)
p <- Parameter(list(1:10, 1:10), index=i, changeable=T)
x <- Variable(list(1:10, rep(30,10)), index=i)
x[i] >= p[i]
f <- Objective(minimize)
f ~ Sum(-1/(x[i]-50), i)
}
s1 <- System(initVal)
sol1 <- solve(s1, f)
current(s1, x)
current(s1,p)"list(1:10,21:30)
The latter statement is supposed to assign a new list value to the Parameter
p. However, on my computer that statement causes the error:
Problem in parse(text = "script.run(exprs.literal={..: Syntax error: illegal
string ("list(1:10,21:30)\n\n})\n\n") on input line 2
Use traceback() to see the call stack
> traceback()
4: eval(action, sys.parent())
3: doErrorAction("Problem in parse(text = \"script.run(exprs.literal={..:
Syntax error: illegal string (\"list(1:10,21:30)\\n\\n})\\n\\n\") on input line
2",
2: parse(text =
"script.run(exprs.literal={\ncurrent(s1,p)\"list(1:10,21:30)\n\n})\n"
1:
Message: Problem in parse(text = "script.run(exprs.literal={..: Syntax error:
illegal string ("list(1:10,21:30)\n\n})\n\n") on input line 2
Does anyone know an updated syntax or is this a bug? I have S-Plus 6.0 Release
4, and I am not sure what the NUOPT version number is (don't see how to get it
from the help menu) but it's about 6 months old.
Thanks,
David
|