# \[AMPL 24525\] Question

**URL:** <https://discuss.ampl.com/t/ampl-24525-question/368>\
**Category:** Google Group Mirror\
**Created:** [February 11, 2023, 11:07am UTC](https://discuss.ampl.com/t/ampl-24525-question/368 "2023-02-11T11:07:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sahebeh\_Azar](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Sahebeh\_Azar](https://discuss.ampl.com/u/Sahebeh_Azar)\
**Post date:** [February 11, 2023, 11:07am UTC](https://discuss.ampl.com/t/ampl-24525-question/368/1 "2023-02-11T11:07:30Z")

</div>

I would be grateful if someone could answer my question:

I have two param, how I can have a new param including their sum. For example:

Options randseed 0;  
Param L:= 100;  
Param x1 {1…10} := L_Uniform01();  
Param y1 {1…10} := L_Uniform01();

Param x2 {0} := L/2;

Param y2 {0} := L/2;

How I can have this???👇🏻  
Param x = summation param x1 and x2  
Param y = summation param y1 and y2

---

<div class="post-metadata">

**Author:** ![AMPL\_Google\_Group](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@AMPL\_Google\_Group](https://discuss.ampl.com/u/AMPL_Google_Group)\
**Post date:** [February 13, 2023, 3:53am UTC](https://discuss.ampl.com/t/ampl-24525-question/368/2 "2023-02-13T03:53:21Z")

</div>

You can write “param x =” (or “param x :=”) followed by the expression that you want to use to define x. For example, if you want x to be equal to x2[0] + x1[1] + . . . + x1[10], you can write

`param x = x2[0] + sum {j in 1..10} x1[j];`

The same approach can be used for param y. (Note that the statement begins with “param”, not “Param”. Also if you want x2 to be indexed over only the set that contains 0, you must write “param x2 {0…0}”.)
