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