MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Non-linear Programming - Plot3D

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110115] Re: Non-linear Programming - Plot3D
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Wed, 2 Jun 2010 02:06:14 -0400 (EDT)
  • References: <hu2g3f$l2l$1@smc.vnet.net>

"Trevor Rabey" wrote:

> I can use Plot3D to plot a surface z as a function of x and y, say z =
> x^2-y^2, abd the NLP problem is to max or min z on some region defined
> by a function or functions such as:
> x + y <= 12, x<=10, y <=10
> I cannot seem to find a good way to plot the constraints, ie the
> extrusion of the region from the xy plane.
> Help, anyone? TIA.
> --
> Trevor Rabey
>

I don't know exactly what you want. If you want to show the area, where
the constraints are true, you can use RegionPlot:

RegionPlot[
x + y <= 12 && x <= 10 && y <= 10, {x, -10, 15}, {y, -10, 15}]

If you want to restrict your Plot3D on area of the constraints only, you
may use RegionFunction, e.g.

Plot3D[Sin[x]^2 y, {x, 0, 5 \[Pi]}, {y, 0, 30},
 RegionFunction -> Function[{x, y, z}, x <= 12 && x <= 10 && y <= 10]]

//Peter 
-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: fyi, for users of free Mathematica player on linux 64 bit OS
  • Next by Date: Re: Fluid dynamic over a complex terrain
  • Previous by thread: Re: Non-linear Programming - Plot3D
  • Next by thread: tabulating expression with arbitrary precision