mm-739 === Subject: Re: true limit of mathematica ? Help me !!! > During this calculation: > m= Table[(i-j)+3.*j^-4 +50*I,{I,1,10000},{j,1,10000}]; > Det[m] So lets see: Your Matrix has Complex Numbers, and has 10000^2 entries: In[10]:= $Version Out[10]= 5.1 for Linux (January 27, 2005) In[5]:= MaxMemoryUsed[] Out[5]= 2218976 In[11]:= ByteCount[3. + I] Out[11]= 64 In[12]:= 10000^2*ByteCount[3. + I] Out[12]= 6400000000 So it takes 6400000000 bytes, wich is 6400000 kilobyte or 6400 M 6.4 G Maybe more, because while calculaten Det[m] more memory would be needed. > the kernel has jammed and the following message has been visualized > No more memory available. > Mathematica kernel has shut down. > Is it possible to overcome this obstacle? > The dimension of the in demand memory is not limited from windows xp > or my hardware-software' configuratiion, in fact such error also > happens in xp 64 Bit with Mathematica 5.2 (64 Bit) Athlon 64 2 GB Ram. First step would be to get more memory ... Detlef === Subject: Re: Pictures into Mathematica But be careful - pictures that appear in Widows do not always work on a Mac, as I found out earlier this year when trying to do a presentation on a Mac using a notebook with pictures in it that I prepared on my Win XP machine. Ian >>How do I import pictures that I have made into Mathematica 5.2 ? >> >Have you had a chance to the the documentation for the function >Import[]? It's very straightforward... >Evaluate $ImportFormats in a notebook to see if the file format of your >images are supported. === Subject: A very EZ Question! Make a Graph! Hi Everybody, I need to make a graph given the vertices and edges. let's say: Vertex set: V=Range[5]={1,2,3,4,5} Edge Set: E={{1,2},{2,3},{4,5},{1,4},{2,5}}; Also, Is there any funtion that Lists the vertices adjacent to a given vertex! I mean using the Combinatorica package in Mathematica! I know it might sound stupid, but I could find a solution to this in Mathematica Manual!!! I appreciate your help. chekad === Subject: Re: How to create units? Renan, With the V4ExtendUnits package from my web site below you can install your own units. (I'm not certain if I have the correct definition of all your information units.) Needs[Miscellaneous`V4ExtendUnits`] InstallNewUnit /@ {kibibyte -> 1024*Byte, mibibyte -> 1024^2*Byte, gibibyte -> 1024^3*Byte}; NewUnitRules {kibibyte -> 8192.*Bit, mibibyte -> 8.388608*^6*Bit, gibibyte -> 8.589934592*^9*Bit} kibibyte // ToUnit[Byte] 1024. Byte 1024 Byte // ToUnit[kibibyte] 1. kibibyte 32.5 gibibyte // ToUnit[{Byte, Bit}] {3.489660928*^10*Byte, 2.7917287424*^11*Bit} But I didn't check for Bit as a base unit in the old package and updated it for this today. So you must use a 9 Sep 2005 or later version. David Park djmp@earthlink.net http://home.earthlink.net/~djmp/ I'd like to define custom units in Mathematica. Is this possible? I want to define binary units (kibi/mibi/gibibytes) as used in computers, because currently: In[1]:= Convert[1 Kilo Byte,Byte] Out[1]= 1000 Byte When it is supposed to be 1024 bytes. How to define custom unit? === Subject: New SetFaceAndFont Palette, please help me to check! Almost a year back I submitted to MathGroup a SetFaceAndFont palette. Now I have completely revised this palette, and added a lot of functions: Search buttons, for searching the Online Mathematica help, the MathGroup (and Wiki-webMathematica) and the whole web (including your own desktop, if you have Google Desktop with Wolfram Notebook Indexer installed). Just select some words and press the button... Bracketing buttons to add different brackets around the selection. A list item duplicator button, which duplicates the selection with a comma inserted in between. This button can also be used after interactive choice of points in a plot (See menu item Get Graphics Coordinates...) or be used to duplicate cells. A peel button to remove brackets (of almost any kind), with the separate ability to turn cells into text cells with text as TextData. It eliminates the annoying reformatting when you delete one quote or bracket and suddenly lose sight of the matching partner. A rewritten CopyAsInputFormK button, for copying code with formatting removed. Embedded InvisibleSpace? No problems, it is converted to a usual visible one, Fontsize, fontcolor and background color buttons. And if all your spaces have been transformed into multiplication signs, there is a button for that... Help function, integrated into the Mathematica help. Even if you usually do not use palettes much, you might find this palette useful. Please visit my web site http://web.telia.com/~u31815170/Mathematica for download, and please report any errors you find or any comments you have. Ingolf Dahl Sweden === Subject: Re: Hardware question 1. Athlon64 3200+ SUSE Linux Desktop9 with score 1.84 2. 4-way 1.3 GHz Itanium 2 Red Hat Enterprise Linux with score 1.83 3. 3Ghz Pentium 4 Red Hat Linux9 with score 1.42 4. 2-way 2.0 Ghz PowerMac G5 Apple Mac OS X 10.3 with score 1.11 5. 2.4 Ghz Pentium 4 Microsoft Windows XP with score 1.0 Someone might have the 2005 benchmark data. J.87nos > does somebody know, what hardware is best for a huge mathematica > calculation, that needs lots of memory? > I think of minimum 8GB memory and the fastest possible processors > (probably opterons???). > However, it should be a personal computer. > Is it better to run it under Linux or Windows? > Manuel Schmidt === Subject: Re: Hardware question > does somebody know, what hardware is best for a huge mathematica > calculation, that needs lots of memory? > I think of minimum 8GB memory and the fastest possible processors > (probably opterons???). > However, it should be a personal computer. > Is it better to run it under Linux or Windows? > Manuel Schmidt Really, that is equivalent to the question How long is a piece of string. One thing that is important is that if you are going to get 8GB of memory, you must make sure you install the 64-bit version of Windows (or whatever) and the 64-bit version of Mathematica - otherwise, most of that memory will just sit there idle. introducing a rational 64-bit architecture and forcing Intel to follow them - they deserve to get the business! Before spending a lot of money, it may be worth getting someone to look at your code because it is very easy to write Mathematica code that works, but is horrendously inefficient. David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Simplify Expressions with Non commutative multiplication I have a rather lengthy expression of abstract products of matrices of the form myDot[M1,M2,...] If Inv[M] denotes the inverse matrix i have told mathematica that myDot[P1___,P2_,Inv[P2_],P3___]:=myDot[P1,P3]; myDot[P1___,Inv[P2_],P2_,P3___]:=myDot[P1,P3]; myDot[]=Unity; and that myDot[P1___,P2_+P3_,P4___]:=myDot[P1,P2,P4]+myDot[P1,P3,P4]; and a lot more things. My Problem is: In big expressions i have huge cancellations of the form myDot[M1,Inv[M1+M2+M3+....]] + myDot[M2,Inv[M1+M2+M3+....]] + myDot[M3 ,Inv[M1+M2+M3+....]]+... such that the summands M1,M2.... should be summed and then cancel against the Inv[...] part. I have a very slow workaround, myDotSimp[HoldPattern[Plus[P6___, myDot[P5___, P1_, P3___], myDot[P5___,P2_, P3___]]]] := P6 + myDot[P5, P1 + P2, P3]; SetOptions[Simplify, TransformationFunctions -> {Automatic,myDotSimp}]; this thing, however, is immensly time consuming. On the other hand, cancellations of the type Simplify[b/(b+c)+c/(b+c)] are extremly fast. Is there a way to combine the power of Simplify on Rational functions with a noncommutative multiplication? robert schoefbeck === Subject: Looking for n for which all 2-partitions are prime partitions. Is it possible to find an even number n => 4 such that the values (n - Prime[i]) are primes for ALL integers i in the interval [1, PrimePi[n/2]]? In other words; does an n exists having a corresponding set {{a,b}: (a + b) = n, with all a,b element of Primes}? A way to begin attacking this problem follows: Let PrimeP be the set of prime partition points {p,q} corresponding to n, such that n = p + q; p and q are prime; and p is less or equal than q. Let CompP be the set of composite partition points {p,q} corresponding to n, such that n = p + q; p is prime but, q is composite; and p is less or equal than q. Let AllP be the (disjoint) union of the sets PrimeP and CompP. Let LPrimeP, LCompP, and LAllP denote the lengths of the sets PrimeP, CompP, and AllP, respectively. For what n's is LPrimeP > LCompP? A program for heuristic exploration of this later question follows : Off[General::spell1] Clear[LAll,LPrimeP,LCompP] LAllP[n_Integer?Positive]:=Length[Transpose@{n-#,#}&@ Select[n-Prime@Range@PrimePi[n/2],IntegerQ]] LPrimeP[n_Integer?Positive]:=Length[Transpose@{n-#,#}&@ Select[n-Prime@Range@PrimePi[n/2],PrimeQ]] LCompP[n_Integer?Positive]:=Block[{c},c=(LAllP[n]-LPrimeP[n]);c] For[n=4,nLCompP[n], Print[{n,LPrimeP[n],LCompP[n]}]];n+=2] After running this program for a while; the value {30030,905,850} is eventually reached. Unfortunately, seeking n > 30030 implies me having to abort the program, since it stalls forever. I'm just wondering if anyone could suggest an alternative approach, (a proof that such an n doesn't exist would be perfect!) but, seriously; someway to faccilitate and accelerate the calculations to reach values of n higher than 30030. === Subject: Re: Why this function does not return a single value Hi Bill I know that Mathematica treats space as a multiplication sign. What happens here is that when I remove the multiplication signs in Input mode, convert to Standard mode and then back to Input mode the multiplication signs reappear. I just did the following experiment. Opened fresh Mathematica notebook and typed in (in Standard mode) g[x_,a[1]_]:=a*x (no spaces anywhere) Executed that Then converted to Input mode and there will be a star between a[1] and the blanc sign _ . However when I remove the square brackets from the input that does not happen. Marek >>For now I have only one thing to say. Those multiplication signs >>appear out of nowhere when I convert the call with function definition >>from Input Form to Standard Form. I can remove the m while in Standard >>form but as soon as I execute this cell (or convert it to Standard >>Form) they reappear. Is that the way it is suppose to be? > When a multiplication sign appears as a result of converting from one form > to another it typically is because there is a space between expressions in > the original form. Mathematica treats a space between expressions as > multiplication. And often, it is very difficult to notice an extra space. > -- To reply via email subtract one hundred and four === Subject: Re: Mathematica won't run if LANG var is set to pt_BR > I have installed Mathematica in Linux (Ubuntu Linux 5.04 - essentially > Debian) and works OK, as long as my LANG environment variable is set to 'C' > (which means 'no specific language') or 'US'. > But I want to use the GNOME window manager in Portuguese, and this, > automagically sets the LANG variable to pt_BR (which means 'Brazilian > Portuguese'). When this is set, Mathematica will not run, it will error at > startup with An illegal right-hand side value was specified for the cell > style option FontColor. > Anybody knows how to fix this problem? > I use Mathematica 5.0. > Renan Probabaly you can make your own script like this, and name it mathematica and put it in ~/bin : #!/bin/sh export LANG=C /path/to/your/mathematica Hope this helps, Jie === Subject: Re: Mathematica won't run if LANG var is set to pt_BR > > I have installed Mathematica in Linux (Ubuntu Linux 5.04 - essentially > Debian) and works OK, as long as my LANG environment variable is set to 'C' > (which means 'no specific language') or 'US'. > > But I want to use the GNOME window manager in Portuguese, and this, > automagically sets the LANG variable to pt_BR (which means 'Brazilian > Portuguese'). When this is set, Mathematica will not run, it will error at > startup with An illegal right-hand side value was specified for the cell > style option FontColor. > > Anybody knows how to fix this problem? > > I use Mathematica 5.0. > I use Mathematica 5.1, but I expect my solution to work for you. In my > installation, links for math, mathematica and Mathematica were placed > in /usr/local/bin. I replaced each of these links with the following > shell script: > #!/bin/bash > MATH=`basename $0` > export LANG=C > export LD_ASSUME_KERNEL=2.4.1 > export OMP_NUM_THREADS=1 > exec /usr/local/Wolfram/Mathematica/5.1/Executables/$MATH $@ You should also replace MathKernel. I don't know whether mcc benefits from any of these environment variables, but it wouldn't hurt to replace it too. Scott -- Scott Hemphill hemphill@alumni.caltech.edu This isn't flying. This is falling, with style. -- Buzz Lightyear === Subject: Re: (how to) make a boxes from a MatrixForm representation? Hello Albert: I tried this, but it gives the same result as ToBoxes[a]. I do not know what is special about MatrixForm as compared to StandardForm or TraditionalForm, but ToBoxes seems to ignore it completely. maybe only the front-end knows about MatrixForm and the kernel does not. === Subject: Precedence Hi all, I've been writing a package using Mathematica to do lattice perturbation theory. As a part of my package, I'd like to define my own matrix multiplication, which I call dotm. Since CenterDot looks pretty and has no previous assignment, I've used it as both the input and output format of dotm. However, I run into problems when I try to type things like Y[x].g A[x].Y[x+a] where the . should be imagined to be CenterDot. Because the precedence of the . is higher than the precedence of the multiplication, this gives (Y.g)(A.Y) instead of Y.(gA).Y. I know I can attach a TagBox to the CenterDot to force it to have lower precedence, but that ruins the convenience of typing esc-.-esc to get the dot. Is there some other way to teach Mathematica to use a lower precedence? Xerxes === Subject: Re: Re: rootsearch in a piecewise function juejung, You appear to be unaware of the Hold attribute of some of the functions you are using. Also, you may be neglecting the fact that your function was only defined for x>0. By the way, there isn't much distinction between parameters and variables in Mathematica. I made some changes to your code. It now produces the results I think you want: reps[1]={a[Rule]3,b[Rule]4,c[Rule]20,d[Rule]1.5} expr[3]=-6+c/x+d^2 expr[2]=10+a*x^(1/2)-x-b expr[1]=Which[0 hi group, > why does the root search in the following piecewise function not work, > when the plot function before evaluates just fine. > if i use the /.para already at the point where i define f2 and f3 then the > root command works. however, the actual functions f2 and f3 are much > longer and i would like to replace parametervalues only at the point where > i do in the example below. it seems that findroot is evaluated before the > replacement takes place?? > juergen > para = {a -> 3, b -> 4, c -> 20, d -> 1.5}; > f2[x_] := 10 + a* x^(1/2) - x - b; > f3[x_] := -6 + c/x + d^2; > f1[x_] := Which[0 < x < b, f2[x], b <= x < 10, f3[x],10 <= x, x^(1/2)] > /.para; > df1[x_] = D[f1[x], x]; > Plot[f1[x] /.para, {x, 0.1, 15}] > Plot[df1[x] /.para, {x,0.1, 15}] > FindRoot[{f1[x] == 0} /.para, {x, 2}] > FindRoot[{df1[x] == 0} /.para, {x, 2}] > Hi Juergen, > you'll have to map Evaluate at f1[x], because Which has Attribute > HoldAll. This means, without Evaluate, f1[x] contains only calls to f2 > and f3. And the expression f2[x] does not contain any of your parameters. > Compare: > f1[x] > Which[0 < x < 4, f2[x], 4 <= x < 10], f3[x], 10 <= x, Sqrt[x]] > with > Evaluate /@ f1[x] > Which[0 < x < 4, 10 - b + a*Sqrt[x] - x, 4 <= x < 10], -6 + d^2 + c/x, > 10 <= x, Sqrt[x]] > FindRoot[Evaluate /@ f1[x]==0 /. para, {x, 5}] will find the root at > 16/3. (The start value 2 leads the algorithm towards negative x-values, > where f is not defined). > and FindRoot[Evaluate /@ df1[x]==0 /. para, {x, 2}] gives you the > location of the maximum at 9/4. > -- > Peter Pein, Berlin > GnuPG Key ID: 0xA34C5A82 > http://people.freenet.de/Peter_Berlin/ -- Chris Chiasson http://chrischiasson.com/ 1 (810) 265-3161 === Subject: Numerical integration over half-infinite intervals I do a lot of 1D NIntegrates over half-infinite domains [0,Infinity). Sometimes you can simply put Infinity as an upper bound and Mathematica will return an answer. In that case, I don't have a problem. But, sometimes, this fails or takes too long, and I am forced to truncate the integral. Let's assume my integral converges, is not zero, and my integrand is relatively smooth with a few derivatives, at least. Suppose each finite truncated integral can be successfully computed to the same fixed PrecisionGoal. Given that, my questions: Is it possible to extrapolate these truncated results to a limit with a known precision? If so, how, and how does that precision relate to the fixed PrecisionGoal above? alan === Subject: Re: NMinimize InitialPoints BUGREPORT ? > 5.2 has a similar bug: with {S,R} it appears to get the initial point > correct, but otherwise follows the same solution path as 5.1. No, it's not the same solution path as 5.1: some of the {S,R} pairs are the same, but the others have either 1.0 or 1.5 subtracted from S and added to R. === Subject: Switching to Mac caused 20x slowdown - please help! Hello All, I'm having a major speed problem in moving from Linux to Mac. RedHat - Mathematica 5 Mathematica 5.2 The bit of code below, which I need to loop many many times, is now taking about 20 times longer - from ~.01 sec in Linux to ~.2 sec in OSX. The lag seems to be in the first function, newh2 which I admit is probably implemented very poorly. I tried simpler versions using fail. Can anyone speed up this code? H0 = 3.335*^-10 ; !((newh2[ z_?NumberQ, dq_, dz_, z1_, Om_: .28] := Module[{h2temp, qmodify, z2}, [IndentingNewLine]z2 = z1 + dz; h2temp = Om*((1 + z))^3 + ((1 - Om)); [IndentingNewLine]qmodify = (((1 + z)/(1 + z1)))^(2 dq*((UnitStep[z - z1] - UnitStep[z - z2]))) *(((1 + z2)/(1 + z1)))^(2 dq*UnitStep[z - z2]); [IndentingNewLine]h2temp *= qmodify[IndentingNewLine]];)) 99, Om_: .28, h_: .717137] := 5 Log[10, ((1 + z))/(10 h*H0) NIntegrate[1/@newh2[x, dq, dz, z1, Om], {x, 0, z}]];)) {0.235472 Second,45.9423} === Subject: PolynomialGCD Is there anyway to get PolynomialGCD to work with Complex numbers? For example get: PolynomialGCD[(x+y) I, (x+y) 2 I] to return: (x+y) I ? Jon Palmer === Subject: Simplify and Noncommutativity I have a rather lengthy expression of abstract products of matrices of the form myDot[M1,M2,...] If Inv[M] denotes the inverse matrix i have told mathematica that myDot[P1___,P2_,Inv[P2_],P3___]:=myDot[P1,P3]; myDot[P1___,Inv[P2_],P2_,P3___]:=myDot[P1,P3]; myDot[]=Unity; and that myDot[P1___,P2_+P3_,P4___]:=myDot[P1,P2,P4]+myDot[P1,P3,P4]; and a lot more things. My Problem is: In big expressions i have huge cancellations of the form myDot[M1,Inv[M1+M2+M3+....]] + myDot[M2,Inv[M1+M2+M3+....]] + myDot[M3 ,Inv[M1+M2+M3+....]]+... such that the summands M1,M2.... should be summed and then cancel against the Inv[...] part. I have a very slow workaround, myDotSimp[HoldPattern[Plus[P6___, myDot[P5___, P1_, P3___], myDot[P5___,P2_, P3___]]]] := P6 + myDot[P5, P1 + P2, P3]; SetOptions[Simplify, TransformationFunctions -> {Automatic,myDotSimp}]; this thing, however, is immensly time consuming. On the other hand, cancellations of the type Simplify[b/(b+c)+c/(b+c)] are extremly fast. Is there a way to combine the power of Simplify on Rational functions with a noncommutative multiplication? robert schoefbeck === Subject: cannot find the required native library named JLinkNativeLibrary I've got the following error log: Fatal error: cannot find the required native library named JLinkNativeLibrary. java.lang.UnsatisfiedLinkError: MLOpen at com.wolfram.jlink.NativeLink.MLOpen(Native Method) at com.wolfram.jlink.NativeLink.(Unknown Source) at com.wolfram.jlink.MathLinkFactory.createMathLink0(Unknown Source) at com.wolfram.jlink.MathLinkFactory.createMathLink(Unknown Source) at com.wolfram.jlink.MathLinkFactory.createKernelLink0(Unknown Source) at com.wolfram.jlink.MathLinkFactory.createKernelLink(Unknown Source) at com.gsta.jlink.examples.HelloJLink.main(HelloJLink.java:51) I know the file does exist under JLinkSystemFilesLibrariesWindows folder but how to make use of it? Appriciated for helps.