Search found 3 matches

by FrancescaC
1 month ago
Forum: Syntax
Topic: Conditional statement with variable
Replies: 5
Views: 486

Re: Conditional statement with variable

Thank you very much, this worked! Sorry if I insist with questions, but this is really helping me a lot :) Is it normal that the binary variable ( b(t) in your example ) is not really binary in the solutions? It often (i.e. in many of the timesteps) assumes values very close to 1 or 0, but not exact...
by FrancescaC
1 month ago
Forum: Syntax
Topic: Conditional statement with variable
Replies: 5
Views: 486

Re: Conditional statement with variable

Thank you Atharv! I understood why I can't use conditional statements on variables. I also looked into the bigM method, which would work perfectly if my "control" variable was binary, for example: Set t 'time' /1:24/ Binary variable U(t) 'State of the battery ON-OFF' Variable Pbatt Parameters V, I E...
by FrancescaC
1 month ago
Forum: Syntax
Topic: Conditional statement with variable
Replies: 5
Views: 486

Conditional statement with variable

Hello, I am working on an energy system optimization with a storage device. I need the power stored or delivered by the battery to be = 0 when the state of charge is max (>= 100%) or min (<= 0%) respectively. The problem is both the power and the SOC are variables defined at each timestep. The parts...