A70 ==== Subject: How can get the Path of current Notebook ? How can get the Path of current Notebook ? -- http://www.quzhi.net ==== Subject: Re: Light and surface colors ShadowPlot3D is also borked in that respect in versions 5.1. WRI says that some default settings have been (perhaps mistakenly) changed in that function, and so they may well have been changed in many of the other 3D ones, too. The email I got says that this will be resolved. C.O. >Hi to everyone. I've just obtained a Student License of Mathematica, and I'm working in >graphics... I've created, after a half-day of work, an image representing an ellipsoid, >with a colored surface When I try to represent it, I must put Ligthing->False to see surface >colors. I'd like to know if there's a way to obtain a rendered image, in which I >can have both light and surface color, to give a shadow to the figure and >create a more 3D effect. >Below there's the code... >Daniele >-------------------------- << Graphics`ContourPlot3D`; a = 7; b = 5; c = 4; r = 1; ellipsoid = ContourPlot3D[ > (x/a)^2 + (y/b)^2 + (z/c)^2 - r, { > x, -10, 10}, {y, -10, 10}, {z, -10, 10}, > PlotPoints -> 12, > AspectRatio -> Automatic > ]; (*It finds the median point of vertices of a list of a 3D coordinates*) >midpoint[l_] := Apply[Plus, Transpose[l], 2]/Length[l]; >(*Function to map in the ellipsoid surface*) >pressure[x_, y_, z_] := x^2 + y^2 + Sin[4z]; (*Color Function*) >color[x_] := Hue[pressure @@ midpoint[x]/50]; (*Rule to change original graphic object*) >colorpolygon = Polygon[coord_] :{color[coord],EdgeForm[{}],Polygon[coord]}; (*creation of new, colored ellipsoid*) >coloredellipse = ellipsoid /. colorpolygon; (*Visualization of the shape*) >(*I'd like to have also the light...*) >Show[coloredellipse, Lighting -> False]; > > -- PGP Key ID: 0x235FDED1 Please avoid sending me Word or PowerPoint attachments. http://www.gnu.org/philosophy/no-word-attachments.html ==== Subject: Re: Light and surface colors you have need a half-day for With[{a = 1, b = 2, c = 1/2}, ParametricPlot3D[ {a*Cos[phi]*Sin[th], b*Sin[phi]*Sin[th], c*Cos[th], Hue[phi/(2Pi)]}, {th, 0, Pi}, {phi, 0, 2Pi}, Lighting -> False] ] but wish With[{a = 1, b = 2, c = 1/2}, ParametricPlot3D[ {a*Cos[phi]*Sin[th], b*Sin[phi]*Sin[th], c*Cos[th], SurfaceColor[Hue[phi/(2Pi)]]}, {th, 0, Pi}, {phi, 0, 2Pi}] ] You can't have shadows in Mathematica. Even when you would be able to produce shadows, your scene has no floor or wall to show you the shadow You can try MathGL3d form http://phong.informatik.uni-leipzig.de/~kuska/mathgl3dv3/ and save the graphics to POVRay or Renderman and use these render engines to obtain light sources with shadows but you should add a floor or a box with solid walls in the back of the object. Jens Daniele Lupo schrieb im Newsbeitrag | Hi to everyone. | | I've just obtained a Student License of Mathematica, and I'm working in | graphics... | | I've created, after a half-day of work, an image representing an ellipsoid, | with a colored surface | | When I try to represent it, I must put Ligthing->False to see surface | colors. | | I'd like to know if there's a way to obtain a rendered image, in which I | can have both light and surface color, to give a shadow to the figure and | create a more 3D effect. | | | Below there's the code... | | | Daniele | | | -------------------------- | | << Graphics`ContourPlot3D`; | | a = 7; b = 5; c = 4; r = 1; | | ellipsoid = ContourPlot3D[ | (x/a)^2 + (y/b)^2 + (z/c)^2 - r, { | x, -10, 10}, {y, -10, 10}, {z, -10, 10}, | PlotPoints -> 12, | AspectRatio -> Automatic | ]; | | (*It finds the median point of vertices of a list of a 3D coordinates*) | midpoint[l_] := Apply[Plus, Transpose[l], 2]/Length[l]; | | | (*Function to map in the ellipsoid surface*) | pressure[x_, y_, z_] := x^2 + y^2 + Sin[4z]; | | (*Color Function*) | color[x_] := Hue[pressure @@ midpoint[x]/50]; | | (*Rule to change original graphic object*) | colorpolygon = Polygon[coord_] :> | {color[coord],EdgeForm[{}],Polygon[coord]}; | | (*creation of new, colored ellipsoid*) | coloredellipse = ellipsoid /. colorpolygon; | | (*Visualization of the shape*) | (*I'd like to have also the light...*) | Show[coloredellipse, Lighting -> False]; | ==== Subject: Re: positive square root Hi Paul >> (2) My current solution is to use, e.g., Abs[Sqrt[z]]. But when >> Mathematica echoes this, it puts the Abs function *under* the radical, >> so it looks like Sqrt[Abs[z]]. Is this a bug in the display? This is NOT a bug in the display, it is an evaluation. If you write 2+2, Mathematica will evaluate that to 4, in the same way, if you write Abs[Sqrt[z]], Mathematica will evaluate it to Sqrt[Abs[z]] (they are in fact the same for complex numbers). Mathematica evaluates your input, and sometimes those evaluations are, well, somehow silly for a human. For example, if you write b+a, Mathematica will evaluate that to a+b (just writing the a before the b). >> (1) Is there a way to tell Mathematica that I'm only interested in >> positive square roots? Actually, Mathematica assumes in some of the commands that you only want the positive root, for example, if you Plot[Sqrt[x],{x,0,4}] Mathematica plots only the positive root. So, in which command do you have the problem? Please be more specific Finally there is a library that must be used very very very carefully. That library is RealOnly (you can check it in the AddOns part of the help) Needs[Miscellaneous`RealOnly`] That library could be interesting for you, but it can create problems with the internal work of other commands that seem not related, like plots or integrals. Bye! Jose Luis http://homepage.cem.itesm.mx/lgomez/ -----Mensaje original----- De: paulvonhippel at yahoo [mailto:paulvonhippel@yahoo.com] Enviado el: Jueves, 14 de Julio de 2005 01:49 a.m. Para: mathgroup@smc.vnet.net Asunto: positive square root I work in a world where the square root is always a positive number. But Mathematica allows for the possibility of negative square roots. Two questions arise: (1) Is there a way to tell Mathematica that I'm only interested in positive square roots? (2) My current solution is to use, e.g., Abs[Sqrt[z]]. But when Mathematica echoes this, it puts the Abs function *under* the radical, so it looks like Sqrt[Abs[z]]. Is this a bug in the display? ==== Subject: Polynomial eigenvalue problem Does anyone know a Mathematica solution for the polynomial eigenvalue problem (PEP)? The PEP problem of order p . N is: Find the eigenvalues lambda, and eigenvectors v (each an N-vector) that solve (A_0 + lambda A_1 + lambda^2 A_2 + ... + lambda^p A_p) x = 0, where: p is a given integer, each coefficients A_i is a given N x N (real or complex) square matrix. There are p . N solution pairs (lambda, x) if the problem is not ill-posed. If both A_0 and A_p are singular the problem is potentially ill-posed. alan ==== Subject: Re: positive square root > I work in a world where the square root is always a positive number. > But Mathematica allows for the possibility of negative square roots. > Two questions arise: (1) Is there a way to tell Mathematica that I'm only interested in > positive square roots? (2) My current solution is to use, e.g., Abs[Sqrt[z]]. But when > Mathematica echoes this, it puts the Abs function *under* the radical, > so it looks like Sqrt[Abs[z]]. Is this a bug in the display? > Hi Paul, I don't think so. It is just in general easier, to evaluate Sqrt[Abs[z]] than Abs[Sqrt[z]]: In[1]:= Assuming[(x | y) [Element] Reals, FullSimplify[ {Abs[ComplexExpand[Sqrt[x + I*y]]],(*sqrt first*) ComplexExpand[Sqrt[Abs[x + I*y]]]}]](*abs first*) Out[1]= {(x^2 + y^2)^(1/4)* Abs[Cos[(1/2)*ArcTan[x, y]] + I*Sin[(1/2)*ArcTan[x, y]]], x^2 + y^2)^(1/4)} These are of course equivalent: In[2]:= SameQ @@ Simplify[ComplexExpand[%]] Out[2]= True -- http://people.freenet.de/Peter_Berlin/ ==== Subject: Re: positive square root *you* live in a world where the square root is always a positive number ? and you can't escape ? And what is Sqrt[-1] in your world ? For real positive arguments Mathematica will compute real positve square roots, just say Simplify[] and FullSimplify[] that your arguments are real and positive ? Jens paulvonhippel at yahoo schrieb im Newsbeitrag |I work in a world where the square root is always a positive number. | But Mathematica allows for the possibility of negative square roots. | Two questions arise: | | (1) Is there a way to tell Mathematica that I'm only interested in | positive square roots? | | (2) My current solution is to use, e.g., Abs[Sqrt[z]]. But when | Mathematica echoes this, it puts the Abs function *under* the radical, | so it looks like Sqrt[Abs[z]]. Is this a bug in the display? | ==== Subject: Re: positive square root Hi Paul, Mathematica is correct. You can convince yourselve by considering that any number r may be written in exponential form: r= a Exp[-I b] where a (a>=0) is the absolute value of the number and b (real) its argument. Taking the square root gives (neglecting multiplicity) Sqrt[a] Exp[-I b/2] Taking the absolute value, the exponential disappears. Sqrt[a] is positive by definition and we are left with: Sqrt[a] Therefore: Abs[Sqrt[r]] == Sqrt[a] == Sqrt[Abs[r]] sincerely, Daniel > I work in a world where the square root is always a positive number. > But Mathematica allows for the possibility of negative square roots. > Two questions arise: (1) Is there a way to tell Mathematica that I'm only interested in > positive square roots? (2) My current solution is to use, e.g., Abs[Sqrt[z]]. But when > Mathematica echoes this, it puts the Abs function *under* the radical, > so it looks like Sqrt[Abs[z]]. Is this a bug in the display? > ==== Subject: simple integrals I have both Mathematica_4 and Mathematica_5. I have been trying to evaluate some simple, definite integrals. Mathematica_4 has absolutely no problem in executing this task. However, it seems that Mathematica_5 extends the region of analyticity to include complex variables. In so doing, it responds with a number of constraints that were imposed to execute. How do I get Mathematic_5 to default, so-to-speak, to Mathematica_4. Incidentally, if I try to do the same integrals in their indefinite form, Mathematic_5 can execute to completion. If anyone is interested, I would be happy to send the attachments that explain very clearly what I am faced with. Stan ==== Subject: Re: Light and surface colors Daniele, with the following commands you will see a red sphere with shadows from the lighting: < Identity]; Show[Graphics3D[SurfaceColor[RGBColor[1,0,0]]],mySphere, DisplayFunction-> $DisplayFunction] This is an improvement: <{7,5},DisplayFunction-> Identity]; Show[Graphics3D[EdgeForm[]], Graphics3D[SurfaceColor[RGBColor[1,0,0]]],mySphere, DisplayFunction->$DisplayFunction] Bye! Jose Luis http://homepage.cem.itesm.mx/lgomez/ -----Mensaje original----- De: Daniele Lupo [mailto:danwolf_no_spam_please_@libero.it] Enviado el: Jueves, 14 de Julio de 2005 01:49 a.m. Para: mathgroup@smc.vnet.net Asunto: Light and surface colors Hi to everyone. I've just obtained a Student License of Mathematica, and I'm working in graphics... I've created, after a half-day of work, an image representing an ellipsoid, with a colored surface When I try to represent it, I must put Ligthing->False to see surface colors. I'd like to know if there's a way to obtain a rendered image, in which I can have both light and surface color, to give a shadow to the figure and create a more 3D effect. Below there's the code... Daniele -------------------------- << Graphics`ContourPlot3D`; a = 7; b = 5; c = 4; r = 1; ellipsoid = ContourPlot3D[ (x/a)^2 + (y/b)^2 + (z/c)^2 - r, { x, -10, 10}, {y, -10, 10}, {z, -10, 10}, PlotPoints -> 12, AspectRatio -> Automatic ]; (*It finds the median point of vertices of a list of a 3D coordinates*) midpoint[l_] := Apply[Plus, Transpose[l], 2]/Length[l]; (*Function to map in the ellipsoid surface*) pressure[x_, y_, z_] := x^2 + y^2 + Sin[4z]; (*Color Function*) color[x_] := Hue[pressure @@ midpoint[x]/50]; (*Rule to change original graphic object*) colorpolygon = Polygon[coord_] :> {color[coord],EdgeForm[{}],Polygon[coord]}; (*creation of new, colored ellipsoid*) coloredellipse = ellipsoid /. colorpolygon; (*Visualization of the shape*) (*I'd like to have also the light...*) Show[coloredellipse, Lighting -> False]; ==== Subject: Comparison of Mathematica on Various Computers ''Comparison of Mathematica on Various Computers'' is now on (or ) Mathematica 5.x benchmark on http://www2.staff.fh-vorarlberg.ac.at/~ku/karl/timings50.html New results for Mathematica 5.x: Intel Pentium Mobile, 1.70GHz, 512Mb, Windows XP SP2 IBM Thinkpad T41, Pentium M 1.6 G, 1GB, Linux PowerBook G4 12, 867 MHz, Mac OS X 10.3.7 Dell Latitude D600 Pentium M 1.7 GHz, 1GB, Windows XP SP2 Dell DIMENSION 8400 Pentium 4 3.60 GHz, 3GB, Windos XPSP2 Dual Opteron 248 (2.2GHz), 2GB, Linux x86_64 Opteron 252, 2GB, Fedora Core 3, x86-64 Athlon 64 3500+, at 2310 MHz, 1GB, SuSE Linux 9.2 x86_64 Athlon 64 3200+ 2GHZ, 1GB DDR 500, Windows XP SP2 Power Mac G5 Dual 2.7 GHz, 4 GB, Mac OS X ACER TravelMate 800, Centrino 1.6 GHz, MS Windows XP Professional Powerbook G4, 1.5 GHz, 1GB, Mac OS X 10.4.1 Power Mac G5 Dual 2.7 GHz, 4 GB, Mac OS X (10.4.1) Thinkpad 43p Pentium M 760, 2.0Ghz, 1Gb The test notebook for Mathematica 5.x is available at http://www2.staff.fh-vorarlberg.ac.at/~ku/karl/math/MMA5.0-Test.nb Karl Unterkofler ==== Subject: Re: Light and surface colors Daniele, I tried to send you a Mathematica notebook with the code for this but your server rejected it because of a full mailbox. To make a shaded plot with regular Mathematica graphics we could use ParametricPlot3D with the 4th argument in the parametrization. The 4th argument gives graphics directives for plotting the surface. We don't have to turn the Lighting off if we give SurfaceColor instead of a raw color. We redefine the pressure for the parameters of the ellipsoid. ellipsoid[a_, b_, c_][u_, v_] := {a Cos[v]Cos[u], b Cos[v]Sin[u], c Sin[v]} pressure[x_, y_, z_] := x^2 + y^2 + Sin[4z]; pressure[u_, v_] = pressure[x, y, z] /. Thread[{x, y, z} -> ellipsoid[7, 5, 4][u, v]] 49*Cos[u]^2*Cos[v]^2 + 25*Cos[v]^2*Sin[u]^2 + Sin[16*Sin[v]] Then define the parametrization for the ellipsoid with the function on it. ellipsoidfunction[a_, b_, c_][u_, v_] := {a Cos[v]Cos[u], b Cos[v]Sin[u], c Sin[v], {EdgeForm[], SurfaceColor[Hue[pressure[u, v]/50]]}} Then we can plot. ParametricPlot3D[ellipsoidfunction[7, 5, 4][u, v], {u, 0, 2*Pi}, {v, -Pi/2, Pi/2}, PlotPoints -> 100, ImageSize -> 450]; There are three problems with this plot. 1) The regular Mathematica lighting tends to interfer with the colors on the surface. 2) The Hue color function is not easy to interpret. What is high pressure and what is low pressure? 3) It doesn't give a very accurate indication of what the shape of the contours are. They are not quite as regular as one might expect. My second solution uses DrawGraphics (from my web site below). It trims a grid of polygons in the uv-plane to the contour regions and then maps the resulting grids to the ellipsoidal surface. It uses the TwoColorScale function to give a color scale that gives shades of blue for values below 25 and shades of red for colors above 25. It is much easier to interpret two-color plots - they are similar to cartographic maps. The NeutralLighting option is used to turn down the color saturation of the regular lighting so it doesn't interfer with the surface colors. Needs[DrawGraphics`DrawingMaster`] colorfun = TwoColorScale[{-0.29, 25, 49.7}, {ColorMix[RoyalBlue, Black][0.5], RoyalBlue, ColorMix[RoyalBlue, White][0.8], ColorMix[Red, White][0.8], Red, ColorMix[Red, Black][0.5]}]; polygrid = N[MakePolyGrid[{40, 20}, {{0, -Pi/2}, {2*Pi, Pi/2}}]]; contours = Range[-0.29, 49.7, (49.7 + 0.29)/10]; Do[polys[i] = TrimPolygons[pressure[#1, #2] & , {contours[[i]], contours[[i + 1]]}][polygrid], {i, 1, Length[contours] - 1}] Draw3DItems[ {Table[{SurfaceColor[colorfun[(contours[[i]] + contours[[i + 1]])/2]], EdgeForm[], polys[i] /. {(u_)?NumberQ, (v_)?NumberQ} -> ellipsoid[7, 5, 4][u, v]}, {i, 1, Length[contours] - 1}]}, BoxRatios -> Automatic, NeutralLighting[0.1, 0.5, 0], Boxed -> False, Axes -> False, PlotRegion -> {{-0.1, 1.1}, {-0.3, 1.2}}, ViewPoint -> {1.534, -2.831, 1.04}, Background -> Linen, ImageSize -> 450]; The contours actually are somewhat irregular and wavy as one can check by making a ContourPlot of the pressure in the uv-plane using a high number of plot points. David Park djmp@earthlink.net http://home.earthlink.net/~djmp/ Hi to everyone. I've just obtained a Student License of Mathematica, and I'm working in graphics... I've created, after a half-day of work, an image representing an ellipsoid, with a colored surface When I try to represent it, I must put Ligthing->False to see surface colors. I'd like to know if there's a way to obtain a rendered image, in which I can have both light and surface color, to give a shadow to the figure and create a more 3D effect. Below there's the code... Daniele -------------------------- << Graphics`ContourPlot3D`; a = 7; b = 5; c = 4; r = 1; ellipsoid = ContourPlot3D[ (x/a)^2 + (y/b)^2 + (z/c)^2 - r, { x, -10, 10}, {y, -10, 10}, {z, -10, 10}, PlotPoints -> 12, AspectRatio -> Automatic ]; (*It finds the median point of vertices of a list of a 3D coordinates*) midpoint[l_] := Apply[Plus, Transpose[l], 2]/Length[l]; (*Function to map in the ellipsoid surface*) pressure[x_, y_, z_] := x^2 + y^2 + Sin[4z]; (*Color Function*) color[x_] := Hue[pressure @@ midpoint[x]/50]; (*Rule to change original graphic object*) colorpolygon = Polygon[coord_] :> {color[coord],EdgeForm[{}],Polygon[coord]}; (*creation of new, colored ellipsoid*) coloredellipse = ellipsoid /. colorpolygon; (*Visualization of the shape*) (*I'd like to have also the light...*) Show[coloredellipse, Lighting -> False]; ==== Subject: How to display dates in plots I'm evaluating Mathematica v5.1 to automate some data analysis for me. I have one question that I have yet to find an answer (or even a clue). I was hoping someone here may have a good idea. I collect data sets that I want to plot in various ways versus time. Each record in the data sets includes a date/time string and various (numeric) sensor readings. I've got an ugly but effective loop to convert the date strings in my data files to serial time. I've been this serial time to plot my data. Now the question is: is there a way to format the plot axes to display a human readable date rather than the serial date? One note: Not all the data records are taken at regular intervals. When an event is happening on one of the sensors, we often increase the sampling frequency to get better resolution. ==== Subject: How do I add a secondary y-axis to MultipleListPlot I have been trying to figure out if there is a way to plot two (or more) sets of data on one plot, but with different y-axes? I have data that have different zero offsets and features on that are on different scales, but I would like to plot them on top of each other. This is fairly simple on an XY scatter plot in Excel, but of course Excel is extremely tedious to use for very large datasets. ==== Subject: Graphical modeling of extinct lifeforms with Mathematica I have added another animation to my visualization site. This one is an animated model of Anomalocaris canadensis, an extinct creature from the Cambrian period about 550 million years ago. The model was created entirely from graphics primitives and top level functions, not imported data. http://members.wri.com/jeffb/visualization/animations.shtml There's also a new 2D visualization showing astonomical image processing: http://members.wri.com/jeffb/visualization/2d.shtml -Jeff ==== Subject: Enhancements to special functions in Version 5.2 Here are three expressions which are equivalent for x>0: In[1]:= expr1 = MeijerG[{{0, 1}, {}}, {{1/2}, {}}, x]; expr2 = -Sqrt[Pi]*E^(1/(2*x))* (BesselK[0, 1/(2*x)] - BesselK[1, 1/(2*x)])/(2*x); expr3 = Pi*HypergeometricU[3/2, 2, 1/x]/(2*x); One problem is that we still cannot evaluate expr1 numerically near x = 0. Mathematica 5.1 just returned results with zero precision, no matter how high the value of $MaxExtraPrecision was set. Mathematica 5.2 gives an incorrect result: In[4]:= N[expr1 /. x -> 1/100, 20] Out[4]= 4.3516430954922696409302990656967`20.*^22 (all digits are incorrect). If we increase the value of $MinPrecision, then Mathematica will be able to compute several significant digits, but still the answer will be wrong in the sense of the Mathematica significance arithmetic model: with $MinPrecision = 50 the precision of the answer will be 50, but only about 6 digits will be correct. I suppose this could be called an improvement. The series expansions about x = 0: In[5]:= Series[expr1, {x, 0, 1}] Series[expr2, {x, 0, 1}] // Simplify[#, x > 0]& Series[expr3, {x, 0, 1}] // Simplify[#, x > 0]& Out[5]= MeijerG[{{0, 1}, {}}, {{1/2}, {}}, 0] + Derivative[0, 0, 1][MeijerG][{{0, 1}, {}}, {{1/2}, {}}, 0]*x + O[x]^2 Out[6]= Pi*Sqrt[x]/2 + O[x]^1 Out[7]= Pi*Sqrt[x]/2 + O[x]^1 Out[5] is incorrect because the leading term should be O(sqrt(x)) for positive x. The series expansions about x = Infinity: In[8]:= Series[expr1, {x, Infinity, 1}] Series[expr2, {x, Infinity, 1}] Series[expr3, {x, Infinity, 1}] Out[8]= MeijerG[{{0, 1}, {}}, {{1/2}, {}}, x] Out[9]= Sqrt[Pi] + Sqrt[Pi]*(1 + EulerGamma - Log[4] + Log[1/x])/(2*x) + O[x, Infinity]^2 Out[10]= Sqrt[Pi] + Sqrt[Pi]*(-1 + 2*EulerGamma + PolyGamma[0, 3/2])/(2*x) + O[x, Infinity]^2 Now Out[10] is incorrect, because the Log[x]/x term is missing. Overall, obtaining asymptotic expansions about singular points is still hopeless: such examples can probably be constructed for any of the higher transcendental functions in Mathematica, e.g., Series[StruveL[1, Sqrt[z]], {z, Infinity, 1}], which goes into infinite recursion and returns a meaningless result, or Series[HypergeometricPFQ[{1/2, 1/2, 1}, {3/4, 5/4}, 1/a], {a, 0, 1}], which returns ComplexInfinity + HypergeometricPFQ[{1/2, 1/2, 1}, {3/4, 5/4}, ComplexInfinity]. Integration: In[11]:= Integrate[(expr1 - Sqrt[Pi])/x, {x, 1, Infinity}] Integrate[(expr2 - Sqrt[Pi])/x, {x, 1, Infinity}] Integrate[(expr3 - Sqrt[Pi])/x, {x, 1, Infinity}] Out[11]= -Sqrt[E*Pi]*BesselK[0, 1/2] Out[12]= -Infinity Integrate::gener : Unable to check convergence. Out[13]= -EulerGamma*Sqrt[Pi] - Sqrt[E*Pi]*BesselK[0, 1/2] + Sqrt[Pi]*Log[4] Out[11] and Out[12] are both incorrect. Taking into account that I picked the initial MeijerG function and the two identities for it pretty much at random, all this seems rather disappointing. The identities expr1 == expr2 == expr3 are the formulas 07.34.03.0393.01 and 07.34.03.0392.01 from functions.wolfram.com. The domain of validity for the second one is given as !IntervalMemberQ[Interval[{-1, 0}], z], which seems to be incorrect: if z approaches a negative real value from above, then 1/z approaches the real line from below, so expr1 is continuous from above and expr3 isn't. Hence, their values on the branch cut of HypergeometricU cannot be the same. Maxim Rytin m.r@inbox.ru ==== Subject: Re: D[...] change in 5.1 Hi Alexei, You have a misunderstanding of pattern matching. It is clear that the left hand side of a definition must match. This is only the case if anything that is not marked as a pattern must match literally. E.g. f[a] only matches f[a] and not f[b]. On the other hand f[a_] matches f[b]. Now consider your construct: D[n[i_], x[j_], NonConstants -> n] Here only i and j are pattern. Ther rest must match literally. This is not the case with: D[1 + n[k], x[l], NonConstants -> n] Here 1+ does not match. To make it match you would need a pattern like: D[a_:0 + n[i_], x[j_], NonConstants -> n] This accounts for an additive term with a default value of 0. Further, I do not see why you need the NonConstants -> n. sincerely, Daniel >I am sorry, here what I meant: In[1] := n /: D[n[i_], x[j_], NonConstants -> n] := (1/r)*(d[i, j] - >n[i]*n[j]); In[2] := D[n[k], x[l], NonConstants -> n] >Out[2] = (d[k, l] - n[k] n[l]) / r In[3] := D[1 + n[k], x[l], NonConstants -> n] >Out[3] = D[n, x[l], NonConstants -> n] In[4] := $Version >Out[4] = 5.1 for Linux x86 (64 bit) (January 27, 2005) in earlier versions, but it is not in 5.1! The difference gives all >kind of problems in more complicated expressions. I try to combat this >with Hold and ReleaseHold, but ran into a more peculiar problem, which >is even more puzzling to me: In[1] := n /: D[ n[i_], x[j_], NonConstants -> {n, r} ] := ( [Delta][i, >j] - n[i] n[j]) / r; >In[2] := r /: D[ r, x[i_], NonConstants -> {n,r} ] := n[i]; In[3] := D[ [Delta][i,j] BesselJ[0 , k r] , x[l], NonConstants -{n,r} ] >Out[3] = 0 In[4] := D[ [Delta][i,j] BesselJ[0 , k r] , x[m], NonConstants -{n,r} ] >Out[4] = - k BesselJ[1,k r] n[m] [Delta][i,j] In[8] := ?k >Global`k In[9]:= ? [Delta] >Global`[Delta] Now, Out[3] and Out[4] should be the simmilar. The only difference is >what simbol m or l is used in respective differentiation by x[m] >or x[l]. But again they are not. The problem disappears if I substitute >[Delta], which I enter from keyboard as Esc d Esc, for example by >d. Alexei. > > > >In previous version two lines below seemed to work as intended: In: >n /: D[n[i_], x[j_], NonConstants -> {n,r}] := (1/r)( d[i,j] - n[i] >n[j] ); D[ 1 + n[k], x[l] ] Out: (-n[k] n[l] + d[k,l]) r But now in ver 5.1 I get something like: >Out: D[n, x[l], NonConstants -> {J, r, n}] (1) The funny part is that D[ n[k], x[l] ] is recognized and >substituted by the expression associated with definition of n. I wonder whether there is a possibility to get Mathematica 5.1 >recognize n[k] as an indexed symbol n. Alexei Akolzin. > >Hi Alexei, >>Have you posted the correct expression? I am asking because here what >>I get with Mathematica 5.1.1: >>In[1]:= >>n /: D[n[i_], x[j_], NonConstants -> {n, r}] := >> (1/r)*(d[i, j] - n[i]*n[j]); >>In[2]:= >>D[1 + n[k], x[l]] >>Out[2]= >>0 >>In[3]:= >>Information[n, LongForm -> False] >>n >>n /: D[n[i_], x[j_], NonConstants -> {n, r}] := >> (1/r)*(d[i, j] - n[i]*n[j]) >>In[4]:= >>$Version >>Out[4]= >>5.1 for Microsoft Windows (January 27, 2005) >>/J.M. >> > > -- Daniel Huber Metrohm Ltd. Oberdorfstr. 68 CH-9100 Herisau Tel. +41 71 353 8585, Fax +41 71 353 8907 E-Mail: Internet: ==== Subject: Re: D[...] change in 5.1 I am sorry, here what I meant: In[1] := n /: D[n[i_], x[j_], NonConstants -> n] := (1/r)*(d[i, j] - n[i]*n[j]); In[2] := D[n[k], x[l], NonConstants -> n] Out[2] = (d[k, l] - n[k] n[l]) / r In[3] := D[1 + n[k], x[l], NonConstants -> n] Out[3] = D[n, x[l], NonConstants -> n] In[4] := $Version Out[4] = 5.1 for Linux x86 (64 bit) (January 27, 2005) in earlier versions, but it is not in 5.1! The difference gives all kind of problems in more complicated expressions. I try to combat this with Hold and ReleaseHold, but ran into a more peculiar problem, which is even more puzzling to me: In[1] := n /: D[ n[i_], x[j_], NonConstants -> {n, r} ] := ( [Delta][i, j] - n[i] n[j]) / r; In[2] := r /: D[ r, x[i_], NonConstants -> {n,r} ] := n[i]; In[3] := D[ [Delta][i,j] BesselJ[0 , k r] , x[l], NonConstants -> {n,r} ] Out[3] = 0 In[4] := D[ [Delta][i,j] BesselJ[0 , k r] , x[m], NonConstants -> {n,r} ] Out[4] = - k BesselJ[1,k r] n[m] [Delta][i,j] In[8] := ?k Global`k In[9]:= ? [Delta] Global`[Delta] Now, Out[3] and Out[4] should be the simmilar. The only difference is what simbol m æor l is used in respective differentiation by x[m] or x[l]. But again they are not. The problem disappears if I substitute [Delta], which I enter from keyboard as Esc d Esc, for example by d. Alexei. ==== Subject: Re: D[...] change in 5.1 In previous version two lines below seemed to work as intended: In: > n /: D[n[i_], x[j_], NonConstants -> {n,r}] := (1/r)( d[i,j] - n[i] n[j] ); > D[ 1 + n[k], x[l] ] Out: (-n[k] n[l] + d[k,l]) r But now in ver 5.1 I get something like: > Out: D[n, x[l], NonConstants -> {J, r, n}] (1) The funny part is that D[ n[k], x[l] ] is recognized and substituted by the > expression associated with definition of n. I wonder whether there is a possibility to get Mathematica 5.1 recognize > n[k] as an indexed symbol n. Alexei Akolzin. > Hi Alexei, Have you posted the correct expression? I am asking because here what I get with Mathematica 5.1.1: In[1]:= n /: D[n[i_], x[j_], NonConstants -> {n, r}] := (1/r)*(d[i, j] - n[i]*n[j]); In[2]:= D[1 + n[k], x[l]] Out[2]= 0 In[3]:= Information[n, LongForm -> False] n n /: D[n[i_], x[j_], NonConstants -> {n, r}] := (1/r)*(d[i, j] - n[i]*n[j]) In[4]:= $Version Out[4]= 5.1 for Microsoft Windows (January 27, 2005) /J.M. ==== Subject: Re: D[...] change in 5.1 Hi Alexei, $Version Why do you need: NonConstants -> {n,r}, that does not make sense. Without it it works. sincerely, Daniel In previous version two lines below seemed to work as intended: In: > n /: D[n[i_], x[j_], NonConstants -> {n,r}] := (1/r)( d[i,j] - n[i] n[j] ); > D[ 1 + n[k], x[l] ] Out: (-n[k] n[l] + d[k,l]) r But now in ver 5.1 I get something like: > Out: D[n, x[l], NonConstants -> {J, r, n}] (1) The funny part is that D[ n[k], x[l] ] is recognized and substituted by the > expression associated with definition of n. I wonder whether there is a possibility to get Mathematica 5.1 recognize > n[k] as an indexed symbol n. Alexei Akolzin. >