MathGroup Archive 2002

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

Search the Archive

Re: plotting with boundary conditions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34503] Re: [mg34482] plotting with boundary conditions
  • From: BobHanlon at aol.com
  • Date: Fri, 24 May 2002 02:42:05 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 5/23/02 5:15:51 AM, rajeshwary at neo.tamu.edu writes:

>I need to plot a surface 
>  f(a,b) = a^2-2*c(a,b)+b^2; given the boundary conditions c(a,b)< ab
>
>  Here c(a,b) is another function of (a,b) given by
>  c(a,b) = 0.1*(a-1)^2+0.1*(b-1)^2-0.01
>
>Is there a direct command to set these boundary conditions...?? If i give
>
>
>f[a_, b_] := If[c[a, b] < a*b, a^2 + b^2 - 2*c[a, b],];
>
>Plot3D[f[a, b], {a, 0, 2}, {b, 0, 2}, AxesLabel -> {"a", "b", "f"}, 
>  ViewPoint -> {2, 2, 2}]
>
>I get error messages for the values of a and b for which f(a,b) doesnot
>exist.
>
>Can anybody please tell me how i can get this plot?
>

Needs["Calculus`Integration`"];

c[a_,b_]:=(10*((a-1)^2+(b-1)^2)-1)/100;

f[a_,b_]:=a^2-2*c[a,b]+b^2;

Plot3D[f[a,b],{a,-2,2},{b,-2,2},
    AxesLabel->{"a","b","f"}, PlotPoints->35];

Plot3D[Boole[c[a,b]<a*b],{a,-2,2},{b,-2,2},
    AxesLabel->{"a","b","f"}, PlotPoints->35];

Plot3D[f[a,b]*Boole[c[a,b]<a*b],{a,-2,2},{b,-2,2},
    AxesLabel->{"a","b","f"}, PlotPoints->35];


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: Re: generating random numbers in Mathematica
  • Next by Date: Re: Solving an equation
  • Previous by thread: plotting with boundary conditions
  • Next by thread: RE: plotting with boundary conditions