Skip to content

Commit 3656a30

Browse files
authored
minor typos
1 parent cf52085 commit 3656a30

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

_posts/2025-05-09-gams-formatter.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We can then write the objective function to maximise as:
1313
$$Z = x_1*v_{1} + x_2*v_{2} + x_3*v_{3} + x_4*v_{4} + x_5*v_{5}$$
1414

1515
subject to the constraint:
16-
$$x_1*w_{1} + x_2*w_{2} + x_3*w_{3} + x_4*w_{4} + x_5*w_{5} + \le 100$$
16+
$$x_1*w_{1} + x_2*w_{2} + x_3*w_{3} + x_4*w_{4} + x_5*w_{5} \le 100$$
1717

1818
This representation obviously does not scale well with 1000s of items, so we can refactor it in GAMS like so:
1919

@@ -23,7 +23,7 @@ Z =e= sum(i, x(i) * v(i) )
2323

2424
and
2525

26-
```gams
26+
```
2727
sum(i, x(i) * w(i) ) =l= 100
2828
```
2929

@@ -47,9 +47,7 @@ This great [intro](https://derek.stride.host/posts/comprehensive-introduction-to
4747

4848
Because we could parse this tree as `(x + y) + z` or `x + ( y + z)` we need to explicitly tell the parser that we prefer the left option (in the `grammar.js` this is done with `prec.left()` wrapped around the rule)
4949

50-
In GAMS you can assign a set like `x = 1`, a subset of the set `x(i) = 1` or an attribute `x.lo(i) = 1`.
51-
52-
We can set up these rules like so:
50+
In GAMS you can assign a set like `x = 1`, a subset of the set `x(i) = 1` or an attribute `x.lo(i) = 1`. We can set up these rules like so:
5351

5452
```javascript
5553
parameter_reference: $ => seq(

0 commit comments

Comments
 (0)