[AMPL 24525] Question

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} := LUniform01();
Param y1 {1…10} := L
Uniform01();

Param x2 {0} := L/2;

Param y2 {0} := L/2;

How I can have this???:point_down:t2:
Param x = summation param x1 and x2
Param y = summation param y1 and y2

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}”.)