MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayMATLAB Central > MATLAB Newsreader > Optimization using Heaviside function 

Subject: Optimization using Heaviside function From: Petros Date: 13 Jun, 2010 17:37:03 Message: 1 of 18 
I try to run a onevariable optimization of a function that makes use of the heaviside function. 
Subject: Optimization using Heaviside function From: Roger Stafford Date: 13 Jun, 2010 18:25:06 Message: 2 of 18 
"Petros " <p3tris@gmail.com> wrote in message <hv34vv$91u$1@fred.mathworks.com>... 
Subject: Optimization using Heaviside function From: Walter Roberson Date: 13 Jun, 2010 18:33:27 Message: 3 of 18 
Petros wrote: 
Subject: Optimization using Heaviside function From: Petros Date: 13 Jun, 2010 18:43:03 Message: 4 of 18 
Thanks for replying. Really the function is not that one. The real function is a 2variable function with quadratic parts and heaviside functions. I just wanted to start with something simpler. I cannot avoid the heaviside functions unfortunately, because they represent decisions made by a controller. So, the functions are 
Subject: Optimization using Heaviside function From: Petros Date: 13 Jun, 2010 19:06:03 Message: 5 of 18 
If I use an approximation like: heaviside(x)=1/(1+exp(50000*x)) which gives a good approximation of the heaviside funtion, will it be ok for using fmincon? 
Subject: Optimization using Heaviside function From: Roger Stafford Date: 13 Jun, 2010 19:48:03 Message: 6 of 18 
"Petros " <p3tris@gmail.com> wrote in message <hv38rn$sfv$1@fred.mathworks.com>... 
Subject: Optimization using Heaviside function From: Roger Stafford Date: 13 Jun, 2010 20:25:04 Message: 7 of 18 
(Ignoring the as yet unspecified Q0,) you have discontinuities along the x1 axis only at 0 and 5, and along the x2 axis at 0 and 19. Define 
Subject: Optimization using Heaviside function From: Petros Date: 13 Jun, 2010 20:25:05 Message: 8 of 18 
I understand what you are saying. But, these functions get really complicated. How do I check finite number of possible solutions? I have managed to plot a few of them with syms and ezsurf() after that what? 
Subject: Optimization using Heaviside function From: John D'Errico Date: 13 Jun, 2010 20:59:04 Message: 9 of 18 
"Petros " <p3tris@gmail.com> wrote in message <hv3a6r$ip3$1@fred.mathworks.com>... 
Subject: Optimization using Heaviside function From: Roger Stafford Date: 13 Jun, 2010 22:42:04 Message: 10 of 18 
"Petros " <p3tris@gmail.com> wrote in message <hv3er0$nk7$1@fred.mathworks.com>... 
Subject: Optimization using Heaviside function From: Greg Heath Date: 14 Jun, 2010 02:06:44 Message: 11 of 18 
On Jun 13, 1:37 pm, "Petros " <p3t...@gmail.com> wrote: 
Subject: Optimization using Heaviside function From: Petros Date: 14 Jun, 2010 07:58:03 Message: 12 of 18 
Greg Heath <heath@alumni.brown.edu> wrote in message <dde7f674e072434d821310ee9a1a9d2e@5g2000vbf.googlegroups.com>... 
Subject: Optimization using Heaviside function From: Greg Heath Date: 14 Jun, 2010 13:10:57 Message: 13 of 18 
On Jun 14, 3:58 am, "Petros " <p3t...@gmail.com> wrote: 
Subject: Optimization using Heaviside function From: Petros Date: 14 Jun, 2010 13:24:04 Message: 14 of 18 
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? 
Subject: Optimization using Heaviside function From: Steven Lord Date: 14 Jun, 2010 14:20:34 Message: 15 of 18 

Subject: Optimization using Heaviside function From: Greg Heath Date: 15 Jun, 2010 17:14:36 Message: 16 of 18 
On Jun 14, 9:24 am, "Petros " <p3t...@gmail.com> wrote: 
Subject: Optimization using Heaviside function From: Johan Löfberg Date: 16 Jun, 2010 10:33:08 Message: 17 of 18 
Greg Heath <heath@alumni.brown.edu> wrote in message <85578c571844440e952c6dda746ad5c3@t10g2000yqg.googlegroups.com>... 
Subject: Optimization using Heaviside function From: Johan Löfberg Date: 16 Jun, 2010 10:36:07 Message: 18 of 18 
whoops, should be 
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.