[AMPL 1827] Initial value for a variable...

View: New views
2 Messages — Rating Filter:   Alert me  

[AMPL 1827] Initial value for a variable...

by Poppu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello everyone at AMPL newsgroup!
I have been here for some time now, and i love this place :D Great
info and program ^^
I wanted to know something because i have a problem when i want to
give in my model an initial value for a variable. (i think its a
really noob problem... but i cant seems to find the problem!)

My variable is like this in the model:

set hidro;
set escalon;
set tipo;
param Ph {hidro,type} >= 0;
...
var h{h in hidro,j in escalon,t in tipo} := Ph[h,t], >=0;
...


and Ph[h,t] is a parameter well defined on the data file that
represent the maximum value of the var "h" for any value of the
escalon set... I think i`m right but i keep having this error message:


Error: syntax error
processing commands.
Error: context:  var h {hidro,escalon,tipo} :=  >>> Ph[h, <<< t],
>=0;
Error (512) in /home/neosotc/neos-bin/ampl -R amplin


Any idea on how to solve the problem? thx for the help everyone!

PD:sry for my bad english... if you need to know something else, pls
let me know!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---


[AMPL 1829] Re: Initial value for a variable...

by pietro belotti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Poppu,

I think you shouldn't use "h" for both the variable name and the index.

Cheers,
Pietro

On Thu, Jun 12, 2008 at 7:02 PM, Poppu <daimadoshi@...> wrote:

>
> Hello everyone at AMPL newsgroup!
> I have been here for some time now, and i love this place :D Great
> info and program ^^
> I wanted to know something because i have a problem when i want to
> give in my model an initial value for a variable. (i think its a
> really noob problem... but i cant seems to find the problem!)
>
> My variable is like this in the model:
>
> set hidro;
> set escalon;
> set tipo;
> param Ph {hidro,type} >= 0;
> ...
> var h{h in hidro,j in escalon,t in tipo} := Ph[h,t], >=0;
> ...
>
>
> and Ph[h,t] is a parameter well defined on the data file that
> represent the maximum value of the var "h" for any value of the
> escalon set... I think i`m right but i keep having this error message:
>
>
> Error:  syntax error
> processing commands.
> Error: context:  var h {hidro,escalon,tipo} :=  >>> Ph[h, <<< t],
>>=0;
> Error (512) in /home/neosotc/neos-bin/ampl -R amplin
>
>
> Any idea on how to solve the problem? thx for the help everyone!
>
> PD:sry for my bad english... if you need to know something else, pls
> let me know!
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To post to this group, send email to ampl@...
To unsubscribe from this group, send email to ampl-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/ampl?hl=en
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price!