# ts_node is ignored in the objective function (bug?)

We describe the issue through an example. If we set the following symbols:

```
ts_node(grid, node, 'balancePenalty', f, t) = 10; (A)
p_gnBoundaryPropertiesForStates('elec', 'link_node', 'balancePenalty', 'useTimeSeries') = 1 ; (B)
```

then we expect it to have an impact on the objective function, however, this is not case because of the following:

2c_objective.gms

```
+ sum(gn(grid, node),
+ vq_gen(inc_dec, grid, node, s, f, t)
*( PENALTY_BALANCE(grid, node)${not
+ ts_node_(grid, node, 'balancePenalty', s, f,
)
) // END sum(gn)
```

1e_inputs.gms

```
// Nodes with states
gn_state(grid, node)${ gn_stateSlack(grid, node)
or p_gn(grid, node, 'energyStoredPerUnitOfState')
or sum((stateLimits, useConstantOrTimeSeries), p_gnBoundaryPropertiesForStates(grid, node, stateLimits, useConstantOrTimeSeries))
or sum(useConstantOrTimeSeries, p_gnBoundaryPropertiesForStates(grid, node, 'reference', useConstantOrTimeSeries))
}
= yes;
// Existing grid-node pairs
gn(grid, node)${ sum(unit, gnu(grid, node, unit))
or gn_state(grid, node)
or sum((f, t), ts_influx(grid, node, f, t))
or sum(node_, gn2n(grid, node, node_))
or sum(node_, gn2n(grid, node_, node))
or sum(node_, gnn_state(grid, node, node_))
or sum(node_, gnn_state(grid, node_, node))
}
= yes;
```

Hence, setting (B) will not affect gn_state and eventually gn. As a workaround one can set, e.g.:

`p_gnBoundaryPropertiesForStates('elec', 'link_node','upwardLimit','useTimeSeries') = 1E50;`

, then we will observe that the values in (A) appears in objective function.

Additional information

```
p_gnBoundaryPropertiesForStates(grid, node, param_gnBoundaryTypes, param_gnBoundaryProperties)
param_gnBoundaryTypes "Types of boundaries that can be set for a node with a state variable" /
upwardLimit "Absolute maximum state of the node (unit of measure depends on energyStoredPerUnitOfState)"
downwardLimit "Absolute minimum energy in the node (unit of measure depends on energyStoredPerUnitOfState)"
upwardSlack01*upwardSlack20 "A threshold after which a specific cost co-efficient is applied (unit of measure depends on energyStoredPerUnitOfState)"
downwardSlack01*downwardSlack20 "A threshold after which a specific cost co-efficient is applied (unit of measure depends on energyStoredPerUnitOfState)"
reference "Reference value for a state that can be used to bound a state (unit of measure depends on energyStoredPerUnitOfState)"
maxSpill "Maximum spill rate from the node (MWh/h)"
minSpill "Minimum spill rate from the node (MWh/h)"
balancePenalty "Penalty value for violating the energy balance of that particular node (EUR/MWh) (can be interpretated as the energy price in certain settings)"
/
```

perhaps, one can define a subset param_gnBoundaryTypes_gn_state(param_gnBoundaryTypes) that ensures that if any of the values in the set are defined, then it will affect the objective function.