MathGroup Archive 2010

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

Search the Archive

Re: Problem with Min Max between two functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112098] Re: Problem with Min Max between two functions
  • From: "J. Batista" <jbatista800 at gmail.com>
  • Date: Mon, 30 Aug 2010 06:20:21 -0400 (EDT)

Dear Maria, I reviewed your note.  I did not experience the error that you
described when executing the notebook.  I will directly send you the
original notebook with the additional lines of code appended to the end.
This version of your original notebook also has the graphical results I
obtained after executing it, in the form of the final image found in the
notebook.
Regards,
J. Batista

On Thu, Aug 26, 2010 at 6:49 AM, maria giovanna dainotti <
mariagiovannadainotti at yahoo.it> wrote:

> Dear J. Batista,
> I used the following equations
> R1====1.029
> R2====3.892
> R3====8
> e1====250
> e2====11.8
> e3====80.5
> i====p/12
> spherenear[x_,y_]:====((R3^2-x^2-y^2)^(1/2))
> spherefar[x_,y_]:====-((R3^2-x^2-y^2)^(1/2))
> jetnear[x_,y_]:====Min[Re[spherenear[x,y]],Re[(R1^2-x^2)^(1/2)+y*Tan[i]]]
> jetfar[x_,y_]:====Max[Re[spherefar[x,y]],Re[-(R1^2-x^2)^(1/2)]+y*Tan[i]]
> jetbrightness[x_,y_]:====Boole[-R1==EF==82==A3x==EF==82==A3R1]*(jetnear[x,y] -
> jetfar[x,y])*e1
> emptynear[x_,y_]:====Min[Re[spherenear[x,y]],Re[(R2^2-x^2)^(1/2)+y*Tan[i]]]
> emptyfar[x_,y_]:====Max[Re[spherefar[x,y]],Re[-(R2^2-x^2)^(1/2)]+y*Tan[i]]
> emptybrightness[x_,y_]:====Boole[-R1<x<R1]*(emptynear[x,y] -jetnear[x,y] +
> jetfar[x,y]- emptyfar[x,y])*e2 +(Boole[-R2
> <x<-R1]+Boole[R2>x>R1])*(emptynear[x,y] -jetnear[x,y] + jetfar[x,y]-
> emptyfar[x,y])*e2
> spherebrightness[x_,y_]:====Boole[-R2<x<R2]*(spherenear[x,y] -emptynear[x,y]
> +
> emptyfar[x,y]- spherefar[x,y])*e3
> +(Boole[x<-R2]+Boole[R2<x])*(spherenear[x,y] -
> spherefar[x,y])*e3
> ==E3==80==80
>
> f[x_,y_]:====((jetnear[x,y]-jetfar[x,y])*e1+e3*(spherenear[x,y]-emptynear[x,y]+emptyfar[x,y]-spherefar[x,y])+e2*(emptynear[x,y]-jetnear[x,y]+jetfar[x,y]-emptyfar[x,y]))*Boole[-R1<x<R1]+((emptynear[x,y]-emptyfar[x,y])*e2+e3*(spherenear[x,y]-emptynear[x,y]+emptyfar[x,y]-spherefar[x,y]))*(Boole[-R2<x<-R1]+Boole[R2>x>R1])+(spherenear[x,y]-spherefar[x,y])*e3*(Boole[x<-R2]+Boole[x>R2])
>
> ==E3==80==80
> 1.029
> 3.892
> 8
> 250
> 11.8
> 80.5p==C2
>
> originalPlot====ContourPlot[f[x,y],{x,-8,8},{y,-8,8},Contours==EF==82==AE50,ColorFunction==EF==82==AE(Hue[#]&)]/12
>
> originalColorData========ImageData[originalPlot];
>
> targetPixels========Position[originalColorData,originalColorData[[180,180=
]]];newColorData========ReplacePart[originalColorData,targetPixels
>
> ->
> Image[newColorData]
> But I got the following error message:
> Part::partd: Part specification
> \[NoBreak]originalColorData==EF==81==90180,180\[RightDoubleBracket]\[NoBr=
eak]
> is longer
> than depth of object. ==EF==82==87
> ==C2
> Image::imgarray: The specified argument
> \[NoBreak]originalColorData\[NoBreak]
> should be an array of rank 2 or 3 with machine-size numbers. ==EF==82==87
> I will be very grateful if you could help me.
> Thanks a lot
> Best regards
> Maria
> ==C2 {1.,1.,1.}];
>
> ________________________________
> Da: J. Batista <jbatista800 at gmail.com>
> A: mathgroup at smc.vnet.net
> Inviato: Lun 2 agosto 2010, 13:02:00
> Oggetto: [mg111445] Re: Problem with Min Max between two functions
>
> Maria/All, I just learned from a colleague that all equations on my messa=
ge
> have double equal signs.==C2  Please note that is probably due to a trans=
m==
> ission
> error.==C2  All equations should only have a single equal sign.==C2  I'm
> retransmitting my original message.
> Regards,
> J. Batista
> On Sun, Aug 1, 2010 at 3:10 AM, J. Batista <jbatista800 at gmail.com> wrote:
>
> > Dean Maria, here is a possible solution to your question.==C2  The whit=
e
> > contour areas can be removed by approaching the output of ContourPlot a=
s
> ==
> an
> > image, treating the task as one of image processing (as suggested
> previou==
> sly
> > by Daniel Lichtblau).==C2  First, equate the original ContourPlot outpu=
t==
>  with a
> > variable name, for example originalPlot ======== Out[1]==C2  (where Out=
[1] i==
> s the
> > ContourPlot output cell).==C2  Alternatively, you can simply select the
> > ContourPlot, copy and then paste into the first line of the code sequen=
ce
> > below in place of the variable originalPlot.==C2  I will now display th=
e==
>  four
> > lines of the code sequence and then explain them afterwards.
> >
> > originalColorData ======== ImageData[originalPlot];
> >
> > targetPixels ======== Position[originalColorData, originalColorData[[18=
0,
> 180==
> ]]];
> >
> > newColorData ======== ReplacePart[originalColorData, targetPixels -> {1=
., 1.,
> > 1.}];
> >
> > Image[newColorData]
> >
> >
> > The first code line accomplishes the task of collecting and reading the
> > ContourPlot into computer memory as image data, in this case a vector o=
f
> ==
> RGB
> > color values.==C2  Note that I place a semicolon at the end of this and=
 ==
> other
> > lines of code in order to suppress the visual output of the code
> sequence==
> 's
> > result.==C2  This is because the vector is lengthy and will clog the no=
t==
> ebook
> > unnecessarily.
> > The second code line establishes the pattern by which the portions of t=
he
> > plot that you wish to alter are identified as a subset of the entire
> > original data set.==C2  The pattern is established by entering the pixe=
l
> > coordinate of a representative target pixel that you wish to alter, in
> th==
> is
> > case [[180, 180]] being one of the pixels in the white contour areas.===
C2==
>  You
> > can determine an appropriate pixel coordinate by right-clicking in the
> > original ContourPlot output, selecting Get Indices, and then guiding yo=
ur
> > cursor to a desired location within the plot.
> > The third code line replaces the pixel locations flagged by the previou=
s
> > pattern search with new pixel data, in this case new RGB color values
> tha==
> t
> > you select.==C2  I have used the example of {1., 1., 1.} to illustrate =
c==
> hanging
> > from the semi-white color of the original plot to a true white that
> match==
> es
> > the plot background.==C2  Be sure to use decimal points as above when e=
x==
> pressing
> > color values for your pixels, as something like {1, 1, 1} will not
> > be understood correctly for this purpose.==C2  If you want to change th=
e
> > semi-white color of your original plot to black, use {0., 0., 0.}.
> > The fourth and final line re-establishes the newly altered set of pixel
> > data as an image object, and displays the altered image.
> >
> > Hope this helps.
> > Best Regards,
> > J. Batista
> >
> >==C2  On Mon, Jul 26, 2010 at 6:37 AM, maria giovanna dainotti <
> > mariagiovannadainotti at yahoo.it> wrote:
> >
> >> Dear Mathgroup,
> >> I have the following function
> >> R1========1.029
> >> R2========3.892
> >> R3========8
> >> e1========250
> >> e2========11.8
> >> e3========80.5
> >> i========pi/12
> >> spherenear[x_,y_]:========((R3^2-x^2-y^2)^(1/2))
> >> spherefar[x_,y_]:========-((R3^2-x^2-y^2)^(1/2))
> >>
> emptynear[x_,y_]:========Min[Re[spherenear[x,y]],Re[(R2^2-x^2)^(1/2)+y*Ta=
n[i==
> ]]====
> ]
> >>
> emptyfar[x_,y_]:========Max[Re[spherefar[x,y]],Re[-(R2^2-x^2)^(1/2)]+y*Ta=
n[i==
> ]]
> >>
> jetnear[x_,y_]:========Min[Re[spherenear[x,y]],Re[(R1^2-x^2)^(1/2)+y*Tan[=
i]]==
> ]
> >> jetfar[x_,y_]:========Max[Re[spherefar[x,y]],Re[-(R1^2-x^2)^(1/2)]+y*T=
an[i]]
> >>
> >>
> f[x_,y_]:========((jetnear[x,y]-jetfar[x,y])*e1+e3*(spherenear[x,y]-empty=
nea==
> r[====
>
> x,y]+emptyfar[x,y]-spherefar[x,y])+e2*(emptynear[x,y]-jetnear[x,y]+jetfar=
[x==
> ====
>
> ,y]-emptyfar[x,y]))*Boole[-R1========EF========82========A3x========EF===
======82========A3R1]+((emp==
> tynear[x,y]-====
>
> emptyfar[x,y])*e2+e3*(spherenear[x,y]-emptynear[x,y]+emptyfar[x,y]-sphere=
fa==
> ====
>
> r[x,y]))*(Boole[-R2<x<-R1]+Boole[R2>x>R1])+(spherenear[x,y]-spherefar[x,y=
])==
> ====
> *e3*(Boole[x<-R2]+Boole[x>R2])
> >>
> >>
> >>
> ContourPlot[f[x,y],{x,-8,8},{y,-8,8},Contours========EF========82=========
AE{0,100,20==
> 0,300,====
> 400,500,600,700,800,900}]
> >>
> >> From the picture you can see there is a white contours that results a
> bi==
> ====
> t
> >> odd, I
> >> think th at it comes out from the introduction of the Min and Max.
> >> I would like to remove this white contour. Could you help me?
> >> Thanks a lot for your attention
> >> Cheers
> >> Maria
> >>
> >>
> >
>
>
>
>
> --0-882231370-1282758216==:97664
> Content-Type: text/html; charset=="utf-8"
> Content-Transfer-Encoding: quoted-printable
> X-Sun-Content-Length: 10136
>
> <html><head><style type=="text/css"><!-- DIV {margin:0px;} --></style></h=
e==
> ad><body><div style=="font-family:arial, helvetica, sans-serif;font-size:=
1==
> 4pt"><DIV>Dear J. Batista,</DIV>==0A<DIV>I used the following
> equations</DIV==
> >==0A<DIV>==0A<P>R1==1.029</P>==0A<P>R2==3.892</P>==0A<P>R3==8</P>==0A<P>=
e1==
> ==250</P>==0A<P>e2==11.8</P>==0A<P>e3==80.5</P>==0A<P>i==<FONT face==Math=
==
> ematica1Mono>p</FONT>/12</P>==0A<P>spherenear[x_,y_]:==((R3^2-x^2-y^2)^(1=
/2==
> ))</P>==0A<P>spherefar[x_,y_]:==-((R3^2-x^2-y^2)^(1/2))</P>==0A<P>jetnear=
[x_==
> ,y_]:==Min[Re[spherenear[x,y]],Re[(R1^2-x^2)^(1/2)+y*Tan[i]]]</P>==0A<P>j=
et==
> far[x_,y_]:==Max[Re[spherefar[x,y]],Re[-(R1^2-x^2)^(1/2)]+y*Tan[i]]</P>===
0A==
> <P>jetbrightness[x_,y_]:==Boole[-R1<FONT face==Mathematica1Mono>==EF==82=
==A3==
> </FONT>x<FONT face==Mathematica1Mono>==EF==82==A3</FONT>R1]*(jetnear[x,y]=
 - j==
> etfar[x,y])*e1</P>==0A<P>emptynear[x_,y_]:==Min[Re[spherenear[x,y]],Re[(R=
2^==
> 2-x^2)^(1/2)+y*Tan[i]]]</P>==0A<P>emptyfar[x_,y_]:==Max[Re[spherefar[x,y]=
],==
> Re[-(R2^2-x^2)^(1/2)]+y*Tan[i]]</P>==0A<P>emptybrightness[x_,y_]:==Boole[=
-R==
> 1<FONT face==Mathematica1Mono>&lt;</FONT>x<FONT face==Mathematica1Mono>&l=
==
> t;</FONT>R1]*(emptynear[x,y] -jetnear[x,y] + jetfar[x,y]-
> emptyfar[x,y])*e2==
>  +(Boole[-R2 &lt;x&lt;-R1]+Boole[R2&gt;x&gt;R1])*(emptynear[x,y]
> -jetnear[x==
> ,y] + jetfar[x,y]- emptyfar[x,y])*e2</P>==0A<P>spherebrightness[x_,y_]:===
Bo==
> ole[-R2<FONT face==Mathematica1Mono>&lt;</FONT>x<FONT face==Mathematica1M=
==
> ono>&lt;</FONT>R2]*(spherenear[x,y] -emptynear[x,y] + emptyfar[x,y]-
> sphere==
> far[x,y])*e3 +(Boole[x&lt;-R2]+Boole[R2&lt;x])*(spherenear[x,y] -
> spherefar==
> [x,y])*e3</P>==0A<P>==E3==80==80</P>==0A<P>f[x_,y_]:==((jetnear[x,y]-jetf=
ar[x,y==
>
> ])*e1+e3*(spherenear[x,y]-emptynear[x,y]+emptyfar[x,y]-spherefar[x,y])+e2=
*(==
> emptynear[x,y]-jetnear[x,y]+jetfar[x,y]-emptyfar[x,y]))*Boole[-R1<FONT
> face==
> ==Mathematica1Mono>&lt;</FONT>x<FONT face==Mathematica1Mono>&lt;</FONT>R1=
==
>
> ]+((emptynear[x,y]-emptyfar[x,y])*e2+e3*(spherenear[x,y]-emptynear[x,y]+e=
mp==
>
> tyfar[x,y]-spherefar[x,y]))*(Boole[-R2&lt;x&lt;-R1]+Boole[R2&gt;x&gt;R1])=
+(==
>
> spherenear[x,y]-spherefar[x,y])*e3*(Boole[x&lt;-R2]+Boole[x&gt;R2])</P>===
0A<==
>
> P>==E3==80==80</P>==0A<P>1.029</P>==0A<P>3.892</P>==0A<P>8</P>==0A<P>250<=
/P>==0A<P>==
> 11.8</P>==0A<P>80.5</P><FONT face==Mathematica1Mono>==0A<P>p</FONT><FONT =
fac==
> e=="Times New Roman">/12</FONT></P>&nbsp;<BR><B><FONT face==Courier>==0A<=
P==
> >originalPlot==ContourPlot[f[x,y],{x,-8,8},{y,-8,8},Contours</FONT><FONT =
f==
> ace==Mathematica1Mono>==EF==82==AE</FONT><FONT face==Courier>50,ColorFunc=
tio==
> n</FONT><FONT face==Mathematica1Mono>==EF==82==AE</FONT><FONT face==Couri=
er>==
> (Hue[#]&amp;)]</P></B></FONT></DIV>==0A<DIV style=="FONT-FAMILY: arial, h=
el==
> vetica, sans-serif; FONT-SIZE: 14pt"><B><FONT face==Courier>==0A<P align=
====
> left>originalColorData====ImageData[originalPlot];</P>==0A<P align==left>=
==
> targetPixels====Position[originalColorData,originalColorData[[180,180]]];=
==
> newColorData====ReplacePart[originalColorData,targetPixels</P>==0A<P alig=
n==
> ==left>-&gt;</FONT><FONT face==Courier>{1.,1.,1.}];</P>==0A<P>Image[newCo=
l==
> orData]</P>==0A<P>But I got the following error message:
> </P>==0A<P>Part::par==
> td: Part specification \[NoBreak]originalColorData<FONT face==Mathematica=
2==
> >==EF==81==90</FONT>180,180\[RightDoubleBracket]\[NoBreak] is longer than
> dept==
> h of object. <A href=="http://reference.wolfram.com/mathematica/ref/Part.=
h==
> tml"><FONT face==Mathematica1>==EF==82==87</FONT></A></P>==0A<P>&nbsp;</P=
>==0A<==
> P>Image::imgarray: The specified argument
> \[NoBreak]originalColorData\[NoBr==
> eak] should be an array of rank 2 or 3 with machine-size numbers. <A href=
==
> =="http://reference.wolfram.com/mathematica/ref/Image.html";><FONT face==M=
==
> athematica1>==EF==82==87</FONT></A></P>==0A<P>I will be very grateful if =
you
> co==
> uld help me.</P>==0A<P>Thanks a lot</P>==0A<P>Best
> regards</P>==0A<P>Maria</P>==
> ==0A<P>&nbsp;</P></B></FONT>==0A<DIV style=="FONT-FAMILY: arial, helvetic=
a, ==
> sans-serif; FONT-SIZE: 13px"><FONT size==2 face==Tahoma>==0A<HR SIZE==1>=
==
> ==0A<B><SPAN style=="FONT-WEIGHT: bold">Da:</SPAN></B> J. Batista &lt;jba=
ti==
> sta800 at gmail.com&gt;<BR><B><SPAN style=="FONT-WEIGHT: bold">A:</SPAN></B>=
 ==
> mathgroup at smc.vnet.net<BR><B><SPAN style=="FONT-WEIGHT: bold">Inviato:</S=
P==
> AN></B> Lun 2 agosto 2010, 13:02:00<BR><B><SPAN style=="FONT-WEIGHT: bold=
"==
> >Oggetto:</SPAN></B> [mg111445] Re: Problem with Min Max between two
> functi==
> ons<BR></FONT><BR>Maria/All, I just learned from a colleague that all
> equat==
> ions on my message<BR>have double equal signs.&nbsp; Please note that is
> pr==
> obably due to a transmission<BR>error.&nbsp; All equations should only
> have==
>  a single equal sign.&nbsp; I'm<BR>retransmitting my original
> message.<BR>R==
> egards,<BR>J. Batista<BR>On Sun, Aug 1, 2010 at 3:10 AM, J. Batista &lt;<=
A
> ==
> href=="mailto:jbatista800 at gmail.com" ymailto=="mailto:jbatista800 at gmail.c=
==
> om">jbatista800 at gmail.com</A>&gt; wrote:<BR><BR>&gt; Dean Maria, here is =
a
> ==
> possible solution to your question.&nbsp; The white<BR>&gt; contour areas
> c==
> an be
>  removed by approaching the output of ContourPlot as an<BR>&gt; image,
> trea==
> ting the task as one of image processing (as suggested previously<BR>&gt;
> b==
> y Daniel Lichtblau).&nbsp; First, equate the original ContourPlot output
> wi==
> th a<BR>&gt; variable name, for example originalPlot ==== Out[1]&nbsp; (w=
==
> here Out[1] is the<BR>&gt; ContourPlot output cell).&nbsp; Alternatively,
> y==
> ou can simply select the<BR>&gt; ContourPlot, copy and then paste into th=
e
> ==
> first line of the code sequence<BR>&gt; below in place of the variable
> orig==
> inalPlot.&nbsp; I will now display the four<BR>&gt; lines of the code
> seque==
> nce and then explain them afterwards.<BR>&gt;<BR>&gt; originalColorData =
====
> == ImageData[originalPlot];<BR>&gt;<BR>&gt; targetPixels ==== Position[o=
==
> riginalColorData, originalColorData[[180, 180]]];<BR>&gt;<BR>&gt;
> newColorD==
> ata ==== ReplacePart[originalColorData, targetPixels -&gt; {1., 1.,<BR>&g=
==
> t; 1.}];<BR>&gt;<BR>&gt; Image[newColorData]<BR>&gt;<BR>&gt;<BR>&gt; The
> fi==
> rst code
>  line accomplishes the task of collecting and reading the<BR>&gt;
> ContourPl==
> ot into computer memory as image data, in this case a vector of
> RGB<BR>&gt;==
>  color values.&nbsp; Note that I place a semicolon at the end of this and
> o==
> ther<BR>&gt; lines of code in order to suppress the visual output of the
> co==
> de sequence's<BR>&gt; result.&nbsp; This is because the vector is lengthy
> a==
> nd will clog the notebook<BR>&gt; unnecessarily.<BR>&gt; The second code
> li==
> ne establishes the pattern by which the portions of the<BR>&gt; plot that
> y==
> ou wish to alter are identified as a subset of the entire<BR>&gt; origina=
l
> ==
> data set.&nbsp; The pattern is established by entering the pixel<BR>&gt;
> co==
> ordinate of a representative target pixel that you wish to alter, in
> this<B==
> R>&gt; case [[180, 180]] being one of the pixels in the white contour
> areas==
> .&nbsp; You<BR>&gt; can determine an appropriate pixel coordinate by
> right-==
> clicking in the<BR>&gt; original ContourPlot output, selecting Get
>  Indices, and then guiding your<BR>&gt; cursor to a desired location
> within==
>  the plot.<BR>&gt; The third code line replaces the pixel locations
> flagged==
>  by the previous<BR>&gt; pattern search with new pixel data, in this case
> n==
> ew RGB color values that<BR>&gt; you select.&nbsp; I have used the exampl=
e
> ==
> of {1., 1., 1.} to illustrate changing<BR>&gt; from the semi-white color
> of==
>  the original plot to a true white that matches<BR>&gt; the plot
> background==
> .&nbsp; Be sure to use decimal points as above when expressing<BR>&gt;
> colo==
> r values for your pixels, as something like {1, 1, 1} will not<BR>&gt; be
> u==
> nderstood correctly for this purpose.&nbsp; If you want to change
> the<BR>&g==
> t; semi-white color of your original plot to black, use {0., 0.,
> 0.}.<BR>&g==
> t; The fourth and final line re-establishes the newly altered set of
> pixel<==
> BR>&gt; data as an image object, and displays the altered
> image.<BR>&gt;<BR==
> >&gt; Hope this helps.<BR>&gt; Best Regards,<BR>&gt; J.
>  Batista<BR>&gt;<BR>&gt;&nbsp; On Mon, Jul 26, 2010 at 6:37 AM, maria
> giova==
> nna dainotti &lt;<BR>&gt; <A href=="mailto:mariagiovannadainotti at yahoo.it=
"==
>  ymailto=="mailto:mariagiovannadainotti at yahoo.it">mariagiovannadainotti@y=
a==
> hoo.it</A>&gt; wrote:<BR>&gt;<BR>&gt;&gt; Dear Mathgroup,<BR>&gt;&gt; I
> hav==
> e the following function<BR>&gt;&gt; R1====1.029<BR>&gt;&gt; R2====3.89==
> 2<BR>&gt;&gt; R3====8<BR>&gt;&gt; e1====250<BR>&gt;&gt; e2====11.8<BR==
> >&gt;&gt; e3====80.5<BR>&gt;&gt; i====pi/12<BR>&gt;&gt; spherenear[x_,y==
> _]:====((R3^2-x^2-y^2)^(1/2))<BR>&gt;&gt; spherefar[x_,y_]:====-((R3^2-==
> x^2-y^2)^(1/2))<BR>&gt;&gt; emptynear[x_,y_]:====Min[Re[spherenear[x,y]],=
==
> Re[(R2^2-x^2)^(1/2)+y*Tan[i]]==<BR>]<BR>&gt;&gt; emptyfar[x_,y_]:====Max=
==
> [Re[spherefar[x,y]],Re[-(R2^2-x^2)^(1/2)]+y*Tan[i]]<BR>&gt;&gt;
> jetnear[x_,==
> y_]:====Min[Re[spherenear[x,y]],Re[(R1^2-x^2)^(1/2)+y*Tan[i]]]<BR>&gt;&gt=
==
> ; jetfar[x_,y_]:====Max[Re[spherefar[x,y]],Re[-(R1^2-x^2)^(1/2)]+y*Tan[i]=
==
> ]<BR>&gt;&gt;<BR>&gt;&gt;
>  f[x_,y_]:====((jetnear[x,y]-jetfar[x,y])*e1+e3*(spherenear[x,y]-emptynea=
==
> r[==<BR>x,y]+emptyfar[x,y]-spherefar[x,y])+e2*(emptynear[x,y]-jetnear[x,y=
]==
> +jetfar[x==<BR>,y]-emptyfar[x,y]))*Boole[-R1====EF====82====A3x====
> ==EF====82====A3R1]+((emptynear[x,y]-==<BR>emptyfar[x,y])*e2+e3*(sphe==
> renear[x,y]-emptynear[x,y]+emptyfar[x,y]-spherefa==<BR>r[x,y]))*(Boole[-R=
2==
> &lt;x&lt;-R1]+Boole[R2&gt;x&gt;R1])+(spherenear[x,y]-spherefar[x,y])==<BR=
>==
> *e3*(Boole[x&lt;-R2]+Boole[x&gt;R2])<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt;
> Co==
> ntourPlot[f[x,y],{x,-8,8},{y,-8,8},Contours====EF====82====AE{0,100,2==
> 00,300,==<BR>400,500,600,700,800,900}]<BR>&gt;&gt;<BR>&gt;&gt; From the p=
i==
> cture you can see there is a white contours that results a bi==<BR>t<BR>&=
g==
> t;&gt; odd, I<BR>&gt;&gt; think th at it comes out from the introduction
> of==
>  the Min and Max.<BR>&gt;&gt; I would like to remove this white contour.
> Co==
> uld you help me?<BR>&gt;&gt; Thanks a lot for your attention<BR>&gt;&gt;
> Ch==
> eers<BR>&gt;&gt;
>
>  Maria<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;<BR><BR><BR></DIV></DIV></div><br>=
==0A==
> ==0A==0A==0A      </body></html>
> --0-882231370-1282758216==:97664--
>
>

--00163691fc66c5736f048efc72a6
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
X-Sun-Content-Length: 24381

<div>Dear Maria, I reviewed your note.  I did not experience the error th=
at you described when executing the notebook.  I will directly send you t=
he original notebook with the additional lines of code appended to the end.=
  This version of your original notebook also has the graphical results I=
 obtained after executing it, in the form of the final image found in the n=
otebook.</div>

<div>Regards,</div>
<div>J. Batista<br><br></div>
<div class="gmail_quote">On Thu, Aug 26, 2010 at 6:49 AM, maria giovanna =
dainotti <span dir="ltr">&lt;<a href="mailto:mariagiovannadainotti@yaho=
o.it">mariagiovannadainotti at yahoo.it</a>&gt;</span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex=
; PADDING-LEFT: 1ex" class="gmail_quote">Dear J. Batista,<br>I used the f=
ollowing equations<br>R1==1.029<br>R2==3.892<br>R3==8<br>e1==
=250<br>e2==11.8<br>
e3==80.5<br>i==p/12<br>spherenear[x_,y_]:==((R3^2-x^2-y^2)^(1/2=
))<br>spherefar[x_,y_]:==-((R3^2-x^2-y^2)^(1/2))<br>jetnear[x_,y_]:==
=Min[Re[spherenear[x,y]],Re[(R1^2-x^2)^(1/2)+y*Tan[i]]]<br>jetfar[x_,y_]:=
==Max[Re[spherefar[x,y]],Re[-(R1^2-x^2)^(1/2)]+y*Tan[i]]<br>
jetbrightness[x_,y_]:==Boole[-R1=EF=82=A3x=EF=82=A3R1]*(jet=
near[x,y] - jetfar[x,y])*e1<br>emptynear[x_,y_]:==Min[Re[spherenear[x,y=
]],Re[(R2^2-x^2)^(1/2)+y*Tan[i]]]<br>emptyfar[x_,y_]:==Max[Re[spherefar=
[x,y]],Re[-(R2^2-x^2)^(1/2)]+y*Tan[i]]<br>
emptybrightness[x_,y_]:==Boole[-R1&lt;x&lt;R1]*(emptynear[x,y] -jetnear=
[x,y] +<br>jetfar[x,y]- emptyfar[x,y])*e2 +(Boole[-R2<br>&lt;x&lt;-R1]+Bool=
e[R2&gt;x&gt;R1])*(emptynear[x,y] -jetnear[x,y] + jetfar[x,y]-<br>emptyfar[=
x,y])*e2<br>
spherebrightness[x_,y_]:==Boole[-R2&lt;x&lt;R2]*(spherenear[x,y] -empty=
near[x,y] +<br>emptyfar[x,y]- spherefar[x,y])*e3 +(Boole[x&lt;-R2]+Boole[R2=
&lt;x])*(spherenear[x,y] -<br>spherefar[x,y])*e3<br>=E3=80=80<br>f[x_=
,y_]:==((jetnear[x,y]-jetfar[x,y])*e1+e3*(spherenear[x,y]-emptynear[x,y=
]+emptyfar[x,y]-spherefar[x,y])+e2*(emptynear[x,y]-jetnear[x,y]+jetfar[x,y]=
-emptyfar[x,y]))*Boole[-R1&lt;x&lt;R1]+((emptynear[x,y]-emptyfar[x,y])*e2+e=
3*(spherenear[x,y]-emptynear[x,y]+emptyfar[x,y]-spherefar[x,y]))*(Boole[-R2=
&lt;x&lt;-R1]+Boole[R2&gt;x&gt;R1])+(spherenear[x,y]-spherefar[x,y])*e3*(Bo=
ole[x&lt;-R2]+Boole[x&gt;R2])<br>
<br>=E3=80=80<br>1.029<br>3.892<br>8<br>250<br>11.8<br>80.5p=C2<br>=
originalPlot==ContourPlot[f[x,y],{x,-8,8},{y,-8,8},Contours=EF=82=
=AE50,ColorFunction=EF=82=AE(Hue[#]&amp;)]/12<br><br>originalColorD=
ata====ImageData[originalPlot];<br>
targetPixels====Position[originalColorData,originalColorData[[180,1=
80]]];newColorData====ReplacePart[originalColorData,targetPixels<br=
><br>-&gt;<br>Image[newColorData]<br>But I got the following error message:=
<br>Part::partd: Part specification<br>
\[NoBreak]originalColorData=EF=81=90180,180\[RightDoubleBracket]\[NoB=
reak] is longer<br>than depth of object. =EF=82=87<br>=C2<br>Image:=
:imgarray: The specified argument \[NoBreak]originalColorData\[NoBreak]<br>=
should be an array of rank 2 or 3 with machine-size numbers. =EF=82=8=
7<br>
I will be very grateful if you could help me.<br>Thanks a lot<br>Best regar=
ds<br>Maria<br>=C2 {1.,1.,1.}];<br><br>________________________________<b=
r>Da: J. Batista &lt;<a href="mailto:jbatista800 at gmail.com">jbatista800@g=
mail.com</a>&gt;<br>
A: <a href="mailto:mathgroup at smc.vnet.net">mathgroup at smc.vnet.net</a><br>=
Inviato: Lun 2 agosto 2010, 13:02:00<br>Oggetto: [mg111445] Re: Problem wit=
h Min Max between two functions<br><br>Maria/All, I just learned from a col=
league that all equations on my message<br>
have double equal signs.=C2  Please note that is probably due to a tran=
sm=<br>ission<br>error.=C2  All equations should only have a single e=
qual sign.=C2  I&#39;m<br>retransmitting my original message.<br>Regard=
s,<br>J. Batista<br>
On Sun, Aug 1, 2010 at 3:10 AM, J. Batista &lt;<a href="mailto:jbatista80=
0 at gmail.com">jbatista800 at gmail.com</a>&gt; wrote:<br><br>&gt; Dean Maria, h=
ere is a possible solution to your question.=C2  The white<br>&gt; cont=
our areas can be removed by approaching the output of ContourPlot as =<br=
>
an<br>&gt; image, treating the task as one of image processing (as suggeste=
d previou=<br>sly<br>&gt; by Daniel Lichtblau).=C2  First, equate the=
 original ContourPlot output=<br> with a<br>&gt; variable name, for exa=
mple originalPlot ==== Out[1]=C2  (where Out[1] i=<br>
s the<br>&gt; ContourPlot output cell).=C2  Alternatively, you can simp=
ly select the<br>&gt; ContourPlot, copy and then paste into the first line =
of the code sequence<br>&gt; below in place of the variable originalPlot.=
=C2  I will now display the=<br>
 four<br>&gt; lines of the code sequence and then explain them afterwards=
.<br>&gt;<br>&gt; originalColorData ==== ImageData[originalPlot];<b=
r>&gt;<br>&gt; targetPixels ==== Position[originalColorData, origin=
alColorData[[180, 180=<br>
]]];<br>&gt;<br>&gt; newColorData ==== ReplacePart[originalColorDat=
a, targetPixels -&gt; {1., 1.,<br>&gt; 1.}];<br>&gt;<br>&gt; Image[newColor=
Data]<br>&gt;<br>&gt;<br>&gt; The first code line accomplishes the task of =
collecting and reading the<br>
&gt; ContourPlot into computer memory as image data, in this case a vector =
of =<br>RGB<br>&gt; color values.=C2  Note that I place a semicolon a=
t the end of this and =<br>other<br>&gt; lines of code in order to suppre=
ss the visual output of the code sequence=<br>
&#39;s<br>&gt; result.=C2  This is because the vector is lengthy and wi=
ll clog the not=<br>ebook<br>&gt; unnecessarily.<br>&gt; The second code =
line establishes the pattern by which the portions of the<br>&gt; plot that=
 you wish to alter are identified as a subset of the entire<br>
&gt; original data set.=C2  The pattern is established by entering the =
pixel<br>&gt; coordinate of a representative target pixel that you wish to =
alter, in th=<br>is<br>&gt; case [[180, 180]] being one of the pixels in =
the white contour areas.=C2=<br>
 You<br>&gt; can determine an appropriate pixel coordinate by right-click=
ing in the<br>&gt; original ContourPlot output, selecting Get Indices, and =
then guiding your<br>&gt; cursor to a desired location within the plot.<br>
&gt; The third code line replaces the pixel locations flagged by the previo=
us<br>&gt; pattern search with new pixel data, in this case new RGB color v=
alues tha=<br>t<br>&gt; you select.=C2  I have used the example of {1=
., 1., 1.} to illustrate c=<br>
hanging<br>&gt; from the semi-white color of the original plot to a true wh=
ite that match=<br>es<br>&gt; the plot background.=C2  Be sure to use=
 decimal points as above when ex=<br>pressing<br>&gt; color values for yo=
ur pixels, as something like {1, 1, 1} will not<br>
&gt; be understood correctly for this purpose.=C2  If you want to chang=
e the<br>&gt; semi-white color of your original plot to black, use {0., 0.,=
 0.}.<br>&gt; The fourth and final line re-establishes the newly altered se=
t of pixel<br>
&gt; data as an image object, and displays the altered image.<br>&gt;<br>&g=
t; Hope this helps.<br>&gt; Best Regards,<br>&gt; J. Batista<br>&gt;<br>&gt=
;=C2  On Mon, Jul 26, 2010 at 6:37 AM, maria giovanna dainotti &lt;<br>
&gt; <a href="mailto:mariagiovannadainotti at yahoo.it">mariagiovannadainott=
i at yahoo.it</a>&gt; wrote:<br>&gt;<br>&gt;&gt; Dear Mathgroup,<br>&gt;&gt; I=
 have the following function<br>&gt;&gt; R1====1.029<br>&gt;&gt; R2=
====3.892<br>
&gt;&gt; R3====8<br>&gt;&gt; e1====250<br>&gt;&gt; e2===
==11.8<br>&gt;&gt; e3====80.5<br>&gt;&gt; i====pi/12<br=
>&gt;&gt; spherenear[x_,y_]:====((R3^2-x^2-y^2)^(1/2))<br>&gt;&gt; =
spherefar[x_,y_]:====-((R3^2-x^2-y^2)^(1/2))<br>
&gt;&gt; emptynear[x_,y_]:====Min[Re[spherenear[x,y]],Re[(R2^2-x^2)=
^(1/2)+y*Tan[i=<br>]]==<br>]<br>&gt;&gt; emptyfar[x_,y_]:=====
Max[Re[spherefar[x,y]],Re[-(R2^2-x^2)^(1/2)]+y*Tan[i=<br>]]<br>&gt;&gt; j=
etnear[x_,y_]:====Min[Re[spherenear[x,y]],Re[(R1^2-x^2)^(1/2)+y*Tan=
[i]]=<br>
]<br>&gt;&gt; jetfar[x_,y_]:====Max[Re[spherefar[x,y]],Re[-(R1^2-x^=
2)^(1/2)]+y*Tan[i]]<br>&gt;&gt;<br>&gt;&gt; f[x_,y_]:====((jetnear[=
x,y]-jetfar[x,y])*e1+e3*(spherenear[x,y]-emptynea=<br>r[==<br>x,y]+em=
ptyfar[x,y]-spherefar[x,y])+e2*(emptynear[x,y]-jetnear[x,y]+jetfar[x=<br>
==<br>,y]-emptyfar[x,y]))*Boole[-R1====EF====82===
==A3x====EF====82====A3R1]+((emp=<br>tynear[x=
,y]-==<br>emptyfar[x,y])*e2+e3*(spherenear[x,y]-emptynear[x,y]+emptyfar=
[x,y]-spherefa=<br>==<br>r[x,y]))*(Boole[-R2&lt;x&lt;-R1]+Boole[R2&gt=
;x&gt;R1])+(spherenear[x,y]-spherefar[x,y])=<br>
==<br>*e3*(Boole[x&lt;-R2]+Boole[x&gt;R2])<br>&gt;&gt;<br>&gt;&gt;<br>&=
gt;&gt; ContourPlot[f[x,y],{x,-8,8},{y,-8,8},Contours====EF===
==82====AE{0,100,20=<br>0,300,==<br>400,500,600,700,800,9=
00}]<br>&gt;&gt;<br>&gt;&gt; From the picture you can see there is a white =
contours that results a bi=<br>
==<br>t<br>&gt;&gt; odd, I<br>&gt;&gt; think th at it comes out from th=
e introduction of the Min and Max.<br>&gt;&gt; I would like to remove this =
white contour. Could you help me?<br>&gt;&gt; Thanks a lot for your attenti=
on<br>
&gt;&gt; Cheers<br>&gt;&gt; Maria<br>&gt;&gt;<br>&gt;&gt;<br>&gt;<br><br><b=
r><br><br>--0-882231370-1282758216=:97664<br>Content-Type: text/html; cha=
rset=&quot;utf-8&quot;<br>Content-Transfer-Encoding: quoted-printable<br>
X-Sun-Content-Length: 10136<br><br>&lt;html&gt;&lt;head&gt;&lt;style type=
=&quot;text/css&quot;&gt;&lt;!-- DIV {margin:0px;} --&gt;&lt;/style&gt;&l=
t;/he=<br>ad&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial, helv=
etica, sans-serif;font-size:1=<br>
4pt&quot;&gt;&lt;DIV&gt;Dear J. Batista,&lt;/DIV&gt;=0A&lt;DIV&gt;I used =
the following equations&lt;/DIV=<br>&gt;=0A&lt;DIV&gt;=0A&lt;P&gt;R1=
=1.029&lt;/P&gt;=0A&lt;P&gt;R2=3.892&lt;/P&gt;=0A&lt;P&gt;R3=8&lt=
;/P&gt;=0A&lt;P&gt;e1=<br>
=250&lt;/P&gt;=0A&lt;P&gt;e2=11.8&lt;/P&gt;=0A&lt;P&gt;e3=80.5&lt=
;/P&gt;=0A&lt;P&gt;i=&lt;FONT face=Math=<br>ematica1Mono&gt;p&lt;/F=
ONT&gt;/12&lt;/P&gt;=0A&lt;P&gt;spherenear[x_,y_]:=((R3^2-x^2-y^2)^(1/2=
=<br>))&lt;/P&gt;=0A&lt;P&gt;spherefar[x_,y_]:=-((R3^2-x^2-y^2)^(1/2)=
)&lt;/P&gt;=0A&lt;P&gt;jetnear[x_=<br>
,y_]:=Min[Re[spherenear[x,y]],Re[(R1^2-x^2)^(1/2)+y*Tan[i]]]&lt;/P&gt;==
0A&lt;P&gt;jet=<br>far[x_,y_]:=Max[Re[spherefar[x,y]],Re[-(R1^2-x^2)^(1=
/2)]+y*Tan[i]]&lt;/P&gt;=0A=<br>&lt;P&gt;jetbrightness[x_,y_]:=Boole[=
-R1&lt;FONT face=Mathematica1Mono&gt;=EF=82=A3=<br>
&lt;/FONT&gt;x&lt;FONT face=Mathematica1Mono&gt;=EF=82=A3&lt;/FONT&=
gt;R1]*(jetnear[x,y] - j=<br>etfar[x,y])*e1&lt;/P&gt;=0A&lt;P&gt;emptyn=
ear[x_,y_]:=Min[Re[spherenear[x,y]],Re[(R2^=<br>2-x^2)^(1/2)+y*Tan[i]]]=
&lt;/P&gt;=0A&lt;P&gt;emptyfar[x_,y_]:=Max[Re[spherefar[x,y]],=<br>
Re[-(R2^2-x^2)^(1/2)]+y*Tan[i]]&lt;/P&gt;=0A&lt;P&gt;emptybrightness[x_,y=
_]:=Boole[-R=<br>1&lt;FONT face=Mathematica1Mono&gt;&amp;lt;&lt;/FONT=
&gt;x&lt;FONT face=Mathematica1Mono&gt;&amp;l=<br>t;&lt;/FONT&gt;R1]*(e=
mptynear[x,y] -jetnear[x,y] + jetfar[x,y]- emptyfar[x,y])*e2=<br>
 +(Boole[-R2 &amp;lt;x&amp;lt;-R1]+Boole[R2&amp;gt;x&amp;gt;R1])*(emptyne=
ar[x,y] -jetnear[x=<br>,y] + jetfar[x,y]- emptyfar[x,y])*e2&lt;/P&gt;=0=
A&lt;P&gt;spherebrightness[x_,y_]:=Bo=<br>ole[-R2&lt;FONT face=Mathem=
atica1Mono&gt;&amp;lt;&lt;/FONT&gt;x&lt;FONT face=Mathematica1M=<br>
ono&gt;&amp;lt;&lt;/FONT&gt;R2]*(spherenear[x,y] -emptynear[x,y] + emptyfar=
[x,y]- sphere=<br>far[x,y])*e3 +(Boole[x&amp;lt;-R2]+Boole[R2&amp;lt;x])*=
(spherenear[x,y] - spherefar=<br>[x,y])*e3&lt;/P&gt;=0A&lt;P&gt;=E3=
=80=80&lt;/P&gt;=0A&lt;P&gt;f[x_,y_]:=((jetnear[x,y]-jetfar[x,y=<=
br>
])*e1+e3*(spherenear[x,y]-emptynear[x,y]+emptyfar[x,y]-spherefar[x,y])+e2*(=
=<br>emptynear[x,y]-jetnear[x,y]+jetfar[x,y]-emptyfar[x,y]))*Boole[-R1&lt=
;FONT face=<br>=Mathematica1Mono&gt;&amp;lt;&lt;/FONT&gt;x&lt;FONT face=
=Mathematica1Mono&gt;&amp;lt;&lt;/FONT&gt;R1=<br>
]+((emptynear[x,y]-emptyfar[x,y])*e2+e3*(spherenear[x,y]-emptynear[x,y]+emp=
=<br>tyfar[x,y]-spherefar[x,y]))*(Boole[-R2&amp;lt;x&amp;lt;-R1]+Boole[R2=
&amp;gt;x&amp;gt;R1])+(=<br>spherenear[x,y]-spherefar[x,y])*e3*(Boole[x&a=
mp;lt;-R2]+Boole[x&amp;gt;R2])&lt;/P&gt;=0A&lt;=<br>
P&gt;=E3=80=80&lt;/P&gt;=0A&lt;P&gt;1.029&lt;/P&gt;=0A&lt;P&gt;3.=
892&lt;/P&gt;=0A&lt;P&gt;8&lt;/P&gt;=0A&lt;P&gt;250&lt;/P&gt;=0A&lt;P=
&gt;=<br>11.8&lt;/P&gt;=0A&lt;P&gt;80.5&lt;/P&gt;&lt;FONT face=Mathem=
atica1Mono&gt;=0A&lt;P&gt;p&lt;/FONT&gt;&lt;FONT fac=<br>
e=&quot;Times New Roman&quot;&gt;/12&lt;/FONT&gt;&lt;/P&gt;&amp;nbsp;&lt;=
BR&gt;&lt;B&gt;&lt;FONT face=Courier&gt;=0A&lt;P=<br>&gt;originalPlot=
=ContourPlot[f[x,y],{x,-8,8},{y,-8,8},Contours&lt;/FONT&gt;&lt;FONT f=<=
br>ace=Mathematica1Mono&gt;=EF=82=AE&lt;/FONT&gt;&lt;FONT face=Co=
urier&gt;50,ColorFunctio=<br>
n&lt;/FONT&gt;&lt;FONT face=Mathematica1Mono&gt;=EF=82=AE&lt;/FONT&=
gt;&lt;FONT face=Courier&gt;=<br>(Hue[#]&amp;amp;)]&lt;/P&gt;&lt;/B&gt;=
&lt;/FONT&gt;&lt;/DIV&gt;=0A&lt;DIV style=&quot;FONT-FAMILY: arial, hel=
=<br>vetica, sans-serif; FONT-SIZE: 14pt&quot;&gt;&lt;B&gt;&lt;FONT face=
=Courier&gt;=0A&lt;P align==<br>
left&gt;originalColorData==ImageData[originalPlot];&lt;/P&gt;=0A&lt;P=
 align=left&gt;=<br>targetPixels==Position[originalColorData,origin=
alColorData[[180,180]]];=<br>newColorData==ReplacePart[originalColorD=
ata,targetPixels&lt;/P&gt;=0A&lt;P align=<br>
=left&gt;-&amp;gt;&lt;/FONT&gt;&lt;FONT face=Courier&gt;{1.,1.,1.}];&lt=
;/P&gt;=0A&lt;P&gt;Image[newCol=<br>orData]&lt;/P&gt;=0A&lt;P&gt;But =
I got the following error message: &lt;/P&gt;=0A&lt;P&gt;Part::par=<br>=
td: Part specification \[NoBreak]originalColorData&lt;FONT face=Mathemati=
ca2=<br>
&gt;=EF=81=90&lt;/FONT&gt;180,180\[RightDoubleBracket]\[NoBreak] is l=
onger than dept=<br>h of object. &lt;A href=&quot;<a href="http://ref=
erence.wolfram.com/mathematica/ref/Part.h=" target="_blank">http://refe=
rence.wolfram.com/mathematica/ref/Part.h=</a><br>
tml&quot;&gt;&lt;FONT face=Mathematica1&gt;=EF=82=87&lt;/FONT&gt;&l=
t;/A&gt;&lt;/P&gt;=0A&lt;P&gt;&amp;nbsp;&lt;/P&gt;=0A&lt;=<br>P&gt;Im=
age::imgarray: The specified argument \[NoBreak]originalColorData\[NoBr=<=
br>eak] should be an array of rank 2 or 3 with machine-size numbers. &lt;A =
href=<br>
=&quot;<a href="http://reference.wolfram.com/mathematica/ref/Image.html=
" target="_blank">http://reference.wolfram.com/mathematica/ref/Image.html=
</a>&quot;&gt;&lt;FONT face=M=<br>athematica1&gt;=EF=82=87&lt;/FO=
NT&gt;&lt;/A&gt;&lt;/P&gt;=0A&lt;P&gt;I will be very grateful if you co=
=<br>
uld help me.&lt;/P&gt;=0A&lt;P&gt;Thanks a lot&lt;/P&gt;=0A&lt;P&gt;Bes=
t regards&lt;/P&gt;=0A&lt;P&gt;Maria&lt;/P&gt;=<br>=0A&lt;P&gt;&amp;n=
bsp;&lt;/P&gt;&lt;/B&gt;&lt;/FONT&gt;=0A&lt;DIV style=&quot;FONT-FAMILY=
: arial, helvetica, =<br>
sans-serif; FONT-SIZE: 13px&quot;&gt;&lt;FONT size=2 face=Tahoma&gt;==
0A&lt;HR SIZE=1&gt;=<br>=0A&lt;B&gt;&lt;SPAN style=&quot;FONT-WEIGH=
T: bold&quot;&gt;Da:&lt;/SPAN&gt;&lt;/B&gt; J. Batista &amp;lt;jbati=<br>=
<a href="mailto:sta800 at gmail.com">sta800 at gmail.com</a>&amp;gt;&lt;BR&gt;&=
lt;B&gt;&lt;SPAN style=&quot;FONT-WEIGHT: bold&quot;&gt;A:&lt;/SPAN&gt;&l=
t;/B&gt; =<br>
<a href="mailto:mathgroup at smc.vnet.net">mathgroup at smc.vnet.net</a>&lt;BR&=
gt;&lt;B&gt;&lt;SPAN style=&quot;FONT-WEIGHT: bold&quot;&gt;Inviato:&lt;/=
SP=<br>AN&gt;&lt;/B&gt; Lun 2 agosto 2010, 13:02:00&lt;BR&gt;&lt;B&gt;&lt=
;SPAN style=&quot;FONT-WEIGHT: bold&quot;=<br>
&gt;Oggetto:&lt;/SPAN&gt;&lt;/B&gt; [mg111445] Re: Problem with Min Max bet=
ween two functi=<br>ons&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;Maria/All, I just=
 learned from a colleague that all equat=<br>ions on my message&lt;BR&gt;=
have double equal signs.&amp;nbsp; Please note that is pr=<br>
obably due to a transmission&lt;BR&gt;error.&amp;nbsp; All equations should=
 only have=<br> a single equal sign.&amp;nbsp; I&#39;m&lt;BR&gt;retrans=
mitting my original message.&lt;BR&gt;R=<br>egards,&lt;BR&gt;J. Batista&l=
t;BR&gt;On Sun, Aug 1, 2010 at 3:10 AM, J. Batista &amp;lt;&lt;A =<br>
href=&quot;mailto:<a href="mailto:jbatista800 at gmail.com">jbatista800@gm=
ail.com</a>&quot; ymailto=&quot;mailto:<a href="mailto:jbatista800@gmai=
l.c">jbatista800 at gmail.c</a>=<br>om&quot;&gt;<a href="mailto:jbatista80=
0 at gmail.com">jbatista800 at gmail.com</a>&lt;/A&gt;&amp;gt; wrote:&lt;BR&gt;&l=
t;BR&gt;&amp;gt; Dean Maria, here is a =<br>
possible solution to your question.&amp;nbsp; The white&lt;BR&gt;&amp;gt; c=
ontour areas c=<br>an be<br> removed by approaching the output of Conto=
urPlot as an&lt;BR&gt;&amp;gt; image, trea=<br>ting the task as one of im=
age processing (as suggested previously&lt;BR&gt;&amp;gt; b=<br>
y Daniel Lichtblau).&amp;nbsp; First, equate the original ContourPlot outpu=
t wi=<br>th a&lt;BR&gt;&amp;gt; variable name, for example originalPlot =
== Out[1]&amp;nbsp; (w=<br>here Out[1] is the&lt;BR&gt;&amp;gt; Conto=
urPlot output cell).&amp;nbsp; Alternatively, y=<br>
ou can simply select the&lt;BR&gt;&amp;gt; ContourPlot, copy and then paste=
 into the =<br>first line of the code sequence&lt;BR&gt;&amp;gt; below in=
 place of the variable orig=<br>inalPlot.&amp;nbsp; I will now display th=
e four&lt;BR&gt;&amp;gt; lines of the code seque=<br>
nce and then explain them afterwards.&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt; o=
riginalColorData ==<br>= ImageData[originalPlot];&lt;BR&gt;&amp;gt;&l=
t;BR&gt;&amp;gt; targetPixels == Position[o=<br>riginalColorData, ori=
ginalColorData[[180, 180]]];&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt; newColorD=
=<br>
ata == ReplacePart[originalColorData, targetPixels -&amp;gt; {1., 1.,&l=
t;BR&gt;&amp;g=<br>t; 1.}];&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt; Image[new=
ColorData]&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt; The fi=<=
br>rst code<br>
 line accomplishes the task of collecting and reading the&lt;BR&gt;&amp;g=
t; ContourPl=<br>ot into computer memory as image data, in this case a ve=
ctor of RGB&lt;BR&gt;&amp;gt;=<br> color values.&amp;nbsp; Note that I =
place a semicolon at the end of this and o=<br>
ther&lt;BR&gt;&amp;gt; lines of code in order to suppress the visual output=
 of the co=<br>de sequence&#39;s&lt;BR&gt;&amp;gt; result.&amp;nbsp; This=
 is because the vector is lengthy a=<br>nd will clog the notebook&lt;BR&g=
t;&amp;gt; unnecessarily.&lt;BR&gt;&amp;gt; The second code li=<br>
ne establishes the pattern by which the portions of the&lt;BR&gt;&amp;gt; p=
lot that y=<br>ou wish to alter are identified as a subset of the entire&=
lt;BR&gt;&amp;gt; original =<br>data set.&amp;nbsp; The pattern is establ=
ished by entering the pixel&lt;BR&gt;&amp;gt; co=<br>
ordinate of a representative target pixel that you wish to alter, in this&l=
t;B=<br>R&gt;&amp;gt; case [[180, 180]] being one of the pixels in the wh=
ite contour areas=<br>.&amp;nbsp; You&lt;BR&gt;&amp;gt; can determine an =
appropriate pixel coordinate by right-=<br>
clicking in the&lt;BR&gt;&amp;gt; original ContourPlot output, selecting Ge=
t<br> Indices, and then guiding your&lt;BR&gt;&amp;gt; cursor to a desire=
d location within=<br> the plot.&lt;BR&gt;&amp;gt; The third code line =
replaces the pixel locations flagged=<br>
 by the previous&lt;BR&gt;&amp;gt; pattern search with new pixel data, in=
 this case n=<br>ew RGB color values that&lt;BR&gt;&amp;gt; you select.&a=
mp;nbsp; I have used the example =<br>of {1., 1., 1.} to illustrate chang=
ing&lt;BR&gt;&amp;gt; from the semi-white color of=<br>
 the original plot to a true white that matches&lt;BR&gt;&amp;gt; the plo=
t background=<br>.&amp;nbsp; Be sure to use decimal points as above when =
expressing&lt;BR&gt;&amp;gt; colo=<br>r values for your pixels, as someth=
ing like {1, 1, 1} will not&lt;BR&gt;&amp;gt; be u=<br>
nderstood correctly for this purpose.&amp;nbsp; If you want to change the&l=
t;BR&gt;&amp;g=<br>t; semi-white color of your original plot to black, us=
e {0., 0., 0.}.&lt;BR&gt;&amp;g=<br>t; The fourth and final line re-estab=
lishes the newly altered set of pixel&lt;=<br>
BR&gt;&amp;gt; data as an image object, and displays the altered image.&lt;=
BR&gt;&amp;gt;&lt;BR=<br>&gt;&amp;gt; Hope this helps.&lt;BR&gt;&amp;gt; =
Best Regards,&lt;BR&gt;&amp;gt; J.<br> Batista&lt;BR&gt;&amp;gt;&lt;BR&gt=
;&amp;gt;&amp;nbsp; On Mon, Jul 26, 2010 at 6:37 AM, maria giova=<br>
nna dainotti &amp;lt;&lt;BR&gt;&amp;gt; &lt;A href=&quot;mailto:<a href=
="mailto:mariagiovannadainotti at yahoo.it">mariagiovannadainotti at yahoo.it</=
a>&quot;=<br> ymailto=&quot;mailto:<a href="mailto:mariagiovannadai=
notti at yahoo.it">mariagiovannadainotti at yahoo.it</a>&quot;&gt;mariagiovannada=
inotti@ya=<br>
<a href="http://hoo.it/"; target="_blank">hoo.it</a>&lt;/A&gt;&amp;gt; w=
rote:&lt;BR&gt;&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt; Dear Mathgroup,&lt;BR&gt;=
&amp;gt;&amp;gt; I hav=<br>e the following function&lt;BR&gt;&amp;gt;&amp=
;gt; R1==1.029&lt;BR&gt;&amp;gt;&amp;gt; R2==3.89=<br>
2&lt;BR&gt;&amp;gt;&amp;gt; R3==8&lt;BR&gt;&amp;gt;&amp;gt; e1==250=
&lt;BR&gt;&amp;gt;&amp;gt; e2==11.8&lt;BR=<br>&gt;&amp;gt;&amp;gt; e3=
==80.5&lt;BR&gt;&amp;gt;&amp;gt; i==pi/12&lt;BR&gt;&amp;gt;&amp;gt;=
 spherenear[x_,y=<br>
_]:==((R3^2-x^2-y^2)^(1/2))&lt;BR&gt;&amp;gt;&amp;gt; spherefar[x_,y_]:=
==-((R3^2-=<br>x^2-y^2)^(1/2))&lt;BR&gt;&amp;gt;&amp;gt; emptynear[x_=
,y_]:==Min[Re[spherenear[x,y]],=<br>Re[(R2^2-x^2)^(1/2)+y*Tan[i]]=&=
lt;BR&gt;]&lt;BR&gt;&amp;gt;&amp;gt; emptyfar[x_,y_]:==Max=<br>
[Re[spherefar[x,y]],Re[-(R2^2-x^2)^(1/2)]+y*Tan[i]]&lt;BR&gt;&amp;gt;&amp;g=
t; jetnear[x_,=<br>y_]:==Min[Re[spherenear[x,y]],Re[(R1^2-x^2)^(1/2)+=
y*Tan[i]]]&lt;BR&gt;&amp;gt;&amp;gt=<br>; jetfar[x_,y_]:==Max[Re[sphe=
refar[x,y]],Re[-(R1^2-x^2)^(1/2)]+y*Tan[i]=<br>
]&lt;BR&gt;&amp;gt;&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt;<br> f[x_,y_]:===
((jetnear[x,y]-jetfar[x,y])*e1+e3*(spherenear[x,y]-emptynea=<br>r[=&lt;=
BR&gt;x,y]+emptyfar[x,y]-spherefar[x,y])+e2*(emptynear[x,y]-jetnear[x,y]==
<br>+jetfar[x=&lt;BR&gt;,y]-emptyfar[x,y]))*Boole[-R1==EF==82==
=A3x==<br>
=EF==82==A3R1]+((emptynear[x,y]-=&lt;BR&gt;emptyfar[x,y])*e2+e3=
*(sphe=<br>renear[x,y]-emptynear[x,y]+emptyfar[x,y]-spherefa=&lt;BR&gt;=
r[x,y]))*(Boole[-R2=<br>&amp;lt;x&amp;lt;-R1]+Boole[R2&amp;gt;x&amp;gt;R1=
])+(spherenear[x,y]-spherefar[x,y])=&lt;BR&gt;=<br>
*e3*(Boole[x&amp;lt;-R2]+Boole[x&amp;gt;R2])&lt;BR&gt;&amp;gt;&amp;gt;&lt;B=
R&gt;&amp;gt;&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt; Co=<br>ntourPlot[f[x,y],{=
x,-8,8},{y,-8,8},Contours==EF==82==AE{0,100,2=<br>00,300,=&=
lt;BR&gt;400,500,600,700,800,900}]&lt;BR&gt;&amp;gt;&amp;gt;&lt;BR&gt;&amp;=
gt;&amp;gt; From the pi=<br>
cture you can see there is a white contours that results a bi=&lt;BR&gt;t=
&lt;BR&gt;&amp;g=<br>t;&amp;gt; odd, I&lt;BR&gt;&amp;gt;&amp;gt; think th=
 at it comes out from the introduction of=<br> the Min and Max.&lt;BR&g=
t;&amp;gt;&amp;gt; I would like to remove this white contour. Co=<br>
uld you help me?&lt;BR&gt;&amp;gt;&amp;gt; Thanks a lot for your attention&=
lt;BR&gt;&amp;gt;&amp;gt; Ch=<br>eers&lt;BR&gt;&amp;gt;&amp;gt;<br> Mar=
ia&lt;BR&gt;&amp;gt;&amp;gt;&lt;BR&gt;&amp;gt;&amp;gt;&lt;BR&gt;&amp;gt;&lt=
;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/div&gt;&lt;br&gt;=
=0A=<br>
=0A=0A=0A      &lt;/body&gt;&lt;/html&gt;<br>--0-882231370-1282=
758216=:97664--<br><br></blockquote></div><br>

--00163691fc66c5736f048efc72a6--


  • Prev by Date: Re: i get an empty figure when exporting it, if I keep Epilogue->{.....}
  • Next by Date: Re: How avoid .nb in palette title bar?
  • Previous by thread: Re: Problem with Min Max between two functions
  • Next by thread: Re: trading