Michael, thank you very much for your willingness to help.

I have a polynomial (specific heat capacity, to be exact) which is a function of the temperature. It has different forms for two ranges of temperatures.

For instance, not in gams language, but in algebraic form, it has the form:

Cp(T) = a1*TË†3 + a2*TË†2 (for T2000) where a7 and a8 are parameters

The problem I am encountering is that the â€œa’sâ€ parameters of the Cp polynomial are different for different species (O2, H2, H2O). So, what I did, was create an set â€œkâ€, which attributes a different polynomial Cpk, to each species.

I then have

Cp(k, T) = a1k*TË†3 + a2k*TË†2 etcâ€¦

Additional to this, I must be able to have different values of the variable T for the polynomial, for instance T(i), where when I use a different value of i, I have a different temperature.

I envisaged using

Cp(k, T(i)), but this is not allowed in GAMS (this is why I used â€œiâ€ to distinguish the temperatures).

I then used

Cp(k, i) and defined the polynomial as:

Cp(k, i) = a1k*T(i)Ë†3 + a2*T(i)Ë†2 etcâ€¦

The problem with doing this is that when I use Cp in my program, I donâ€™t see how can I recover the variable T(i), since the indices in Cp are â€œi, kâ€, not â€œT(i), kâ€.

This is why my question asks the question of how to define a vector (T(i)), within a function (Cp(i, T(i)), which is apparently not allowed in GAMS.

Please advise if my problem is clearly presented.

Tks a lot.

Bruno

Sent with Unibox

On Jan 18, 2016, at 1:19 PM, Michael Bussieck wrote:

Bruno,

I do not understand what you try to do. Since you have not gotten useful answer can you try to be more specific in your question. Can you write this in pseudo code or some other formal language?

Best,

Michael Bussieck - GAMSWorld Coordinator

On Friday, January 15, 2016 at 4:26:22 PM UTC-5, Bruno Hannud wrote:

```
Tks Omid.
I still don't see how could I get the variable T(i). It is a variable, not a parameter. On the process of optimization, the variable T(i) should assume changing values until the final conversion. How could the gdx file help?
On Saturday, January 9, 2016 at 12:22:12 PM UTC-2, omid ziaee wrote:
Hi,
You can use call to run another gams file. Then put the results in a .gdx file and use the results in your program. Look at the following sample code,
$setglobal ide "ide=%gams.ide% lo=%gams.lo% errorlog=%gams.errorlog% errmsg=1"
$call =gams yourprogram.gms %ide%
$if errorlevel 1 $abort your_model failed
$gdxin yourfilename.gdx
On Tuesday, January 5, 2016 at 1:49:26 AM UTC-6, Bruno Hannud wrote:
Hi everyone.
I have a polynomial G(i) which is a function of a parameter T(i) (eg G(i) = T(i)**3).
Once I set i, I have T(i), and therefore G(i).
The problem arises when I want to use T(i) as a variable, to be obtained from another program. GAMS doesn't even allow us to write G(T(i)). G(T) goes ok, but I need many T's (i.e. a vector)
Is there a way out?
Thaks for your help.
```

–

You received this message because you are subscribed to a topic in the Google Groups “gamsworld” group.

To unsubscribe from this topic, visit https://groups.google.com/d/topic/gamsworld/OqdpzHJgRfI/unsubscribe.

To unsubscribe from this group and all its topics, send an email to gamsworld+unsubscribe@googlegroups.com.

To post to this group, send email to gamsworld@googlegroups.com.

Visit this group at https://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/d/optout.

–

To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.

To post to this group, send email to gamsworld@googlegroups.com.

Visit this group at https://groups.google.com/group/gamsworld.

For more options, visit https://groups.google.com/d/optout.