piecewise function #1393
Replies: 6 comments 11 replies
-
I have no idea what you mean with "When I run, it's not possible to report an error" And please put the code in a code block |
Beta Was this translation helpful? Give feedback.
-
I'm sorry I didn't make myself clear.Here u1 is the 0-1binvar variable,f1 is the sdpvar variable,f1min Is a number. u1=binvar(1,3); uf1 is part of the objective function,However, the running result is not feasible.I just want to express that different f1 ranges cause different uf1 values. However,When I set one of the conditions to be met
The problem is solvable. What is the reason for this? |
Beta Was this translation helpful? Give feedback.
-
Sorry about the block I'm not really sure how to output the block.
This is a screenshot of the code .As I said before, uf1 is part of the objective function and f1min is a number.What exactly is wrong with this piecewise function?
…------------------ 原始邮件 ------------------
发件人: "yalmip/YALMIP" ***@***.***>;
发送时间: 2024年4月1日(星期一) 晚上7:49
***@***.***>;
***@***.******@***.***>;
主题: Re: [yalmip/YALMIP] piecewise function (Discussion #1393)
You would have to supply a reproducible example, because there is no way in a sensible model that the first would be infeasible and the second feasible
...and again, use code blocks (<> in the menu) to make code readable. I've edited you second block to illustrate
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
That doesn't work either? I'm sorry I can't get this website open |
Beta Was this translation helpful? Give feedback.
-
Hello teacher, how to define the segmentation function in yalmip?
The use implies that the following problem occurs.
F=[F,implies(u1(1),[f1<=f1min,uf1==1])
implies(u1(2),[f1min<=f1<=f1min1.5,uf1==(1.5f1min-f1)/(0.5f1min)])
implies(u1(3),[f1>=f1min1.5,uf1==0])
sum(u1(n,:))==1];
Here u1 is the 0-1binvar variable,f1 is the sdpvar variable,f1min Is a number. uf1 is part of the objective function. When I run, it's not possible to report an error.
But when I set one of the conditions u1(2)==1, it works, why is that?
Why not choose one of the three?
Beta Was this translation helpful? Give feedback.
All reactions