Subject: Re: Re: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data John, Your idea about non-conflicting color names seems good. Also there should be a unit Degree and a different name for the numerical constant. The specific problem here though is different. Previously, the package Graphics`Colors` contained a set of named colors. These colors were all uniformly represented in that they were all RGBColors. That is, they all had the same Head. This uniformity of representation was useful and I am certain that it plays a role in a lot of user code. In Version 5.1 the WRI developers have moved a few of the colors from the Graphics`Colors` package to the kernel. (I think this is a mistake because I am for similar things being treated uniformly. They should either move all of the color names to the kernel or keep them together in the package. But that is not the specific issue here. But suppose they move Gold to the kernel, then your message isn't going to work.) In doing this, WRI also changed the representation of certain neutral colors such as Black, White and Gray from RGBColor to GrayLevel. I think this is a great mistake because it will break every algorithm that depends on all named colors having the same Head. I cannot think of a good reason for making this gratuitous change. I found out about this problem from a beta tester who was using the DrawGraphics package where it broke the ColorMix function. When he complained to Wolfram Support (I never understand why beta testers must work through Wolfram Support and don't have direct contacts to the developers!) he just received a bureaucratic reply that said they took the possibility of breaking old code into account (but do it anyway) and that I could just change my code since my package was not Wolfram associated. (I did, but now users of the package will have to stumble across the problem, wonder what is going on, then check my site and download the new version.) received a short reply that there was a good reason, although I never found out what that reason was. So WRI received at least three messages about this problem well before the release of 5.1. Now it turns out that this change not only affects user code not associated with Wolfram Research but also breaks their own code. RasterArray requires all the colors in the array to have the same Head. By fracturing the representation of the named colors the user can no longer obtain expected behavior for RasterArray, and I suppose also for DensityGraphics (maybe someone could test that with a color function that uses named colors with Black, White or Gray). It reminds me of that old vaudville doctor joke: Doctor, my code breaks when I use Gray. Then don't use Gray! Use RGBColor[0.752907, 0.752907, 0.752907]. If this kind of thinking portends what we may expect for the user interface for the 'graphics' Version, whenever it should appear, then I wouldn't be too hopeful. David Park djmp@earthlink.net http://home.earthlink.net/~djmp/ > G'day David, > Very curious. I just checked and indeed all works fine with 5.0 but Gray > isn't liked much in 5.1. Neither is Black, another color defined by > GrayLevel. Other colors defined by RGB seems to work fine though. > There probably is a good reason floating around somewhere. Not having 5.1 yet, I don't know exactly what the problem is but one good reason might be that some of the colours in Graphics`Colors` have names that clash with other useful packages. Because of this, I have long had a private version which loads with the following message: Graphics`Colors` - loading modified version of this standard package in which the colors {Cobalt, Gold, Gray, Titanium, Zinc} have been renamed: {CobaltColor, GoldColor, GrayColor, TitaniumColor, ZincColor} to eliminate clashes with the standard packages Miscellaneous`ChemicalElements` and Miscellaneous`Units`. I'm not sure if this explains a problem with Black though. John Jowett === Subject: Re: Re: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data David, I still don't have 5.1 but I agree with you that these seem to have be useless and arbitrary changes to Graphics`Colors`. Wolfram should fix it but, if they don't, I suppose it is always possible to keep a copy of the previous Colors.m inside a directory called Graphics in a location that comes earlier in $Path than that of the standard packages ({$UserBaseDirectory,Applications} or {$BaseDirectory,Applications} for Unprotect and modify those colours that are now in the kernel. This is what I have been doing with my modified version that avoids the name clashes with the chemical elements. It's annoying because anybody (such as you or me) distributing a package or application that depends on Graphics`Colors` will have to ensure that all users do something similar. I'm not sure that it is necessary to have a unit Degree as Kelvin is already there and is used, e.g., in the definition of BoltzmannConstant. The Miscellaneous`Units` has a special handling of temperature scales (ConvertTemperature) that are not proportional to each other like other units. It seems a bit clumsy but I don't have much occasion to use it myself. Otherwise Convert[5 Fahrenheit, Kelvin] returns something that might be considered reasonable, with a warning message. If anyone at Wolfram is listening, and agrees with all of us here that this mess should be tidied up, I would vote that the names {Gold, Cobalt, Titanium, Zinc} be reserved for chemical elements rather than colours. {Golden,CobaltBlue,TitaniumWhite,ZincWhite} might be reasonable alternatives (perhaps I'll put those in my version now). CobaltGreen is already in the package and the last two are very close to white. Otherwise, there are plenty of creative names for colours in automobile catalogues ... Gray is more difficult. It is a formally defined SI unit but is also common American usage for the colour. There is always the spelling Grey from British (and Australian, I think) English for the colour but I don't want to strain transatlantic relations here. Still, people not using the Units package would be free to define Gray=Grey for their convenience. It would also not hurt much to define GreyLevel=GrayLevel. John Jowett > John, > Your idea about non-conflicting color names seems good. Also there should be > a unit Degree and a different name for the numerical constant. > The specific problem here though is different. > Previously, the package Graphics`Colors` contained a set of named colors. > These colors were all uniformly represented in that they were all RGBColors. > That is, they all had the same Head. This uniformity of representation was > useful and I am certain that it plays a role in a lot of user code. > In Version 5.1 the WRI developers have moved a few of the colors from the > Graphics`Colors` package to the kernel. (I think this is a mistake because I > am for similar things being treated uniformly. They should either move all > of the color names to the kernel or keep them together in the package. But > that is not the specific issue here. But suppose they move Gold to the > kernel, then your message isn't going to work.) In doing this, WRI also > changed the representation of certain neutral colors such as Black, White > and Gray from RGBColor to GrayLevel. I think this is a great mistake because > it will break every algorithm that depends on all named colors having the > same Head. I cannot think of a good reason for making this gratuitous > change. > I found out about this problem from a beta tester who was using the > DrawGraphics package where it broke the ColorMix function. When he > complained to Wolfram Support (I never understand why beta testers must work > through Wolfram Support and don't have direct contacts to the developers!) > he just received a bureaucratic reply that said they took the possibility of > breaking old code into account (but do it anyway) and that I could just > change my code since my package was not Wolfram associated. (I did, but now > users of the package will have to stumble across the problem, wonder what is > going on, then check my site and download the new version.) Steven > received a short reply that there was a good reason, although I never found > out what that reason was. So WRI received at least three messages about this > problem well before the release of 5.1. > Now it turns out that this change not only affects user code not associated > with Wolfram Research but also breaks their own code. RasterArray requires > all the colors in the array to have the same Head. By fracturing the > representation of the named colors the user can no longer obtain expected > behavior for RasterArray, and I suppose also for DensityGraphics (maybe > someone could test that with a color function that uses named colors with > Black, White or Gray). > It reminds me of that old vaudville doctor joke: Doctor, my code breaks > when I use Gray. Then don't use Gray! Use RGBColor[0.752907, 0.752907, > 0.752907]. > If this kind of thinking portends what we may expect for the user interface > for the 'graphics' Version, whenever it should appear, then I wouldn't be > too hopeful. > David Park > djmp@earthlink.net > http://home.earthlink.net/~djmp/ > G'day David, > Very curious. I just checked and indeed all works fine with 5.0 but Gray > isn't liked much in 5.1. Neither is Black, another color defined by > GrayLevel. Other colors defined by RGB seems to work fine though. > There probably is a good reason floating around somewhere. > Not having 5.1 yet, I don't know exactly what the problem is but one > good reason might be that some of the colours in Graphics`Colors` have names > that clash with other useful packages. Because of this, I have long had a > private version which loads with the following message: > Graphics`Colors` - loading modified version of this standard package in > which > the colors > {Cobalt, Gold, Gray, Titanium, Zinc} > have been renamed: > {CobaltColor, GoldColor, GrayColor, TitaniumColor, ZincColor} > to eliminate clashes with the standard packages > Miscellaneous`ChemicalElements` and Miscellaneous`Units`. > I'm not sure if this explains a problem with Black though. > John Jowett === Subject: Re: Iterator problem. There is an error in the definition of your bounds (cyclic definition actually). The upper bound for i is j. The lower bound for j is i , so you cannot expect a software to solve it, isn't it ;) ? yehuda > I am having a problem with iterators in Mathematica. > > I have a sequence of integers defined by a[n]. I wish to build a table >of integers out of the above such that this table only contains integers of >the form a(i)+a(j)+a(k). > I tried Table[a[i] + a[j] + a[k], {k, 1, 3}, {j, i, k}, {i, 1, j}] but >the iterators do not have appropriate bounds. > Any help would be greatly appreciated. >Bob. === Subject: Re: Iterator problem. The Table statement as you've written it (ignoring the syntax problem) suggests that you want i <= j <= k. If so, the table can be written in a couple of ways, equivalent except for order: one=Table[a[i]+a[j]+a[k],{i,1,3},{j,i,3},{k,j,3}]//Flatten two=Table[a[i]+a[j]+a[k],{k,1,3},{j,1,k},{i,1,j}]//Flatten Sort@one==Sort@two {3 a[1],2 a[1]+a[2],2 a[1]+a[3],a[1]+2 a[2],a[1]+a[2]+a[3],a[1]+2 a[3],3 a[2],2 a[2]+a[3],a[2]+2 a[3],3 a[3]} {3 a[1],2 a[1]+a[2],a[1]+2 a[2],3 a[2],2 a[1]+a[3],a[1]+a[2]+a[3],2 a[2]+a[3], a[1]+2 a[3],a[2]+2 a[3],3 a[3]} True If you wanted i < j < k, the table is either of these: one=Table[a[i]+a[j]+a[k],{i,1,3},{j,i+1,3},{k,j+1,3}]//Flatten two=Table[a[i]+a[j]+a[k],{k,1,3},{j,1,k-1},{i,1,j-1}]//Flatten Sort@one==Sort@two {a[1]+a[2]+a[3]} {a[1]+a[2]+a[3]} True (That's a hard way to do it, of course.) Bobby > I am having a problem with iterators in Mathematica. > > I have a sequence of integers defined by a[n]. I wish to build a table > of integers out of the above such that this table only contains integers of > the form a(i)+a(j)+a(k). > I tried Table[a[i] + a[j] + a[k], {k, 1, 3}, {j, i, k}, {i, 1, j}] but > the iterators do not have appropriate bounds. > Any help would be greatly appreciated. > Bob. -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Iterator problem. I am having a problem with iterators in Mathematica. I have a sequence of integers defined by a[n]. I wish to build a table of integers out of the above such that this table only contains integers of the form a(i)+a(j)+a(k). I tried Table[a[i] + a[j] + a[k], {k, 1, 3}, {j, i, k}, {i, 1, j}] but the iterators do not have appropriate bounds. Any help would be greatly appreciated. Bob. === Subject: Re: Iterator problem. This does what you want (I assume you want to suppress cases that are symmetrically related, so I use 1<=i<=j<=k<=3): Table[a[i] + a[j] + a[k], {k,1,3},{j,1,k},{i,1,j}]//Flatten In Mathematica the outermost iterator is the one on the LEFT. Steve Luttrell > I am having a problem with iterators in Mathematica. > I have a sequence of integers defined by a[n]. I wish to build a table > of integers out of the above such that this table only contains integers > of > the form a(i)+a(j)+a(k). > I tried Table[a[i] + a[j] + a[k], {k, 1, 3}, {j, i, k}, {i, 1, j}] but > the iterators do not have appropriate bounds. > Any help would be greatly appreciated. > Bob. === Subject: Re: Iterator problem. and j should run from i, while i is not set to a value, only Table[a[i] + a[j] + a[k], {k, 1, 3}, {j, 1, k}, {i, j, k}] will do something but probably not what you want. Jens Robert G. Wilson v schrieb im Newsbeitrag > I am having a problem with iterators in Mathematica. > I have a sequence of integers defined by a[n]. I wish to build a table > of integers out of the above such that this table only contains integers > of > the form a(i)+a(j)+a(k). > I tried Table[a[i] + a[j] + a[k], {k, 1, 3}, {j, i, k}, {i, 1, j}] but > the iterators do not have appropriate bounds. > Any help would be greatly appreciated. > Bob. === Subject: Re: Iterator problem. > I am having a problem with iterators in Mathematica. > > I have a sequence of integers defined by a[n]. I wish to build a table > of integers out of the above such that this table only contains integers of > the form a(i)+a(j)+a(k). > I tried Table[a[i] + a[j] + a[k], {k, 1, 3}, {j, i, k}, {i, 1, j}] but > the iterators do not have appropriate bounds. > Any help would be greatly appreciated. > Bob. Hi Bob, I guess it should read Table[a[i] + a[j] + a[k], {k, 1, 3}, {j, 1, k}, {i, 1, j}]. -- Peter Pein 10245 Berlin === Subject: Re: Iterator problem. > I am having a problem with iterators in Mathematica. > > I have a sequence of integers defined by a[n]. I wish to build a table > of integers out of the above such that this table only contains integers of > the form a(i)+a(j)+a(k). > I tried Table[a[i] + a[j] + a[k], {k, 1, 3}, {j, i, k}, {i, 1, j}] but > the iterators do not have appropriate bounds. > Any help would be greatly appreciated. > Bob. Your middle iterator depends on i, which is your innermost iterator - hence the error. Try Table[a[i] + a[j] + a[k], {k, 1, 3}, {j, i, k}, {i, 1, j}] //Flatten David Bailey === Subject: Re: UnitStep Quotation from the help for UnitStep[] UnitStep[x] represents the unit step function, equal to 0 for x<0 and 1 for x[GreaterEqual]0. When using the rule p->0 for 1/p UnitStep[1-p] you get 1/0 UnitStep[-1]. Mathematica tries to evaluate 1/0 first and this causes the error message If you try UnitStep[p-1] /p /.p->0 you will get Indeterminate which results from evaluating 0/0. You may try Limit[1/p UnitStep[p-1],p->0] and get 0 Which gives you the Limit but not the Value of UnitStep[p-1]/p I hope this helps yehuda >Why does the following give me 'indeterminate, infinite expression >encountered', etc. instead of zero.... >(1/p) UnitStep[p-1] /.p->0 >I defined a function using the UnitStep because p could = 0 and I >thought this would be the way around that problem.......but didnt work >the way I expected..... >jerry blimbaum === Subject: Re: UnitStep (1/0)*0 is undefined in Mathematica, just as it should be. You can define the function this way, however: (inputs) f[p_] = If[p == 0, 0, (1/p) UnitStep[p - 1]]; Integrate[f@x, {x, -5, 5}] D[f@x, {x}] Integrate[%, x] Plot[f@x, {x, -5, 5}] (outputs) Log[5] If[x == 0, 0, DiracDelta[x - 1]/ x - UnitStep[x - 1]/x^2] Integrate[If[x == 0, 0, DiracDelta[x - 1]/x - UnitStep[x - 1]/x^2], x] (and a plot) D followed by Integrate is unevaluated. In version 5.1 we have a different choice: (inputs) f[p_] = Piecewise[{{0, p == 0}, {(1/p) UnitStep[p - 1], True}}]; Integrate[f@x, {x, -5, 5}] D[f@x, {x}] Integrate[%, x] Plot[f@x, {x, -5, 5}] (outputs) Log[5] Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] Piecewise[{{0, x <= 1}}, -1 + 1/x] (and a plot) This time D followed by Integrate is evaluated, but WRONG. Bobby > Why does the following give me 'indeterminate, infinite expression > encountered', etc. instead of zero.... > (1/p) UnitStep[p-1] /.p->0 > I defined a function using the UnitStep because p could = 0 and I > thought this would be the way around that problem.......but didnt work > the way I expected..... > jerry blimbaum -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Re: UnitStep > In version 5.1 we have a different choice: > (inputs) > f[p_] = Piecewise[{{0, p == 0}, {(1/p) UnitStep[p - 1], True}}]; > Integrate[f@x, {x, -5, 5}] > D[f@x, {x}] > Integrate[%, x] > Plot[f@x, {x, -5, 5}] > (outputs) > Log[5] > Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] > Piecewise[{{0, x <= 1}}, -1 + 1/x] > (and a plot) > This time D followed by Integrate is evaluated, but WRONG. I don't know why you think it's wrong. But in fact, it is not only right, but also clever. Note that the original function is discontinuous, as is its derivative. Then when we Integrate that, we need to get an antiderivative of the derivative of f. But due to the discontinuity, an antiderivative of the derivative of f need not be f itself. To confirm that the result of Integrate is correct, just differentiate that result Piecewise[{{0, x <= 1}}, -1 + 1/x] in your head. Don't you get Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] just as desired? The antiderivative is clever because Mathematica chose -1 as the constant of integration in the part for x > 1, thereby nicely making the antiderivative continuous. David Cantrell === Subject: UnitStep Why does the following give me 'indeterminate, infinite expression encountered', etc. instead of zero.... (1/p) UnitStep[p-1] /.p->0 I defined a function using the UnitStep because p could = 0 and I thought this would be the way around that problem.......but didnt work the way I expected..... jerry blimbaum === Subject: Re: UnitStep You want to take a limit rather than do a replacement (which is what you use of /.p->0 does). Limit[(1/p) UnitStep[p-1] , p->0] Steve Luttrell > Why does the following give me 'indeterminate, infinite expression > encountered', etc. instead of zero.... > (1/p) UnitStep[p-1] /.p->0 > I defined a function using the UnitStep because p could = 0 and I > thought this would be the way around that problem.......but didnt work > the way I expected..... > jerry blimbaum === Subject: Re: UnitStep > Why does the following give me 'indeterminate, infinite expression > encountered', etc. instead of zero.... > (1/p) UnitStep[p-1] /.p->0 > I defined a function using the UnitStep because p could = 0 and I > thought this would be the way around that problem.......but didnt work > the way I expected..... > jerry blimbaum Jerry, what you get is 0/0, which is not (and must not be) defined. Use If[p<1, 0, 1/p] instead. -- Peter Pein 10245 Berlin === Subject: Re: help with mathlink Your problem is that you created a Visual C++ project which compiles a Win32 Console Application instead of a Win32 Windows Application. Console applications create a command prompt if one wasn't used to launch it, and their entry point is the function int main(int argc, char **argv) A Win32 program expects the application to create a window if output is necessary, and its entry point is int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) The addtwo example should be compiled as a Windows Application. You could use the main() function by replacing the line... #elif WINDOWS_MATHLINK with #elif 0 in addtwo.c, but this is a suboptimal solution, since every time you Install[] addtwo, a command prompt window would appear. John Fultz jfultz@wolfram.com User Interface Group Wolfram Research, Inc. > I'm trying to learn how to use mathlink, but I'm still unable tu run > the simplest example provided with Mathematica (addtwo). > I'm using Mathematica 4.1 and MS Visual C++ 6.0 > Here's the problem: I added to MS Visual c++ project the following > files: > Source files: > - addtwo.c > - addtwo.tm.c > Headers files: > - mathlink.h > Resource files: > - ml32i2m.lib > I can compile both the 2 source files with 0 errors and 0 warnings, > but when I try to link them to build the output - executable file I > get the error: > ----------Configuration: addtwo - Win32 Debug---------- > Compiling... > addtwo.c > addtwo.tm.c > Linking... > LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main > Debug/addtwo.exe : fatal error LNK1120: 1 unresolved externals > Error executing link.exe. > addtwo.exe - 2 error(s), 0 warning(s) > I really can't understand what's wrong... I'm only trying to follow > step-by-step the MathLink tutorial and it doesn't work... :( > -- > OT === Subject: Re: help with mathlink John Fultz ha scritto nel messaggio > Your problem is that you created a Visual C++ project which compiles a > Win32 Console Application instead of a Win32 Windows Application. > -cut- Yes! Now -creating a Win32Windows Application- everything is working correctly. -- === Subject: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data I don't know firsthand that Wolfram said something like I think WRI have said that this is a Mac problem due to the apple implementation of postscript/PDF. However, they did report to me that a similar problem under Linux is an X11 problem. As I have before, I note here that we are buying Mathematica to do a job, not to be told that it is X11's fault or Mac's ps/pdf implementation fault. All that may in fact be true; however, if Mathematica doesn't work properly then it is broken and there is a bug. The sort of comments I have heard are really irritating, and I wish the developers would just accept the responsibility for a bad choice on their part, and then fix it. This rotated-text problem has been with us for at least two years. I second the thought that new features are fine, but how about putting a similar effort into fixing the old problems. Kevin >>Here is one thing that I hazard is a new bug. I don't actually have 5.1 so >>maybe someone can check it for me. >>The following works fine in 5.0.1. >>Needs[Graphics`Colors`] >>f[x_, y_] := >>With[{v = Sin[x y]}, >> Which[v < 0, Gray, >> v < 0.2, LightCoral, >> v < 0.4, PaleGreen, >> v < 0.6, CadetBlue, >> v < 0.8, GeraniumLake, >> True, UltramarineViolet >> ]] >>Show[Graphics[ >> {RasterArray[ >> Table[f[x, y], {x, 0, 5, 5/101}, {y, 0, 5, 5/101}], {{0, 0}, {5, >> 5}}]}], >> AspectRatio -> Automatic, >> Frame -> True, >> ImageSize -> 400]; >>If it doesn't work in 5.1, I'm sure there's a good reason. >>David Park >>djmp@earthlink.net >>http://home.earthlink.net/~djmp/ >>New features and better algorithms are great, but does anyone know if >>they've fixed any bugs in this release? Things like >>The rotated text bug on Macs where labels on the y-axis of frames are >>garbled. > I think WRI have said that this is a Mac problem due to the apple > implementation of postscript/PDF. Eg. If you use Apple's 'save as PDF' the > text is garbled but if you use Acrobat it comes out fine. > Mike >>The instability in large eigenvalue calculations, which sometimes make >>it impossible to interrupt the kernel and other times cause the kernel >>to unexpectedly quit. >>The feature where Mathematica uses a non-standard character >>encoding, so that text in graphics is garbled when imported into some >>other programs, like Illustrator. >>I'm excited about cluster analysis, but I can't bring myself to fork >>over any more money to Stephen Wolfram until simple problems which >>have existed for years are fixed. >>-Tim --------------070707040700070006040907 filename=kmccann.vcf begin:vcard fn:Kevin J. McCann n:McCann;Kevin J. org:University of Maryland, Baltimore County (UMBC);Physics/JCET adr:1000 Hilltop Circle;;Physics Building;Baltimore;MD;21250;USA email;internet:kmccann@umbc.edu title:Research Associate Professor url:http://alg.umbc.edu version:2.1 end:vcard --------------070707040700070006040907-- === Subject: Re: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data >> this is essentially a cosmetic problem What are Plots and graphics in general if not cosmetic, concerned entirely with appearance and readability? We don't need graphics to work well, because it's cosmetic? Bobby > Kevin, > Since I do not use Linux I have no knowledge of what problems may exist. If > this is a system software problem, which I believe it is, then is it > reasonable to expect WRI to spend time and money to develop a work around > given that this is essentially a cosmetic problem. The gobbled y axis labels > are corrected if you save a graphics selection as EPS and past into programs > such as illustrator or freehand. The labels are also corrected if you save > as PDF using Acrobat. > If you were running WRI you'd presumably prioritize all bugs or psuedo bugs > and allocate resources appropriately. I would have thought that trying to > fix something that may well get fixed in a future Mac OS release should be a > low priority given that (IMHO) it is cosmetic. > Mike >> I don't know firsthand that Wolfram said something like >> I think WRI have said that this is a Mac problem due to the apple >> implementation of postscript/PDF. >> However, they did report to me that a similar problem under Linux is an >> X11 problem. As I have before, I note here that we are buying >> Mathematica to do a job, not to be told that it is X11's fault or Mac's >> ps/pdf implementation fault. All that may in fact be true; however, if >> Mathematica doesn't work properly then it is broken and there is a bug. >> The sort of comments I have heard are really irritating, and I wish the >> developers would just accept the responsibility for a bad choice on >> their part, and then fix it. This rotated-text problem has been with us >> for at least two years. I second the thought that new features are fine, >> but how about putting a similar effort into fixing the old problems. >> Kevin >> Here is one thing that I hazard is a new bug. I don't actually have 5.1 so >> maybe someone can check it for me. >> >> The following works fine in 5.0.1. >> >> Needs[Graphics`Colors`] >> >> f[x_, y_] := >> With[{v = Sin[x y]}, >> Which[v < 0, Gray, >> v < 0.2, LightCoral, >> v < 0.4, PaleGreen, >> v < 0.6, CadetBlue, >> v < 0.8, GeraniumLake, >> True, UltramarineViolet >> ]] >> >> Show[Graphics[ >> {RasterArray[ >> Table[f[x, y], {x, 0, 5, 5/101}, {y, 0, 5, 5/101}], {{0, 0}, {5, >> 5}}]}], >> AspectRatio -> Automatic, >> Frame -> True, >> ImageSize -> 400]; >> >> If it doesn't work in 5.1, I'm sure there's a good reason. >> >> David Park >> djmp@earthlink.net >> http://home.earthlink.net/~djmp/ >> >> >> >> >> New features and better algorithms are great, but does anyone know if >> they've fixed any bugs in this release? Things like >> >> The rotated text bug on Macs where labels on the y-axis of frames are >> garbled. > I think WRI have said that this is a Mac problem due to the apple > implementation of postscript/PDF. Eg. If you use Apple's 'save as PDF' the > text is garbled but if you use Acrobat it comes out fine. > Mike >> The instability in large eigenvalue calculations, which sometimes make >> it impossible to interrupt the kernel and other times cause the kernel >> to unexpectedly quit. >> >> The feature where Mathematica uses a non-standard character >> encoding, so that text in graphics is garbled when imported into some >> other programs, like Illustrator. >> >> I'm excited about cluster analysis, but I can't bring myself to fork >> over any more money to Stephen Wolfram until simple problems which >> have existed for years are fixed. >> >> -Tim >> >> >> >> --------------070707040700070006040907 >> filename=kmccann.vcf >> begin:vcard >> fn:Kevin J. McCann >> n:McCann;Kevin J. >> org:University of Maryland, Baltimore County (UMBC);Physics/JCET >> adr:1000 Hilltop Circle;;Physics Building;Baltimore;MD;21250;USA >> email;internet:kmccann@umbc.edu >> title:Research Associate Professor >> url:http://alg.umbc.edu >> version:2.1 >> end:vcard >> --------------070707040700070006040907-- -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Re: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data The MacOS 'problem' exposed by the rotated text bug *has* been fixed in OS X. However, to take advantage of the fix, you have to start using the new 2D engine -- Quartz. Since QuickDraw (The OS 9 graphics engine) has been deprecated, I am sure that Wolfram is working on an upgrade. I have been dealing with this problem since version 1.1, and on the larger scheme of things, I'd rather have the right results and faster performance. I can always export the graphs as eps into Illustrator (my main use for Illustrator), and for quick presentations, the screen output is usable. george > Kevin, > Since I do not use Linux I have no knowledge of what problems may > exist. If > this is a system software problem, which I believe it is, then is it > reasonable to expect WRI to spend time and money to develop a work > around > given that this is essentially a cosmetic problem. The gobbled y axis > labels > are corrected if you save a graphics selection as EPS and past into > programs > such as illustrator or freehand. The labels are also corrected if you > save > as PDF using Acrobat. > If you were running WRI you'd presumably prioritize all bugs or psuedo > bugs > and allocate resources appropriately. I would have thought that trying > to > fix something that may well get fixed in a future Mac OS release > should be a > low priority given that (IMHO) it is cosmetic. > Mike === Subject: Re: Re: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data They were warned, they did it anyway, and it broke their own code. The word comeuppance springs to mind. Bobby > John, > Your idea about non-conflicting color names seems good. Also there should be > a unit Degree and a different name for the numerical constant. > The specific problem here though is different. > Previously, the package Graphics`Colors` contained a set of named colors. > These colors were all uniformly represented in that they were all RGBColors. > That is, they all had the same Head. This uniformity of representation was > useful and I am certain that it plays a role in a lot of user code. > In Version 5.1 the WRI developers have moved a few of the colors from the > Graphics`Colors` package to the kernel. (I think this is a mistake because I > am for similar things being treated uniformly. They should either move all > of the color names to the kernel or keep them together in the package. But > that is not the specific issue here. But suppose they move Gold to the > kernel, then your message isn't going to work.) In doing this, WRI also > changed the representation of certain neutral colors such as Black, White > and Gray from RGBColor to GrayLevel. I think this is a great mistake because > it will break every algorithm that depends on all named colors having the > same Head. I cannot think of a good reason for making this gratuitous > change. > I found out about this problem from a beta tester who was using the > DrawGraphics package where it broke the ColorMix function. When he > complained to Wolfram Support (I never understand why beta testers must work > through Wolfram Support and don't have direct contacts to the developers!) > he just received a bureaucratic reply that said they took the possibility of > breaking old code into account (but do it anyway) and that I could just > change my code since my package was not Wolfram associated. (I did, but now > users of the package will have to stumble across the problem, wonder what is > going on, then check my site and download the new version.) > received a short reply that there was a good reason, although I never found > out what that reason was. So WRI received at least three messages about this > problem well before the release of 5.1. > Now it turns out that this change not only affects user code not associated > with Wolfram Research but also breaks their own code. RasterArray requires > all the colors in the array to have the same Head. By fracturing the > representation of the named colors the user can no longer obtain expected > behavior for RasterArray, and I suppose also for DensityGraphics (maybe > someone could test that with a color function that uses named colors with > Black, White or Gray). > It reminds me of that old vaudville doctor joke: Doctor, my code breaks > when I use Gray. Then don't use Gray! Use RGBColor[0.752907, 0.752907, > 0.752907]. > If this kind of thinking portends what we may expect for the user interface > for the 'graphics' Version, whenever it should appear, then I wouldn't be > too hopeful. > David Park > djmp@earthlink.net > http://home.earthlink.net/~djmp/ >> G'day David, >> Very curious. I just checked and indeed all works fine with 5.0 but Gray >> isn't liked much in 5.1. Neither is Black, another color defined by >> GrayLevel. Other colors defined by RGB seems to work fine though. >> There probably is a good reason floating around somewhere. > Not having 5.1 yet, I don't know exactly what the problem is but one > good reason might be that some of the colours in Graphics`Colors` have names > that clash with other useful packages. Because of this, I have long had a > private version which loads with the following message: > Graphics`Colors` - loading modified version of this standard package in > which > the colors > {Cobalt, Gold, Gray, Titanium, Zinc} > have been renamed: > {CobaltColor, GoldColor, GrayColor, TitaniumColor, ZincColor} > to eliminate clashes with the standard packages > Miscellaneous`ChemicalElements` and Miscellaneous`Units`. > I'm not sure if this explains a problem with Black though. > John Jowett -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data Kevin, Since I do not use Linux I have no knowledge of what problems may exist. If this is a system software problem, which I believe it is, then is it reasonable to expect WRI to spend time and money to develop a work around given that this is essentially a cosmetic problem. The gobbled y axis labels are corrected if you save a graphics selection as EPS and past into programs such as illustrator or freehand. The labels are also corrected if you save as PDF using Acrobat. If you were running WRI you'd presumably prioritize all bugs or psuedo bugs and allocate resources appropriately. I would have thought that trying to fix something that may well get fixed in a future Mac OS release should be a low priority given that (IMHO) it is cosmetic. Mike > I don't know firsthand that Wolfram said something like > I think WRI have said that this is a Mac problem due to the apple > implementation of postscript/PDF. > However, they did report to me that a similar problem under Linux is an > X11 problem. As I have before, I note here that we are buying > Mathematica to do a job, not to be told that it is X11's fault or Mac's > ps/pdf implementation fault. All that may in fact be true; however, if > Mathematica doesn't work properly then it is broken and there is a bug. > The sort of comments I have heard are really irritating, and I wish the > developers would just accept the responsibility for a bad choice on > their part, and then fix it. This rotated-text problem has been with us > for at least two years. I second the thought that new features are fine, > but how about putting a similar effort into fixing the old problems. > Kevin > Here is one thing that I hazard is a new bug. I don't actually have 5.1 so > maybe someone can check it for me. > > The following works fine in 5.0.1. > > Needs[Graphics`Colors`] > > f[x_, y_] := > With[{v = Sin[x y]}, > Which[v < 0, Gray, > v < 0.2, LightCoral, > v < 0.4, PaleGreen, > v < 0.6, CadetBlue, > v < 0.8, GeraniumLake, > True, UltramarineViolet > ]] > > Show[Graphics[ > {RasterArray[ > Table[f[x, y], {x, 0, 5, 5/101}, {y, 0, 5, 5/101}], {{0, 0}, {5, > 5}}]}], > AspectRatio -> Automatic, > Frame -> True, > ImageSize -> 400]; > > If it doesn't work in 5.1, I'm sure there's a good reason. > > David Park > djmp@earthlink.net > http://home.earthlink.net/~djmp/ > > > > > New features and better algorithms are great, but does anyone know if > they've fixed any bugs in this release? Things like > > The rotated text bug on Macs where labels on the y-axis of frames are > garbled. >> I think WRI have said that this is a Mac problem due to the apple >> implementation of postscript/PDF. Eg. If you use Apple's 'save as PDF' the >> text is garbled but if you use Acrobat it comes out fine. >> Mike > The instability in large eigenvalue calculations, which sometimes make > it impossible to interrupt the kernel and other times cause the kernel > to unexpectedly quit. > > The feature where Mathematica uses a non-standard character > encoding, so that text in graphics is garbled when imported into some > other programs, like Illustrator. > > I'm excited about cluster analysis, but I can't bring myself to fork > over any more money to Stephen Wolfram until simple problems which > have existed for years are fixed. > > -Tim > > > > --------------070707040700070006040907 > filename=kmccann.vcf > begin:vcard > fn:Kevin J. McCann > n:McCann;Kevin J. > org:University of Maryland, Baltimore County (UMBC);Physics/JCET > adr:1000 Hilltop Circle;;Physics Building;Baltimore;MD;21250;USA > email;internet:kmccann@umbc.edu > title:Research Associate Professor > url:http://alg.umbc.edu > version:2.1 > end:vcard > --------------070707040700070006040907-- === Subject: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data I stand corrected. Seems this is not a Mac problem, or at least hasn't been for sometime (since OS X at least). Mike > Kevin, > Since I do not use Linux I have no knowledge of what problems may exist. If > this is a system software problem, which I believe it is, then is it > reasonable to expect WRI to spend time and money to develop a work around > given that this is essentially a cosmetic problem. The gobbled y axis labels > are corrected if you save a graphics selection as EPS and past into programs > such as illustrator or freehand. The labels are also corrected if you save > as PDF using Acrobat. > If you were running WRI you'd presumably prioritize all bugs or psuedo bugs > and allocate resources appropriately. I would have thought that trying to > fix something that may well get fixed in a future Mac OS release should be a > low priority given that (IMHO) it is cosmetic. > Mike >> I don't know firsthand that Wolfram said something like >> I think WRI have said that this is a Mac problem due to the apple >> implementation of postscript/PDF. >> However, they did report to me that a similar problem under Linux is an >> X11 problem. As I have before, I note here that we are buying >> Mathematica to do a job, not to be told that it is X11's fault or Mac's >> ps/pdf implementation fault. All that may in fact be true; however, if >> Mathematica doesn't work properly then it is broken and there is a bug. >> The sort of comments I have heard are really irritating, and I wish the >> developers would just accept the responsibility for a bad choice on >> their part, and then fix it. This rotated-text problem has been with us >> for at least two years. I second the thought that new features are fine, >> but how about putting a similar effort into fixing the old problems. >> Kevin > > >> Here is one thing that I hazard is a new bug. I don't actually have 5.1 so >> maybe someone can check it for me. >> >> The following works fine in 5.0.1. >> >> Needs[Graphics`Colors`] >> >> f[x_, y_] := >> With[{v = Sin[x y]}, >> Which[v < 0, Gray, >> v < 0.2, LightCoral, >> v < 0.4, PaleGreen, >> v < 0.6, CadetBlue, >> v < 0.8, GeraniumLake, >> True, UltramarineViolet >> ]] >> >> Show[Graphics[ >> {RasterArray[ >> Table[f[x, y], {x, 0, 5, 5/101}, {y, 0, 5, 5/101}], {{0, 0}, {5, >> 5}}]}], >> AspectRatio -> Automatic, >> Frame -> True, >> ImageSize -> 400]; >> >> If it doesn't work in 5.1, I'm sure there's a good reason. >> >> David Park >> djmp@earthlink.net >> http://home.earthlink.net/~djmp/ >> >> >> >> >> New features and better algorithms are great, but does anyone know if >> they've fixed any bugs in this release? Things like >> >> The rotated text bug on Macs where labels on the y-axis of frames are >> garbled. > > > I think WRI have said that this is a Mac problem due to the apple > implementation of postscript/PDF. Eg. If you use Apple's 'save as PDF' the > text is garbled but if you use Acrobat it comes out fine. > > Mike > > >> The instability in large eigenvalue calculations, which sometimes make >> it impossible to interrupt the kernel and other times cause the kernel >> to unexpectedly quit. >> >> The feature where Mathematica uses a non-standard character >> encoding, so that text in graphics is garbled when imported into some >> other programs, like Illustrator. >> >> I'm excited about cluster analysis, but I can't bring myself to fork >> over any more money to Stephen Wolfram until simple problems which >> have existed for years are fixed. >> >> -Tim >> >> >> > > >> --------------070707040700070006040907 >> filename=kmccann.vcf >> begin:vcard >> fn:Kevin J. McCann >> n:McCann;Kevin J. >> org:University of Maryland, Baltimore County (UMBC);Physics/JCET >> adr:1000 Hilltop Circle;;Physics Building;Baltimore;MD;21250;USA >> email;internet:kmccann@umbc.edu >> title:Research Associate Professor >> url:http://alg.umbc.edu >> version:2.1 >> end:vcard >> --------------070707040700070006040907-- === Subject: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data Mike, Yes it is reasonable to expect them to produce a product that works on the systems that they advertise it for. Perhaps for some the garbled y-axis is a cosmetic problem. For me it is essential, since I use Mathematica in both class lectures and seminars, and it is seriously unprofessional to have the junked up y-axis labels and any other non-horizontal text lables. As I have said before, mat lab has figured out how to make their labels work correctly under linux, unix, mac, ...; so, it is possible. Kevin >>Kevin, >>Since I do not use Linux I have no knowledge of what problems may exist. If >>this is a system software problem, which I believe it is, then is it >>reasonable to expect WRI to spend time and money to develop a work around >>given that this is essentially a cosmetic problem. The gobbled y axis labels >>are corrected if you save a graphics selection as EPS and past into programs >>such as illustrator or freehand. The labels are also corrected if you save >>as PDF using Acrobat. >>If you were running WRI you'd presumably prioritize all bugs or psuedo bugs >>and allocate resources appropriately. I would have thought that trying to >>fix something that may well get fixed in a future Mac OS release should be a >>low priority given that (IMHO) it is cosmetic. >>Mike === Subject: Re: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data > I don't know firsthand that Wolfram said something like > I think WRI have said that this is a Mac problem due to the apple > implementation of postscript/PDF. > However, they did report to me that a similar problem under Linux is an > X11 problem. As I have before, I note here that we are buying > Mathematica to do a job, not to be told that it is X11's fault or Mac's > ps/pdf implementation fault. All that may in fact be true; however, if > Mathematica doesn't work properly then it is broken and there is a bug. > The sort of comments I have heard are really irritating, and I wish the > developers would just accept the responsibility for a bad choice on > their part, and then fix it. This rotated-text problem has been with us > for at least two years. I second the thought that new features are > fine, > but how about putting a similar effort into fixing the old problems. > Kevin frustrating as hearing it's not our fault in response to complaints about a bug, particularly the long-standing one you describe here, which has never appeared in any other software that I know of. I don't doubt that there are quirks in Apple's postscript implementation, but it's obviously possible to deal with them. Not doing so is inexcusable. Blame-shifting is even worse. ----- Selwyn Hollis http://www.appliedsymbols.com (edit reply-to to reply) > New features and better algorithms are great, but does anyone know if > they've fixed any bugs in this release? Things like > The rotated text bug on Macs where labels on the y-axis of frames are > garbled. >> I think WRI have said that this is a Mac problem due to the apple >> implementation of postscript/PDF. Eg. If you use Apple's 'save as >> PDF' the >> text is garbled but if you use Acrobat it comes out fine. >> Mike > The instability in large eigenvalue calculations, which sometimes > make > it impossible to interrupt the kernel and other times cause the > kernel > to unexpectedly quit. > The feature where Mathematica uses a non-standard character > encoding, so that text in graphics is garbled when imported into some > other programs, like Illustrator. > I'm excited about cluster analysis, but I can't bring myself to fork > over any more money to Stephen Wolfram until simple problems which > have existed for years are fixed. > -Tim > --------------070707040700070006040907 > filename=kmccann.vcf > begin:vcard > fn:Kevin J. McCann > n:McCann;Kevin J. > org:University of Maryland, Baltimore County (UMBC);Physics/JCET > adr:1000 Hilltop Circle;;Physics Building;Baltimore;MD;21250;USA > email;internet:kmccann@umbc.edu > title:Research Associate Professor > url:http://alg.umbc.edu > version:2.1 > end:vcard > --------------070707040700070006040907-- === Subject: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data > rotated-text problem has been with us > for at least two years. Andrew Watson (see below, from Google Groups) and I had a good laugh over this. === Subject: At long last, Sir, have you no shame? Saying first that I am a fanatical Mathematica user, in awe of the product and its developers, I nonetheless feel compelled to say that... I am absolutely astonished that Mathematica 4.0 has *still* not fixed the FrameLabel rotated text bug, which prevents vertical axis labels from appearing properly when rendered on screen on the Mac. This bug causes endless troubles for those of us who prepare figures for both printing and live presentation. This bug has been present since time immemorial, but elicits only sheepish chuckles from Wolfram developers when mentioned. What gives? Is this really something that has stumped the greatest computational minds of the end of the millenium? Is it really so low on the list of priorities that it has persisted for 10 years? Have you no shame? Andrew B. Watson NASA Ames Research Center ------------------------------------------------------------------------ === Subject: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data Johshua, attention, but I suspect that the 5.0 comments will be dug up and displayed when someone complains again about the same problem in 6.0, 7.0, ... Kevin >> rotated-text problem has been with us >>for at least two years. > Andrew Watson (see below, from Google Groups) and I had a good laugh over > this. === > Subject: At long last, Sir, have you no shame? > Saying first that I am a fanatical Mathematica user, in awe of the product > and its developers, I nonetheless feel compelled to say that... > I am absolutely astonished that Mathematica 4.0 has *still* not fixed the > FrameLabel rotated text bug, which prevents vertical axis labels from > appearing properly when rendered on screen on the Mac. This bug causes > endless troubles for those of us who prepare figures for both printing and > live presentation. This bug has been present since time immemorial, but > elicits only sheepish chuckles from Wolfram developers when mentioned. What > gives? Is this really something that has stumped the greatest computational > minds of the end of the millenium? Is it really so low on the list of > priorities that it has persisted for 10 years? Have you no shame? > Andrew B. Watson > NASA Ames Research Center > ------------------------------------------------------------------------ === Subject: Approximate entropy applied to the Pi digits In Ivars Peterson's MathTrek - Randomness, Risk, and Financial Markets: http://www.maa.org/mathland/mathtrek_10_11_04.html I found the reference to Steven M. Pincus' Approximate entropy. I applied it to Hofstader's sequence, the last digits of the primes and Pi's digits and the Approximate entropy came out larger in that order. My program is really slow, but it does seem to give the ApEn function as defined in the paper. It is a lot like a Lyapunov Largest exponent in the way I've calculated it, but it more a probability measure on the variables than a direct result of the variables. It is also much harder and takes longer than a Lyapunov since it has two distinct sums in it. It is more closely related to correlation dimension that Kaplan-York dimension in it's method of calculation. Clear [f,n,d,c,Phi,ApEn,a,i,j,k,r,m,g,digits] (*Steven M. Pincus,Approximate entropy as a measure of system complexity, PNAS,vol 88,pp2297-2301,March 1991,Mathematics*) digits=100 $MaxExtraPrecision =digits f[n_]:=Floor[Mod[10^n*Pi,10]] (* approximate Entropy for Pi digits sequence*) d[i_,j_,m_,n_]:=Max[Table[Abs[f[i+k-1]-f[j+k-1]],{k,1,m-1}]] c[i_,r_,m_,n_]:=N[Sum[If[d[i,j,m,n]True] y=Fit[a,{1,x},x] gb=Plot[y,{x,1,digits}] Show[{ga,gb}] Respectfully, Roger L. Bagula tftn@earthlink.net, 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 : alternative email: rlbtftn@netscape.net URL : http://home.earthlink.net/~tftn === Subject: webMathematica & Dreamweaver Has anybody got any tips on how the production of webMathematica pages can be done using Dreamweaver MX? Ian Roberts === Subject: Re: webMathematica & Dreamweaver > Has anybody got any tips on how the production of webMathematica pages > can be done using Dreamweaver MX? > Ian Roberts Ian you'd have to prepare a webpage in dreamweaver with 'blocks' (divs preferrably or alternatively tables) for your webMathematica stuff and then insert the relevant code within these tags. In other words you essentially use both programs independently. Dreamweaver gives you the design and layout and the webMathematica code within the divs gives you the functionality. Mike --------------------------- Michael Honeychurch Mathematica in Education and Research http://www.ijournals.net === Subject: Principal Value integral The following Principal Value integral does not appear to give the correct result. Integrate[1/(x^3-1), {x, -Infinity, Infinity}, PrincipalValue->True] This gives I Pi / 3, which surely can't be right since the answer should be real. When doing it numerically, it gives the right answer: < True] -(Pi/Sqrt[3]) Bobby > The following Principal Value integral does not appear to give the > correct result. > Integrate[1/(x^3-1), {x, -Infinity, Infinity}, PrincipalValue->True] > This gives I Pi / 3, which surely can't be right since the answer should > be real. > When doing it numerically, it gives the right answer: > < CauchyPrincipalValue[1/(x^3-1), {z, -Infinity, {1}, Infinity}] > This gives -1.8138 which is the correct answer (it's -Pi/Sqrt[3]). > Any explanations? Is this a bug or am I missing something? > Carlo -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Re: Principal Value integral > Version 5.1 gets your desired result: > Integrate[1/(x^3 - 1), {x, -Infinity, Infinity}, > PrincipalValue -> True] > -(Pi/Sqrt[3]) > Bobby ... as good old Version 4.0 does :-) -- Peter Pein 10245 Berlin === Subject: Re: Principal Value integral > The following Principal Value integral does not appear to give the > correct result. > Integrate[1/(x^3-1), {x, -Infinity, Infinity}, PrincipalValue->True] > This gives I Pi / 3, which surely can't be right since the answer should > be real. Using version 5.0, the result is correct: -Pi/Sqrt[3] . What version are you using? David > When doing it numerically, it gives the right answer: > < CauchyPrincipalValue[1/(x^3-1), {z, -Infinity, {1}, Infinity}] > This gives -1.8138 which is the correct answer (it's -Pi/Sqrt[3]). > Any explanations? Is this a bug or am I missing something? > Carlo === Subject: Re: Principal Value integral That's highly strange. I'm using version 5.0.1 (student version) on Win XP SP2. I just tried it again on a fresh kernel, gives the same wrong result. Must be a bug peculiar to 5.0.1 then I guess... can anyone else confirm this? Carlo >>The following Principal Value integral does not appear to give the >>correct result. >>Integrate[1/(x^3-1), {x, -Infinity, Infinity}, PrincipalValue->True] >>This gives I Pi / 3, which surely can't be right since the answer should >>be real. > Using version 5.0, the result is correct: -Pi/Sqrt[3] . > What version are you using? === Subject: Re: Principal Value integral > That's highly strange. I'm using version 5.0.1 (student version) on Win > XP SP2. I just tried it again on a fresh kernel, gives the same wrong > result. Must be a bug peculiar to 5.0.1 then I guess... can anyone else > confirm this? I also use version 5.0.1 for Students (Windows XP) and can reproduce your bug. -- Curt Fischer === Subject: Recursion loop help needed tia sal Greets All, I'm having a little trouble in creating this example in mathematica, I'm not sure how to make the array dynamic enough in mathematica to include Cn.....Xn in example 1. Does anybody have any idea Example 1: User Input for four numbers 15,17,8,12... (Note: user can input any amount of numbers) (15+17) /25/2 ->b1 (b1+8) /25/2 ->b2 (b2+12) /25/2 ->b3 (b1+b2) /25/2 ->c1 (c1 +b3)/25/2 ->c2 (c1 +c2) /25/2 ->c3 Tia === Subject: Mathematica&SuSe 9.2: Inputformulars disabled Hello! I am running Mathematica 4.1 under Suse Linux 9.2 and there are strange effects: Starting any Windowmanager (i.e fvwm or kde) the regular way (with startx) and callin Mathematica, Mathematica starts ... but any inputformular is disabled, for example the input of keywords in the help, or the input of filenames to save. In short Mathematica is useless. Starting the X-Window with xinit, then starting the windowmanager fvwm or twm, then running mathematica and it works. The above procedure with Windowmanager kde fails. (For the ones thinking of a deja vue: no one answered. maybe in the mean time there are some ideas?) greetings Detlef === Subject: Re: Mathematica&SuSe 9.2: Inputformulars disabled Make sure NumLock is off. Kevin > Hello! > I am running Mathematica 4.1 under Suse Linux 9.2 and > there are strange effects: > Starting any Windowmanager (i.e fvwm or kde) the regular > way (with startx) and callin Mathematica, Mathematica starts ... > but any inputformular is disabled, for example the input > of keywords in the help, or the input of filenames to > save. > In short Mathematica is useless. > Starting the X-Window with xinit, > then starting the windowmanager fvwm > or twm, > then running mathematica and it works. > The above procedure > with Windowmanager kde fails. > (For the ones thinking of a deja vue: > no one answered. > maybe in the mean time there are some ideas?) > greetings > Detlef --------------000904000408090505000702 filename=kmccann.vcf begin:vcard fn:Kevin J. McCann n:McCann;Kevin J. org:University of Maryland, Baltimore County (UMBC);Physics/JCET adr:1000 Hilltop Circle;;Physics Building;Baltimore;MD;21250;USA email;internet:kmccann@umbc.edu title:Research Associate Professor url:http://alg.umbc.edu version:2.1 end:vcard --------------000904000408090505000702-- === Subject: Re: Mathematica&SuSe 9.2: Inputformulars disabled > Hello! > I am running Mathematica 4.1 under Suse Linux 9.2 and > there are strange effects: > Starting any Windowmanager (i.e fvwm or kde) the regular > way (with startx) and callin Mathematica, Mathematica starts ... > .... Although I haven't had those specific problems I had problem with keyboard input. Keys seemed to be disabled and You couldn't click on links. The solution is to make sure that your NumLock key is Off. /J === Subject: Re: Re: Piecewise symbol in 5.1 Windows XP Pro (with all the updates).Ê Mathematica ver 5.0 is also installed, but I think I'll remove it.Ê The display is much nicer now.Ê :>) -- Dana > It sounds like the installation of fonts in an upgrade scenario isn't as > reliable as it should be.Ê What various people are describing here is that > some or all of the Mathematica fonts being used are coming from their 5.0 > (or possibly earlier) installation rather than the 5.1 installation.Ê We > are investigating the problem to try to determine under exactly what > circumstances this happens and how to fix it. > I'm including some instructions below on how to fix the problem under > Windows.Ê If you have difficulties, or are experiencing problems on > platforms other than Windows, you should contact Technical Support at > support@wolfram.com. > First, to determine if you have a problem, copy and paste the following > into 5.1... > [ConjugateTranspose] [Transpose] [Piecewise] > You should see characters which look kind of like a plus, a T, and a left > brace.Ê If you don't, try rebooting your system.Ê If the problem still > persists, then... > * Open the Fonts control panel. > * Find all fonts which begin with the name Mathematica and delete >Ê them (if you find fonts beginning with Math, you shouldnt' delete >Ê those). > * Double-check to make sure they're all gone.Ê This is important, since >Ê occasionally, multiple copies of a font can be installed, and a font >Ê can reappear after you deleted it.Ê If there are some fonts which >Ê refuse to go away, reboot the system and try again. > * In the Mathematica 5.1 installation directory, which is probably... >ÊÊÊÊÊ C:Program FilesWolfram ResearchMathematica5.1 >Ê open the subdirectory >ÊÊÊÊÊ SystemFilesFontsTrueType > * Select all of the files in this directory, and drag them to the Fonts >Ê control panel window.Ê You'll briefly get a progress dialog indicating >Ê that the fonts are being installed. > John Fultz > jfultz@wolfram.com > User Interface Group > Wolfram Research, Inc. === Subject: Re: 5.1 symbols for transpose, conjugate, conjugate transpose don't display hi, have had installed 4.2 as well as 5.0.1 as well as 5.1 on the same system (windows 2000). had the same problem with Esc tr Esc etc. but not only this in addition any gui applikation did not work. deinstalled all mathematica versions. reinstalled 5.1 and every thing worked well. === Subject: Compile problem here I provide a simple test code (just copies a vector) which denies to compile but gives the error message The type of return values in ... are different. I am using Mathematica 5.0. SRSort = Compile[{{f, _Real, 1}}, Module[{lambda,i}, lambda=Length[f]; Index = Table[0, {lambda}]; For[i = 1, i <= lambda, i++, Index[[i]] = f[[i]]; ]; Return[Index]; ]; ]; When I just put Index at the end of the loop, the function compiles but does not deliver any output. Any idea what's the problem here? joerg === Subject: Re: Compile problem You like semicolons too well. This works: SRSort = Compile[ {{f, _Real, 1}}, Module[{lambda, i}, lambda = Length[f]; Index = Table[0, {lambda}]; For[i = 1, i <= lambda, i++, Index[[i]] = f[[i]]; ]; Index]]; data = RandomArray[BinomialDistribution[12, 0.3], 12] copy=SRSort[data] {5, 3, 2, 3, 4, 3, 6, 6, 2, 6, 2, 3} {5, 3, 2, 3, 4, 3, 6, 6, 2, 6, 2, 3} But this works a lot better: copy=data Bobby > here I provide a simple test code (just copies a vector) which denies to > compile but gives the error message The type of return values in ... > are different. > I am using Mathematica 5.0. > SRSort = Compile[{{f, _Real, 1}}, Module[{lambda,i}, > lambda=Length[f]; > Index = Table[0, {lambda}]; > For[i = 1, i <= lambda, i++, > Index[[i]] = f[[i]]; > ]; > Return[Index]; > ]; > ]; > When I just put Index at the end of the loop, the function compiles > but does not deliver any output. > Any idea what's the problem here? > joerg -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Re: Compile problem the problem is that you have written Compile[__,Module[___];] and so the final Null of compound expression will returned. Jens Joerg Schaber schrieb im Newsbeitrag > here I provide a simple test code (just copies a vector) which denies to > compile but gives the error message The type of return values in ... > are different. > I am using Mathematica 5.0. > SRSort = Compile[{{f, _Real, 1}}, Module[{lambda,i}, > lambda=Length[f]; > Index = Table[0, {lambda}]; > For[i = 1, i <= lambda, i++, > Index[[i]] = f[[i]]; > ]; > Return[Index]; > ]; > ]; > When I just put Index at the end of the loop, the function compiles > but does not deliver any output. > Any idea what's the problem here? > joerg === Subject: Pattern matching partial derivatives Hi all, I can't get finding patterns that would match a simple partial derivative: Input: ?f ?x D[f, x, NonConstants -> {f}] // FullForm Output: Global`f Global`x D[f, x, Rule[NonConstants, List[f]]] Input: MatchQ[ D[f, x, Rule[NonConstants, List[f]]], D[f_, x_, Rule[NonConstants, nc_]] ] Output: False Am I damned ? Nicolas === Subject: Re: Pattern matching partial derivatives > Hi all, > I can't get finding patterns that would match a simple partial derivative: > Input: > ?f > ?x > D[f, x, NonConstants -> {f}] // FullForm > Output: > Global`f > Global`x > D[f, x, Rule[NonConstants, List[f]]] > Input: > MatchQ[ > D[f, x, Rule[NonConstants, List[f]]], > D[f_, x_, Rule[NonConstants, nc_]] > ] > Output: > False > Am I damned ? > Nicolas Nicolas, Yes, getting this output from Mathematica can be a sign of damnation! Alternatively, look at this: D[f_, x_, Rule[NonConstants, nc_]] // FullForm 0 If you want to manipulate derivatives in complicated ways, one way is to use your own notation for a derivative (say dD) which will obviously not evaluate, and then use dD ->D to get evaluation when you need it. David === Subject: Re: Pattern matching partial derivatives > Nicolas, > Yes, getting this output from Mathematica can be a sign of damnation! > Alternatively, look at this: > D[f_, x_, Rule[NonConstants, nc_]] // FullForm > If you want to manipulate derivatives in complicated ways, one way is to > use your own notation for a derivative (say dD) which will obviously not > evaluate, and then use dD ->D to get evaluation when you need it. David, still I'm frustrated. Why couldn't we use patterns to manipulate partial derivatives ? How can it be that, as you pointed out, D[f_, x_, Rule[NonConstants, nc_]] // FullForm gives 0 ? This seems crazy to me... === Subject: Re : Principal Value integral Hello Carlo, I obtain the correct answer with 5.0 ! What version do you use? In fact, we always should be very prudent using Integrate, because there are still a lot of bugs. Just look in the archive! A good thing is always to check that NIntegrate gives the same numerical value! F.Jaccard -----Message d'origine----- DeÊ: Carlo Teubner [mailto:AskMeAndIllTellYou.@example.com] ËÊ: mathgroup@smc.vnet.net ObjetÊ: Principal Value integral The following Principal Value integral does not appear to give the correct result. Integrate[1/(x^3-1), {x, -Infinity, Infinity}, PrincipalValue->True] This gives I Pi / 3, which surely can't be right since the answer should be real. When doing it numerically, it gives the right answer: < Hi Group > I would like to define, e.g., > y = f[x] > ` z = g[y] > in such a way that when I type y I get f[x] and when I type z I get g[y], > and not g[f[x]]. For example from > Cos[y] + Exp[z] > I would like to obtain > Cos[f[x]] + Exp[g[y]] > In other words, I would like to use the same symbol (y) for two different > objects depending on whether y is in the lhs or rhs of the affectation. I > really need affectations rather than rules for y and z. > I could define different contexts for y. Is there a lighter solution ? > Geronimo It might be a good idea to share more of your project with this group so that people can suggest alternative formulations of your problem. However, you will gain much flexibility by not defining things with '=', but using transformation rules. For example, this gives you what you want: z /. {y -> f[x], z -> g[y]} If you used //. you would get exhaustive evaluation and end up with g[f[x]] - which is what you don't want. I hope this helps, David Bailey === Subject: Re: Using the same symbol for different quantities > However, you will gain much flexibility by not defining things with '=', > but using transformation rules. For example, this gives you what you want: > z /. {y -> f[x], z -> g[y]} And maybe name your rules at the beginning of your notebook, e.g. myRules = {y -> f[x], z -> g[y]} and then further down z /. myRules Gives you flexibility to change your rules if you change your notation later on. === Subject: tetrahedral Siegel Disk Julia map Siegel disks don't just happen in complex dynamics of quadratics. You can set this type of motion going on other Riemannian surfaces as Dr. McMullen suggested in his paper on K3 surfaces using an tetraheral implicit surface and a Salem based irrational number. In this simulation an Siegel disk is located on a Riemannian tetraheral surface. Clear[x,y,a,b,s,f,g,a0,t] (*tetrahedral Siegel Disk Julia map*) (* idea based on McMullen K3 ( tetrahedral) surface Siegel disk dynamics*) z=x[n-1,t]+I*y[n-1,t] z4=ComplexExpand[z^4-2*Sqrt[3]*I*z^2+1] (* Riemannian Tetrahedron polynomial from Elliptic Curves, McKean and Moll, p22, Ellipical invariants of Platonic solids*) (* j[z]=(z^4-2*Sqrt[3]*I*z^2+1)^3/(z^4+2*Sqrt[3]*I*z^2+1) *) f[n_,t_]=Re[z4] g[n_,t_]=Im[z4] gm=N[(1+Sqrt[5])/2]; a=Cos[2*Pi*gm]; b=Sin[2*Pi*gm]; digits=1500; x[n_,t_]:=x[n,t]=x[n-1,t]*a-y[n-1,t]*b+f[n,t]/4 y[n_,t_]:=y[n,t]=x[n-1,t]*b+y[n-1,t]*a+g[n,t]/4 x[0,t_]:=0.27/(1+t/2);y[0,t_]=0.01/(1+t/2); a=Flatten[Table[Table[{x[n,t],y[n,t]},{n,0, digits}],{t,1,10}],1]; ListPlot[a, PlotRange->All] Respectfully, Roger L. Bagula tftn@earthlink.net, 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 : alternative email: rlbtftn@netscape.net URL : http://home.earthlink.net/~tftn === Subject: Re: tetrahedral Siegel Disk Julia map http://www.math.harvard.edu/~ctm/gallery/menu.html A gallery of tetrahedral / K3 Siegel disk dynamics by Dr McMullen Dynamics on K3 surfaces K3 movie K3 surface Tame Wilder Ergodic Stable manifold Tame blowup Poncelet's theorem Poncelet Java (Schwartz) Dynamics on a (2,2) curve >Siegel disks don't just happen in complex dynamics of quadratics. >You can set this type of motion going on other Riemannian surfaces >as Dr. McMullen suggested in his paper on K3 surfaces >using an tetraheral implicit surface and a Salem based irrational number. >In this simulation an Siegel disk is located on a Riemannian >tetraheral surface. >Clear[x,y,a,b,s,f,g,a0,t] >(*tetrahedral Siegel Disk Julia map*) >(* idea based on McMullen K3 ( tetrahedral) surface Siegel disk dynamics*) >z=x[n-1,t]+I*y[n-1,t] >z4=ComplexExpand[z^4-2*Sqrt[3]*I*z^2+1] >(* Riemannian Tetrahedron polynomial from Elliptic Curves, McKean and Moll, > p22, Ellipical invariants of Platonic solids*) >(* j[z]=(z^4-2*Sqrt[3]*I*z^2+1)^3/(z^4+2*Sqrt[3]*I*z^2+1) *) >f[n_,t_]=Re[z4] >g[n_,t_]=Im[z4] >gm=N[(1+Sqrt[5])/2]; >a=Cos[2*Pi*gm]; >b=Sin[2*Pi*gm]; >digits=1500; >x[n_,t_]:=x[n,t]=x[n-1,t]*a-y[n-1,t]*b+f[n,t]/4 >y[n_,t_]:=y[n,t]=x[n-1,t]*b+y[n-1,t]*a+g[n,t]/4 >x[0,t_]:=0.27/(1+t/2);y[0,t_]=0.01/(1+t/2); >a=Flatten[Table[Table[{x[n,t],y[n,t]},{n,0, digits}],{t,1,10}],1]; >ListPlot[a, PlotRange->All] >Respectfully, Roger L. Bagula >tftn@earthlink.net, 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 : >alternative email: rlbtftn@netscape.net >URL : http://home.earthlink.net/~tftn -- Respectfully, Roger L. Bagula tftn@earthlink.net, 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 : alternative email: rlbtftn@netscape.net URL : http://home.earthlink.net/~tftn === Subject: launching a kernel on a remote linux machine through ssh from a linux machine I am trying to launch a kernel on a faster linux machine (call it fast.here.com, IP address 5.5.5.5) and connect it to my local front end (on lamo.here.com, IP address 7.7.7.7). Both run Mathematica 5.0.1.0 on Fedora Linux (3 and 2, respectively). The connection goes through ssh. On the front end on lamo.here.com I now try to add a kernel with Kernel Configuration Options.... If I select as the remote machine the same as my local machine lamo.here.com, everything works fine. I know I could do this without going through TCP/IP, but just for checking it out: Arguments passed to MLOpen: -LinkMode Listen -LinkProtocol TCPIP String passed to shell to launch kernel: ssh lamo.here.com math -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName `linkname` Choosing this to be the notebook's kernel, once I execute the first calculation it pops up a box saying Link created on 35945@7.7.7.7,35946@7.7.7.7, then asks for the password for lamo.here.com, and everything works fine; I can run calculations as usual. The problem appears when I change the above string to ssh fast.here.com math -mathlink -LinkMode Connect -LinkProtocol TCPIP -LinkName `linkname` (note that only the computer name has changed). When I do the first calculation, I still get a box saying Link created on 35950@7.7.7.7,35951@7.7.7.7, then one asking for the password for fast.here.com. But then it stops doing anything. The result is that I have no kernel running, neither on fast.here.com nor on lamo.here.com, and no result is being displayed. Does anyone know what I'm doing wrong? I've been searching through old messages on this forum and could not figure it out. Walter. === Subject: Re: launching a kernel on a remote linux machine through ssh from a linux machine Hi Walter, on my machine I launch remote kernel with the following settings (copied) Arguments to pass to MLOpen: -LinkMode Connect -LinkProtocol TCP -LinkName 3007 -LinkHost remote.xxx.xxx.xxx String to launch kernel ssh user@remote.xxx.xxx.xxx math -mathlink -LinkMode Listen -LinkProtocol TCP -LinkName 3007 -LinkHost localhost.xxx.xxx.xxx Instead of 3007 you can chose any other port, which is used to data transfer. I have heard that there may be problems if your remote host is after fireware, which dissalow use of these high ports. Just note. that I use Listen for ssh started kernel and pass Connect to MLOpen. You do it in different order. This not worked for me. Also I marked translate returns box. > I am trying to launch a kernel on a faster linux machine (call it > fast.here.com, IP address 5.5.5.5) and connect it to my local > front end (on lamo.here.com, IP address 7.7.7.7). Both run > Mathematica 5.0.1.0 on Fedora Linux (3 and 2, respectively). The > connection goes through ssh. > On the front end on lamo.here.com I now try to add a kernel with > Kernel Configuration Options.... > If I select as the remote machine the same as my local machine > lamo.here.com, everything works fine. I know I could do this without > going through TCP/IP, but just for checking it out: > Arguments passed to MLOpen: > -LinkMode Listen -LinkProtocol TCPIP > String passed to shell to launch kernel: > ssh lamo.here.com math -mathlink -LinkMode Connect > -LinkProtocol TCPIP -LinkName `linkname` > Choosing this to be the notebook's kernel, once I execute the first > calculation it pops up a box saying Link created on > 35945@7.7.7.7,35946@7.7.7.7, then asks for the password for > lamo.here.com, and everything works fine; I can run calculations as > usual. > The problem appears when I change the above string to > ssh fast.here.com math -mathlink -LinkMode Connect > -LinkProtocol TCPIP -LinkName `linkname` > (note that only the computer name has changed). When I do the first > calculation, I still get a box saying Link created on > 35950@7.7.7.7,35951@7.7.7.7, then one asking for the password for > fast.here.com. But then it stops doing anything. The result is that I > have no kernel running, neither on fast.here.com nor on lamo.here.com, > and no result is being displayed. > Does anyone know what I'm doing wrong? I've been searching through old > messages on this forum and could not figure it out. > Walter. -- Arturas Acus === Subject: Re: launching a kernel on a remote linux machine through ssh from a linux machine > I am trying to launch a kernel on a faster linux machine (call it > fast.here.com, IP address 5.5.5.5) and connect it to my local > front end (on lamo.here.com, IP address 7.7.7.7). Both run > Mathematica 5.0.1.0 on Fedora Linux (3 and 2, respectively). The > connection goes through ssh. > Does anyone know what I'm doing wrong? I've been searching through > old messages on this forum and could not figure it out. Hi Walter, does the kernel start without problems when you try ssh fast.here.com math on a text console, or do you get an error message? Marcus -- What is life but a series of inspired follies? -- George Bernard Shaw === Subject: Re: launching a kernel on a remote linux machine through ssh from a linux machine > does the kernel start without problems when you try > ssh fast.here.com math > on a text console, or do you get an error message? Yes, typing ssh fast.here.com math gives me a text-mode kernel on fast without any problems. Walter. === Subject: Re: launching a kernel on a remote linux machine through ssh from a linux machine Did I I say use a RAW MathLink connection? On second thoughts don't. Yas > I am trying to launch a kernel on a faster linux machine (call it > fast.here.com, IP address 5.5.5.5) and connect it to my local > front end (on lamo.here.com, IP address 7.7.7.7). Both run > Mathematica 5.0.1.0 on Fedora Linux (3 and 2, respectively). The > connection goes through ssh. > On the front end on lamo.here.com I now try to add a kernel with > Kernel Configuration Options.... > If I select as the remote machine the same as my local machine > lamo.here.com, everything works fine. I know I could do this without > going through TCP/IP, but just for checking it out: > Arguments passed to MLOpen: > -LinkMode Listen -LinkProtocol TCPIP > String passed to shell to launch kernel: > ssh lamo.here.com math -mathlink -LinkMode Connect > -LinkProtocol TCPIP -LinkName `linkname` > Choosing this to be the notebook's kernel, once I execute the first > calculation it pops up a box saying Link created on > 35945@7.7.7.7,35946@7.7.7.7, then asks for the password for > lamo.here.com, and everything works fine; I can run calculations as > usual. > The problem appears when I change the above string to > ssh fast.here.com math -mathlink -LinkMode Connect > -LinkProtocol TCPIP -LinkName `linkname` > (note that only the computer name has changed). When I do the first > calculation, I still get a box saying Link created on > 35950@7.7.7.7,35951@7.7.7.7, then one asking for the password for > fast.here.com. But then it stops doing anything. The result is that I > have no kernel running, neither on fast.here.com nor on lamo.here.com, > and no result is being displayed. > Does anyone know what I'm doing wrong? I've been searching through old > messages on this forum and could not figure it out. > Walter. === Just some thoughts: Are the username the same for lamo and fast. If different then the string passed to the shell should read ssh username_on_fast@fast.here.com string to launch kernel and use the Raw MathLink connection. In your case you don't have to translate returns either. And firewall settings at the other end and your end? But it sounds like all is fine for you if you get a dialogue as you describe. Yas > I am trying to launch a kernel on a faster linux machine (call it > fast.here.com, IP address 5.5.5.5) and connect it to my local > front end (on lamo.here.com, IP address 7.7.7.7). Both run > Mathematica 5.0.1.0 on Fedora Linux (3 and 2, respectively). The > connection goes through ssh. > On the front end on lamo.here.com I now try to add a kernel with > Kernel Configuration Options.... > If I select as the remote machine the same as my local machine > lamo.here.com, everything works fine. I know I could do this without > going through TCP/IP, but just for checking it out: > Arguments passed to MLOpen: > -LinkMode Listen -LinkProtocol TCPIP > String passed to shell to launch kernel: > ssh lamo.here.com math -mathlink -LinkMode Connect > -LinkProtocol TCPIP -LinkName `linkname` > Choosing this to be the notebook's kernel, once I execute the first > calculation it pops up a box saying Link created on > 35945@7.7.7.7,35946@7.7.7.7, then asks for the password for > lamo.here.com, and everything works fine; I can run calculations as > usual. > The problem appears when I change the above string to > ssh fast.here.com math -mathlink -LinkMode Connect > -LinkProtocol TCPIP -LinkName `linkname` > (note that only the computer name has changed). When I do the first > calculation, I still get a box saying Link created on > 35950@7.7.7.7,35951@7.7.7.7, then one asking for the password for > fast.here.com. But then it stops doing anything. The result is that I > have no kernel running, neither on fast.here.com nor on lamo.here.com, > and no result is being displayed. > Does anyone know what I'm doing wrong? I've been searching through old > messages on this forum and could not figure it out. > Walter. === Subject: Re: launching a kernel on a remote linux machine through ssh from a linux machine Hi Walter, Its probably a typo, but your message indicates that Mathematica is connecting to lamo both times. What happens if you explicitely start the remote kernel? In other words, kernel menu -> start kernel -> remote. Also, check whether or not the remote kernel is actually starting. After trying to start it with Mathematica, log in to fast and 'ps ax | grep MathKernel' or whatever to see if the process actually exists. You could also run 'w'tto see if the connection was made properly. I assume you can manually SSH into fast from lamo. Good luck, Daniel === Subject: Re: launching a kernel on a remote linux machine through ssh from a linux machine > Its probably a typo, but your message indicates that Mathematica is connecting > to lamo both times. I think the message Link created on 35950@7.7.7.7,35951@7.7.7.7 refers to the computer which is running the front end, which is lamo in both cases. > What happens if you explicitely start the remote kernel? In other words, > kernel menu -> start kernel -> remote. That does not work either. It asks for a password but at the end the kernel is not running. > Also, check whether or not the remote kernel is actually starting. No, it is not starting. > I assume you can manually SSH into fast from lamo. Sure: running a ssh lamo.here.com math gives me a text-mode kernel, as expected. Walter. === Subject: Re: launching a kernel on a remote linux machine through ssh from a linux machine Hi Walter, I can't get this working either. Here's what I learned, though. The two little boxes under Advanced Options can be tested through normal tools. The first box, -LinkMode Listen -LinkProtocol TCPIP -LinkOptions MLDontInteract is roughly equivalent to typing (on lamo) LinkCreate[LinkProtocol->tcpip] (Does anyone know what integer MLDontInteract translates to?) The second box is simply the SSH command. The closest I came to getting this working was with the following sequence of events. Maybe you can see what I'm doing wrong. Mathematica input is prefixed by system:> ; shell input by system>> ; notes/musings by .... Note that firewalling restricts the ports I can use; an available port number is designated as PORT1. lamo:> link=LinkCreate[PORT1, LinkProtocol->tcpip] .... Why does this command open up 2 ports?? .... LinkCreate[PORT1,PORT2] gives me control over both... lamo>> netstat -at .... (Linux command) see that PORT1 is open for listening lamo>> ssh -R PORT1:localhost:PORT1 username@fast fast>> netstat -a -P tcp -f inet .... (Solaris command) see that SSH opened PORT1 for forwarding fast>> math fast:> l=LinkConnect[PORT1, LinkProtocol->tcpip] fast:> LinkWrite[l,hello??] .... link is dead... fast:> Exit fast>> exit lamo:> LinkClose[l] Maybe a similar line of attack works? If so, packaging up the correct steps into the format for the kernel dialog shouldn't be too hard. The only useful newsgroup post I could find was http://forums.wolfram.com/mathgroup/archive/1999/Nov/msg00264.html The page it refers to is gone, but I think it moved to http://support.wolfram.com/mathematica/kernel/configure/windows/mannonunix.h tml However, this information is for MS Windows from a few years ago. Later, Daniel === Subject: Re: launching a kernel on a remote linux machine through ssh from a linux machine > lamo:> link=LinkCreate[PORT1, LinkProtocol->tcpip] > .... Why does this command open up 2 ports?? > .... LinkCreate[PORT1,PORT2] gives me control over both... > lamo>> netstat -at > .... (Linux command) see that PORT1 is open for listening here is where I think I have the problem: netstat -at on lamo gives me no open ports that are due to my executing the LinkCreate command on lamo. I suppose my firewall is too paranoid (default Fedora Core 2 settings). Would anyone out there know how to fix this? I use iptables for a firewall. Actually, just saying LinkCreate[LinkProtocol->tcpip] figures out two random port numbers by itself. Walter. === Subject: Re: launching a kernel on a remote linux machine through ssh from a linux machine Comment on the part about firewall and named ports. I once tried everything to get the remote mathkernel to work through a SSH-forwarded port, with no success. Mathematica creates two ports for the tcp-traffic. The first port is mainly used but there is some tcp-traffic in the other port at the beginning of the session, and the link won't work without it. This second port seems to be totally undocumented feature, and it's number can't be controlled by the user. Because the number of this port can vary, it is impossible to use SSH-tunnels or put a hole in the firewall. This is too bad, because different security-issues must be taken into account nowadays, and Mathematica's remote kernel implementation, in my oppinnion, is not up to date. ... > The closest I came to getting this working was with the following > sequence of events. Maybe you can see what I'm doing wrong. > Mathematica input is prefixed by system:> ; shell input by system>> > ; notes/musings by .... Note that firewalling restricts the ports I > can use; an available port number is designated as PORT1. ... -- Antti Penttil.8a Antti.I.Penttila@helsinki.fi.removethis === Subject: Re: Mathematica&SuSe 9.2: Inputformulars disabled I know for a fact that there is a patch that is well known under SuSe. I can't remember the details but it's a SuSe problem that has never been fixed. I found it under the archives a year or so ago. Sorry I can't remember more but I do know that the Wolfram people know and can tell you how to fix it. The fix is actually on the SuSe web site as I recall. Cliff --- Detlef Mueller > Hello! > I am running Mathematica 4.1 under Suse Linux 9.2 > and > there are strange effects: > Starting any Windowmanager (i.e fvwm or kde) the > regular > way (with startx) and callin Mathematica, > Mathematica starts ... > but any inputformular is disabled, for example the > input > of keywords in the help, or the input of filenames > to > save. > In short Mathematica is useless. > Starting the X-Window with xinit, > then starting the windowmanager fvwm > or twm, > then running mathematica and it works. > The above procedure > with Windowmanager kde fails. > (For the ones thinking of a deja vue: > no one answered. > maybe in the mean time there are some ideas?) > greetings > Detlef === Subject: Newbie Question I'm using Mathematica on Windows, on a computer with a 1600x1200 display. The default sizes for display fonts, particularly in the notebook window are smaller than I would like. Could someone please give me some advice on how to change the default size of text so that it's bigger? I'd appreciate any and all advice. Peter Petto Bay Village, OH === Subject: Re: [Newbie Question] changing default font sizes > I'm using Mathematica on Windows, on a computer with a 1600x1200 > display. The default sizes for display fonts, particularly in the > notebook window are smaller than I would like. > Could someone please give me some advice on how to change the > default size of text so that it's bigger? > I'd appreciate any and all advice. Hi Peter, some possibilities are... 1. use Format -> Magnification 2. go to Format -> Option Inspector... -> Formatting Options -> Font Options select Scope: notebook (or global) and choose your favorite font size. 3. edit the style sheet: Format -> Edit Style Sheet... Marcus PS. please use descriptive subject lines -- God knows. Or guesses. -- John Irving === Subject: Re: UnitStep If we're dealing with functional calculus, the derivative of UnitStep is DiracDelta. In that case, the problem is in D (not Integrate), because it doesn't differentiate UnitStep consistently in the two versions of f. My naive understanding of the indefinite integral is a Lebesgue integral that (conceptually) leaves the lower limit unspecified, which implies an arbitrary additive constant -- not a piecewise constant function. Defining antiderivative to mean a right-inverse of D (D[Integrate[g,x],x] == g[x] a.e.) is defensible in the right context, but 1) That's not everybody's default interpretation. (It's certainly not mine!) 2) It's not documented in Help. 3) It breaks the Fundamental Theorem of Integral Calculus. On that point, here's an example: (inputs) c[x_] = Piecewise[{{0, x < 1}, {1, x < 2}, {2, x < 3}}, 4]; integral[x_] = Integrate[x^2, x] + c[x]; Derivative[1][integral][x] integral[2.5] - integral[1.5] Integrate[x^2, {x, 1.5, 2.5}] (outputs) x^2 + Piecewise[{{0, x < 1 || 1 < x < 2 || 2 < x < 3 || x > 3}}, Indeterminate] 5.083333333333333 4.083333333333333 If your definition of indefinite integral doesn't satisfy the Fundamental Theorem, are you SURE it's the right definition? Bobby >>> I don't know why you think it's wrong. >> Because THESE are the right answers: >> f[x_] = (1/x)*UnitStep[x - 1]; >> g[x_] = D[f[x], {x}] >> h[x_] = Simplify[Integrate[g[x], x]] >> DiracDelta[-1 + x]/x - UnitStep[-1 + x]/x^2 >> UnitStep[-1 + x]/x > I agree that's _a_ right answer for the antiderivative. > But it's not the only right answer, of course. The answer > Piecewise[{{0, x <= 1}}, -1 + 1/x], which you'd claimed > to be wrong, is also a right answer (and, being > continuous, it is, in a sense, a nicer right answer). >> The x==0 case in Piecewise is a red herring, BTW. It's >> removable, yet Mathematica lets it become a problem. >> f[x_] = Piecewise[{{0, x == 0}, {(1/x)*UnitStep[x - 1], True}}]; >> g[x_] = D[f[x], {x}] >> h[x_] = Integrate[g[x], x] >> Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] >> Piecewise[{{0, x <= 1}}, -1 + 1/x] > lets it become a problem. The results are fine. >> Both definitions above for f are identical, point by point and in >> form at the only discontinuity. I'm not saying Mathematica should >> have gotten this right, but I _am_ saying it got it wrong. > And I still don't know why you think that Mathematica got it wrong. > The answer Piecewise[{{0, x <= 1}}, -1 + 1/x] is _a_ correct one. > I should also take this opportunity to correct something I'd said > previously. I had said But due to the discontinuity, an antiderivative > of the derivative of f need not be f itself. I'd actually intended to say > that, due to the discontinuity, an antiderivative of the derivative of f > need not merely differ from f by a constant. > David Cantrell >>> In version 5.1 we have a different choice: >>> >>> (inputs) >>> f[p_] = Piecewise[{{0, p == 0}, {(1/p) UnitStep[p - 1], True}}]; >>> Integrate[f@x, {x, -5, 5}] >>> D[f@x, {x}] >>> Integrate[%, x] >>> Plot[f@x, {x, -5, 5}] >>> >>> (outputs) >>> Log[5] >>> Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] >>> Piecewise[{{0, x <= 1}}, -1 + 1/x] >>> (and a plot) >>> >>> This time D followed by Integrate is evaluated, but WRONG. >> >> I don't know why you think it's wrong. But in fact, it is not only >> right, but also clever. Note that the original function is >> discontinuous, as is its derivative. Then when we Integrate >> that, we need to get an antiderivative of the derivative of f. >> But due to the discontinuity, an antiderivative of the derivative >> of f need not be f itself. To confirm that >> the result of Integrate is correct, just differentiate that result >> >> Piecewise[{{0, x <= 1}}, -1 + 1/x] >> >> in your head. Don't you get >> >> Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] >> >> just as desired? >> >> The antiderivative is clever because Mathematica chose -1 as the >> constant of integration in the part for x > 1, thereby nicely making >> the antiderivative continuous. >> >> David Cantrell -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Re: UnitStep >> I don't know why you think it's wrong. > Because THESE are the right answers: > f[x_] = (1/x)*UnitStep[x - 1]; > g[x_] = D[f[x], {x}] > h[x_] = Simplify[Integrate[g[x], x]] > DiracDelta[-1 + x]/x - UnitStep[-1 + x]/x^2 > UnitStep[-1 + x]/x I agree that's _a_ right answer for the antiderivative. But it's not the only right answer, of course. The answer Piecewise[{{0, x <= 1}}, -1 + 1/x], which you'd claimed to be wrong, is also a right answer (and, being continuous, it is, in a sense, a nicer right answer). > The x==0 case in Piecewise is a red herring, BTW. It's > removable, yet Mathematica lets it become a problem. > f[x_] = Piecewise[{{0, x == 0}, {(1/x)*UnitStep[x - 1], True}}]; > g[x_] = D[f[x], {x}] > h[x_] = Integrate[g[x], x] > Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] > Piecewise[{{0, x <= 1}}, -1 + 1/x] lets it become a problem. The results are fine. > Both definitions above for f are identical, point by point and in > form at the only discontinuity. I'm not saying Mathematica should > have gotten this right, but I _am_ saying it got it wrong. And I still don't know why you think that Mathematica got it wrong. The answer Piecewise[{{0, x <= 1}}, -1 + 1/x] is _a_ correct one. I should also take this opportunity to correct something I'd said previously. I had said But due to the discontinuity, an antiderivative of the derivative of f need not be f itself. I'd actually intended to say that, due to the discontinuity, an antiderivative of the derivative of f need not merely differ from f by a constant. David Cantrell >> In version 5.1 we have a different choice: >> >> (inputs) >> f[p_] = Piecewise[{{0, p == 0}, {(1/p) UnitStep[p - 1], True}}]; >> Integrate[f@x, {x, -5, 5}] >> D[f@x, {x}] >> Integrate[%, x] >> Plot[f@x, {x, -5, 5}] >> >> (outputs) >> Log[5] >> Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] >> Piecewise[{{0, x <= 1}}, -1 + 1/x] >> (and a plot) >> >> This time D followed by Integrate is evaluated, but WRONG. > I don't know why you think it's wrong. But in fact, it is not only > right, but also clever. Note that the original function is > discontinuous, as is its derivative. Then when we Integrate > that, we need to get an antiderivative of the derivative of f. > But due to the discontinuity, an antiderivative of the derivative > of f need not be f itself. To confirm that > the result of Integrate is correct, just differentiate that result > Piecewise[{{0, x <= 1}}, -1 + 1/x] > in your head. Don't you get > Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] > just as desired? > The antiderivative is clever because Mathematica chose -1 as the > constant of integration in the part for x > 1, thereby nicely making > the antiderivative continuous. > David Cantrell === Subject: Re: UnitStep >> I don't know why you think it's wrong. Because THESE are the right answers: f[x_] = (1/x)*UnitStep[x - 1]; g[x_] = D[f[x], {x}] h[x_] = Simplify[Integrate[g[x], x]] DiracDelta[-1 + x]/x - UnitStep[-1 + x]/x^2 UnitStep[-1 + x]/x The x==0 case in Piecewise is a red herring, BTW. It's removable, yet Mathematica lets it become a problem. f[x_] = Piecewise[{{0, x == 0}, {(1/x)*UnitStep[x - 1], True}}]; g[x_] = D[f[x], {x}] h[x_] = Integrate[g[x], x] Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] Piecewise[{{0, x <= 1}}, -1 + 1/x] Both definitions above for f are identical, point by point and in form at the only discontinuity. I'm not saying Mathematica should have gotten this right, but I _am_ saying it got it wrong. (That's life, when we use a CAS.) The OP's original problem should not have occurred at all. UnitStep[x-c] f[x] is a well-behaved function if f[x] is well-behaved for x >= c. The behavior of f on x < c is (or should be) irrelevant. Bobby >> In version 5.1 we have a different choice: >> (inputs) >> f[p_] = Piecewise[{{0, p == 0}, {(1/p) UnitStep[p - 1], True}}]; >> Integrate[f@x, {x, -5, 5}] >> D[f@x, {x}] >> Integrate[%, x] >> Plot[f@x, {x, -5, 5}] >> (outputs) >> Log[5] >> Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] >> Piecewise[{{0, x <= 1}}, -1 + 1/x] >> (and a plot) >> This time D followed by Integrate is evaluated, but WRONG. > I don't know why you think it's wrong. But in fact, it is not only right, > but also clever. Note that the original function is discontinuous, as is > its derivative. Then when we Integrate that, we need to get an > antiderivative of the derivative of f. But due to the discontinuity, an > antiderivative of the derivative of f need not be f itself. To confirm that > the result of Integrate is correct, just differentiate that result > Piecewise[{{0, x <= 1}}, -1 + 1/x] > in your head. Don't you get > Piecewise[{{0, x < 1}, {-(1/x^2), x > 1}}, Indeterminate] > just as desired? > The antiderivative is clever because Mathematica chose -1 as the constant > of integration in the part for x > 1, thereby nicely making the > antiderivative continuous. > David Cantrell -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Re: UnitStep >Why does the following give me 'indeterminate, infinite expression >encountered', etc. instead of zero.... >(1/p) UnitStep[p-1] /.p->0 Mathematica replaces p with 0 everywhere then evaluates the resulting expression. Since UnitStep[p-1]/.p->0 is 0, the result is 0/0 which is indeterminate. You can verify this is what is happening by doing Trace[1/p UnitStep[p-1]/.p->0] -- To reply via email subtract one hundred and four === Subject: Re: limits I was confused by your proof for (3), so here goes my attempt. It's patterned after yours, but I've made the choice of n far more explicit. Here are some manual steps: Inequality[Sum[1/i, {i, n}], Equal, Sum[1/i, {i, k}] + Sum[1/i, {i, k + 1, n}], Less, k + Sum[1/i, {i, k + 1, n}], Equal, k + Sum[1/k, {i, k + 1, n}] + Sum[1/i - 1/k, {i, k + 1, n}], Less, k + (n - k)/k + Sum[1/(k + 1) - 1/k, {i, k + 1, n}], Equal, k + (n - k)/k - (n - k)/(k*(k + 1))]; The last term is sumBound = Last@% // Simplify (k^2 + n)/(1 + k) Check to see that sumBound/n is monotone decreasing in n: Simplify[D[sumBound/n, n]] -(k^2/((1 + k)*n^2)) Now solve for n: Solve[sumBound/n == 1/k, n] {{n -> k^3}} Hence, for n > k^3, the OP's Sum[...]/n is less than 1/k. Bobby >> hello all, >> Would you please help me in any of these limits: >> Prove: >> lim(1^p+2^p+3^p+...+n^p)/n^(p+1)= 1/(p+1) >> n->infinity >> lim(1^p+2^p+3^p+...+n^p- n/(1+p))= 0.5 >> n->infinity >> lim(1/n)(1+1/2+1/3+...+1/n)=0 >> n->infinity > I am not really sure whether I should try to answer this question since: > 1. These problems require proofs. This is a Mathematica list and not a > math list, and proofs are not something Mathematica does very well at > this stage. > 2. These look like some kind of homework problems and as a math > professor I guess I should disapprove of this method of problem > solving. > Still the problems were interesting enough to tempt me to solve them so > I will give a brief indication how they the first and the last could be > solved. The second one, in its present form, seems wrong. > 1. I shall assume that p>-1. Consider the integral: > Integrate[x^p, {x, 0, 1}, Assumptions -> p > -1] > 1/(p + 1) > Now compute it using the method of Riemann sums. That is, divide the > interval [0,1] into n equal subintervals of length 1/n. The Riemann sum > is precisely > Sum[(i/n)^p*(1/n), {i, 0, n}] > which is just Sum[i^p/n^(p+1),[i,0,n}] > Since the limit must be equal to the integral you get your answer. > 3. It is enough to show that for every integer k, the sum Sum[1/i, > {i,1,n}] can be made less than n/k by taking n large enough. Any such > sum looks has the form 1+1/2+1/3 +...+1/k (terms >=1/k) + 1/(k+1) + > 1/(k+2)+.... . The first k summands are all greater than 1/k and their > sum is less than k. All the remaining terms are less than 1/k with the > difference at least 1/(k(k+1)). It it now obvious that if n is large > enough, that is if you have enough terms smaller than 1/k, than this > total sum can be made less than the sum you would have if all the terms > were equal to 1/k, in other words it is less than n/k. Hence n*(n/k) < > 1/k. This shows that (1/n)*Sum[1/i, {i,1,n}] is less than 1/k for every > positive integer k, provided n is large enough. This proves part 3. > 2) Part 2), at least as you stated it is false. We can show it using > Mathematica (or equally easily by hand). > s[p_] := Sum[1/p^i - n/(1 + p), {i, 1, n}] // Simplify > s[p] > (((p + 1)*(p^n - 1))/p^n - n^2*(p - 1))/(p^2 - 1) > Limit[s[1], n -> Infinity] > -Infinity > Limit[s[2], n -> Infinity] > -Infinity > Andrzej Kozlowski > Chiba, Japan > http://www.akikoz.net/~andrzej/ > http://www.mimuw.edu.pl/~akoz/ -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Re: limits I was wrong again (all this hurry!) but the conclusion is still the same, statement 2 is false. In[1]:= s[p_] := Simplify[Sum[i^p, {i, 1, n}] - n/(1 + p)] In[2]:= s[1] Out[2]= n^2/2 In[3]:= s[2] Out[3]= (1/6)*n*(2*n^2 + 3*n - 1) In[4]:= Limit[s[1], n -> Infinity] Out[4]= Infinity In[5]:= Limit[s[2], n -> Infinity] Out[5]= Infinity Andrzej > There was an error in my reply, which however makes no difference to > the final outcome. > The correct definition of s in problem 2 is: > s[p_] := Simplify[Sum[1/i^p - n/(1 + p), {i, 1, n}]] > which gives: > s[p] > ((p + 1)*HarmonicNumber[n, p] - n^2)/(p + 1) > With that: > Limit[s[1], n -> Infinity] > -Infinity > and > Limit[s[2], n -> Infinity] > -Infinity > Which in any case shows that the statement in part 2 is false. > hello all, > Would you please help me in any of these limits: > Prove: > lim(1^p+2^p+3^p+...+n^p)/n^(p+1)= 1/(p+1) > n->infinity > lim(1^p+2^p+3^p+...+n^p- n/(1+p))= 0.5 > n->infinity > lim(1/n)(1+1/2+1/3+...+1/n)=0 > n->infinity >> I am not really sure whether I should try to answer this question >> since: >> 1. These problems require proofs. This is a Mathematica list and not >> a math list, and proofs are not something Mathematica does very well >> at this stage. >> 2. These look like some kind of homework problems and as a math >> professor I guess I should disapprove of this method of problem >> solving. >> Still the problems were interesting enough to tempt me to solve them >> so I will give a brief indication how they the first and the last >> could be solved. The second one, in its present form, seems wrong. >> 1. I shall assume that p>-1. Consider the integral: >> Integrate[x^p, {x, 0, 1}, Assumptions -> p > -1] >> 1/(p + 1) >> Now compute it using the method of Riemann sums. That is, divide the >> interval [0,1] into n equal subintervals of length 1/n. The Riemann >> sum is precisely >> Sum[(i/n)^p*(1/n), {i, 0, n}] >> which is just Sum[i^p/n^(p+1),[i,0,n}] >> Since the limit must be equal to the integral you get your answer. >> 3. It is enough to show that for every integer k, the sum Sum[1/i, >> {i,1,n}] can be made less than n/k by taking n large enough. Any such >> sum looks has the form 1+1/2+1/3 +...+1/k (terms >=1/k) + 1/(k+1) + >> 1/(k+2)+.... . The first k summands are all greater than 1/k and >> their sum is less than k. All the remaining terms are less than 1/k >> with the difference at least 1/(k(k+1)). It it now obvious that if n >> is large enough, that is if you have enough terms smaller than 1/k, >> than this total sum can be made less than the sum you would have if >> all the terms were equal to 1/k, in other words it is less than n/k. >> Hence n*(n/k) < 1/k. This shows that (1/n)*Sum[1/i, {i,1,n}] is less >> than 1/k for every positive integer k, provided n is large enough. >> This proves part 3. >> 2) Part 2), at least as you stated it is false. We can show it using >> Mathematica (or equally easily by hand). >> s[p_] := Sum[1/p^i - n/(1 + p), {i, 1, n}] // Simplify >> s[p] >> (((p + 1)*(p^n - 1))/p^n - n^2*(p - 1))/(p^2 - 1) >> Limit[s[1], n -> Infinity] >> -Infinity >> Limit[s[2], n -> Infinity] >> -Infinity >> Andrzej Kozlowski >> Chiba, Japan >> http://www.akikoz.net/~andrzej/ >> http://www.mimuw.edu.pl/~akoz/ === Subject: Re: limits There was an error in my reply, which however makes no difference to the final outcome. The correct definition of s in problem 2 is: s[p_] := Simplify[Sum[1/i^p - n/(1 + p), {i, 1, n}]] which gives: s[p] ((p + 1)*HarmonicNumber[n, p] - n^2)/(p + 1) With that: Limit[s[1], n -> Infinity] -Infinity and Limit[s[2], n -> Infinity] -Infinity Which in any case shows that the statement in part 2 is false. >> hello all, >> Would you please help me in any of these limits: >> Prove: >> lim(1^p+2^p+3^p+...+n^p)/n^(p+1)= 1/(p+1) >> n->infinity >> lim(1^p+2^p+3^p+...+n^p- n/(1+p))= 0.5 >> n->infinity >> lim(1/n)(1+1/2+1/3+...+1/n)=0 >> n->infinity > I am not really sure whether I should try to answer this question > since: > 1. These problems require proofs. This is a Mathematica list and not a > math list, and proofs are not something Mathematica does very well at > this stage. > 2. These look like some kind of homework problems and as a math > professor I guess I should disapprove of this method of problem > solving. > Still the problems were interesting enough to tempt me to solve them > so I will give a brief indication how they the first and the last > could be solved. The second one, in its present form, seems wrong. > 1. I shall assume that p>-1. Consider the integral: > Integrate[x^p, {x, 0, 1}, Assumptions -> p > -1] > 1/(p + 1) > Now compute it using the method of Riemann sums. That is, divide the > interval [0,1] into n equal subintervals of length 1/n. The Riemann > sum is precisely > Sum[(i/n)^p*(1/n), {i, 0, n}] > which is just Sum[i^p/n^(p+1),[i,0,n}] > Since the limit must be equal to the integral you get your answer. > 3. It is enough to show that for every integer k, the sum Sum[1/i, > {i,1,n}] can be made less than n/k by taking n large enough. Any such > sum looks has the form 1+1/2+1/3 +...+1/k (terms >=1/k) + 1/(k+1) + > 1/(k+2)+.... . The first k summands are all greater than 1/k and their > sum is less than k. All the remaining terms are less than 1/k with the > difference at least 1/(k(k+1)). It it now obvious that if n is large > enough, that is if you have enough terms smaller than 1/k, than this > total sum can be made less than the sum you would have if all the > terms were equal to 1/k, in other words it is less than n/k. Hence > n*(n/k) < 1/k. This shows that (1/n)*Sum[1/i, {i,1,n}] is less than > 1/k for every positive integer k, provided n is large enough. This > proves part 3. > 2) Part 2), at least as you stated it is false. We can show it using > Mathematica (or equally easily by hand). > s[p_] := Sum[1/p^i - n/(1 + p), {i, 1, n}] // Simplify > s[p] > (((p + 1)*(p^n - 1))/p^n - n^2*(p - 1))/(p^2 - 1) > Limit[s[1], n -> Infinity] > -Infinity > Limit[s[2], n -> Infinity] > -Infinity > Andrzej Kozlowski > Chiba, Japan > http://www.akikoz.net/~andrzej/ > http://www.mimuw.edu.pl/~akoz/ === Subject: Re: limits > hello all, > Would you please help me in any of these limits: > Prove: > lim(1^p+2^p+3^p+...+n^p)/n^(p+1)= 1/(p+1) > n->infinity > lim(1^p+2^p+3^p+...+n^p- n/(1+p))= 0.5 > n->infinity > lim(1/n)(1+1/2+1/3+...+1/n)=0 > n->infinity I am not really sure whether I should try to answer this question since: 1. These problems require proofs. This is a Mathematica list and not a math list, and proofs are not something Mathematica does very well at this stage. 2. These look like some kind of homework problems and as a math professor I guess I should disapprove of this method of problem solving. Still the problems were interesting enough to tempt me to solve them so I will give a brief indication how they the first and the last could be solved. The second one, in its present form, seems wrong. 1. I shall assume that p>-1. Consider the integral: Integrate[x^p, {x, 0, 1}, Assumptions -> p > -1] 1/(p + 1) Now compute it using the method of Riemann sums. That is, divide the interval [0,1] into n equal subintervals of length 1/n. The Riemann sum is precisely Sum[(i/n)^p*(1/n), {i, 0, n}] which is just Sum[i^p/n^(p+1),[i,0,n}] Since the limit must be equal to the integral you get your answer. 3. It is enough to show that for every integer k, the sum Sum[1/i, {i,1,n}] can be made less than n/k by taking n large enough. Any such sum looks has the form 1+1/2+1/3 +...+1/k (terms >=1/k) + 1/(k+1) + 1/(k+2)+.... . The first k summands are all greater than 1/k and their sum is less than k. All the remaining terms are less than 1/k with the difference at least 1/(k(k+1)). It it now obvious that if n is large enough, that is if you have enough terms smaller than 1/k, than this total sum can be made less than the sum you would have if all the terms were equal to 1/k, in other words it is less than n/k. Hence n*(n/k) < 1/k. This shows that (1/n)*Sum[1/i, {i,1,n}] is less than 1/k for every positive integer k, provided n is large enough. This proves part 3. 2) Part 2), at least as you stated it is false. We can show it using Mathematica (or equally easily by hand). s[p_] := Sum[1/p^i - n/(1 + p), {i, 1, n}] // Simplify s[p] (((p + 1)*(p^n - 1))/p^n - n^2*(p - 1))/(p^2 - 1) Limit[s[1], n -> Infinity] -Infinity Limit[s[2], n -> Infinity] -Infinity Andrzej Kozlowski Chiba, Japan http://www.akikoz.net/~andrzej/ http://www.mimuw.edu.pl/~akoz/ === Subject: limits hello all, Would you please help me in any of these limits: Prove: lim(1^p+2^p+3^p+...+n^p)/n^(p+1)= 1/(p+1) n->infinity lim(1^p+2^p+3^p+...+n^p- n/(1+p))= 0.5 n->infinity lim(1/n)(1+1/2+1/3+...+1/n)=0 n->infinity === Subject: Re: Recursion loop help needed tia sal Clear[c,f]; k=1/50; f[x_?VectorQ] := Rest[FoldList[(#1+#2)*k&,First[x],Rest[x]]]; entries={15,17,8,12}; b=f[entries] {16/25, 108/625, 3804/15625} ci=f[b] {254/15625, 2029/390625} n=Length[entries]; Clear[c]; c[m_Integer /; 0n-2] := c[m] = (c[m-1]+c[m-2])*k ; Table[c[m],{m,6}] {254/15625, 2029/390625, 8379/19531250, 109829/976562500, 528779/48828125000, 6020229/2441406250000} Bob Hanlon === > Subject: Recursion loop help needed tia sal > Greets All, > I'm having a little trouble in creating this example in mathematica, I'm > not sure how to make the array dynamic enough in mathematica to include > Cn.....Xn in example 1. Does anybody have any idea > Example 1: > User Input for four numbers 15,17,8,12... (Note: user can input any amount > of numbers) > (15+17) /25/2 ->b1 > (b1+8) /25/2 ->b2 > (b2+12) /25/2 ->b3 > (b1+b2) /25/2 ->c1 > (c1 +b3)/25/2 ->c2 > (c1 +c2) /25/2 ->c3 > Tia === Subject: Non-algebraic solution I want to plot the following type of logarithmic equation having dependent variable y and independent variable x. Log[y/a] + b*Log[c+y/d] = -x where a,b,c and d are some arbitrary constants. First I tried to solve the equation for y using Solve function in Mathematica 4.2, but got the following error message: Solve:: tdep : The equations appear to involve the variables to be solved for in an essentially non-algebraic way. Could someone please guide me as to how do we solve such equation with/without Mathematica. or If possible, how to obtain y vs. x plot in Mathematica without soving them exactly. Waiting for the kind resonse. Ravi === Subject: Re: Non-algebraic solution > I want to plot the following type of logarithmic equation having > dependent variable y and independent variable x. > Log[y/a] + b*Log[c+y/d] = -x > where a,b,c and d are some arbitrary constants. > First I tried to solve the equation for y using Solve function in > Mathematica 4.2, but got the following error > message: > Solve:: tdep : > The equations appear to involve the variables to be solved > for in an essentially non-algebraic way. > Could someone please guide me as to how do we solve such equation > with/without Mathematica. > or > If possible, how to obtain y vs. x plot in Mathematica without soving them > exactly. > Waiting for the kind resonse. > Ravi I really wonder why nobody got the idea to use ParametricPlot? ParametricPlot[{-Log[y/a] - b*Log[c+y/d],y}, {y,y1,y2}(*desired y-Range*), PlotRange->{{x1,x2},{y1,y2}}] looks simple to me. Did I miss something? -- Peter Pein 10245 Berlin === Subject: Re: Non-algebraic solution Needs[Graphics`ImplicitPlot`] With[{a = 1, b = 0.10, c = 1, d = 1}, ImplicitPlot[ Log[y/a] + b*Log[c + y/d] == -x, {x, -10, 100}, {y, 1/10, 100}] ] Jens B.Ravinder schrieb im Newsbeitrag > I want to plot the following type of logarithmic equation having > dependent variable y and independent variable x. > Log[y/a] + b*Log[c+y/d] = -x > where a,b,c and d are some arbitrary constants. > First I tried to solve the equation for y using Solve function in > Mathematica 4.2, but got the following error > message: > Solve:: tdep : > The equations appear to involve the variables to be solved > for in an essentially non-algebraic way. > Could someone please guide me as to how do we solve such equation > with/without Mathematica. > or > If possible, how to obtain y vs. x plot in Mathematica without soving them > exactly. > Waiting for the kind resonse. > Ravi === Subject: zero eigenvalues and corresponding eigenvectors of a square and a rectangular matrice for example I have a image matrice. And I'm trying to find its eigen matrice using the image as a matrice not as a vector. For a 3x3 image if we turn the image matrice into vector form we can find 9 eigen vectors which some of them have zero eigenvalue. But in matrice form we can find only 3 eigenvectors. But can I find the zero eigenvectors which have zero eigenvalue which corresponds in the vector form.I'm trying to find zero eigenvalues and their eigenvectors for an image matrice when using image as a matrice not as a vector. === Subject: Re: Pattern matching partial derivatives Nicolas, Since D[f_, x_, Rule[NonConstants, nc_]] 0 you need HoldPattern here. MatchQ[D[f, x, NonConstants -> {f}], HoldPattern[D[f_, x_, NonConstants -> nc_]]] True David Park djmp@earthlink.net http://home.earthlink.net/~djmp/ Hi all, I can't get finding patterns that would match a simple partial derivative: Input: ?f ?x D[f, x, NonConstants -> {f}] // FullForm Output: Global`f Global`x D[f, x, Rule[NonConstants, List[f]]] Input: MatchQ[ D[f, x, Rule[NonConstants, List[f]]], D[f_, x_, Rule[NonConstants, nc_]] ] Output: False Am I damned ? Nicolas === Subject: Re: x^3 (1+x^2)^-1 I'm thinking I was wrong about divergence; I was looking at computing the integrals using Series and the normal distribution's moment-generating-function, and I got sums that looked divergent -- but that's probably not be the only way to attack it. Bobby > All but the first is divergent on -oo to oo, while the first is zero. > NIntegrate should handle this very well for finite limits. For instance: > Clear[f] > f[n_Integer][x_] := > (Exp[-(x - m)^2/(2*s^2)]*x^n)/(1 + x^2) > NIntegrate[f[2][x] /. {m -> 0, s -> 1}, {x, -5, 2}] > 0.8149597066587511 > NIntegrate[f[1][x] /. {m -> 0, s -> 1}, {x, -5, 5}] > 0. > Bobby >> any suggestion to make the integral of: >> Exp[-(x-m)^2/(2 s^2)] x (1+x^2)^-1 >> Exp[-(x-m)^2/(2 s^2)] x^2 (1+x^2)^-1 >> Exp[-(x-m)^2/(2 s^2)] x^3 (1+x^2)^-1 >> between -inf and +inf (or indefinite)? >> Look like it is not possible, but it is too long time I do not make >> integrals with more advanced techinques (as going to the complex plane)... >> so if you have suggestions (wonderful a solution :) ).... >> THANKS >> Ale -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Re: x^3 (1+x^2)^-1 All but the first is divergent on -oo to oo, while the first is zero. NIntegrate should handle this very well for finite limits. For instance: Clear[f] f[n_Integer][x_] := (Exp[-(x - m)^2/(2*s^2)]*x^n)/(1 + x^2) NIntegrate[f[2][x] /. {m -> 0, s -> 1}, {x, -5, 2}] 0.8149597066587511 NIntegrate[f[1][x] /. {m -> 0, s -> 1}, {x, -5, 5}] 0. Bobby > any suggestion to make the integral of: > Exp[-(x-m)^2/(2 s^2)] x (1+x^2)^-1 > Exp[-(x-m)^2/(2 s^2)] x^2 (1+x^2)^-1 > Exp[-(x-m)^2/(2 s^2)] x^3 (1+x^2)^-1 > between -inf and +inf (or indefinite)? > Look like it is not possible, but it is too long time I do not make > integrals with more advanced techinques (as going to the complex plane)... > so if you have suggestions (wonderful a solution :) ).... > THANKS > Ale -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Re: convolution vs. NMinimize Does anybody know what 4*π*t^3 means? Bobby > I've had some problems with the nonlinear fit of my measuresd data > before. > Now, i have worked it out. I have to use a numerical global > optimization. > The fit with NMinimize leads to very good results. > The problem now is, that the fit needs about 6 hours computation time. > I'm sure this could be faster, but i don't have an idea how... > i've generated a sum of squares from the measured data and the model. > The model consists of the actual model and a numerical convolution of > the > model with a measured input signal. The convolution should be the the > time-consuming > step. I don't know what mathematica is doing exactly (e.g., which > steps are calculated > symbolical or numerical). The optimization should be fast, if the > model with the actual > parameters, and the convolution would be evaluated numerically. > I've attached the code for the optimization. > In[11]:= > pred[Pe_,tau_]:=Module[{model,pred1,falt}, > model=(Pe*tau/(4*π*t^3))^0.5*Exp[-Pe/(4*t/tau)*(1-t/tau)^2]; > pred1=Map[model/.{t->#}&,time];falt=ListConvolve[inp,pred1,1];falt > ] > In[15]:=soln=NMinimize[Plus@@Table[((yc[Pe,tau][[i]])-respconvdata[[i,2]])^2, > {i,Length[time]}],{{tau,15,20},{Pe,95,110}},MaxIterations->50,Method->Diffe rentialEvolution]//Timing > inp is the input signal > pred is the predicted Convolution product > respconvdata is the measured curve > Does anybody have an idea? > (e.g., how to apply the convolution on a different way..) > julia -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: convolution vs. NMinimize I've had some problems with the nonlinear fit of my measuresd data before. Now, i have worked it out. I have to use a numerical global optimization. The fit with NMinimize leads to very good results. The problem now is, that the fit needs about 6 hours computation time. I'm sure this could be faster, but i don't have an idea how... i've generated a sum of squares from the measured data and the model. The model consists of the actual model and a numerical convolution of the model with a measured input signal. The convolution should be the the time-consuming step. I don't know what mathematica is doing exactly (e.g., which steps are calculated symbolical or numerical). The optimization should be fast, if the model with the actual parameters, and the convolution would be evaluated numerically. I've attached the code for the optimization. In[11]:= pred[Pe_,tau_]:=Module[{model,pred1,falt}, model=(Pe*tau/(4*π*t^3))^0.5*Exp[-Pe/(4*t/tau)*(1-t/tau)^2]; pred1=Map[model/.{t->#}&,time];falt=ListConvolve[inp,pred1,1];falt ] In[15]:=soln=NMinimize[Plus@@Table[((yc[Pe,tau][[i]])-respconvdata[[i,2]])^2 , {i,Length[time]}],{{tau,15,20},{Pe,95,110}},MaxIterations->50,Method->Diffe rentialEvolution]//Timing inp is the input signal pred is the predicted Convolution product respconvdata is the measured curve Does anybody have an idea? (e.g., how to apply the convolution on a different way..) julia === Subject: Re: convolution vs. NMinimize hi julia, especialy (but not only) with samplelegths which are powers of 2 convolution can be done efficiently by FFT (Mathematica Fourier[]) the convolution theorem states that to perform convolution(f,g) you may take the the fourier transforms F=Fourier[f] and G=Fourier[g] and get the convolution by calculating InverseFourier[F*G] for a sample length n Fourier[] calculates in n*Log[n] time (because of FFT) ListConvolve[] calculates in n*n time the differnece is enormous for large n. As Fourier assumes periodic data, you will have to pad your data and your convolution kernel with zeros if you need same behavior like ListConvolve[] could be possible that ListConvolve[] allready uses FFT methods in this case the statement that ListConvolve[] calculates in n*n time would be false and you wold not gain any speedup. > I've had some problems with the nonlinear fit of my measuresd data > before. > Now, i have worked it out. I have to use a numerical global > optimization. > The fit with NMinimize leads to very good results. > The problem now is, that the fit needs about 6 hours computation time. > I'm sure this could be faster, but i don't have an idea how... > i've generated a sum of squares from the measured data and the model. > The model consists of the actual model and a numerical convolution of > the > model with a measured input signal. The convolution should be the the > time-consuming > step. I don't know what mathematica is doing exactly (e.g., which > steps are calculated > symbolical or numerical). The optimization should be fast, if the > model with the actual > parameters, and the convolution would be evaluated numerically. > I've attached the code for the optimization. > In[11]:= > pred[Pe_,tau_]:=Module[{model,pred1,falt}, > model=(Pe*tau/(4*π*t^3))^0.5*Exp[-Pe/(4*t/tau)*(1-t/tau)^2]; > pred1=Map[model/.{t->#}&,time];falt=ListConvolve[inp,pred1,1];falt > ] > In[15]:=soln=NMinimize[Plus@@Table[((yc[Pe,tau][[i]])-respconvdata[[i,2]])^2, > {i,Length[time]}],{{tau,15,20},{Pe,95,110}},MaxIterations->50,Method->Diffe rentialEvolution]//Timing > inp is the input signal > pred is the predicted Convolution product > respconvdata is the measured curve > Does anybody have an idea? > (e.g., how to apply the convolution on a different way..) > julia === Subject: Re: Re: Re: Re: Newly Released Mathematica 5.1 Delivers Unmatched Performance for Handling Data John, I was thinking of angular measurement. The following works... Needs[Miscellaneous`Units`] Convert[(Pi/4)*Radian, ¡] 45 ¡ but the following, using an approximate value, does not work because Degree immediately multiplies out undoing the conversion. Convert[1.35 Radian, ¡] 1.35 The ExtendUnits package at my web site fixes this but at the expense of putting a HoldForm on the degree symbol. Needs[Miscellaneous`V4ExtendUnits`] 1.35 Radian // ToUnit[¡] % // FullForm 77.3493 ¡ Times[77.34930234266115`, HoldForm[Degree]] Since I generally consider value substitution and unit conversion as the last step in a physical calculation this is not a huge problem. Still it would be nice if units and numerical constants had different names. David Park djmp@earthlink.net http://home.earthlink.net/~djmp/ I'm not sure that it is necessary to have a unit Degree as Kelvin is already there and is used, e.g., in the definition of BoltzmannConstant. The Miscellaneous`Units` has a special handling of temperature scales (ConvertTemperature) that are not proportional to each other like other units. It seems a bit clumsy but I don't have much occasion to use it myself. Otherwise Convert[5 Fahrenheit, Kelvin] returns something that might be considered reasonable, with a warning message. > John, > Your idea about non-conflicting color names seems good. Also there should be > a unit Degree and a different name for the numerical constant. === Subject: Projections I am a Calculus Professor. I want to know how I can use Mathematica to produce projections in the xy, xz and yz axis of level surfaces. For example, compute the volume of a region R bounded by the parabolic cylinder x = y^2 and the planes z = 0 and x + z = 1. In the process we need to compute the projection of the level surface in the xy, xz and yz axis. === Subject: Re: Speeding UP Indexing and Joining of Different Size Rectangular Matrixes Here's an approach you might try: Define lookup functions for a and b. When this is done for each dataset, the original dataset is no longer needed. It might actually be more efficient to do this while reading in the data (assuming it came from a file), so that the data is never stored in a matrix at all. (I'm assuming the index is in column 1.) Clear@aFind aFind[_] := {} aNDX = (aFind[First@#] = Rest@#; First@#) & /@ a Clear@a Clear@bFind bFind[_] := {} bNDX = (bFind[First@#] = Rest@#; First@#) & /@ b Clear@b Now we can loop through indices in aNDX or bNDX to reach all the data, or we can loop through abNDX = Intersection[aNDX, bNDX] to see only the records in both datasets. The value of extract will be the concatenation of both dataset rows. It will look like {{data from table a},{data from table b}}, {{},{data from table b}} or {{data from table a}, {}}, depending on whether x is in both datasets, dataset b only, or a only. extract[x_] := {aFind[x], bFind[x]} This replaces your For loop, AppendTo, and Extract. It takes zero time to define this. The nth column of a record in a or b can be accessed using Part in a couple of different ways: aFind[x_][[n]] == extract[x][[1,n]] bFind[x_][[n]] == extract[x][[2,n]] The first will fail (in either form) if x isn't an index in dataset a, and the second will fail (in either form) if it isn't in b. I have no idea what Flatten is doing for you, what the variables interestBalance and currentBalance are, or what you intend matsort to do. Bobby > Fellow MathGroup, > I have been using Mathematica for financial analysis purposes and have been > developing note book programs for about 5 years. > My skills at this are self taught with help from Wolfram training and support. > The largest challenge has been the speed in the analysis of large data sets. > The following is an example of a routine that takes many hours. > PLEASE HELP AND SHOW HOW I CAN IMPROVE THE ROUTINE TO MAKE THE RUN TIME > SHORTER. > Equipment HP XP 3.24 processor 2 Gigs > Mathematica 5.01 > Data set a= 257470 by 40, Mixed numeric and string fields, but each field > (column) is either or numeric or string > Data set b= 258705 by 5, All fields are numeric > Objective: RowJoin the rows from each data set that have the same ID field > in their corresponding column one. > ROUTINE > Create Index By Invoice ID > firstCol=loc01[[1]]; > lastCol =loc01[[1]]; > aa = Transpose[Take[Transpose[a],{firstCol, lastCol}]]; > Length[aa] > 257470 > firstCol=loc04[[1]]; > lastCol =loc04[[1]]; > bb = Transpose[Take[Transpose[b],{firstCol, lastCol}]]; > Length[bb] > 258705 > idx=Intersection[aa,bb]; > Length[idx] > 257249 > n=Length[idx]+1 > 257250 > Locate Position Of Each Record In aTable > ans01={}; > For[i=1,i step1 = Position[aa,idx[[i]]]; > AppendTo[ans01,step1]] > ans01=Flatten[ans01,1]; > Locate Position Of Each Record In bTable > ans02={}; > For[i=1,i step1 = Position[bb,idx[[i]]]; > AppendTo[ans02,step1]] > ans02=Flatten[ans02,1]; > Extract a Records by Index > ans01 =Extract[currentBalance,ans01]; > Dimensions[ans01] > Flatten If Not A Matrix > If[MatrixQ[ans01],ans01=ans01,ans01=Flatten[ans01,1]]; > Dimensions[ans01] > Extract b Records by Index > ans02 =Extract[interestBalance,ans02]; > Dimensions[ans02] > Flatten If Not A Matrix > If[MatrixQ[ans02],ans02=ans02,ans02=Flatten[ans02,1]]; > Dimensions[ans02] > ans01=matsort[ans01,loc01[[1]]]; > ans02=matsort[ans02,loc04[[1]]]; > noteTerms=RowJoin[ans02,ans01]; > Dimensions[noteTerms] -- DrBob@bigfoot.com www.eclecticdreams.net === Subject: Speeding UP Indexing and Joining of Different Size Rectangular Matrixes Fellow MathGroup, I have been using Mathematica for financial analysis purposes and have been developing note book programs for about 5 years. My skills at this are self taught with help from Wolfram training and support. The largest challenge has been the speed in the analysis of large data sets. The following is an example of a routine that takes many hours. PLEASE HELP AND SHOW HOW I CAN IMPROVE THE ROUTINE TO MAKE THE RUN TIME SHORTER. Equipment HP XP 3.24 processor 2 Gigs Mathematica 5.01 Data set a= 257470 by 40, Mixed numeric and string fields, but each field (column) is either or numeric or string Data set b= 258705 by 5, All fields are numeric Objective: RowJoin the rows from each data set that have the same ID field in their corresponding column one. ROUTINE Create Index By Invoice ID firstCol=loc01[[1]]; lastCol =loc01[[1]]; aa = Transpose[Take[Transpose[a],{firstCol, lastCol}]]; Length[aa] 257470 firstCol=loc04[[1]]; lastCol =loc04[[1]]; bb = Transpose[Take[Transpose[b],{firstCol, lastCol}]]; Length[bb] 258705 idx=Intersection[aa,bb]; Length[idx] 257249 n=Length[idx]+1 257250 Locate Position Of Each Record In aTable ans01={}; For[i=1,i just a thought, from a frustrated mind: > given that one can explicitely tell a symbol is a constant by modifying > its attributes, then why the hell doesn't the partial derivative D take > advantage of it, and treat nonconstant symbol as.... nonconstants, by > default ?? > Nicolas I suspect part of the problem with D and Dt is that a set of conventions that might suit one problem domain would not seem right in another context. In any case, I am sure the rules for these operations are cast in stone because too much stuff would break if WRI changed them! I must say though (relating to your previous question) I have never understood why D evaluates if either of its arguments is a pattern! It is, however, very easy to supply a recursive definition for dD that uses whatever rules you see fit. One option is to define dD using a set of transformation rules and then apply them with //. if and when you want your derivatives evaluated. That way you can leave expressions like d(sin(x))/dx unevaluated in your expressions, which can be useful in some contexts. David Bailey === Subject: Re: On constants and D's behaviour > just a thought, from a frustrated mind: > given that one can explicitely tell a symbol is a constant by modifying > its attributes, then why the hell doesn't the partial derivative D take > advantage of it, and treat nonconstant symbol as.... nonconstants, by > default ?? > Nicolas Why should D duplicate another functions behaviour? Use Dt instead of D: Dt[c, x] Dt[c, x] SetAttributes[c, Constant] Dt[c, x] 0 Andrzej Kozlowski Chiba, Japan http://www.akikoz.net/~andrzej/ http://www.mimuw.edu.pl/~akoz/ === Subject: Re: On constants and D's behaviour You need to use Dt rather than D. Thus Dt[a,x] gives Dt[a,x] whereas Dt[a,x,Constants[Rule]{a}] gives 0 Steve Luttrell > just a thought, from a frustrated mind: > given that one can explicitely tell a symbol is a constant by modifying > its attributes, then why the hell doesn't the partial derivative D take > advantage of it, and treat nonconstant symbol as.... nonconstants, by > default ?? > Nicolas === Subject: Combining graphics and tabels in one cell I have a two-dimensional matrix which I want to display using BarChart3D and TableForm. However, I would like them to appear side-by-side in one output cell. Is there a way to combine a graphical object and a non-graphical object in one cell (ie equivalent to GraphicsArray for two graphical objects) ? Peter === Subject: Re: Combining graphics and tabels in one cell > I have a two-dimensional matrix which I want to display using BarChart3D and > TableForm. However, I would like > them to appear side-by-side in one output cell. Is there a way to combine a > graphical object and a non-graphical > object in one cell (ie equivalent to GraphicsArray for two graphical objects) > Peter I don't claim to be a Mathematica expert, but the following works for me as an understandable way to convert text stuff, including perhaps a Table, into a graphic that can then be joined with other graphics: g1 = Graphics[{ Text[ StyleForm[ SequenceForm[ Some title stringn, TableForm[ Table[<>]]], FontFamily -> Helvetica,FontSize->9, FontWeight -> Bold], {0.5, 0.5},{0, 0}]}] The Graphics[ ] part of course creates a graphic. The Text[] part creates a text block within the graphic The StyleForm[ ] part lets you set the font family, size, etc., of the text stuff and the Table in that text block The SequenceForm[ ] is necessary to combine the multiple text stuff, including text strings and Tables, as sequential arguments to StyleForm[]. The numbers in the final line position the total block of text stuff centered in the graphic. You can then use Show[g1] to create a graphic which can be one of the graphics in your GraphicsArray. I use this same template, combined with Show[g1], to create title slides for Mathematica animations. The title and all of the numerical and other data for a given animation are inserted into g1, which becomes the first graphic in a notebook, followed by any number of graphic cells for the animation itself. I can then easily auto-select and animate all of the graphics cells, or use Save Selection to make a QuickTime movie, with the title slide as the opening slide. The one weakness of this approach is that the text block doesn't scale if you change the size of the graphic. You have to pick a font size and font weight that makes the text block fit properly within the size of the graphic g1, as determined by ImageSize. === Subject: Re: Combining graphics and tabels in one cell You could generate 2 graphics objects then display them side by side using DisplayTogetherArray. <I have a two-dimensional matrix which I want to display using BarChart3D >and TableForm. However, I would like > them to appear side-by-side in one output cell. Is there a way to combine > a graphical object and a non-graphical > object in one cell (ie equivalent to GraphicsArray for two graphical > objects) ? > Peter === Subject: filtering of a graphics Supersedes: How to export graphics through 'filter' (filter is a shell script) Display[! filter > plot.eps,plot,EPS] doesn't work. Seb. === Subject: Re: Boolean Type func[x_ /; Element[x, Reals]] := x^2; func[x_ /; Element[x, Booleans]] := Not[x]; or func[x_?(Element[#, Reals]&)] := x^2; func[x_?(Element[#, Booleans]&)] := Not[x]; Bob Hanlon === > Subject: Boolean Type > All, > I would like to define a function wich would work (in different ways) for both > real and boolean input argruments. How should I best implement a function which > would implement the following intent? > func[x_Real]:= some function involving a real varialble x > func[x_Boolean]:= some function involving a boolean variable x > Al Myers