-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I have the max function in the objective function? #18
Comments
Hello,
Thank you for reaching us. I will try to answer your questions.
A) You can do a max function using linear constraint as follow. Instead of
energy (1,t) * 10 + max( energy(1,1:t) ),
you can create a new variable, says "y", and write
energy (1,t) * 10 + y
s.t. y >= energy(1,1:t)
Since you are minimizing, y will always be tight to the maximum value of
energy(1,1:t).
B) In such case, at stage t with realization xi, you take the corresponding
node n(t, xi) and you solve the associated problem, given your previous
decision at previous stages. This will give you the best solution. i,e,.
the solution that minimizes (in expectation) your objective.
C) In that case, you can create one extra node at the beginning that does
nothing. This will give you the possibility to simulate the fact that you
start with 3 nodes at stage 1.
I hope those answers will help you, do not hesitate to contact us again if
you want more details :-).
Best regards,
Damien
Le sam. 13 mars 2021 à 04:18, hssharadga ***@***.***> a
écrit :
… A) Can I have the max function in the objective function? Is the SDDP able
to solve this kind of problem?
For example the objective function: obj = energy (1,t) * 10 if t<H
obj = energy (1,t) * 10 + max (energy(1,1:t)) if t=H
I am getting the following error: Error using max
Invalid data type. First argument must be numeric or logical.
B) If my problem got solved How can I get the solution that would lead to
the best objective function with the highest probability?
C) Why the lattice.randomPath() assumes for the first stage that the
selected node is node 1. Let me explain it: in my problem, I assume that I
have 3 stages and for each stage, I have 3 nodes. My question: Why this
function take random nodes for stage 2 and stage 3 while it assumes the
selected node for stage 1 is node number 1.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#18>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA6XCZ6DCDPAWSRAYMKGXTLTDMNUBANCNFSM4ZDT5CBA>
.
--
Damien Scieur
Homepage: https://damienscieur.com/
|
Thank you again @windows7lover I have one question what if the realization is not one of the expected scenarios (node)? Your help is appreciated! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A) Can I have the max function in the objective function? Is the SDDP able to solve this kind of problem?
For example the objective function: obj = energy (1,t) * 10 if t<H
.........................................................................obj = energy (1,t) * 10 + max (energy(1,1:t)) if t=H
I am getting the following error: Error using max
Invalid data type. First argument must be numeric or logical.
B) If my problem got solved How can I get the solution that would lead to the best objective function with the highest probability?
C) Why the lattice.randomPath() assumes for the first stage that the selected node is node 1. Let me explain it: in my problem, I assume that I have 3 stages and for each stage, I have 3 nodes. My question: Why this function take random nodes for stage 2 and stage 3 while it assumes the selected node for stage 1 is node number 1.
The text was updated successfully, but these errors were encountered: