s-news
[Top] [All Lists]

Changing a Parameter value in a NUOPT System

To: <s-news@lists.biostat.wustl.edu>
Subject: Changing a Parameter value in a NUOPT System
From: "Quinn, David" <David.Quinn@nrgenergy.com>
Date: Fri, 25 Oct 2002 20:11:43 -0500
Cc: "Quinn, David" <David.Quinn@nrgenergy.com>
Thread-index: AcJ8hjRc9JLd9Z6FTlGrHCUIbwy9BQAA0huw
Thread-topic: How to change a Parameter value in a NUOPT System
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

<Prev in Thread] Current Thread [Next in Thread>