From: Greg Heath on
On Jun 14, 9:24 am, "Petros " <p3t...(a)gmail.com> wrote:
> I do have the NN toolbox (because I work at my university's pc which has all toolbox) but even if I use that, how do I solve the problem later?

I thought you said that the discontinuous heaviside was
your only problem.If that is true, try to construct a
sequence of solutions where each new solution is based
on replacing heaviside(z) with logsig(a(n)*z) with
a(n) > a(n-1) >= 1.

Hope this helps.

Greg
From: Johan Löfberg on
Greg Heath <heath(a)alumni.brown.edu> wrote in message <85578c57-1844-440e-952c-6dda746ad5c3(a)t10g2000yqg.googlegroups.com>...
> On Jun 14, 9:24 am, "Petros " <p3t...(a)gmail.com> wrote:
> > I do have the NN toolbox (because I work at my university's pc which has all toolbox) but even if I use that, how do I solve the problem later?
>
> I thought you said that the discontinuous heaviside was
> your only problem.If that is true, try to construct a
> sequence of solutions where each new solution is based
> on replacing heaviside(z) with logsig(a(n)*z) with
> a(n) > a(n-1) >= 1.
>
> Hope this helps.
>
> Greg


If you are willing to use a mixed-integer solver (glpk, gurobi,cplex, etc), the following code implements my interpretation of your problem, in the modelling language YALMIP (free matlab toolbox)

d1 = sdpvar(2,1);
d2 = binvar(2,1);
d3 = binvar(2,1);

sdpvar L Q P x1 x2

a = 1;
b = 2;
c = 3;
d = 4;
e = 5;
f = 6;
Q0 = 7;

Constraints1 = [implies(d1(1),[P==a, 0<x1<5]),implies(d1(2),[P==b, x1>5]),sum(d1)==1]
Constraints2 = [implies(d2(1),[Q==c, 0<x2<19]),implies(d2(2),[Q==d, x2>19]),sum(d2)==1];
Constraints3 = [implies(d3(1),[L == (Q-P-Q0)*e, 0<Q-P-Q0<100])];
Constraints4 = [implies(d3(2),[L == (Q-P-Q0)*f, 100<Q-P-Q0<200]),sum(d3)==1]
Constraints = [Constraints1,Constraints2,Constraints3,Constraints4,-1000<[L Q P x1 x2]<1000];
solvesdp(Constraints,L)
From: Johan Löfberg on
whoops, should be

d1 =binvar(2,1);



"Johan Löfberg" <loefberg(a)control.ee.ethz.ch> wrote in message <hva994$jg3$1(a)fred.mathworks.com>...
> Greg Heath <heath(a)alumni.brown.edu> wrote in message <85578c57-1844-440e-952c-6dda746ad5c3(a)t10g2000yqg.googlegroups.com>...
> > On Jun 14, 9:24 am, "Petros " <p3t...(a)gmail.com> wrote:
> > > I do have the NN toolbox (because I work at my university's pc which has all toolbox) but even if I use that, how do I solve the problem later?
> >
> > I thought you said that the discontinuous heaviside was
> > your only problem.If that is true, try to construct a
> > sequence of solutions where each new solution is based
> > on replacing heaviside(z) with logsig(a(n)*z) with
> > a(n) > a(n-1) >= 1.
> >
> > Hope this helps.
> >
> > Greg
>
>
> If you are willing to use a mixed-integer solver (glpk, gurobi,cplex, etc), the following code implements my interpretation of your problem, in the modelling language YALMIP (free matlab toolbox)
>
> d1 = sdpvar(2,1);
> d2 = binvar(2,1);
> d3 = binvar(2,1);
>
> sdpvar L Q P x1 x2
>
> a = 1;
> b = 2;
> c = 3;
> d = 4;
> e = 5;
> f = 6;
> Q0 = 7;
>
> Constraints1 = [implies(d1(1),[P==a, 0<x1<5]),implies(d1(2),[P==b, x1>5]),sum(d1)==1]
> Constraints2 = [implies(d2(1),[Q==c, 0<x2<19]),implies(d2(2),[Q==d, x2>19]),sum(d2)==1];
> Constraints3 = [implies(d3(1),[L == (Q-P-Q0)*e, 0<Q-P-Q0<100])];
> Constraints4 = [implies(d3(2),[L == (Q-P-Q0)*f, 100<Q-P-Q0<200]),sum(d3)==1]
> Constraints = [Constraints1,Constraints2,Constraints3,Constraints4,-1000<[L Q P x1 x2]<1000];
> solvesdp(Constraints,L)