A100 === Subject: Re: Substitute all known relations in result How do I make mathematica to display results with all known > relations / variables? > E.g. if a result is > x^2+y^2 > and before Id defined > r = x^2+y^2 > Id like mathematica to display the result rather as r. And: Id like mathematica to do this for each relation defined before > w/o specifying every possible replacement. Any help much appreciated. It is not possible to do this. When you define > r = x^2 + y^2 > Mathematica will know that from now on whenever it sees r, it should > replace r by x^2 + y^2. This is like variable assignment in any other > programming language. It is something completely different from > declaring the mathematical statement r == x^2 + y^2 to be true (which > cannot really be done in Mathematica, but *do* take a look at the > documentation of Assuming, Assumptions and $Assumptions) But even if we know that r == x^2 + y^2 is true, we can use this fact = in > many different ways. You say that you want Mathematica to replace > x^2+y^2 by r. Why? This is not the only possible replacement that can > be based on this fact. Why not replace r by x^2+y^2 instead? Or why > not replace x^2 + y^2 by (x^2 + y^2 + r)/2? Or why not replace x by > Sqrt[r - y^2]? (Okay, I know that (x)^2 == (-x)^2 so this last one wa= s > not a correct transformation ... but I think you understand my point.) Why would you select that *single* tranformation from the infinite > number of possibilities? Is your goal to construct an expression that has as few parts as > possible? Then use FullSimplify, e.g. FullSimplify[x^2 + y^2, x^2 + y^2 == r] FullSimplify will try many tranformations on the expression, and it will > return the shortest result (the one with the smallest LeafCount). In > this example this happens to be r. An alternative syntax is Assuming[x^2 + y^2 == r, FullSimplify[x^2 + y^2]] Very interesting question with 2 very interesting and different answers by Andrzej and Szabolcs. The solution by Andrzej is a good example of the use of Groebner basis. Groebner basis are probably not yet an household name, even among Mathematica aficionados. Certainly they were not for me, when I first read them in the Mathematica documentation. This reply by Andrzej will hopefully entice more users to start reading a bit about the theory behind them. The reply by Szabolcs is entirely built inside Mathematica and is definitely worth following his advice on reading about Assumptions. Another useful related function that I would like to suggest is Refine. Alessandro === Subject: Re: Should I uninstall the old version before upgrading? I have 5.0 in a separate directory, but I accepted the default directory fo the updates of 6.0. Im not going to keep incremental updates at the 0.01 level in seperate directories, especially since theyre half a gig each. > When you say you installed 6.0.2 on top of 6.0.1, do you mean into the Except when a program installer (or documentation) explicitly tells me I > can do that, I would never do so. > I want to upgrade Mathematica from v6.0 to v6.0.1. Can I just install >> the new version directly without uninstalling the old version? Should >> I uninstall the old version manually before upgrading? >> Yes, do uninstall first. If you dont, you may encounter problems such > as this: >> thread/8300a97190bd0c3b/f35b55aec1ae60a3?lnk=gst&q=%24Failed+drawing+too= > ls#f35b55aec1ae60a3 >> This is a problem that occurs only if one has moved palettes to a new >> location? Because if you install 6.0.2 in an $InstallationDirectory >> separate from that for 6.0.1, why should it be a problem? Evidently its an issue with the installer. I installed 6.0.2 on top of 6.0.1 on a fairly new XP desktop PC, and it > failed to put the new DrawingTools palette where it need to go. I have > always installed all versions of Mathematica to the default directory, > and have not moved the palettes (or anything else) around. The problem > did not occur on my (older) XP laptop. Someone from Wolfram called me on > the phone to get some more details, because they had not been able to > reproduce the issue. The suspicion, after talking to me, was that the > reason for the different behavior was that my laptop had had older > versions of Mathematica installed, whereas the first version installed > on the desktop was 6.0.0. WRI was able to reproduce the problem after > talking to me, but did not have a fix for it other than uninstalling, > deleting the installation directory, and reinstalling. I didnt have the problem when I installed 6.0.2 over top of 6.0.1 on a > Vista machine (which also never had anything prior to v.6), so this is > seemingly an XP specific problem. -- > Helen Read > University of Vermont -- > Murray Eisenberg mur...@math.umass.edu > Mathematics & Statistics Dept. > Lederle Graduate Research Tower phone 413 549-1020 (H) > University of Massachusetts 413 545-2859 (W) > 710 North Pleasant Street fax 413 545-1801 > Amherst, MA 01003-9305 === Subject: Re: Operate on Heads > I would like to be able to pass a composite name Head, e.g., > FirstSecondThird to a Module, > and then, inside the module, use FirstSecondThird, First, Second, Third Heads, and/or make other Operate ions on Heads How could this be accomplished? > I think you need to clarify this a bit. Pretend you have the function you need, and show us a call to that function and the output you would like to receive. David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Re: Operate on Heads Hi Andy, A basic approach would be to convert everything to strings, use Mathematicas string manipulation commands to create the expression youd like evaluated, then convert back to an expression. See below for a simple example. f[something_, x__] := Module[{strArgs, strHeads}, strHeads = ToString[something]; strArgs = Riffle[ToString /@ {x}, ,]; (* Manipulate your heads here *) strHeads = StringReplace[strHeads, p -> P]; StringJoin[strHeads, [, strArgs, ] ] // ToExpression ] f[plus, 2, 3] Hope that helps, Januk On Mar 16, 6:49 am, Dr Andy D Kucar P2EE4 www.radio4u.com > I would like to be able to pass a composite name Head, e.g., > FirstSecondThird to a Module, > and then, inside the module, use FirstSecondThird, First, Second, Third Heads, and/or make other Operate ions on Heads How could this be accomplished? > === Subject: Re: Operate on Heads > I would like to be able to pass a composite name Head, e.g., > FirstSecondThird to a Module, > and then, inside the module, use FirstSecondThird, First, Second, Third Heads, and/or make other Operate ions on Heads How could this be accomplished? I am not sure I understand the question ... how would this be different from passing a list of {First, Second, Third}? What do you mean exactly when you say composite head? === Subject: Re: Exporting Graphs > I am facing a problem when I try to export a graph was generated from > ContourPlot3D in EPS format. The graph does not take so much time (a > few seconds) to get the outpot but the diffeculty appears when I try > to export it. I tryied the two ways of exporting: using the menu file (save > selection as) and also the another way using the function Export. But > in both cases, the graph takes too much time to get it exported. Also, > the the eps file I get is too big (57 MB). Any help, please? thread/11cdfdd430541848/65aab26e91b1a21f thread/a669fd00915cbbf5/6b0387ea4f8732d4 === Subject: Re: Clearing selected variables > Hello All, > is there a way i can selectively clear all but a few variables in > mathematica?? i have a large number of variables and am iteratively > running my entire notebook through a loop and want most variables except > a few to get cleared between iterations.. > any help would be appreciated! The easiest way: Give them a common Context Begin[temp`] temp`x1 = 55 temp`y[t_]:= t^2/2 End[] ClearAll/@ Names[temp`*] or a common string lcx1=55 ytmp[t]:=t^2 ClearAll/@ Names[*tmp] -- Roland Franzius === Subject: Re: Bug: Derivative[] does not work with functions having slots in Even more interesting: this particular bug even follows from the documentation for Derivative: D[f[#],{#,n}]&. Thus, for your example, f[#] evaluates to Sin[2] and g[#] evaluates to Sin[1 + #1]. Thus, the issue is related to the scoping of Slot[1]. Perhaps the bug could be fixed by effectively changing Mathematica Module[{expr, x}, Function[expr] /. expr -> (D[f[x], {x,n}] /. x -> #)]. That should work. So here is a function that replaces Derivative[1] and works properly in your example: fixedDerivative[f_] := Module[{expr, x}, Function[expr] /. expr -> (D[f[x], x] /. x -> #)] > There is a bug in Derivative. It does not seem to like slots. For example, let f[x_] := Sin[x + #]&[1] (Yes, I know that this looks > silly. It is a simplified example.) D can be used for calculating the derivative, but Derivative cannot. In[2]:= D[f[a], a] > Out[2]= Cos[1 + a] In[3]:= f[a] > Out[3]= 0 A workaround is to use pure functions with explicitly named parameters: In[4]:= g[x_] := Function[{p}, Sin[x + p]][1] In[5]:= g[a] > Out[5]= Cos[1 + a] === Subject: Does Mathematica think Sqrt[2] is rational? This might be already well known, but... Consider the following expression expr = ForAll[{x, y}, x^2 != 2 y^2] If we test it over the Reals, it should be false, since x=Sqrt[2] and y=1 falsify it. Mathematica agrees with us Reduce[expr, {x, y}, Reals] However if we test it over the Integers or the Rationals it should be true, as a demonstration that Sqrt[2] is not rational. Mathematica , unfortunately, does not agree with us Reduce[expr, {x, y}, Integers] Reduce[expr, {x, y}, Rationals] So it appears that Mathematica thinks that there are 2 integers x, y such that x^2 = 2 y^2. Lets consider the negation of the previous expression expr2 = Exists[{x, y}, x^2 == 2 y^2] Mathematica correctly finds out that expr is true over the reals Reduce[expr2, {x, y}, Reals] But gives a wrong answer over the integers or the rationals Reduce[expr2, {x, y}, Integers] Reduce[expr2, {x, y}, Rationals] Finally, if we try the inequality without the quantifiers, the results are not very illuminating with the Reals, but still correct Reduce[x^2 != 2 y^2, {x, y}, Reals] While with Integers Mathematica misses the point entirely Reduce[x^2 != 2 y^2, {x, y}, Integers] Conclusion : Mathematica does not seem to realize that Sqrt[2] is irrational. Am I missing something or WRI has been infiltrated by Pythagoreans :-) ? === Subject: Re: Does Mathematica think Sqrt[2] is rational? Ops.. I have overlooked the trivial solution x=0 and y=0 in the logical equation. If we consider Reduce[ForAll[{x, y}, x != 0 && Element[x | y, Integers], x^2 != 2 y^2]] as suggested by Andrzej, Mathematica answers correctly. Oh well.. the pythagoreans did not come back after all. So Mathematica correctly realizes that Sqrt[2] is irrational. === Subject: Re: Does Mathematica think Sqrt[2] is rational? > This might be already well known, but... Consider the following expression expr = ForAll[{x, y}, x^2 != 2 y^2] If we test it over the Reals, it should be false, since x=Sqrt[2] and > y=1 falsify it. > Mathematica agrees with us Reduce[expr, {x, y}, Reals] However if we test it over the Integers or the Rationals it should be > true, as a demonstration that Sqrt[2] is not rational. > Mathematica , unfortunately, does not agree with us Reduce[expr, {x, y}, Integers] Reduce[expr, {x, y}, Rationals] So it appears that Mathematica thinks that there are 2 integers x, y > such that x^2 = 2 y^2. > Lets consider the negation of the previous expression expr2 = Exists[{x, y}, x^2 == 2 y^2] Mathematica correctly finds out that expr is true over the reals Reduce[expr2, {x, y}, Reals] But gives a wrong answer over the integers or the rationals Reduce[expr2, {x, y}, Integers] Reduce[expr2, {x, y}, Rationals] Finally, if we try the inequality without the quantifiers, the results > are not very illuminating with the Reals, but still correct Reduce[x^2 != 2 y^2, {x, y}, Reals] While with Integers Mathematica misses the point entirely Reduce[x^2 != 2 y^2, {x, y}, Integers] Conclusion : Mathematica does not seem to realize that Sqrt[2] is > irrational. Am I missing something or WRI has been infiltrated by > Pythagoreans :-) ? Thats very strange. I tried this expr=Exists[{x, y}, x/y == Sqrt[2] ] Reduce[expr,Reals] gives True. For Reduce[expr,Integers] or over Rationals I get Reduce::nsmet: This system cannot be solved with the methods available to Reduce. Looks like for your particular definition it breaks. On my system Reduce[Exists[{x, y}, x^2 == 2 y^2], {x, y}, Integers] returns x [Element] Integers && y [Element] Integers which is of course ridiculous since it does not hold for all integer x and y. === Subject: Re: Does Mathematica think Sqrt[2] is rational? > This might be already well known, but... Consider the following expression expr = ForAll[{x, y}, x^2 != 2 y^2] If we test it over the Reals, it should be false, since x=Sqrt[2] and > y=1 falsify it. > Mathematica agrees with us Reduce[expr, {x, y}, Reals] However if we test it over the Integers or the Rationals it should be > true, as a demonstration that Sqrt[2] is not rational. > Mathematica , unfortunately, does not agree with us Reduce[expr, {x, y}, Integers] Reduce[expr, {x, y}, Rationals] So it appears that Mathematica thinks that there are 2 integers x, y > such that x^2 = 2 y^2. > Lets consider the negation of the previous expression expr2 = Exists[{x, y}, x^2 == 2 y^2] Mathematica correctly finds out that expr is true over the reals Reduce[expr2, {x, y}, Reals] But gives a wrong answer over the integers or the rationals Reduce[expr2, {x, y}, Integers] Reduce[expr2, {x, y}, Rationals] > Conclusion : Mathematica does not seem to realize that Sqrt[2] is > irrational. Am I missing something or WRI has been infiltrated by > Pythagoreans :-) ? You seem to have missed the fact that {x,y} = {0,0} gives a solution of x^2 == 2 y^2 which is both _integer_ and _rational_, as well as real. David === Subject: Re: Re: Update 6.0.2 Flame on David. The latest roll out was handled poorly. WR can reach every customer with an email. They did not. Apparently, there is / was a bug in the MAC version of the release so I was not notified. This is not withstanding the fact that I also own the PC version of the software. When I sent an email to tech support asking how to get a copy of the new release, I got an email (after three days) telling me that they did not handle those questions and that they were forwarding the email to another department. As a customer, I have little or no concern about how WR manages itself internally. I would have been satisfied with an email telling me what was going on with an assurance that I would be notifed when the software was ready for distributioin. What I got was a not my job response that almost always indicates problems in the way the company is organized to deal with its customers. If you want to defend WR by calling me absurd, that is your business. However, there are a lot of people in the world that do not want to deal with that kind of customer service. They probably wont be dissuaded from their opinions by people calling them absurd. Richard > The roll out of 6.0.1 is not being handled very well -- even for > premier customers. As of the end of last week, there is no > discussion of the new release at the premier section of the website > and there has been no communication to premier service customers about > what is going on. WR is acting like a company with severe internal problems. I dont > know whether they are getting them from growth or if something else is > going on. They appear to be very unprepared on the customer service > and tech support side for the 6.x release. Its very sad. Bottom line -- its a great product, but it isnt ready for large > scale development work. What an absurd over reaction (as well as your muddle over the version > number). I presume the new release gets mentioned on the site after > everyone has been informed. I would far rather download approximately > 400 MB of code at a time when the server is not overloaded - even if > that means that I wait a day or two more. I cant see what relevance a short delay like that has to do with > Mathematicas suitability for development work! David Bailey > http://www.dbaileyconsultancy.co.uk -- Richard Palmer Home 508 877-3862 Cell 508 982-7266 === Subject: Re: ordering of multivariate polynomial terms how it is possible to rearrange the terms of a multivariate polynomial > in Standard or Traditional Form in such a way that the terms are ordered > according to the number of their variables, i.e. first the constant > term, then the group of terms depending on one of the variables, then > the group of terms depening on two variables, then the group of those > with three variables, etc.? > Stefan The approach below might do what you want. The idea is to recast the polynomial into a list with elements of the form {exponent vector, coefficient} (this uses the function GroebnerBasis`DistributedTermsList). But to achieve your desired ordering we rig the vectors so that they only have ones, that is, we make terms behave as though they were multilinear. We also must keep track of the original terms. Ill do this by replacing each variable to a power, x^j, with x^j*newx (no power associated to that newx) and keep the original variables in coefficients, only using the new ones in exponent vectors. I also will return the result in a dummy head, myPlus, to which I attach a formatting rule to print like the usual Plus, only without evaluating as Plus and reordering terms in the process. Finally, I will note that the code below assumes the input is a polynomial in some obvious set of variables, and that it is in expanded form. Format[myPlus[ee__]] := Infix[myPlus[ee], +] orderByNumberVariables[poly_Plus] := Module[ {vars = Variables[poly], x, n, newvars, ruls, new}, n = Length[vars]; newvars = Array[x, n]; ruls = Table[vars[[j]]^n_. -> vars[[j]]^n*newvars[[j]], {j, n}]; new = GroebnerBasis`DistributedTermsList[poly /. ruls, newvars, MonomialOrder -> DegreeLexicographic]; Apply[myPlus, Map[Last, Reverse[First[new]]]] ] Here is a short example. In[95]:= x^2*y + x*y*z + z^2 Out[95]= x^2 y + x y z + z^2 In[97]:= orderByNumberVariables[x^2*y + x*y*z + z^2] Out[97]= 2 2 (z )+(x y)+(x y z) The formatting is a bit awkward because I had to convert to OutputForm to get the cut-paste to give anything legible. It is not hard to code variants that take a variable list into account in deciding, say, whether x comes before or after z. There is a project afoot to improve on TraditionalForm, in part by making it more configurable. A side effect of this project is that we might (finally) promote DistributedTermsList-- and its sibling functions. Daniel Lichtblau Wolfram Research === Subject: Re: CA for Epidemics with Mathematica? Illustrating Evolutionary Computation with Mathematica. In this book he has some reference to modelling the smallpox epidemic in Paris (maybe, I forget the exact reference) using CAs and other EAs. I think this guy is chasing swarm theory now. HTH. ---------------------------------------------------------------- > I would like to know who is actually using CA to model epidemics with > Mathematica. --V. Stokes === Subject: Re: Speeding up FindMinimum setup >I am having trouble with the time FindMinimum takes to make its first >step in an optimization. I am doing something wrong but I am not sure >what. This is a repost of a previous question that I phrased poorly. I am minimizing a convex f: R^n->R with derivative df: R^n->R^n using >FindMinimum. A toy example, n = 1000; >f[k_] := k.k >df[k_] := 2k I find the minimal k starting at random k0: k0 = RandomReal[1, n]; >ker = Array[k, n]; min = Reap[ > t0 = AbsoluteTime[]; > FindMinimum[f[ker], Transpose[{ker, k0}], Gradient -> df[ker], > StepMonitor :> Sow[AbsoluteTime[] - t0]] >]; min[[2,1]] gives the times of the steps (Above is a bad example as it converges in one step.) For my particular convex f, FindMinimum takes a very long time before >it makes its first step but then proceeds very quickly. And time >scales superlinearly with n. It takes so long that I have resorted to >a C Mathlink function that does BFGS or ConjugateGradient (from Press >et al., Numerical Recipes, v3) and calls f and df through Mathlink. What is FindMinimum doing during this time before the first step? >Compiling f and df? It does this even when I precompile f and df and >specify Method. How do I specify my problem so it works faster? I >would like it to just start making optimization steps because its >surprisingly efficient even with n large when it gets going. for the optimization functions in Mathematica and the examples in >UnconstrainedProblems.m. Art. > > Perhaps you could try using a vector variable approach: Clear[f, df] f[k_List] := k.k df[k_List] := 2 k k0 = RandomReal[1, 1000]; min = FindMinimum[f[v], {v, k0}, Gradient -> df[v]]; Or, a slightly less trivial example: Clear[f, df] f[k_List] := (k.k - 2)^2 df[k_List] := 4 k (k.k - 2) k0 = RandomReal[1, 1000]; min = FindMinimum[f[v], {v, k0}, Gradient -> df[v]]; Carl Woll Wolfram Research === Subject: Re: Pi is not a real number? Actually I realized after submiting that RealDigits will covert Pi to a number on its own. The problem stems from the fact that you are asking for so many digits, although the error message returned by Mathematic even in 6.0.2.0 is misleading. === Subject: Question on looping FindRoot this is probably due to my being relatively new to Mathematica, but I cannot succesfully execute a loop with FindRoot. when I give the following input (I have converted it to input form): ClearSystemCache[] ratio = 1 [Lambda] = 1.4 k = 1 Overscript[U1, DifR] = Table[14 - 6*[Beta]1, {[Beta]1, 0, 0.5/ratio, 0.5/ratio/1000}]; Overscript[U1, UifR] = Table[4 - 18*[Alpha]1, {[Alpha]1, 0, 0.5, 0.0005}]; Overscript[U1, UifL] = Table[10 - 2*[Alpha]1, {[Alpha]1, 0, 0.5, 0.0005}]; Overscript[U1, DifL] = Table[9*([Alpha]1 + 1)^0, {[Alpha]1, 0, 0.5, 0.0005}]; Overscript[U2, LifD] = Table[9*([Alpha]1 + 1)^0, {[Alpha]1, 0, 0.5, 0.0005}]; Overscript[U2, RifD] = Table[8 - 6*[Alpha]2, {[Alpha]2, 0, 0.5, 0.0005}]; Overscript[U2, RifU] = Table[22 - 18*[Beta]2, {[Beta]2, 0, 0.5/ratio, 0.5/ratio/1000}]; Overscript[U2, LifU] = Table[12 - 2*[Beta]2, {[Beta]2, 0, 0.5/ratio, 0.5/ratio/1000}]; For[k = 1, k < 5, k++, eq1 = Pu == (Exp[[Lambda]*(Overscript[U1, UifL][[k]]*Ql + Overscript[U1, UifR][[k]]*(1 - Ql))]/ (Exp[[Lambda]*(Overscript[U1, UifL][[k]]*Ql + Overscript[U1, UifR][[k]]*(1 - Ql))] + Exp[[Lambda]*(Overscript[U1, DifL][[k]]*Ql + Overscript[U1, DifR][[k]]*(1 - Ql))]))*eq2 = Ql == (Exp[[Lambda]*(Overscript[U2, LifU][[k]]*Pu + Overscript[U2, LifD][[k]]*(1 - Pu))]/ (Exp[[Lambda]*(Overscript[U2, LifU][[k]]*Pu + Overscript[U2, LifD][[k]]*(1 - Pu))] + Exp[[Lambda]*(Overscript[U2, RifU][[k]]*Pu + Overscript[U2, RifD][[k]]*(1 - Pu))]))*Prob = FindRoot[{eq1, eq2}, {Pu, 0}, {Ql, 0}]*ProbUp[[k ;; All]] = %[[1]]*ProbLf[[k ;; All]] = %%[[2]]] Im told Symbol::argx: Symbol called with 0 arguments; 1 argument is expected. and: Set::write: Tag Times in Alessandro -- Alessandro Tavoni Ph.D. candidate Advanced Scool of Economics, University of Venice C=E0 Foscari http://venus.unive.it/alessandro.tavoni === Subject: Unwanted lined in PDF-exported Graphics3D Simple code as Export[test.pdf, Graphics3D[{ Polygon[Table[Chop[{Cos[t], Sin[t], 0}], {t, 0, 2 Pi, 0.1}]] }] ] results in a PDF file which has lots of extra lines on the surface. Is there a way to get rid of them? -- m === Subject: Re: is rational? > This might be already well known, but... Consider the following expression expr = ForAll[{x, y}, x^2 != 2 y^2] If we test it over the Reals, it should be false, since x=Sqrt[2] and > y=1 falsify it. > Mathematica agrees with us Reduce[expr, {x, y}, Reals] However if we test it over the Integers or the Rationals it should be > true, as a demonstration that Sqrt[2] is not rational. > Mathematica , unfortunately, does not agree with us Reduce[expr, {x, y}, Integers] Reduce[expr, {x, y}, Rationals] So it appears that Mathematica thinks that there are 2 integers x, y > such that x^2 = 2 y^2. > Lets consider the negation of the previous expression expr2 = Exists[{x, y}, x^2 == 2 y^2] Mathematica correctly finds out that expr is true over the reals Reduce[expr2, {x, y}, Reals] > But gives a wrong answer over the integers or the rationals Reduce[expr2, {x, y}, Integers] Reduce[expr2, {x, y}, Rationals] Finally, if we try the inequality without the quantifiers, the results > are not very illuminating with the Reals, but still correct Reduce[x^2 != 2 y^2, {x, y}, Reals] While with Integers Mathematica misses the point entirely Reduce[x^2 != 2 y^2, {x, y}, Integers] Conclusion : Mathematica does not seem to realize that Sqrt[2] is > irrational. Am I missing something or WRI has been infiltrated by > Pythagoreans :-) ? You are missing a lot... First of all, consider the expression: Reduce[ForAll[{x, y}, Element[x | y, Integers], x^2 != 2 y^2]] False this is correct, because FindInstance[Element[x | y, Integers] && x^2 == 2 y^2, {x, y}] {{x -> 0, y -> 0}} On the other hand: Reduce[ForAll[{x, y}, x != 0 && Element[x | y, Integers], x^2 != 2 y^2]] True as it should be. Note also, that I write everywhere Element[x|y,Integers] , which menas both x and y are assumed to be integers. In general this is what you have to do. Writing only Reduce[expr, {x, y}, Integers], Reduce[expr, {x, y}, Reals] actually means something quite different - it involves the assumption that all the subexpressions occuring in the expression exp are Reals or Integers and can produce very surprising results. Finally, as I have already poitnted out, general quantifier elimination works only over the Reals so its easy to find very simple formulas over which Mathematica will not resolve over the integers. Andrzej Kozlowski === Subject: Re: Does Mathematica think Sqrt[2] is rational? >expr2 = Exists[{x, y}, x^2 == 2 y^2] >Mathematica correctly finds out that expr is true over the reals >Reduce[expr2, {x, y}, Reals] >But gives a wrong answer over the integers or the rationals >Reduce[expr2, {x, y}, Integers] >Reduce[expr2, {x, y}, Rationals] I believe you are overlooking the trivial solution In[5]:= Assuming[x [Element] Integers && y [Element] Integers, FindInstance[expr2, {x, y}]] Out[5]= {{x->0,y->0}} === Subject: Compiled function slowdown generator = Compile[{stepTotAccum_Real, {dxTable, _Real, 1}, pTile_Real, area_Real}, Do[ While[True, u = Random[]; If[ u < stepTotAccum, stats = 1 + 4*Floor[u/pTile]; cand = (u - dxTable[[stats + 2]])/dxTable[[stats + 1]] + dxTable[[stats]]; If[Random[]*dxTable[[stats + 3]] < fComp[cand], Return[cand * (-1)^Random[Integer]] ]; , cand = e1[u]; If[e2[Random[], cand, area] < fComp[cand], Return[cand * (-1)^Random[Integer]] ]; ]; ]; ] ]; === Subject: header/footer option I was asked by one of my students whether the name of section or subsection or title can be used instead of FileName in the header/footer option. The default setting for header information referring to the file name of the Mathematica notebook to be printed is : Cell[ TextData[ {ValueBox[ FileName]}],Header] Thus, instead of the variable FileName some other variable (say SectionName ???) containing text extracted from a section cell (or some other cell type) should be used. An advise would be very much appreciated. Robert Kragler Email: kragler@hs-weingarten.de === Subject: How to consider BrowserCategories in Version 6.0? I want to embed supplementary Mathematica packages in Mathematica version 6.0.x and want to include the BrowserCategories.m and BrowserIndex.nb files in the Help system. In version 5.2 I installed under the directory tree Program Files > Wolfram Research > Mathematica > 5.2 > AddOns > Applications > (supplementary package eg. FuzzyLogic) > Documentation > English > ( .m and .nb files such as BrowserCategories.m, BrowserIndex.nb ...) Then in the Help pulldown menu there is a button Rebuild Help Index with the result that afterwards the additional information was accessible in the Help menu under Help Browser > Add-ons & Links. The same directory tree structure is present in version 6.0.x too. Hence, I could insert in the subdirectory Applications - or even better in ExtraPackages - the supplementary packages etc. I would like to access in version 6.0 too. However, what I cannot find is a similar button which corresponds to Rebuild Help Index (as in version 5.2) to rebuild the Help Index. My question is : how can I install an external Mathematica package so that the files BrowserCategories.m and BrowserIndex.nb will be considered in version 6.0? -- ----------------------------------------------------------------------- Prof. Dr. Robert Kragler Hochschule Ravensburg-Weingarten / Weingarten University of Applied Sciences Faculty Technology & Management Deputy Rector for Research & International Relations / P.O.B 1261, D-88241 Weingarten, Germany Phone: +49 751 501-9539 Fax: +49 751 501-5-9539 Email: kragler@hs-weingarten.de URL: http://www.hs-weingarten.de/~kragler ------------------------------------------------------------------------ === Subject: best fitting I have some experimental data in the form of quadruplets {P, W, t, D}. How can I find the best fit parameters: alfa, A and E1 of the function: P = { (W - K^2/3) / t + A [(W - K^2/3) / t]^3} E1 (t^4) / (25^2) where K = P / (alfa D^0.5). -u === Subject: Bug: symbol recreates itself suddenly It seems to me that after Remove[symbol] some times the symbol is recreated without notice. Consider the following example. How to repeat: In[1]:= $Version Out[1]= 6.0 for Microsoft Windows (32-bit) (April 20, 2007) In[2]:= Unprotect[E]; ClearAttributes[E, {Constant, Protected, ReadProtected}]; Remove[E]; In[4]:= ?E During evaluation of In[4]:= Information::notfound: Symbol E not found. >> In[5]:= Solve[E == 2] Out[5]= {{Global`E -> 2}} (* ?! *) In[6]:= ?E E is the exponential constant e (base of natural logarithms), with numerical value [TildeEqual]2.71828. >> (* THIS IS NOT CORRECT ANSWER *) Severin Posta === Subject: Using a logical Or in the function definition I would like to use Or in the function definition as in ab[ Or[r_Integer,r_Rational], Or[s_Integer,s_Rational] ]:=r/s; In other words, I want the function to take integers or ratios of integers as arguments, but not real numbers which are not rational. But if I give the function integer arguments, it does not evaluate. If I try ar[ r_Integer , Or[s_Integer , s_Rational]] := r/s; and give an integer first argument it works and so on. === Subject: importing nb files a very basic question - sorry for that... probably its me, almost never having programmed large projects that needed breaking up in different notebooks, so I seldom used the Get (<<) function, but I seemed to remember this function would allow me to Import&evaluate a notebook in another. So, defining simply a=2 in a notebook test.nb, when I executed: < {{3.41474*10^9, 3.41474*10^9}}], Cell[BoxData[2], Output, CellChangeTimes -> {3.41474*10^9}]}, Open]]}, WindowSize -> {640, 750}, WindowMargins -> {{150, Automatic}, {Automatic, 52}}, FrontEndVersion -> 6.0 for Linux x86 (32-bit) (February 7, 2008), StyleDefinitions -> Default.nb] (a verbose output which I didnt remember) and, moreover, my a variable still remains undefined! What Im missing (or forgetting)? Alessandro === Subject: Re: V.6.0.2 gripes... me too I tried it: I forbidden Mathematica to accessin Internet (Help- >Internet Connectivity) and the slowdowns remained the same. Id like very much to know what kind of Java code is needed right from the start in the Doc center, and in particular in the Virtual Book and the Function Navigator - since these last two are noticeably even slower. Alessandro Helen Read ha scritto: >> We have been seeing the Java timeout error a lot, on machines on campus >> and at home. It started a few months ago, and the upgrade from 6.0.1 to >> 6.0.2 has not helped. If anything, Im seeing the Java timeout more >> frequently than before, even on two very speedy new machines where I was >> rarely getting the Java error before. What happens much/most of the time >> now is that when you start up Mathematica and go to execute a command, >> Mathematica just hangs for a while. Eventually, after quite a long wait, >> you get the first output, together with the Java timeout error. >> *Usually* its OK if you quit Mathematica and restart, or if you just >> close up the error window and go on. > In the absence of a definitive response from WRI, I think it would be > worth experimenting with a machine disconnected from the internet. I > dont get this problem myself, but I have written code that depended on > paclet information. This worked well if the machine could not access the > internet (once the relevant data had been downloaded once) and well if > the machine had a good internet connection. However with a weak > connection, the system would seem to start the check for more up to date > information, and then get stuck/crash. It seems unrelated to internet access. We have quite good connections at > the university, and we get the Java error there all the time. I have > dial-up at home, and I get the Java error regardless of whether I am > connected. I wonder if Mathematica is trying to update some component on startup. > Any internet access would probably occur via Java. In particular, have > you configured your Mathematica to pre-load any software? Nope. But apparently Mathematica itself tries to load some Java stuff on > startup, hence the timeout errors. -- > Helen Read > University of Vermont === Subject: Re: V.6.0.2 gripes... >> We have been seeing the Java timeout error a lot, on machines on campus >> and at home. It started a few months ago, and the upgrade from 6.0.1 to >> 6.0.2 has not helped. If anything, Im seeing the Java timeout more >> frequently than before, even on two very speedy new machines where I was >> rarely getting the Java error before. What happens much/most of the time >> now is that when you start up Mathematica and go to execute a command, >> Mathematica just hangs for a while. Eventually, after quite a long wait, >> you get the first output, together with the Java timeout error. >> *Usually* its OK if you quit Mathematica and restart, or if you just >> close up the error window and go on. > In the absence of a definitive response from WRI, I think it would be > worth experimenting with a machine disconnected from the internet. I > dont get this problem myself, but I have written code that depended on > paclet information. This worked well if the machine could not access the > internet (once the relevant data had been downloaded once) and well if > the machine had a good internet connection. However with a weak > connection, the system would seem to start the check for more up to date > information, and then get stuck/crash. It seems unrelated to internet access. We have quite good connections at the university, and we get the Java error there all the time. I have dial-up at home, and I get the Java error regardless of whether I am connected. > I wonder if Mathematica is trying to update some component on startup. > Any internet access would probably occur via Java. In particular, have > you configured your Mathematica to pre-load any software? Nope. But apparently Mathematica itself tries to load some Java stuff on startup, hence the timeout errors. -- Helen Read University of Vermont === Subject: Re: V.6.0.2 gripes... > We have been seeing the Java timeout error a lot, on machines on campus > and at home. It started a few months ago, and the upgrade from 6.0.1 to > 6.0.2 has not helped. If anything, Im seeing the Java timeout more > frequently than before, even on two very speedy new machines where I was > rarely getting the Java error before. What happens much/most of the time > now is that when you start up Mathematica and go to execute a command, > Mathematica just hangs for a while. Eventually, after quite a long wait, > you get the first output, together with the Java timeout error. > *Usually* its OK if you quit Mathematica and restart, or if you just > close up the error window and go on. > In the absence of a definitive response from WRI, I think it would be >> worth experimenting with a machine disconnected from the internet. I >> dont get this problem myself, but I have written code that depended on >> paclet information. This worked well if the machine could not access the >> internet (once the relevant data had been downloaded once) and well if >> the machine had a good internet connection. However with a weak >> connection, the system would seem to start the check for more up to date >> information, and then get stuck/crash. It seems unrelated to internet access. We have quite good connections at > the university, and we get the Java error there all the time. I have > dial-up at home, and I get the Java error regardless of whether I am > connected. > I wonder if Mathematica is trying to update some component on startup. >> Any internet access would probably occur via Java. In particular, have >> you configured your Mathematica to pre-load any software? Nope. But apparently Mathematica itself tries to load some Java stuff on > startup, hence the timeout errors. > Clearly Mathematica must only wait for so long for Java to come live, so a sufficient delay in starting Java will cause the problem. I am trying to think of ways in which your machine (is it Windows XP, which I use, or the dreaded Vista) might differ from mine, because so far I have never seen the timeout. One obvious possibility raised by the original post is that your virus scanner introduces some delay - maybe only the first time a command executes... Disconnecting both the internet and your virus scanner would be an interesting experiment. Failing that, I would try disabling any other software that you have running - again as an experiment. Of course, a very old and slow machine might fall foul of a timeout. David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Re: Sub-division of surface plotting by PlotPoints->{m,n} On Feb 17, 4:20 am, Jens-Peer Kuska a) your surface has *no* straight edge > b) > ParametricPlot3D[{u Cos[t], u Sin[t], t}, {u, 1, 2}, {t, 0, 2 Pi}, > Mesh -> All, PlotPoints -> {4096, 4096}] will create more polygons in the polygonal approximation than you > will need. Jens I need to further sub-divide some skew quadrilaterals dividing each > advance for such an indication. ParametricPlot3D[ {u Cos[t], u Sin[t], t}, {u,1,2}, {v,0,Pi}, i.e.,actually ParametricPlot3D[ {u Cos[t], u Sin[t], t}, {u,1,2}, {t, 0,Pi}, > PlotPoints-> {2,3} ] Narasimham I meant {2,3} subdivision points and incorrectly put in the same numbers for PlotPoints. Actually I wished to post <{3,4}] which has 2 X 3 = 6 skew quadrilaterals with total all 8 straight edges. Right? Narasimham === Subject: Re: Sterographic display Yes the two viewpoints can be adjusted together. Here is a code which can do the job in Mathematica 6.0: Manipulate[ > With[{v = RotationTransform[Angle, {0, 0, 1}][{3, 0, 3}], > w = RotationTransform[Angle + 0.1, {0, 0, 1}][{3, 0, 3}]}, Row[{ > Graphics3D[{Sphere[], Cuboid[]}, ViewPoint -> v, SphericalRegion - True, > ImageSize -> 200], > Graphics3D[{Sphere[], Cuboid[]}, ViewPoint -> w, SphericalRegion - True, > ImageSize -> 200]}]], {Angle, 0, 2 Pi}] > Heres another way to rotate two objects together (just start dragging one of them): Row[ {Graphics3D[Cuboid[], ViewPoint -> Dynamic[vp], ViewVertical -> Dynamic[vv], SphericalRegion -> True], Graphics3D[Cuboid[], ViewPoint -> Dynamic[vp], ViewVertical -> Dynamic[vv], SphericalRegion -> True]} ] This example just illustrates the concept, of course it needs a lot more work to build something useful and usable. === Subject: Re: A Use for Interpretation > Very nice! Some other places where this might be employed are in laws > of exponents or laws of logs. Or applying trig identities. Or Laplace > transform. Ideally, this could be used not just by the teacher, but by the student > who would demonstrate that she knows the rules by teaching them to the > computer. Yet theres a catch to that: the Mathematica > sophistication needed, what with ReplaceRepeated, RuleDelayed, HoldForm, > ReleaseHold, and FreeQ. Not to mention the strange definition of the > function, like integrate here, which must be defined in terms of itself. > Since Version 6 appeared and I first encountered Interpretation I found it >> rather difficult to understand what use it might have. The examples in Help >> seem almost bizarre. >> Here is one use where it works rather well. Teachers might often be >> frustrated in demonstrating the behavior of basic function such as D, >> Integrate or Limit because Mathematica automatically evaluates using its >> built-in rules. With Interpretation we can define a pseudo routine that >> displays as the real routine and then apply our own basic transformation >> rules. Here is an example with a linear breakout of Integrate. >> integrate[integrand_, var_] := >> Interpretation[HoldForm[Integrate[integrand, var]], >> integrate[integrand, var]] >> We then define rules that breakout sums and constant factors. The rules even >> display in a nice form. >> rule1 = integrate[a_ + b_, x_] -> integrate[a, x] + integrate[b, x] >> rule2 = integrate[a_?(FreeQ[#, x] &) b_, x_] -> a integrate[b, x] >> Then we can demonstrate how these rules work, performing the actual >> integration in the last step. >> integrate[5 a Sin[x] + y Cos[x] + x^2, x] >> % //. rule1 >> % //. rule2 >> % /. Interpretation[a_, b_] :> ReleaseHold[a] > I think there is a better way to do this. I use Inert[Integrate]Sin[x],{x,0,Pi}] and use a MakeBoxes rule to display the result as a grey-shaded integral. The advantage of this method is that it is possible to edit the contents of the inert integral and re-input the result. David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Re: Re: Making a lists with conditions Here is a way that seems sufficiently different from the others that I have seen to be pehraps worth posting: list1 = {3.8, 3.85, 3.9, 3.95, 4., 4.05, 4.1}; list2 = {{3.85, 120}, {4.0, 111}, {4.1, 314}}; Union[list1 /. (x_)?NumberQ -> {x, $}, list2, SameTest -> (First[#1] == First[#2] &)]/. $ -> 0 {{3.8, 0}, {3.85, 120}, {3.9, 0}, {3.95, 0}, {4., 111}, {4.05, 0}, {4.1, 314}} Andrzej Kozlowski > On Feb 18, 11:02 pm, Guillermo Sanchez I have two list (list1:{a1, ...ai, aj, ..., an}, list2:{{ai, >> bi}, ..., {aj, bj}}. >> I wish to obtain a new list (list3} where be included all members of >> list1 and list2. If elements ak is not included in list2 then write >> {ak, 0}. >> Here is an example: >> list1 = {3.8, 3.85, 3.9, 3.95, 4., 4.05, 4.1}; >> list2 = {{3.85, 120}, { 4.0 , 111}, {4.1, 314}}; >> ff[list1_, list2_] := =BFlist1, list2? >> Here is the ouput that I wist to obtain >> Out:={{3.8, 0} , {3.85`, 120}, {3.9`, 0}, {3.95, 0}, {4.`, 111}, >> {4.05`, 0}, {4.1`, 314}} >> I have a method but it is two complicate. I am sure that some members >> of the group will find a elegant solution >> Guillermo === Subject: Re: Using Mathematica figures in MS Word documents If you resize the graphic in Mathematica so that it is larger, then Copy As Bitmap to MS Word, then in MS Word resize back to whatever (smaller) size you wanted in the first place, you can get very good results. Experiment with the resizing factor to find what suits your requirements. Alternatively, if you make careful use of PlotPoints -> (or whatever is needed to control the plotting accuracy), then you can use Copy As Metafile to obtain good results in MS Word. Stephen Luttrell West Malvern, UK > Using Mathematica Im able to generate lovely graphs and figures. > However, Im almost always disappointed about the quality when I copy > them to Word documents (and I really, really need them in Word; > Mathematica as a wordprocessor is not an option in my case). Copying as WMF (windows meta file) will result in most figures (except > the most simple ones with straight lines) to look ugly. Smooth lines > will be chopped into many wiggly line segments etc. Ive covered the > font problem by having everybody that uses my docs downloading the > Mathematica fonts. Copying as bitmap is also not really an option. On screen its > acceptable, but printed itll look ugly. The only thing that seems to work is to export the graphics as EPS > with a bitmap preview and including this in Word. This yields good > output on the printer, and a somewhat less good (and less accurate) > preview on screen causing my textprocessing department to bug me with > questions about figure quality. Apart from that, its a very clumsy > process, which also increases file size unnecessarily. At least Id > like to have this as a menu option (Copy as EPS with preview). Im > not sure whether a corresponding paste would work in Word, though. I use lots of programs that are able to embed their graphics in word > as an OLE object (Statistica,Excel,Flowcharter). This seems to work > great as far as quality is concerned. Wouldnt this be an option for > Mathematica? Any thoughts or solutions on this? > === Subject: Re: Using Mathematica figures in MS Word documents Nazdrovje, one way to paste metafiles quite well into MS programs is - believe it or not - to paste them into OpenOffice first and then c&p again into Word or PPT etc. Dunno why, but worked fine for me in V5 and mostly V6 as well. Yves > Using Mathematica Im able to generate lovely graphs and figures. > However, Im almost always disappointed about the quality when I copy > them to Word documents (and I really, really need them in Word; > Mathematica as a wordprocessor is not an option in my case). Copying as WMF (windows meta file) will result in most figures (except > the most simple ones with straight lines) to look ugly. Smooth lines > will be chopped into many wiggly line segments etc. Ive covered the > font problem by having everybody that uses my docs downloading the > Mathematica fonts. Copying as bitmap is also not really an option. On screen its > acceptable, but printed itll look ugly. The only thing that seems to work is to export the graphics as EPS > with a bitmap preview and including this in Word. This yields good > output on the printer, and a somewhat less good (and less accurate) > preview on screen causing my textprocessing department to bug me with > questions about figure quality. Apart from that, its a very clumsy > process, which also increases file size unnecessarily. At least Id > like to have this as a menu option (Copy as EPS with preview). Im > not sure whether a corresponding paste would work in Word, though. I use lots of programs that are able to embed their graphics in word > as an OLE object (Statistica,Excel,Flowcharter). This seems to work > great as far as quality is concerned. Wouldnt this be an option for > Mathematica? Any thoughts or solutions on this? > === Subject: Re: find and count partially identical sublist Define the list to be processed. In[1]:= data={{B,A,0,1},{A,B,6,1},{B,A,4,1},{B,A,4,1 },{A,B,1,1},{B,A,5,1},{B,A,2,1},{A,B,10,1}} Out[1]= {{B,A,0,1},{A,B,6,1},{B,A,4,1},{B,A,4,1},{A,B,1,1},{B,A,5,1},{B,A,2,1},{A,B, 10,1}} Split the list into sublists containing runs of identical sublists (defined according to the stated criterion). In[2]:= data2=Split[data,Take[#1,2]==Take[#2,2]&] Out[2]= {{{B,A,0,1}},{{A,B,6,1}},{{B,A,4,1},{B,A,4,1}},{{A,B,1,1}},{{B,A,5,1},{B,A,2 ,1}},{{A,B,10,1}}} Determine the lengths of the identical runs. In[3]:= length2=Map[Length,data2] Out[3]= {1,1,2,1,2,1} Replace each sublist by an appropriately scaled version. The pattern {x1_,x2_,x3_,y_}?VectorQ matches a list of length 4 each of whose elements is not itself a list. In[4]:= data3=MapThread[#1/.{x1_,x2_,x3_,y_}?VectorQ->{x1,x2,x3,y/#2}&,{data2,length 2}] Out[4]= {{{B,A,0,1}},{{A,B,6,1}},{{B,A,4,1/2},{B,A,4,1/2}},{{A,B,1,1}},{{B,A,5,1/2}, {B,A,2,1/2}},{{A,B,10,1}}} Stephen Luttrell West Malvern, UK > Hello group, I am trying to find and count sublists that are partially identical to > each other and then modify parts of this sublist with the > multiplicity. Its easier to understand if I give an example. Say I have an array (strings and numbers mixed) like: {{B, A, 0, 1}, {A, B, 6, 1}, {B, A, 4, 1}, {B, A, 4, > 1}, {A, B, 1, 1}, {B, A, 5, 1}, {B, A, 2, 1}, {A, B, > 10, 1}} I need to find successive sublists which have the same first two > elements (here {3,4} and {7,6}). Depending on > how many repetitions occur I want to divide the 4th element of each > sublist by the number of repetitions. In the example the result would > be: {{B, A, 0, 1}, {A, B, 6, 1}, {B, A, 4, 1/2}, {B, A, 4, > 1/2}, {A, B, 1, 1}, {B, A, 5, 1/2}, {B, A, 2, 1/ > 2}, {A, B, 10, 1}} The code I came up with is: > tst = Table[{RandomChoice[{A, B}], RandomChoice[{A, B}], > RandomInteger[{0, 10}], 1}, {i, 1, 30}]; > tab = Table[tstSplt[[1, i]] // Length, {i, 1, Length[tstSplt[[1]]]}] > rpl = MapThread[#1[[All, 4]]/#2 &, {tstSplt[[1, All]], tab}] // > Flatten > tst[[All, 4]] = tst[[#, 4]] & @@@ rpl; > tst > This works, but I am somewhat concerned with run speed (my actual > array is much larger, roughly 50000x20). And I have the feeling that I > am wasting too much memory. > One additional comment: The above code only finds successive > duplicates. How would I have to modify it to find all occurences ? Markus Roellig I.Physikalisches Institut der > Universit=E4t zu K=F6ln > Z=FClpicher Strasse 77 > D-50937 K=F6ln > Tel.: +49-221-470-3547 > Fax : +49-221-470-5162 > === Subject: Re: find and count partially identical sublist Hi Markus, > I am trying to find and count sublists that are partially identical to > each other and then modify parts of this sublist with the > multiplicity. Its easier to understand if I give an example. Say I have an array (strings and numbers mixed) like: {{B, A, 0, 1}, {A, B, 6, 1}, {B, A, 4, 1}, {B, A, 4, > 1}, {A, B, 1, 1}, {B, A, 5, 1}, {B, A, 2, 1}, {A, B, > 10, 1}} I need to find successive sublists which have the same first two > elements (here {3,4} and {7,6}). Depending on > how many repetitions occur I want to divide the 4th element of each > sublist by the number of repetitions. In the example the result would > be: {{B, A, 0, 1}, {A, B, 6, 1}, {B, A, 4, 1/2}, {B, A, 4, > 1/2}, {A, B, 1, 1}, {B, A, 5, 1/2}, {B, A, 2, 1/ > 2}, {A, B, 10, 1}} One additional comment: The above code only finds successive > duplicates. How would I have to modify it to find all occurences ? I hope I understood correctly what you want to achieve. Here is my version which finds only successive duplicates, I did not analyze run times and memory consumption, but this could be done more efficient for sure: Flatten[ Map[ Replace[#, {a__, x_} :> {a, x/Length[#]}, {1}] &, Split[data, #1[[{1, 2}]] == #2[[{1, 2}]] &], {1} ], 1 ] If you really need to find all occurrences I would use a completely different approach: ClearAll[$numocc] $numocc[__] = 0; Scan[ ($numocc[#[[1]], #[[2]]] = $numocc[#[[1]], #[[2]]] + 1) &, data ]; Apply[{#1, #2, #3, #4/$numocc[#1, #2]} &, data, {1}] here I abuse the downvalues of the helper symbol $numocc as a dictionary to count occurrences of the first two arguments. To understand what happens you might want to look at DownValues[$numocc]. Again I did not analyze run times and memory consumptions but in this case believe they shouldnt be too bad. After all you are only scanning the data twice, once to count the occurrences and once to divide the forth argument. Memorywise you are making one copy of your data. If really necessary it could with some effort be possible to avoid that copy, but most probably this is not necessary. hth, albert === Subject: DE with variable point boundary condition How to numerically Solve a differential equation like [{ y[ t] == 1 + 2 y[t], y[t + Sin[t]] == 1}, y, {t, 0, 10}] ; Should y[0] be assumed arbitrarily and then refined by some sort of variable boundary value problem iteration? Basically :) does it make sense as the BC is function of a function? Narasimham === Subject: Re: NDSolve[] and Differential Equations: Problem solving two I looked into the set of equations once again to verify it, but the equation phieq contains the phi terms and along with phicon1 and phicon2 (initial conditions) they are all included in the equation as shown below: eqn1 = Table[ Flatten[{wdef1icon1, wdef1icon2, wdef2icon1, wdef2icon2, sdeficon1, sdeficon2, phicon1, phicon2, phieq, v3eq, v1eq, v2eq, modsetitr[[im]]}], {im, 1, nmx}]; So it is something I messed up with solving several different differential equations related to each other. I dont see any example in the Help section. All discusses one differential equation only. If you have any examples please post here. Also one problem I experienced is that in the definition (used in the code) like below: reactP1[t_] := ([Pi]^4 [Kappa] wrf1^2)/ 24 (Chop[wdef1itr[t]] - Chop[func[t, t]]); or simply r1[t_]:=k*(a[x,t]-b[t]) for easy understanding, I am only checking if the entire term i.e., k(a[x,t]-b[t]) is positive and if not positive, substitute zero for that term. For that I am using the below syntax. r[t] = r[t] /. t_?Negative -> 0; (This only checks if the argument is negative or not. Isnt it? If so, then I have to store the a[x,t]-b[t] to another variable and check if that variable is negative). Problem is, if b[t] evaluates to negative, it removes it and shows only k*a[x,t] i.e. r1[t]=k*(a[x,t]-1) becomes r1[t]=k*a[x,t]. If the entire term is not computable i.e. a[x,t] is yet to be found, then I want it to be r1[t]=k*(a[x,t]-1) only and not k*a[x,t]. However in the later steps, (after I introduce Do loop) a[x,t] values will be available and hence it will evaluate the whole term and see if it is negative. That case works fine for me. Do you know workaround for that? Currently I can do one simple thing, I will check the step number, if step is zero (in the Do loop with step=0 in the beginning), I keep it as k*(a[x,t]-1), and as step increments, I do the check so it evaluates the whole term. Gopinath Venkatesan University of Oklahoma === Subject: Re: Summation question >> Good day all, >> I want to make a summation like this: Sum[f[i],{i, start, >> finish}]. What I want is that the sum be over a specific set like >> {1,3,5,7,11,13}. So the sum would be : f[1]+f[3]+f[5]+f[7]+f[11]+f >> [13]. The >> set I want to use is the primes. So, how do I use, if possible, Sum >> over a >> specific set ? One way is to map the sum indices to the set elements eg: Sum[f[Prime[i]],{i,start,finish}] but this may present problems if the sum is over an infinite range. > Sseziwa > In fact, Mathematica sometimes, understands infinte sums or products over the set of all primes, described in precisely this way. A famous example is: In[6]:= Product[1 - Prime[n]^(-z), {n, 1, Infinity}] Out[6]= 1/Zeta[z] Andrzej Kozlowski === Subject: Re: Re: Summation question > Plus @@ Map[f, {1, 3, 5, 7, 11, 13}] BTW, isnt 2 a prime too! And 1 is certainly not one ;-) Andrzej Kozlowski === Subject: squared norm in Mathematica My problem was actually ||SX||^2 i was trying it as multiobjective optimiztaion in Mathematica but i got to know that it can be programmed as single objective .... ||SX||^2=(a11*x1 + a12*x2 + a13*x3)^2 + (a21*x1 + a22*x2 + a23*x3)^2 + (a31*x1 + a32*x2 + a33*x3)^2. therefore my problem becomes x1 >= 0.52, <= 1.47; x2 >= 0.52, <= 1.47; x3 >= 0.52, <= 1.47; x4 >= 0.52, <= 1.47; minimize : ( ((-0.22*x1)+(0.13*x2)+(-0.09*x3)+(0.07*x4))^2 + ((-0.13*x1)+(0.09*x2)+(-0.07*x3)+(0.058*x4))^2 +((-0.09*x1)+(0.07*x2)+ (-0.058*x3)+(0.049*x4))^2); subject to: -4+x1^2+x2^2+x3^2+x4^2=0; IN Mathematica it becomes FindMinimum[{(-0.22 g1+0.13 g2-0.09 g3+0.07 g4)2+(-0.13 x1+0.09 x2-0.07 x3+0.058 x4)2+(-0.09 x1+0.07 x2-0.058 x3+0.049 x4)2,-4+x12+x22+x32+x42=0&&0.52£x1£1.47,0.52£x2 £1.47,0.52£x3£1.47,0.52£x4£ 1.47},{x1,x2,x3,x4}] i have this result when i tried this problem in Mathematica ....i guess Mathematica can handle this problem Set::write : Tag Plus in -4+x12+x22+x32+x42 is Protected FindMinimum::eqineq : Constraints in {0,0.52£x1,0.52£x2,0.52£x3,0.52£x4,x1 £1.47,x2£1.47,x3£1.47,x4£1.47} are not all equality or inequality constraints. With the exception of integer domain constraints for linear programming, domain constraints or constraints with Unequal (!=) are not supported. i donot understand where the fault lies ...when i have only one objective function thanx === Subject: Re: Vector file out of Mathematica? Export as PDF. Both Illustrator and CorelDraw can open and edit this format. Mathematica can Export to other popular 3D formats, such as DXF. Hans > I need to do editing on some Graphic3D objects created in Mathematica. > If I do CopySpecial > metafile or Export[foo.emf, gr3D] (where gr3d > = Graphics3D[...]) and paste or open it in Corel Draw or Adobe > Illustrator, it looks like a very crude bitmap. I need to have it be a > vector file so resolution is preserved. How can I export a vector file > from Mathematica that is in some standard format that common vector > software > can deal with? If some lighting or shading effects are lost, that > would be ok. Steve Gray > === Subject: Re: Vector file out of Mathematica? > I need to do editing on some Graphic3D objects created in Mathematica. > If I do CopySpecial > metafile or Export[foo.emf, gr3D] (where gr3d > = Graphics3D[...]) and paste or open it in Corel Draw or Adobe > Illustrator, it looks like a very crude bitmap. I need to have it be a > vector file so resolution is preserved. How can I export a vector file > from Mathematica that is in some standard format that common vector software > can deal with? If some lighting or shading effects are lost, that > would be ok. > Illustrator understands EPS and PDF. Most vector graphics editors understand SVG. Export to one of these formats. I recommend using PDF with Mathematica 6 and EPS with Mathematica <= 5.2. Avoid windows metafiles whenever you can, especially WMF files (EMF is better). See the doc page of Export (and the links at the bottom) for more info on different formats. === Subject: Re: Vector file out of Mathematica? that is the dark side of the nice new graphics. When there is shading/vector normals ... Mathematica will only create bitmaps. But if you try Plot3D[Sin[x*y], {x, 0, Pi}, {y, 0, Pi}, NormalsFunction -> None] my Corel Draw Copy/Paste 19596 objects, as vector data. Jens > I need to do editing on some Graphic3D objects created in Mathematica. > If I do CopySpecial > metafile or Export[foo.emf, gr3D] (where gr3d > = Graphics3D[...]) and paste or open it in Corel Draw or Adobe > Illustrator, it looks like a very crude bitmap. I need to have it be a > vector file so resolution is preserved. How can I export a vector file > from Mathematica that is in some standard format that common vector software > can deal with? If some lighting or shading effects are lost, that > would be ok. Steve Gray > === Subject: Re: .NET/Link: Explicitly define data type to be sent to .NET object? meantime I was pointed to a very nice solution to the type conversion problem: To transfer e.g. an integer (Mathematica) value into Byte (C++) format, one can first create a .NET object of System.Byte[]. The value from Mathematica is then sent to this object, being a Byte variable in C++ and thus forcing the correct type conversion from Mathematica Integer to Byte. Finally, the System.Byte object is sent to the (in my case) overloaded insert(...) method. By choosing an appropriate type of the intermediate object, one can thus select which specific method (from the list of overloaded methods with same name and arguments) will be executed. Heiko To get some data from Mathematica to a .NET object, I need to > avoid confusion between different integer or real data types in > Mathematica and C++. Is it somehow possible to explicitly define the > type of a variable being sent from Mathematica to C++? Some more detailed description of the problem: The .NET object > contains several overloaded methods for different data types, e.g. > void insert(SByte value), void insert(Int16 value), void insert(Int32 > value), void insert(Int64 value), etc. When I now send integer data > from Mathematica to the object using object@insert[...] the data is > apparently always sent to the insert(Int64 value) method; even if the > integer in Mathematica only contains a value from 0 to 255. This is, > however, not the method I need to call, but e.g. void insert(SByte > value). As I havent written the .NET library myself, I cannot just > change the names of the methods inside. How can I tell .NET/Link in Mathematica that I want the integer/ > real data in Mathematica to be transferred to a specific integer or > real data type in C++? > Heiko === Subject: Constraint visualization Hallo, I am brand new to Mathematica. I have acquired the program to assist me in constraints/solution space visualization but the results I got from my fiddling the past two weeks have been fairly disappointing. (I must admit that Ive elarnt a lot of wonderful new things but I am still unable to carry out my initial objective.) If I can find out how to color all the faces/edges of the following regionplot it will help me a lot. RegionPlot3D[ Or[And[And[And[Fm <= 120/(8 - y), 8 - y >= 0], Or[And[Fm <= 69.6/(2.4 + 2 x), x >= 0], And[Fm <= 69.6/(2.4 - 2 x), x <= 0]]], And[Or[And[Fm <= 69.6/(2.4 + 2 x), x >= 0], And[Fm <= 69.6/(2.4 - 2 x), x <= 0]], And[Fm <= 112/y, y > 0]]], And[And[Fm <= 120/(8 - y), y < 0], Or[And[Fm <= 69.6/(2.4 + 2 x), x >= 0], And[Fm <= 69.6/(2.4 - 2 x), x <= 0]]], And[And[Fm <= 112/y, y > 8], Or[And[Fm <= 69.6/(2.4 + 2 x), x >= 0], And[Fm <= 69.6/(2.4 - 2 x), x <= 0]]]], {x, -2.6, 2.6}, {y, -3, 9.6}, {Fm, 0, 30}] Neil Jacobs === Subject: Re: Localizing Large Numbers of Variables in a DynamicModule: and args = {x1, x2, x3, x4} DynamicModule @@ {args, {x1, x2} } does what you expect .. However -- it is incredible bad style to make functions with large number of variables The usual way is to break down the task to a large number of tiny functions. It is well know from other programming languages that this technique avoid many local variables. Jens > > Im wondering if anyone can see a shorter way of localising a large number of variables within a DynamicModule? For example, instead of > DynamicModule[{x1,x2,x3,x4,x5}, > oo[x1,x2,x3,x4,x5]; > oo[x1,x2,x3,x4,x5]; > something with an idiom along the lines of > args={x1,x2,x3,x4,x5}; > DynamicModule[args, > oo[args]; > oo[args] > === Subject: Re: Localizing Large Numbers of Variables in a DynamicModule: > > Im wondering if anyone can see a shorter way of localising a large number of variables within a DynamicModule? For example, instead of > DynamicModule[{x1,x2,x3,x4,x5}, > oo[x1,x2,x3,x4,x5]; > oo[x1,x2,x3,x4,x5]; > something with an idiom along the lines of > args={x1,x2,x3,x4,x5}; > DynamicModule[args, > oo[args]; > oo[args] > I really dont understand what you are trying to achieve here ... but perhaps you will find some inspiration in this: With[{args = {x1,x2,x3,x4,x5}}, DynamicModule[args, oo@@args; oo@@args; ... ] ] With[] will just subsitute {x1,x2,x3,x4,x5} for every instance of args before it evaluates its body. Szabolcs === Subject: about scoping in modules in the next two modules I would like that the inner module uses a variable from the outer module. mfb[oneObj_] := Module[{ttmp = oneObj},AppendTo[ global2mfb, ttmp]] mfa[e_] := Module[{global2mfb = e, t = 3},mfb[t] ] mfa[{2,3}] gives a message that global2mfb is not a variable with a value, so it can not be changed. It means I do not understand the concept of module in Mathematica. My questions are: 1. why does it go wrong? 2. how can I realize what I want? with friendly greetings, P_ter === Subject: Re: Extracting the value from Solve In[78] soln = Flatten[Solve[Tan[45*Degree]*x + (Sin[108.25718805973634]* (-Sqrt[(-0.425185)^2 + 0.843815^2]))/ Sin[135*Degree] == 0, x]] Out[78] {x -> 1.32538} In[79] x /. soln Tom Dowling > Hi All, After evaluating the following . Solve[Tan[45*Degree]*x + (Sin[108.25718805973634]* > (-Sqrt[(-0.425185)^2 + 0.843815^2]))/ > Sin[135*Degree] == 0, x] > {{x -> 1.3253773537632034}} I wish to extract the value only . 1.3253773537632034 Any advice or help gratefully received. === Subject: Re: Extracting the value from Solve solution = Part[ #,1,1,2] & @ Solve[Tan[45*Degree]*x + (Sin[108.25718805973634]* (-Sqrt[(-0.425185)^2 + 0.843815^2]))/ Sin[135*Degree] == 0, x] > Hi All, After evaluating the following . Solve[Tan[45*Degree]*x + (Sin[108.25718805973634]* > (-Sqrt[(-0.425185)^2 + 0.843815^2]))/ > Sin[135*Degree] == 0, x] > {{x -> 1.3253773537632034}} I wish to extract the value only . 1.3253773537632034 Any advice or help gratefully received. > === Subject: Re: Extracting the value from Solve > Hi All, After evaluating the following . Solve[Tan[45*Degree]*x + (Sin[108.25718805973634]* > (-Sqrt[(-0.425185)^2 + 0.843815^2]))/ > Sin[135*Degree] == 0, x] > {{x -> 1.3253773537632034}} I wish to extract the value only . 1.3253773537632034 > Please read through the doc page of Solve[]. This is illustrated in the third example under Basic Examples. x /. Solve[x^2+1==0, x] === Subject: Re: Question on Sum[] function If I evaluate Sum[Log[x^n],{n,1,Infinity}] I get -Log[x]/12 as an > answer, but if I plug any other value than -1 or +1 in, Mathematica > tells me that the series is divergent; for x=-1 the sum is -I*Pi/12 > and for x=1 the sum is 0, of course. If we restrict ourselves to real numbers, I would say that the series > is only meaningful for x>0, because for x<0, Log[x^n] is not defined > for odd n. For x>0, we write Sum[Log[x^n],{n,1,Infinity}] as > Sum[n*Log[x],{n,1,Infinity}], and clearly this series is only > convergent for x=1, with sum 0. Well, my actual question was how to interpret the closed form > expression that Mathematica gives for the sum of the afore-mentioned > series. Mathematica ought to return to me some condition on x, because > Sum[Log[x^n],{n,1,Infinity}] == -Log[x]/12 is not true for all real, > or complex, x. I hope that you can shed some light on this. Since nobody has answered yet... For simplicity, lets assume that x > 0, so that, as you said, we may write Sum[Log[x^n],{n,1,Infinity}] as Sum[n*Log[x],{n,1,Infinity}]. If x is not 1, then the latter sum is formally Log[x] * Sum[n,{n,1,Infinity}] (*) Now of course Sum[n,{n,1,Infinity}] diverges to Infinity. But there is a sense in which it equals -1/12: Consider In[6]:= Sum[n^p, {n, 1, Infinity}] Out[6]= Zeta[-p] Now of course if p is 1, the sum in In[6] is Sum[n,{n,1,Infinity}]. Replacing p by 1 in Out[6], we get In[7]:= Zeta[-1] Out[7]= -1/12 Therefore, Sum[n,{n,1,Infinity}] equals -1/12. Substituting that result into (*), we get -Log[x]/12 which is the result which Mathematica had given for your original sum. Youre welcome to think of what I said as being rather absurd. Yet, I suspect that what I said is actually related to the reason that Mathematica gave -Log[x]/12 for your sum. David === Subject: Mouth position with the GraphicsRow could you help me with fixing the mouse position within a graphics, if several images are being shown in a row (or grid, etc.)? More precisely, I would like to place a locator within a graphics in such a way that it picks up the mouse position. The following works nicely. The first few lines define a graph (entitled pl), and the following combines it with the Locator Clear[g1, g2, x, pt]; g1[x_] := If[x <= 0, (3*x^2)/16, 0]; g2[x_] := If[x <= 0, x^2/4, 0]; pl = Plot[{g1[x], g2[x]}, {x, -4, 2}, PlotRange -> {{-4, 2}, {-2, 3}}, AxesLabel -> {b, a}, ImageSize -> 250]; DynamicModule[{pt = {1.7, 2}}, pt := Dynamic[MousePosition[{Graphics, Graphics}, {1.7, 2}]]; Show[{pl, Graphics[Locator[pt]]}]] However, in another graph I need to show a polynomial whose coefficients a and b are picked from the locator position (i.e., from the mouse position within the first graph). As soon as I combine these two graphs as a GraphicsRow (or GraphicsColumn, etc.) the result is an error: DynamicModule[{pt = {1.7, 2}}, pt := Dynamic[MousePosition[{Graphics, Graphics}, {1.7, 2}]]; GraphicsRow[{Show[{pl, Graphics[Locator[pt]] }], Dynamic[Plot[pt[[2]] x^2/2 + pt[[1]] x^4/4 + x^6/6, {x, -3, 3}, PlotRange -> {{-4, 4}, {-2, 3}}, Axes -> True, AxesLabel -> {x, f}, ImageSize -> 250] ] }] ] If the same combination is done with only the Locator (but without the MousePosition function) it also works nicely: Clear[g1, g2, x, pt]; g1[x_] := If[x <= 0, (3*x^2)/16, 0]; g2[x_] := If[x <= 0, x^2/4, 0]; pl = Plot[{g1[x], g2[x]}, {x, -4, 2}, PlotRange -> {{-4, 2}, {-2, 3}}, Axes -> True, AxesLabel -> {b, a},ImageSize -> 250]; DynamicModule[{pt = {1.7, 2}}, GraphicsRow[{Show[{pl, Graphics[Locator[Dynamic[pt]]]}], Dynamic[Plot[pt[[2]] x^2/2 + pt[[1]] x^4/4 + x^6/6, {x, -3, 3}, PlotRange -> {{-4, 4}, {-2, 3}}, Axes -> True, AxesLabel -> {x, f}, ImageSize -> 250]]}]] Evidently, the problem is related to the MousePosition function. It is confused by the GraphicsRow. Can you give a hint, how to avoid the confusion when using the MousePosition with the combination of graphics? Alexei -- Alexei Boulbitch, Dr., habil. Senior Scientist IEE S.A. Material Development, ZAE Weiergewan 11, rue Edmond Reuter, L-5326 Contern, Luxembourg Tel.: +352 2454-2566 Fax: +352 2454-3566 e-mail: alexei.boulbitch@iee.lu -- t is strictly prohibited. Please inform us immediately and destroy the original === Subject: Function Works in Notebook NOT Package Any help would be appreciated. I am using Mathematica 5.2. individual values of the rows are within some tolerance, for example 15%, it is considered a match. Since I do not know many elements will be in each row, I had to write a conditional for any value of elements. There is probably a better way of doing this, any suggestions welcomed. Anyway the following function works fine IF I evaluate it in a Notebook. When I try to place it in a package file it does not work. It appears the replacement rules are not working. Why does not it work in the package file? Function: PreliminaryAlignment[x_List, percentTolerance_] := Module[ {ListLength,numLength, correctForm,numData, blankTable,lowerLimit, upperLimit, conditionalTable,stringConditional}, correctForm =SameQ@@(Length/@x); numData = Rest/@x; ListLength=Length/@numData; numLength = First[ListLength]; lowerLimit = ToString[ 1 - percentTolerance]; upperLimit = ToString[1 + percentTolerance]; blankTable = z:Table[_, {<>ToString[numLength]<>}]; conditionalTable = Table[LessEqual[Times[<>lowerLimit<>,Part[kkk, j, <> ToString[i] <> ]], Part[z, <> ToString[ i] <> ], Times[<>upperLimit<>, Part[kkk, j, <>ToString[i]<>]]] , {i,1,numLength}] ; stringConditional = MakeExpression[ blankTable <> /; And[ <> StringReplace[ToString[conditionalTable]<> ], {{[Rule] , }[Rule] } ] ] ; Union[ Table[Flatten[ Position[numData, ReleaseHold[ stringConditional/.{kkk[Rule] numData,j[Rule]l} ] ] ],{l,1, Length[numData]} ] ] ] ] Andrew C Beveridge MS M888 Los Alamos National Laboratory Los Alamos, NM 87545 505-665-2092 e-mail: acbev@lanl.gov === Subject: Re: Update 6.0.2 Your complaint seems born of some frustration that you didnt have the latest (and greatest?) at the same moment, if not before, anybody else did. I dont know that this roll-out is being handled in any significantly different way from previous ones, or that is is not being handled very well. The public announcement about 6.0.2 was made in this group on 29 February 2008. Some folks apparently received notification to download soon thereafter (and of course no doubt some had seen it earlier, in beta). I, a Premier Service subscriber, received an e-mail with the download link on March 10. I dont see any severe internal problems here. Yes, were all anxious to have the latest version as soon as possible (or at least most of us are), but Id prefer the standard WRI method of spreading out the availability over a few days to either their (1) making it instantly available to everybody at the same time and thereby clogging the download servers, or (2) buying more server capacity and/or hiring more personnel and consequently charging more for the product to cover the costs. > The roll out of 6.0.1 is not being handled very well -- even for > premier customers. As of the end of last week, there is no > discussion of the new release at the premier section of the website > and there has been no communication to premier service customers about > what is going on. WR is acting like a company with severe internal problems. I dont > know whether they are getting them from growth or if something else is > going on. They appear to be very unprepared on the customer service > and tech support side for the 6.x release. Its very sad. Bottom line -- its a great product, but it isnt ready for large > scale development work. On 3/11/08, Kowalczyk-Schr=F6der wrot= > e: >> I have no idea how its made available to users. If you email support at >> wolfram.com, they should be able to help. >> Bhuvanesh >> If you have no Premier service it is really expensive to upgrade to >> 6.0.2. I asked my vendor here in Germany and got the answer, it will >> cost around 100 Euro. >> J. Schroeder >> ############################ >> Dr. Joerg Schroeder >> Mozartstrasse 20 >> 28203 Bremen >> 0421-3387021 > -- > Richard Palmer Home 508 877-3862 > Cell 508 982-7266 > -- 3 545-1801 Amherst, MA 01003-9305 === Subject: Register for IMS 2008, 20-24 June 2008, Maastricht, the The 9th International Mathematica Symposium 2008 will take place from 20-24 June 2008 in Maastricht, the Netherlands (Friday through Tuesday). Website: http://www.ims08.org This is to remind you that we will have a wonderful set of keynote and tutorial speakers http://bmiaserver.bmt.tue.nl/IMS2008/?q=node/81: - Dr. Michael Trott, lead developer of the Wolfram functions website and author of the Mathematica Guidebooks. - Conrad Wolfram, Wolfram Research, Managing Director - Dr. Tom Wickham-Jones, Wolfram Research, Director of Kernel Technology - Dr. Roman Maeder, Director of Parallel Computing Technology - Chris Carlson, Wolfram Research, Lead Developer, Interactive Graphics - Dr. Peter Overmann, Wolfram Research, Director of Software Technology - Dr. Norbert Junkes, Max Planck Institute for Radio Astronomy, Bonn, Germany The registration is now open: please register through www.ims08.org. Dont forget to register for the festive conference dinner (Wolfram celebrates its 20th anniversary), underground, deep in the (heated) limestone Caves of Geulhem. Maastricht in summer is a delight. Please consider to bring your family as well. We are looking forward to a much inspiring and successful IMS 2008!! The IMS08 committee: Bart ter Haar Romeny Markus van Almsick Bart Janssen Margret Philips mKim Willems === Subject: Need help to find position of max location Hi All, I would like to find position of this problem Write a function that returns a list that gives the column location of the largest integer in each row of a matrix (a list of lists) of random integers between 30 and 99. Example, for the following 3 X 4 matrix the result is {1,2,1} { {82, 71, 62, 47}, {52, 96, 31, 36}, {94, 52, 86, 12}, } t=Table[RandomInteger[{30,99}],{i,1,3},{j,1,4}] max=Map[Max,t] and I stuck at Position of each Row, if someone can help me. === Subject: Re: how to remove a warning message? Is it totally out of the question to make the presentation entirely Mathematica-based? After all, Mathematica has a Slide Show mode, and you can import graphics into Mathematica. Of course you wont have access to all the fades, dissolves, and other distracting graphics effects junk that Power Point facilitates! (See Tuftes little pamphlet about the evils of Power Point.) I am preparing a hybrid presentation. Part of it runs with Power Point, > then another part - with Mathematica 6, then again with the Power Point. > I open a Mathematica notebook from the Power Point presentation by using > a hyperlink. This results first in a warning message (telling me that > the file I am going to open may contain viruses). The notebook is called > only after pressing OK. This warning message is (i) boring and (ii) it > slows the presentation down. The latter is much worse. Though it is more a Power Point then a Mathematica problem, could you > give me a tip of what can I do to prevent this message to appear? Is there another (more efficient) way to easily and fast call a notebook > from the Power Point, which would later enable me to equally easily and > fast switch back to the Power Point after the Mathematica part will be over? -- 3 545-1801 Amherst, MA 01003-9305 === Subject: Re: Re: Should I uninstall the old version before upgrading? This is a problem that occurs only if one has moved palettes to a new location? Because if you install 6.0.2 in an $InstallationDirectory separate from that for 6.0.1, why should it be a problem? >> I want to upgrade Mathematica from v6.0 to v6.0.1. Can I just install >> the new version directly without uninstalling the old version? Should >> I uninstall the old version manually before upgrading? Yes, do uninstall first. If you dont, you may encounter problems such > as this: thread/8300a97190bd0c3b/f35b55aec1ae60a3?lnk=gst&q=%24Failed+drawing+too= > ls#f35b55aec1ae60a3 > -- 3 545-1801 Amherst, MA 01003-9305 === Subject: Re: Re: Should I uninstall the old version before upgrading? What sort of problems? Something to do with paclet updates? I ask because in the past Ive always left the preceding version installed at least for some time so that I could take care of compatibility issues. >> I want to upgrade Mathematica from v6.0 to v6.0.1. Can I just install >> the new version directly without uninstalling the old version? Should >> I uninstall the old version manually before upgrading? I had problems going from 6.0.1. to 6.0.2 that were only solved by > uninstalling 6.0.1 first and then manually removing all remnents of > the 6.0 folder... > -- 3 545-1801 Amherst, MA 01003-9305 === Subject: error with regular expression within package This must be very simple. But with package below, I get the following error: << test.m Syntax::stresc: Unknown string escape w. test.m: BeginPackage[testing`] test::usage=test[t] Begin[`Private`] test[t_]:=StringCases[t,RegularExpression[w+]] End[] EndPackage[] === Subject: Something To Dye For Several days ago sci-fi author/anthologist, blogger, and general Jill-of-all-trades Kathryn Cramer posted a challenge, titled Who Among You are Geek Enough to Decorate Your Easter Eggs in Mathematica? http://www.kathryncramer.com/kathryn_cramer/2008/03/who-among-you-a.html It begins: I dare you. Send your Mathematica egg notebooks to me. One person egged on by this challenge was her father, John Cramer. http://faculty.washington.edu/jcramer/ http://en.wikipedia.org/wiki/John_G._Cramer K. Cramer kindly sent us several of his, and (to my admittedly untrained eye) they have considerable visual appeal. With hopes of getting more such artwork, those of us affiliated with the Wolfram Demonstration Project http://demonstrations.wolfram.com have decided to raise the stakes ever so slightly. First, since a dare seems too mild, we double-dog dare you; its not a competition, but think of it as a challenge. Second, we intend to write a pre-Easter blog post for http://blog.wolfram.com Prepare your decorated eggs using Manipulate, and submit as Demonstrations. We will include selected artistry therein. Also note that all eggs published on the Demonstrations site become freely available for all to use. Thats right folks, these eggs you can poach... Daniel Lichtblau Wolfram Research === Subject: RE: Re: Insufficient capacity I have a system of equations stored in Excel. I import the following system to a Mathematica code without any problem: (1) Xbm = a vector of N1 real numbers with 20 decimals (2) equR = a vector of N2 equations in the form: X1 - b X2 = 0 where b is a 20 decimal number. For example, with N2=4, we write equR={X1 - b X2 = 0, X3 - c X5 = 0, X4 - a X3 = 0, X5 - d X4 = 0} where coefficients (a, b, c, d) each of which has 20 decimals (3) equI = a vector of N3 equations in the form: Y1 +Y2 - Y3 - Y4 = 0. For example, with N3=3, we write equI={ Y1 +Y2 - Y3 - Y4 = 0, Y4 - Y6 = 0, Y1 + Y3 - Y5 =0} The actual system I am going to solve has a total of 3,500 unknowns and 3,500 equations (N2+N3=3,500). I have no problem in importing the data in Excel to Mathematica. My problem starts when I do several matrix operations because of large decimal numbers. When I make matrix operations, the Mathematica code is not able to the operations and puts me out of the program. I suspect two things: 1) my computer does not have enough memory (my computer Intel core 2 duo processor T5500 has 1.66 Ghz, 667 mhz speed, 2 MB LL cache) 2) large decimals occupy a lot of space in memory 3) Maybe I miss a point in dealing with large decimal numbers. Please let me know your suggestions about what to do, including having an upgraded computer with enough memory and speed. Tugrul -----Original Message----- === Subject: Re: Insufficient capacity > I transfer large amount of data from Excel to Mathematica v.6 and try to > do some matrix operations. The size of the matrces are (3500, 3500) with > 10 digit numbers. However, Mathematica quits when I make the matrix > operation. How can I make it possible to do the matrix operations of large sizes? Is > Grid Math an option in this respect? If so, I like to know how large data > sets Grid Math can handle? > 3500x3500 isnt really large. What are your matrix operations? Does it work, when you convert your matrices to FloatingPoint numbers (N[matrix])? Alois === Subject: Re: Path to *.m file > Im not sure why this is a `Private` variable, but this information can > be found from: System`Private`$InputFileName > This is very useful, and I have checked, and it was there at 5.2, so I guess it is one of those long-term undocumented features! However, it would be nice if it (or the subsequent documented feature) always returned the absolute path-name. As it is, Get[xxx.m] sets this variable to .xx.m, which is less convenient, and misleading if the code in the package has already executed a SetDirectory call. David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Re: Path to *.m file > I too would like a way to determine the path of a .m file while it is >> being loaded by Get. None of the replies provide a fool-proof way of >> doing this (e.g. in the not unusual case that you have two files with >> the same name in different directories). I absolutely agree with your wish that this information should be > available without any hacking but I think that there is no way to load a > file with Get which is not the first in FileNames[filename,$Path] > unless you use an absolute path for filename. The latter is easy to > handle and covered with the else condition in: Catch[If[ > FileType[$Input]=!=File, > First[FileNames[$Input,$Path]/.{}:>Throw[$Failed]], > $Input > ]] so I think the above construct should work for the case you named. > It would be nice if Wolfram >> Research added this to their to do list! Im sure you have seen the post of Carl Woll about an undocumented > private variable that holds that information. Looks like the people at > Wolfram found this information valuable, too, so it probably is only a > small effort to provide that information to the users/package developers > without hacks and workarounds. Sorry for the post with only marginal new information but maybe keeping > the thread alive convinces someone that we really want that little > information accessible :-) albert > Albert, I take your point, although technically there is still room for uncertainty because the .m could create a file of the same name somewhere earlier in the path. OK - I know that is a bit unlikely, but since this information is easily obtainable from the OS, it would be nice if Mathematica handed it on in a completely reliable way. David Bailey http://www.dbaileyconsultancy.co.uk === Subject: question on Cases with elements that might be strings The following is a valid pattern match: In[96]:= StringMatchQ[s1, StringExpression[s, NumberString]] Out[96]= True HOWEVER, the following does not work: In[89]:= Cases[{{1 -> s1, 1}, {2 -> s2, 2}}, {_ -> StringExpression[s, NumberString], _}] Out[89]= {} Even though this works: In[95]:= Cases[{{1 -> s1, 1}, {2 -> s, 2}}, {_ -> StringExpression[s], _}] Out[95]= {{2 -> s, 2}} How come cases does not work on ln[89]? Ramiro === Subject: LevenbergMarquardt I want to thank everyone who replied to my earlier questions. I think I am getting closer to solving my problem. Unfortunately, I have run into another issue. Here is what I am trying to do: result=FindMinimum[Sum[residFunc[xptData,testInstFunc,0,t,numRateConst, rateConst/.{kauto=AEk1float,icauto=AEic1float},numInitConc,ic/.{kauto=AEk 1float,icauto=AEic1float},ec/.{kauto=AEk1float,icauto=AEic1float},rateEq, finalTime][[i]]^2,{i,1,Length[xptY]}],{{k1float,6000},{ic1float,0.003}},Meth od=AELevenbergMarquardt] The problem is that without specifying LevenbergMarquardt as the method I get an error that the gradient is effectively zero, but when I do specify Levenberg Marquardt it says that my function isnt of the appropriate form: FindMinimum::notlm : The objective function for the method LevenbergMarquardt must be in a least-squares form: Sum[f[i][x]^2,{i,1,n}] or Sum[w[i] f[i][x]^2,{i,1,n}] with positive w[i]. It looks to me as though I have a sum of squares, and I know from experience (programming in Fortran many years ago) that LevenbergMarquardt is the way to go for this particular problem. The parameters for residFunc are some experimental data and some fitting paramters (typically in lists), and it returns a one-dimensional list of numbers. Help? Kevin Ausman === Subject: Unexpected failures of FullSimplify on some Root elements For some reason FullSimplify does not resolve some of the Root elements while it does others. In this example Root[2 - 4 #1^2 + #1^4 &, 2] and Root[6 - 6 #1^2 + #1^4 &, 2] go unresolved when you evaluate: Function[k, FullSimplify[Root[Function[x, k - (k - x^2)^2], #] & /@ Range[4]]] /@ Prime[Range[11]] This is despite the fact that Solve[k - (k - x^2)^2 == 0, x] can do so in general. It seems that the second root is most prone not the be resolved. Here Root[-2 - 12 #1^2 + 9 #1^4 &, 3] also appears when you evaluate: Function[k, FullSimplify[Root[Function[x, k - (k - x^2)^2], #] & /@ Range[4]]] /@ (Prime[Range[11]]/3) In this more involved example still only Root[2 - 4 #1^2 + #1^4 &, 2] goes unresolved, try evaluating: FullSimplify[Root[Function[x, 2 - (2 - (2 - (2 - x^2)^2)^2)^2], #] & /@ Range[16]] Strangley enough, Mathematica appears to know the resolution Root[2 - 4 #1^2 + #1^4 &, 2] is -Sqrt[2 - Sqrt[2]] even though this result is not returned, try evaluating: Trace[FullSimplify[Root[2 - 4 #1^2 + #1^4 &, 2]], TraceInternal->True, TraceOriginal->True, TraceDepth->2] Note that the result is cached, so you will see a great deal more Trace output if you run this command as the first thing after restarting Mathematica. By the way, is this fixed in version 6.0.2? Q.E.D. === Subject: Re: Puzzled by the Variance See the bottom definition on the link you gave. It appears mathematica uses the unbiased variance, which divides with (N-1) instead of just N. === Subject: Numbering graphs and tables I have a report in a notebook file which holds a large number of graphs. Is it possible to get Mathematica to automatically place a number under each graph, eg. 1.1, 1.2, 1.3 ? Tom === Subject: Re: Puzzled by the Variance >Im puzzled by the function Variance. We can learn how to >calculate variance from this >page:http://mathworld.wolfram.com/SampleVariance.html. For example, >calculate the sample variance of {1,2,3}. the average of {1,2,3} is >2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. But >mathematica gives that: >In[10]:= Variance[{1.0,2.0,3.0}] >Out[10]= 1. >Why?? Look at the documentation for Variance paying particular note details in the More Information section. Specifically, Mathematica computes an unbiased estimate of the variance which will use n-1 as the divisor (2 in this particular case). Using n as the divisor is the maximum likelihood estimate for the variance. You might also see the difference in divisors referred to as sample variance (n-1) and population variance (n). === Subject: Re: Accessing and using built-in constants in Mathematica 6 / > 2) Also How do I increase the amount of the decimal places? > Example: > elementatomicW := ElementData[C, AtomicWeight] > << Units` > The answer is 1.99443*10^-26 Kilogram I add N like it says but the answer still comes out the same > Example: > << Units` tia sal2 You can do it this way but please beware of what you are doing. In[1]:= < Accessing and using built-in constants in Mathematica 6 / precision > tia sal2 > Sorry if this is a repeat post my last post didnt show up in the > newsgroups I can access the constants for the elements with no problem > Example: > In[1]:= ElementData[C, AtomicWeight] > Out[2]:= 12.0107 1) Im trying to use the built in constants for > speed of light, Planks constant, etc.. but Im having problems > finding them / the proper syntax. 2) Also How do I increase the amount of the decimal places? > Example: > elementatomicW := ElementData[C, AtomicWeight] > << Units` > The answer is 1.99443*10^-26 Kilogram I add N like it says but the answer still comes out the same > Example: > << Units` tia sal2 > === Subject: variance (mg86506) Greeting all Im puzzled by the function Variance. We can learn how to calculate variance from this page: http://mathworld.wolfram.com/SampleVariance.html. For example, calculate the sample variance of {1,2,3}. the average of {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] Out[10]= 1. Why?? -- Best Wishes! Mathematica divides by (N-1) - like as far as I know all programs- This is correct if you have only a sample and not the whole. You can look up the reason for this and the derivation in some book about statistics. J. Schroeder ############################ Dr. Joerg Schroeder Bremen === Subject: Re: Puzzled by the Variance As stated in the Help, Variance provides the unbiased estimate (divided by (Length[list] - 1) rather than Length[list]). See http : // mathworld.wolfram.com/Variance.html Bob Hanlon > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? > -- > Best Wishes! === Subject: Re: Puzzled by the Variance and population variance (also the name are often used confusingly). Usually one wants to guess what the variance of the population sigma^2 (the true variance) is. The formula 1/n Sum[(xi-Mean[x])^2] gives a biased etimate. That is if n->Infinity we do not get the true variance. However, 1/(n-1) Sum[(xi-Mean[x])^2] is not biased and is to be prefered. Therefore, mathematica does the right thing. hope this helps, Daniel > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? === Subject: Re: Puzzled by the Variance > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? > -- > Best Wishes! Mathematica uses the assumption that the data is a sample (size is small), hence it gives the sample variance, not population variance. The formula in this case changes. You need to divide by (n-1) not (n) where n is the sample size. In[5]:= r = {1., 2., 3.}; Variance[r] Out[6]= 1. In[13]:= m = Mean[r]; n = Length[r]; Sum[(r[[i]] - m)^2, {i, 1, n}]/(n - 1) Out[15]= 1. Nasser === Subject: Re: Puzzled by the Variance Variance gives the unbiased estimate of true variance based on a sampl= e: test = {1, 2, 3} Variance@test {1, 2, 3} 1 biased[x_List] := #.# &[x - Mean@x]/Length@test biased@test 2/3 or... biased[x_List] := (Length@x - 1)/Length@x Variance@x biased@test 2/3 Bobby > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.ht= ml. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be = > ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? -- = DrMajorBob@longhorns.com === Subject: Re: Puzzled by the Variance > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? Because, as it is explained in the help page, Variance[list] is computed as Total[(list-Mean[list])^2]/(Length[list]-1) So the total is divided by (number of elements)-1 and not by (no. of elements). g. === Subject: Re: Puzzled by the Variance You are using equation 1 of that page, Variance uses equation 4. The reason for the difference is subtle and is explained in the text between the two equations. > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/= 3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? > -- > Best Wishes! === Subject: Re: Puzzled by the Variance Variance, as being used in Mathematica and in MathWorld, is actually sample variance, as distinct from population variance. What you calculated to be 2/3 is actually the population variance. The difference: sampleVar[x_] := Total[(#^2 &) /@ (x - Mean@x)]/(Length[x] - 1) populationVar[x_] := Total[(#^2 &) /@ (x - Mean@x)]/Length[x] { sampleVar[{1,2,3}], populationVar[{1,2,3}] } // InputForm {1, 2/3} > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? -- 3 545-1801 Amherst, MA 01003-9305 === Subject: Re: Puzzled by the Variance you are shure that varance is not Sum[x[i]-Mean[x],{i,n}]/(n-1) ? and your example should be ((1-2)^2+(2-2)^2+(3-2)^2)/2 -> 1 ?? And any text book about statistics can tell you Why? there is the factor 1/(n-1) and not 1/n. Jens > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? === Subject: Re: Puzzled by the Variance that you divide by (n-1) not n for an unbiased estimator of the variance. To see that Mathematica is actually doing this, I commend to you the Help on Variance. Kevin > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? -- === Subject: Re: Puzzled by the Variance Variance properly has (n-1) in the denominator, to account for one fewer degrees of freedom. george > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html > . > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/ > 3=2/3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? > -- > Best Wishes! === Subject: Re: Puzzled by the Variance > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? There are two formulae for variance, one where you know the true mean - which you have used - where you divide by N, and another where you can only estimate the mean from the data available, where it is appropriate to divide by (N-1) to obtain an unbiased estimate of the true variance. It is this formula that Mathematica has used. David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Re: Puzzled by the Variance for sample variance, you want to divide by N-1, not N. j > Greeting all > Im puzzled by the function Variance. We can learn how to calculate > variance from this page:http://mathworld.wolfram.com/SampleVariance.html. > For example, calculate the sample variance of {1,2,3}. the average of > {1,2,3} is 2, then the variance should be ((1-2)^2+(2-2)^2+(3-2)^2)/3=2/3. > But mathematica gives that: In[10]:= Variance[{1.0,2.0,3.0}] > Out[10]= 1. Why?? === Subject: Re: Impedance Equation fit to Complex Data I dont believe that this is true. I use FindFit often to find the coefficients of Exp[+I k x] and Exp[-I k x] for Quantum Mechanical boundary reflections. Something else is going on here. Kevin FindFit[] cant handle complex values ? as the error message The function value {-0.658637+7.38957 I,0.0321006+5.39846 > I,<<8>>,<<3>>} is not a list of real number say ? Jens > Im trying to fit an equation to data using FindFit. When I type >> in the equation and data and then FindFit, I get this: >> Z := [Omega]^(-(2 ArcTan[H/G])/[Pi]) (G - i H) + R >> Data := {{1.`, 2.658637`- 8.389573` i}, {1.5`, >> 1.784396`- 6.214955` i}, {2.5`, >> 1.656569`- 3.97147` i}, {3.5`, >> 1.633799`- 2.878841` i}, {5.5`, >> 1.357069`- 1.776964` i}, {6.5`, >> 1.259121`- 1.848249` i}, {8.5`, >> 1.105417`- 1.344566` i}, {9.5`, >> 1.119456`- 1.148945` i}, {11.5`, >> 1.082122`- 1.064767` i}, {14.5`, >> 1.015714`- 0.8684088` i}, {15.5`, >> 1.055329`- 0.664562` i}, {18.5`, >> 0.8675349`- 0.5107938` i}, {20.5`, >> 0.8968949`- 0.4148388` i}} >> FindFit[Data, Z, {R, G, H}, [Omega]] >> FindFit::nrlnum: The function value {-0.658637+7.38957 >> [ImaginaryI],0.0321006+5.39846 [ImaginaryI],-0.0241135+3.33901 >> [ImaginaryI],<<5>>,0.212762+0.769883 [ImaginaryI],0.246899+0.605796 >> [ImaginaryI],<<3>>} is not a list of real numbers with dimensions >> {13} at {R,G,H} = {1.,1.,1.}. >> Why?!?!? Why cant FindFit handle this? Whats wrong with it not >> being a list of real numbers? Im pulling my hair out. Ive looked >> at others suggestions for similar problems and they dont work for >> this problem. Am I out of my mind? Does anyone have a suggeston? >> Benji > -- === Subject: Re: V.6.0.2 gripes... It might be that it is more Java related than Mathematica related. My 6.0.1 installation on my office desktop usually starts with a Java time-out message; starting the help centre takes a huge amount of time and causes all fans in my machine to run at maximum speed. This behavior started a couple of months ago, so I guess an update in the Java VM machine must have caused it, since I didnt change anything in Mathematica (Ive also heard rumours of McAFee being involved). Usually, a restart (or two) of Mathematica overcomes the problems. On my home PCs there doesnt seem to be a problem (either 6.01. or 6.02). Naz === Subject: Re: V.6.0.2 gripes... My experience with the Documentation Center in 6.0 and 6.0.1 is that the first call to it is slow, but that after that things are faster at a given session. so could the problem be the initial loading of the Java interpreter, or some other Java-related initialization, and not just initializing the window per se? Then of course theres the issue of how else to handle this. One option is to write everything in a platform-dependent way and avoid a cross-platform tool such as Java entirely. But that has its down-side,too: increased time to program it, higher cost,.... > It is just me, or the handling by Java of the new Function Navigator / > Virtual Book is terrible? It needs a huge time to init the window, and > its reponse time is awful, even worse than the Doc Center. Its an old and tiring camplain, but could people stop writing stuff > in Java, since all they obtain is to slow our PCs to a crawl??? Alessandro > -- 3 545-1801 Amherst, MA 01003-9305 === Subject: Re: V.6.0.2 gripes... It works quite snappily for me... --David On Mar 12, 6:26=A0am, alexxx.ma...@gmail.com Virtual Book is terrible? It needs a huge time to init the window, and > its reponse time is awful, even worse than the Doc Center. Its an old and tiring camplain, but could people stop writing stuff > in Java, since all they obtain is to slow our PCs to a crawl??? Alessandro === Subject: [Fwd: Variance[] is an *unbiassed* estimator of the variance. The estimator you are talking about was named VarianceMLE[] in version5, but seems to have disappeared! don = Table[RandomReal[], {5}]; Variance[don] Biassed = Mean[(don - Mean@don)^2] UB=Biassed*Length@don/(Length@don - 1) Claude -- ******************** === Subject: Re: Nice Mathematica stylestyle for Book Appendix Why dont you start with the Default style sheet and modify it for your own needs? Thats the easiest approach. The principal problem with all of the WRI style sheets is that the Text Cell FontSize is too small. If you look at any textbook or research paper, the text font size will be the same, if not larger, than the font size used in equations. The Section heading has a Frame line on the top that could be eliminated. Also, the Title Cell and Section Cells might have a smaller font. In all of the WRI style sheets the gradation in font size is too great, and Text cells, the most important cells of all, get squeezed down to nothing. So just fix the font sizes and get rid of any extra adornment and it will look pretty good. -- David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ Does anyone know a nice stylesheet ( at > least to start with ) for adding some > Mathematica notebooks as nice appendices > to a book ( B5 format). > I am using Mathematica 5.2 and the book is > written in Adobe Framemaker 7.2 (all > Windows) Printing as PDF and Importing > into framemaker is possible but only page > by page. Maybe there are other ways ?? Eternal glory for some help, Ger de Graaf > . > === Subject: Re: Poisson equation with boundary conditions on rectangle > Im currently trying to solve the following pde with rectangle boundary (I better already use mathematica code here): The equation (Poisson equation): > D[u[y, z], y, y] + D[u[y, z], z, z] + 1 == 0 The boundary conditions on the rectangle(y in [0,0.1] and z in [-0.4,0.4]): > u[y, 0.4] == 0, u[y, -0.4] == 0, u[0, z] == 0, > Derivative[1, 0][u][0.1, z] == 0 I tried the following in mathematica: > eqn = D[u[y, z], y, y] + D[u[y, z], z, z] + 1 == 0; //defining equation > NDSolve[{eqn, u[y, 0.4] == 0, u[y, -0.4] == 0, u[0, z] == 0, Derivative[1, 0][u][0.1, z] == 0 }, u, {y, 0, 0.1}, {z, -0.4, 0.4}] //using NDSolve to solve the boundary problem But, as you might guess, I get an error using NDSolve the way above: NDSolve::ivone: Boundary values may only be specified for one independent variable. Initial values may only be specified at one value of the other independent variable. > When I lookup the description of that error I realize that in my example the following error condition matches: This input generates a message because the equations specify values for the solution on all sides of the solution region. > Does this mean, that mathematica cant approximate the solution to my problem with NDSolve or am I doing something wrong? > So overall question is: How can I solve my problem using mathematica without writing my own numerical pde solver for my problem? Quoting the documentation at http://reference.wolfram.com/mathematica/tutorial/NDSolvePDE.html The Numerical Method of Lines ... It is necessary that the PDE problem be well-posed as an initial value (Cauchy) problem in at least one dimension, since the ODE and DAE integrators used are initial value problem solvers. This rules out purely elliptic equations such as Laplaces equation, but leaves a large class of evolution equations that can be solved quite efficiently. So it seems that youll need to look for third party packages to solve this problem with Mathematica. (But it is possible that I overlooked something and it can do it with some different method. Ive never used Mathematica to solve PDEs.) You can try your luck at the W Library Archive: http://library.wolfram.com/ === Subject: Re: Mixing graphics and text graphs = GraphData[]; n = 3; Row[Join[Riffle[GraphData /@ graphs[[2 ;; 1 + n]], Table[ !(*nStyleBox[+,nFontSize->72,nFontColor->RGBColor[0 , 0, 1]]), {n - 1}]], {!(*nStyleBox[=,nFontSize->72]), GraphData[First[graphs]]}]] I did this by highlighting the symbols I wanted changed, then going to the Format -> Size menu and choosing 72 point font. Hope that helps! > What is the easiest way to get an equation like the one below, but > with + and = symbols being about 6 times larger? graphs = GraphData[]; > n = 3; Riffle[GraphData /@ graphs[[2 ;; 1 + n]], Table[+, {n - 1}]]~ > Join~{=, GraphData[graphs // First]} // Row -- Curtis Osterhoudt cfo@remove_this.lanl.and_this.gov PGP Key ID: 0x4DCA2A10 Please avoid sending me Word or PowerPoint attachments See http://www.gnu.org/philosophy/no-word-attachments.html === Subject: Re: Fast way to select those elements from a list > To clarify: the list I want to construct is those elements from a that are > members of b: > Select[a, MemberQ[b, #] &] This is (I think!) the same as With[ > {c = Intersection[a, b]}, > Select[a, MemberQ[c, #] &] > ] but the latter is faster. >> Two lists of integers: >> {a, b} = Table[RandomInteger[10000, 1000], {2}]; >> Which elements from a are in b? >> Select[a, MemberQ[b, #] &]; // Timing >> {0.351, Null} >> It takes about 0.351 seconds (on my slow laptop). Specialised >> functions for related tasks, such as Intersection[a, b], are much >> faster: >> Intersection[a, b]; // Timing >> {0., Null} >> Using Intersection, heres a somewhat faster way to select those >> elements from a that are in b: >> With[ >> {c = Intersection[a, b]}, >> Select[a, MemberQ[c, #] &] >> ]; // Timing >> {0.09, Null} >> Is there a better, faster way to do this? >> [...] This seems fairly fast. In[23]:= {a, b} = Table[RandomInteger[10000, 1000], {2}]; Timing[s1 = Select[a, MemberQ[b, #] &];] Out[24]= {0.621, Null} In[25]:= Timing[s2 = Module[{mq}, Map[(mq[#] = True) &, b]; Out[25]= {0.02, Null} Out[26]= True Daniel Lichtblau Wolfram Research === Subject: Re: Mathematica hangs... Here is a simple plot that makes that same version of Mathematica hang: ListPlot[{ {15138, 15309, 15341, 15640, 16109, 16675, 16730, 16756, 16797, 17006, 17412, 17880, 18034, 18081, 18101, 18171, 18390, 18569, 18821, 18830}, {45373, 45784, 46153, 47525, 48197, 50014, 50141, 50239, 50342, 50942, 51950, 52198, 52336, 52393, 52450, 52746, 53282, 53861, 54593, 54624}, {52282, 52487, 52633, 53318, 53766, 57825, 58235, 58333, 58564, 59470, 60302, 61050, 61238, 61348, 61460, 61752, 62331, 63000, 63731, 63792}, {11595, 11635, 11663, 11829, 11912, 12704, 12793, 12807, 12845, 13026, 13226, 13372, 13427, 13459, 13477, 13550, 13692, 13840, 14023, 14027}, {67539, 68026, 68260, 69793, 70561, 77539, 77729, 77868, 78137, 80199, 81310, 81882, 82106, 82219, 82302, 82647, 83241, 83960, 84724, 84785} }, Joined -> True] When you remove Joined->True, it works, strangely... Alexander > This sounds a lot like an issue were addressing in an upcoming 6.0.2.1 > release, namely a hang on OS X 10.5.2 with plots which have a specific > AxesOrigin and PlotRange options. I cant be a 100% without being able > to load the external file used in your notebook: Import[$HomeDirectory <> /Desktop/vHCO+.dat, Table] If you would like this to be checked, you may reply with this file attac= hed > and I will have someone in my department check that this is indeed the s= ame issue > (and that it is fixed in 6.0.2.1). I apologize for any inconvenience this may have caused you. Arnoud Buzing, > Manager, Quality Assurance, > Wolfram Research > Ive included the data file in the zip archive Ive linked above. You > should be > able to execute the whole notebook after changing the path appearing > in the > Import[] command to point to wherever the file is on your machine. === Subject: Re: Problems on definit integratiion of gaussian profiles Possibly Im misunderstanding your question, but I dont see anything wrong with the result being independent of b. It basically boils down to the following, which is correct: In[1]:= Integrate[Exp[-(x - a)^2], {x, -Infinity, Infinity}] Out[1]= Sqrt[Pi] And its ok for the results to be different, since the integrands are different. After removing the extra -a^2/c^2 (which is just a multiplicative constant), the two integrands are: Exp[-(b - x)^2/d^2] Exp[-(b^2 - 2*b*d*x + x^2)/d^2] Bhuvanesh, Wolfram Research === Subject: Viewpoint selector for Mac in 6.0? Hello friends, It appears that the viewpoint selector for 3D graphics is absent in 6.0 (Mac version). Is there an alternate way to manually choose a view (other than trying different viewpoints repeatedly)? Suggestions appreciated. Ravi University of Washington === Subject: Problem involving NDSolve So heres my dilemma. I am trying to solve a differential equation with complex roots. Mathematica is taking the incorrect root at certain points when the function crosses over itself. I generated a set of all points at which this occurs. The set is ProblemList={2.8, 5.599, 8.398} I now want to use these points in a function. My function is ComplexRoot[t_]:= If[Abs[t - ProblemList[[1]]] > .01 && Abs[t - ProblemList[[2]]] > .01 && Abs[t - ProblemList[[ 3]]] > .01, Evaluate[I*(2 + 1/2)(I*x[t])^(1 + 1/2)], Evaluate[p[t - .01]]] The goal here is to have Mathematica take the correct root for all t other than the problem t values, and at those t values simply continue in the direction it was heading previously. So I want to then plug into the differential equation solution=NDSolve[{x[t] == 2p[t], x[0] == 0, p[t]==ComplexRoot[t], p[0] == 1}, {x, p}, {t,0,10}, WorkingPrecision -> 30, MaxSteps -> Infinity][[1]]; and not get an error. Right now it gives me an error saying that I havent literally matched the independent variables. If it works, the following graph should have two loops and look like an infinity sign with one of the loops being smaller than the other. ParametricPlot[{Re[p[t]] /. solution, Im[p[t]] /. solution}, Evaluate[{t,0,10}],PlotRange -> {{-2, 2}, {-2, 2}}] What can I do to fix this issue? Any and all help is greatly appreciated. Alex === Subject: Re: Saving Packages > Make a=2 an initialization cell. > Bobby, I think you are thinking of the old way of authoring .m files by using AutoGeneratedPackage. Nowadays it is much easier to edit the .m file directly in Mathematica, but if you copy an input cell from a notebook to a .m file, you need to change its style to Code. The direct editing of .m files works superbly in 6.0.2 with all the heading/text information reversibly stored as comments. It is a real shame not to use it! David Bailey http://www.dbaileyconsultancy.co.uk === Subject: Re: Saving Packages but didnt find so much info - Ill have to dig deeper. Your answers were of course right: setting the cells as init cells did the right thing. Yet Id like to explain better what is my larger problem is: to break down a big project in pieces, it is correct then to save big chunks of code definitions as packages? Im asking because Id like to still keep on modifying those packages, as in a standard notebook. But opening the .m file brings up a different interface, which although it seems useful (drop down boxes with Functions and Sections - Id like to have them in the notebook!) its not so clear to me if Im losing something present in the notebook interface. file, modify it as needed, select all cells and set them to init, and save as .m file. Correct? thank you! alessandro Albert Retey ha scritto: > (a verbose output which I didnt remember) and, moreover, my a > variable still remains undefined! > What Im missing (or forgetting)? I have not investigated this in detail, but I think you should just make > all your input cells (that is the ones you want to appear in the > package) as InitializationCells, then I think the autogenerated packages > and most probably the exported package files will contain these cells. > This has been explained in detail in other threads in this newsgroup. > So? Maybe the right question is How do I create a Package? Because > > obviously Save As->Mathematica Package (.m) is crippled. Since I use this all the time I am quite sure that it works and is not > too crippled... hth, albert === Subject: nondimensionalize a differential equation (ODE or PDE) in Mathematica Nondimensionalizing a differential equation is very common practice before analyzing a dynamic system. Im wondering is there any good way based on Mathematica to do so. I did a search, but I could find any good packages. Peng === Subject: ListPlot Joined/Filling bug? When I try to generate the following plot: ListPlot[{ {15138, 15309, 15341, 15640, 16109, 16675, 16730, 16756, 16797, 17006, 17412, 17880, 18034, 18081, 18101, 18171, 18390, 18569, 18821, 18830}, {45373, 45784, 46153, 47525, 48197, 50014, 50141, 50239, 50342, 50942, 51950, 52198, 52336, 52393, 52450, 52746, 53282, 53861, 54593, 54624}, {52282, 52487, 52633, 53318, 53766, 57825, 58235, 58333, 58564, 59470, 60302, 61050, 61238, 61348, 61460, 61752, 62331, 63000, 63731, 63792}, {11595, 11635, 11663, 11829, 11912, 12704, 12793, 12807, 12845, 13026, 13226, 13372, 13427, 13459, 13477, 13550, 13692, 13840, 14023, 14027}, {67539, 68026, 68260, 69793, 70561, 77539, 77729, 77868, 78137, 80199, 81310, 81882, 82106, 82219, 82302, 82647, 83241, 83960, 84724, 84785} }, Joined -> True] I consistently hang Mathematica to the point where I have to restart its kernel in order to restore functionality. Oddly, if Joined->True is replaced with Filling->Axis, the problem persists, but if either options is removed (so just the markers are plotted), the plot is generated as expected. Is anyone else seeing this behavior? Any ideas what might be causing the problem? Im using 32-bit Mathematica 6.0.2.0 on Mac OS X 10.5. === Subject: Re: smallest fraction If value p/q is known smallest Abs[p]+Abs[q ] should be << NumberTheory`Recognize` Recognize[p/q,1,x] see also http://www.research.att.com/~njas/sequences/A138335 Best wishes, Artur Curtis Osterhoudt pisze: > I doubt this is in the spirit of the problem, but if p and q (assumed > integers) arent restricted to be _positive_, then taking them both to be > very large negative numbers would both fit the p/q in I requirement, and p+q > as small as possible. C.O. >> hi >> suppose that we have an interval I belong to [0,1] >> I want to know how to calculate a fraction p/q >> belong to I and p+q is the smallest possible >> === Subject: Re: smallest fraction >> hi >> suppose that we have an interval I belong to [0,1] >> I want to know how to calculate a fraction p/q >> belong to I and p+q is the smallest possible One method is to use Minimize over integers, setting up appropriate > bounding constraints. minFraction[lo_Rational, hi_Rational] /; 0 < lo < hi := > Minimize[{p + q, {Denominator[lo]*p - Numerator[lo]*q >= 0, > Denominator[hi]*p - Numerator[hi]*q <= 0, p >= 1, q >= 1}}, {p, > q}, Integers] For example, well work with the interval from 2/7 to 4/9 inclusive. In[11]:= minFraction[2/7, 4/9] > Out[11]= {4, {p -> 1, q -> 3}} If you want to enforce that the interval be strictly inside (0,1) > you can > have constraint q>=2. More generally you might try to strengthen > constraints based on the input, should speed become an issue. Daniel Lichtblau > Wolfram Research > There is a small mathematical point involved here, that I thought it might be interesting to make explicit. Maximize looks for an returns only one maximum. For example: Minimize[{-x^2, -1 <= x <= 1}, {x}] {-1, {x -> -1}} returns only the maximum at -1 and not the one at 1. So naturally, there arises the question: is the solution of this problem provided by minFraction always unique? The answer is yes, and the proof is trivial but cute, so I would like first to give it. Suppose the solution is not unique for some 0<=lo=d (and we cant have two equalities). Now consider the fraction a/d. This is larger than a/b and smaller than c/d. Moreover, a+d is smaller than c+d. (As a concrete examaple, tak 1/9 and 3/7, both having the sum 10. Then 1/9<1/7<3/7 and 1/7 has sum 8). Thus we would have another fraction between our two fractions with a smaller sum of numerator and denominator (this is still the be confident that Minimize finds the unique answer. If it were not the case, one could still solve the problem using reduce. Consdier the function f[a_, b_] /; 0 < a < b := {p, q} /. {ToRules[ Reduce[ a <= p/q <= b && (p - 1)/q < a && p/(q - 1) > b && p >= 1 && q >= 1, {p, q}, Integers]]} Then f[1/9, 3/7] {{1, 3}} minFraction[1/9, 3/7] {4, {p -> 1, q -> 3}} In general f will return a finite list of pairs, the first of which has the smallest sum (hence is the solution of the problem): f[7/8, 17/18] {{7, 8}, {8, 9}, {9, 10}, {10, 11}, {11, 12}, {12, 13}, {13, 14}, {14, 15}, {18, 20}, {19, 21}, {20, 22}, {21, 23}} while minFraction[7/8, 17/18] {15, {p -> 7, q -> 8}} minFraction is, as expected, considerably faster. Andrzej Kozlowski === Subject: Re: Mixing immediate assignment and delayed assignment > Hello I have some code akin to this: > In[261]:= list1 = Table[Null, {j, 1, 5}]; > For[i = 1, i <= 5, i++, > list1[[i]] := some_list[[i]]; > ] Which after its execution will have list1 filled with these references: > {some_list[[6]], some_list[[6]], some_list[[6]], some_list[[6]], > some_list[[6]]} But I would like the list to be filled with: > {some_list[[1]], some_list[[2]], some_list[[3]], some_list[[4]], > some_list[[5]]} In other words, I would like the assignment of i to be immediate, but the assignment of some_list to be delayed, as the list will be updated periodically. Inject the value using With[]. Also note that some_list is not a valid symbol name in Mathematica: underscores are used in patterns. In[1]:= list1 = Table[Null, {j, 5}]; In[2]:= Do[ With[{i = j}, list1[[i]] := sl[[i]] ], {j, Length[list1]} ] In[3]:= OwnValues[list1] Out[3]= {HoldPattern[list1] :> {sl[[1]], sl[[2]], sl[[3]], sl[[4]], sl[[5]]}} === Subject: Re: Bug: symbol recreates itself suddenly > Please dont ask why am I doing this. Too late, but I wont ask again, since Im not, in fact, the least bit curious why youre doing it. If you DONT do it, however, you wont have this problem. As for me, when I see a symbol that starts with a capital, I assume its a built-in, created by Wolfram or a trustworthy 3rd party package. I dont change built-ins, and I never name my own variables with capital letters , so its trivial to see which are mine and which are not, at a glance. That saves me a second here, a minute there... over time, it adds up. Maybe were talking a whole HOUR by now. (Ha!) But thats OK, do it your way. (If you can.) > This is not forbidden according to > manual - and it worked in 4.0, 5.0, 5.2 versions. It should work in 6.0 > either. (Or it should be documented.) MANY things should be documented. (Nuff said on THAT touchy topic.) Bobby > This is definitely NOT the correct answer. The correct answer is (should > be) Symbol E not found. By all means this is really a bug. It has far-reaching consequences. Using symbol E afterwards can lead to > mistakes because Mathematica thinks (suddenly!) this is again Euler > constant, not general symbol. Please dont ask why am I doing this. This is not forbidden according to > manual - and it worked in 4.0, 5.0, 5.2 versions. It should work in 6.0 > either. (Or it should be documented.) Severin Posta > In[6]:= ?E >> E is the exponential constant e (base of natural logarithms), with >> numerical value [TildeEqual]2.71828. >> (* THIS IS NOT CORRECT ANSWER *) >> Oh yes, it certainly IS the correct answer. >> Why do you want to Remove built-in constants? (Regardless of whether it >> might or might not work to do so?) >> Bobby > It seems to me that after Remove[symbol] some times the symbol is > recreated without notice. Consider the following example. >> How to repeat: >> In[1]:= $Version >> Out[1]= 6.0 for Microsoft Windows (32-bit) (April 20, 2007) >> In[2]:= Unprotect[E]; ClearAttributes[E, {Constant, Protected, >> ReadProtected}]; Remove[E]; >> In[4]:= ?E >> During evaluation of In[4]:= Information::notfound: Symbol E not > found. >> In[5]:= Solve[E == 2] >> Out[5]= {{Global`E -> 2}} >> (* ?! *) >> In[6]:= ?E >> E is the exponential constant e (base of natural logarithms), with > numerical value [TildeEqual]2.71828. >> (* THIS IS NOT CORRECT ANSWER *) >> Severin Posta >> -- >> DrMajorBob@longhorns.com > > -- = DrMajorBob@longhorns.com === Subject: Re: Bug: symbol recreates itself suddenly > This is definitely NOT the correct answer. The correct answer is (should be) Symbol E not found. By all means this is really a bug. It has far-reaching consequences. Yes, for example doing this will break your Mathematica. > Using symbol E afterwards can lead to > mistakes because Mathematica thinks (suddenly!) this is again Euler > constant, not general symbol. > Did you expect that breaking hundreds of functions by removing E would not lead to mistakes? > Please dont ask why am I doing this. This is not forbidden according to > manual - and it worked in 4.0, 5.0, 5.2 versions. It should work in 6.0 > either. (Or it should be documented.) No, it does not work in v5.2 either. Mathematica loads symbols on demand (see DeclarePackage), and you will find a command in any version that triggers loading a function that uses E. === Subject: Re: Problems on definit integratiion of gaussian profiles Your first expression expr1 = Power[E, Plus[Times[-1, Power[a, 2], Power[c, -2]], Times[-1, Power[d, -2], Power[Plus[b, Times[-1, x]], 2]]]] E^(-(a^2/c^2)-(b-x)^2/d^2) Your second expression expr21 = Power[E, Plus[Times[-1, Power[a, 2], Power[c, -2]], Times[-1, Power[b, 2], Power[d, -2]], Times[2, b, Power[d, -1], x], Times[-1, Power[d, -2], Power[x, 2]]]] E^(-(a^2/c^2) - x^2/d^2 + (2*b*x)/d - b^2/d^2) What your second expression should be expr22 = Power[E, Plus[Times[-1, Power[a, 2], Power[c, -2]], Times[-1, Power[b, 2], Power[d, -2]], Times[2, b, Power[d, -2], x], Times[-1, Power[d, -2], Power[x, 2]]]] E^(-(a^2/c^2) - x^2/d^2 + (2*b*x)/d^2 - b^2/d^2) expr1 == expr22 // Simplify True int1 = Integrate[expr1, {x, -Infinity, Infinity}, Assumptions -> {d > 0}] (d*Sqrt[Pi])/E^(a^2/c^2) int2 = Integrate[expr22, {x, -Infinity, Infinity}, Assumptions -> {d > 0}] (d*Sqrt[Pi])/E^(a^2/c^2) As expected, the results are identical. Bob Hanlon I dont understand the behavoir of Mathematica integrating > exponential functions. I try to integrate the same functions in > different forms. The integrands are Power[E, Plus[Times[-1, Power[a, 2], Power[c, -2]], Times[-1, Power > [d, -2], > Power[Plus[b, Times[-1, x]], 2]]]] or Power[E, Plus[Times[-1, Power[a, 2], Power[c, -2]], Times[-1, Power > [b, 2], > Power[d, -2]], Times[2, b, Power[d, -1], x], Times[-1, Power[d, -2], > Power[x, > 2]]]] which are the same, but the results will differ. Indeed calculating > definit integral in a -Infinity to Infinity domain, assuming that all > variables are larger than 0, the result will be completly different! 1st case the result will be: Times[d, Power[E, Times[-1, Power[a, 2], Power[c, -2]]], Power[Pi, > Rational[1, 2]]] while in the 2nd case Times[d, Power[E, Plus[Power[b, 2], Times[-1, Power[a, 2], Power[c, > -2]], > Times[-1, Power[b, 2], Power[d, -2]]]], Power[Pi, Rational[1, 2]]] As You can see the 1st result is completly independent of b! I dont > understand. How can it be fixed? Zsolt Regaly > === Subject: How can I make a fixed size arrowhead in 3D? I would like to make three-dimensional arrows with arrowheads of a fixed size in printers points, no matter how long the arrows turn out to be in coordinate terms, or how big the graphic is made. In 2D this is effected by using the Small, Medium, Large values for the Arrowheads directive. In 3D, line thickness, point size and text size can be given in printers points. And I can make a 3D arrowhead in the same coordinates as the arrow dimensions (by drawing some polygons at the end of a line), but how do I make it a fixed number of printers points wide and long, just like you can with line thickness, point size or text size? Or is there some other way of getting a fixed size arrowhead in 3D? John === Subject: Re: Maximize Command - Problem Well, Syd sent me an email and told me to try this:(well, I forgot to mention that we have to define a=1;b=1;c=1;d=1;) >fun[x_, y_, z_] =4*(a^2 + (b^2 + c^2 +d^2) (Cos[x])^2*(Cos[y])^2*(Cos[z])^2 + (b*Cos[x]*Cos[y]*Cos[z] +Cos[x]*Sin[y] + d*Sin[x])^2); And then: >Maximize[{fun, -Pi/2 < x < Pi/2 && -Pi/2 < y < Pi/2 && 0 < z < 2*Pi}, {x, y,z}] It displayed an error. So I modified to >Maximize[{fun[x, y, z], -Pi/2 < x < Pi/2 && -Pi/ 2 < y < Pi/2 && 0 < z < 2*Pi}, {x, y, z}] And the command runs for a while and then it displays my input. Omg, this is frustrating, I dont know whatå«s the problem. === Subject: Re: DE with variable point boundary condition this can not be solved! You have a first order ODE and you can specify only ONE initial condition. But you specify y[t]==1 for t=0..10 Sin[10] hope this helps, Daniel > How to numerically Solve a differential equation like > [{ y[ t] == 1 + 2 y[t], y[t + Sin[t]] == 1}, y, {t, 0, 10}] ; Should y[0] be assumed arbitrarily and then refined by some > sort of variable boundary value problem iteration? Basically :) does it make sense as the BC is function of a function? Narasimham > === Subject: Legend with ListDensityPlot Hi everybody, I have a very large list of data representing the value of a scalar field at the point (x0,y0). I represent these data with ListDensityPlot and I would like to show a legend with the scale of colours and the values. How can I do this? Olalla P=E9rez Bilbao, UPV/EHU === Subject: Re: Re: Re: mathematica 64-bit for ms windows Based on some results published on this website, http://www2.staff.fh-vorarlberg.ac.at/~ku/karl/timings60.html I deduce roughly a 30% performance gain for Vista 64 compared to Vista 32, for the benchmark used on the site. Surprisingly by the way, linux seems to be somewhat slower than vista. WB === Subject: Dynamic Rotation: Coupling of Two or More Graphics3D objects? Can anyone suggest a path that I might explore to couple the on-screen of one graphical 3d object to another? Ive tried what I consider to be obvious: using Manipulate to dynamically control viewpoints of several objects, but this is too slow to be useful for my purposes. Id prefer to rotate on object on-screen and have another (in, say, the same graphics grid) transform in response. For example: GraphicsRow[Graphics3D /@ {Cuboid[], Sphere[]}] For a concrete example. Id like to rotate the cube about its origin, but have the sphere rotate about an arbitrary fixed point. If I cant do the coupling, the below (kind of) works, but is cludgy: Manipulate[ GraphicsRow[{Graphics3D[Cuboid[], ViewPoint -> 10 {Cos[t] Sin[p], Sin[t] Sin[p], Cos[p]}], Graphics3D[Cuboid[], ViewPoint -> {a, b, c} + 10 {Cos[t] Sin[p], Sin[t] Sin[p], Cos[p]}]}], {{a, 5}, 1, 10}, {{b, 5}, 1, 10}, {{c, 5}, 1, 10}, {{t, Pi}, 0, 2 Pi}, {{p, Pi/2}, -Pi, Pi}] A potential problem is that I can rotate one and then lose the correspondence (which I could fix with a result button, but...) W. Craig Carter === Subject: Re: Assuming >[Message also posted to: comp.soft-sys.math.mathematica] >[...] I intersperse two comments, based on two posts to this thread. function p[x]/q[x], (or even a rational function in several > variables). Should Mathematica be then required always to try to find > if p[x] and q[x] do not have common roots in some algebraic (or even > transcendental inthe case of several variables) extension of the > rationals? This is far from a trivial problem? [...] > Andrzej Kozlowski The only removable singularities, in this context, are in fact from > exact divisors. So polynomial gcd extraction (used in, say, Together[]) > suffices to remove them. Other cases where numerator and denominator simultaneously vanish will > give points of indeterminacy. These are not removable. Im not sure in what way transcendentals snuck in here. If the > polynomials have common roots, they are describable as an algebraic set. > In particular, isolated common roots will be algebraic numbers. >>[...] But I do know of a case where >>Mathematica goes even further, removing a singularity at which the >>function >>is defined as a number: >In[17]:= FullSimplify[UnitStep[-x^2]] >>Out[17]= 0 >despite the fact that correctly >In[18]:= UnitStep[-x^2] /. x -> 0 >>Out[18]= 1 >Perhaps the simplification above is considered a bug, perhaps not. >David A feature, really. That is, its wrong, but FullSimplify can make > mistakes on measure zero sets. We do not generally regard this > phenomenon as a bug, though we reconsider on case by case basis. How does that `measure zero allowance work in a context of something like Assuming[Element[x, Integers], FullSimplify[something]] ? -- m === Subject: input style within a text style cell If in a text style cell I select some words and go to Format -> Style- > Input, the words I select end up being formatted as, well, Input cells. If, on the other hand, I select some text in a cell in text style and then hit Alt-9 (which is the shortcut for that menu item) the _whole_ cell becomes converted to Input style. Is there a keyboard shortcut to have some words in a text cell be formatted in the style of input cells? -- m === Subject: Re: PowerExpand in version 6 Assuming works by setting $Assumptions, and this has the desired effect for most of the functions, because their Assumptions options is defaulted to $Assumptions. Here is a list of all System` context symbols with Assumptions option: In[184]:= ToExpression /@ Quiet[Select[Names[System`*], MemberQ[ToExpression[#, StandardForm, Options[Unevaluated[#]] &][[All, 1]], Assumptions] &]] Out[184]= {ExpectedValue, FourierCosTransform, FourierSinTransform, FourierTransform, FullSimplify, FunctionExpand, Integrate, InverseFourierCosTransform, InverseFourierSinTransform, InverseFourierTransform, LaplaceTransform, Limit, PiecewiseExpand, PossibleZeroQ, PowerExpand, Refine, Residue, Series, Simplify} We now select the one where Assumptions is not set to $Assumptions: In[185]:= Select[{#, Options[#, Assumptions]} & /@ %, FreeQ[#, HoldPattern[$Assumptions]] &] Out[185]= {{PowerExpand, {Assumptions -> Automatic}}} This was done for backwards compatibility. Unfortunately resetting this option globally might not be a very good idea, because it would change the behavior of some of internal code which uses PowerExpand. As to other issues you point out to, they follow from behavior of Refine: In[193]:= res = PowerExpand[Sqrt[x*y], Assumptions -> True] Out[193]= E^( I [Pi] Floor[ 1/2 - Arg[x]/(2 [Pi]) - Arg[y]/(2 [Pi])]) Sqrt[x] Sqrt[y] In[195]:= Refine[res, Assumptions -> x > 0] Out[195]= Sqrt[x] Sqrt[y] In[196]:= Refine[res, Assumptions -> x > 0 && y > 0] Out[196]= Sqrt[x y] In[197]:= Refine[res, Assumptions -> x > 0 && Arg[y] == 0] Out[197]= Sqrt[x] Sqrt[y] Oleksandr Pavlyk > The ancient function PowerExpand, indispensable before the > Assumptions mechanism was introduced in version 4 of Mathematica, > became a bit of an embarrassment in later versions and there were even > voices, I can remember, arguing that it ought to be deprecated. > Instead, PowerExpand was modified in version 6 by making it possible > to use the Assumptions mechanism with it and this giving this almost > dead function a new lease of life. This is indeed very nice when it > works, but unfortunately the implementation still leaves some things > to be desired. The main example in the documentation is: PowerExpand[Sqrt[x*y], Assumptions -> True] E^(I*Pi*Floor[-(Arg[x]/(2*Pi)) + 1/2 - Arg[y]/(2*Pi)])* > Sqrt[x]*Sqrt[y] which gives a general expansion that is valid for all x and y. But > note that the normally equivalent form Assuming will not work: Assuming[True, PowerExpand[Sqrt[x*y]]] > Sqrt[x]*Sqrt[y] In fact Assuming is simply ignored and the answer returned is the same > as that given by PowerExpand without any assumptions. This is > disappointing for those (like myself) who prefer to use Assuming to > Assumptions -> , but may perhaps be a matter of deliberate design > (why?). But the next problem is certainly a bug. First note that: PowerExpand[Sqrt[x*y], Assumptions -> x > 0] > Sqrt[x]*Sqrt[y] which is quite correct but suppose we make an even stronger assumption: PowerExpand[Sqrt[x*y], Assumptions -> x > 0 && y > 0] > Sqrt[x*y] We do not get the expansion we should obtain. Curiously we can get the > correct expansion if we use a more complicated way of stating the same > assumption, e.g. PowerExpand[Sqrt[x*y], Assumptions -> x > 0 && Arg[y] == 0] > Sqrt[x]*Sqrt[y] or PowerExpand[Sqrt[x*y], Assumptions -> x > 0 && Re[y] > 0] > Sqrt[x]*Sqrt[y] Andrzej Kozlowski === Subject: Re: PowerExpand in version 6 They indeed answer my questions but I have to admit, they also leave me somewhat worried. The reason is that what happened to PowerExpand can be seen as the first signs of Mathematica beginning to break down under the weight of legacy code. Being not very young myself I have seen this sort of thing happen to other old (more than a decade) programs and I hope Mathematica does not go this way. To tell the truth, it seems to me it was an absolutely dreadful (I this way, in order to preserve compatibility with past code. What should have been done was exactly what was done with Random, a new function with a new name (e.g. ExpandPowers) should have been introduced while the old one retained for the sake of compatibility. Now something terrible has happened - the user is lead to believe that Assuming and Assumptions-> are always equivalent and it is only a matter of choice which one to use but the truth is that he can never be sure if his code containing Assuming will work as intended and has to decide everything on a case by case basis. This effectively makes Assuming unusable. Even the second problem, caused by Refine, is worrying. What happens is that when you use PowerExpand[Sqrt[x*y], x>0&&y>0] first Sqrt[x*y] is expanded and then put back (by Refine) and all of that happens in a way totally non-transparent to the user. Again, this results in total unpredictability. The user can never be sure if PowerExpand will expand powers or will not. These unpredictabilities add up, so that I would now avoid using the new PowerExpand in any code since the trouble of checking what it will do in individual cases seems to exceed its benefits. Fortunately it is only one function but I think it is important that it should not become a precedent for future development of Mathematica. Obviously the way to proceed when certain oldish functions are replaced by more sophisticated version is the way that was used in the case of Random, RandomInteger, RandomReal etc, than the approach adopted in the case of PowerExpand. Andrzej Assuming works by setting $Assumptions, and this has the desired > effect for most of the functions, because their Assumptions options > is defaulted to $Assumptions. Here is a list of all System` context symbols with Assumptions option: In[184]:= ToExpression /@ > Quiet[Select[Names[System`*], > MemberQ[ToExpression[#, StandardForm, > Options[Unevaluated[#]] &][[All, 1]], Assumptions] &]] Out[184]= {ExpectedValue, FourierCosTransform, FourierSinTransform, > FourierTransform, FullSimplify, FunctionExpand, Integrate, > InverseFourierCosTransform, InverseFourierSinTransform, > InverseFourierTransform, LaplaceTransform, Limit, PiecewiseExpand, > PossibleZeroQ, PowerExpand, Refine, Residue, Series, Simplify} We now select the one where Assumptions is not set to $Assumptions: In[185]:= Select[{#, Options[#, Assumptions]} & /@ %, > FreeQ[#, HoldPattern[$Assumptions]] &] Out[185]= {{PowerExpand, {Assumptions -> Automatic}}} This was done for backwards compatibility. Unfortunately resetting > this option globally might not be a very good idea, because it would > change the behavior of some of internal code which uses PowerExpand. As to other issues you point out to, they follow from behavior of > Refine: In[193]:= res = PowerExpand[Sqrt[x*y], Assumptions -> True] Out[193]= E^( > I [Pi] Floor[ > 1/2 - Arg[x]/(2 [Pi]) - Arg[y]/(2 [Pi])]) Sqrt[x] Sqrt[y] In[195]:= Refine[res, Assumptions -> x > 0] Out[195]= Sqrt[x] Sqrt[y] In[196]:= Refine[res, Assumptions -> x > 0 && y > 0] Out[196]= Sqrt[x y] In[197]:= Refine[res, Assumptions -> x > 0 && Arg[y] == 0] Out[197]= Sqrt[x] Sqrt[y] Oleksandr Pavlyk >> The ancient function PowerExpand, indispensable before the >> Assumptions mechanism was introduced in version 4 of Mathematica, >> became a bit of an embarrassment in later versions and there were >> even >> voices, I can remember, arguing that it ought to be deprecated. >> Instead, PowerExpand was modified in version 6 by making it possible >> to use the Assumptions mechanism with it and this giving this almost >> dead function a new lease of life. This is indeed very nice when it >> works, but unfortunately the implementation still leaves some things >> to be desired. >> The main example in the documentation is: >> PowerExpand[Sqrt[x*y], Assumptions -> True] >> E^(I*Pi*Floor[-(Arg[x]/(2*Pi)) + 1/2 - Arg[y]/(2*Pi)])* >> Sqrt[x]*Sqrt[y] >> which gives a general expansion that is valid for all x and y. But >> note that the normally equivalent form Assuming will not work: >> Assuming[True, PowerExpand[Sqrt[x*y]]] >> Sqrt[x]*Sqrt[y] >> In fact Assuming is simply ignored and the answer returned is the >> same >> as that given by PowerExpand without any assumptions. This is >> disappointing for those (like myself) who prefer to use Assuming to >> Assumptions -> , but may perhaps be a matter of deliberate design >> (why?). But the next problem is certainly a bug. >> First note that: >> PowerExpand[Sqrt[x*y], Assumptions -> x > 0] >> Sqrt[x]*Sqrt[y] >> which is quite correct but suppose we make an even stronger >> assumption: >> PowerExpand[Sqrt[x*y], Assumptions -> x > 0 && y > 0] >> Sqrt[x*y] >> We do not get the expansion we should obtain. Curiously we can get >> the >> correct expansion if we use a more complicated way of stating the >> same >> assumption, e.g. >> PowerExpand[Sqrt[x*y], Assumptions -> x > 0 && Arg[y] == 0] >> Sqrt[x]*Sqrt[y] >> or >> PowerExpand[Sqrt[x*y], Assumptions -> x > 0 && Re[y] > 0] >> Sqrt[x]*Sqrt[y] >> Andrzej Kozlowski > === Subject: Re: ImageSize option when exporting PDFs > When exporting EPS graphics, theImageSizeoption can be set in > Export[]. These produce graphics of different sizes: Export[gr.eps, Graphics[Circle[]],ImageSize-> 150] > Export[gr.eps, Graphics[Circle[]],ImageSize-> 300] But this does not work for PDF. These produce identical graphics: Export[gr.pdf, Graphics[Circle[]],ImageSize-> 150] > Export[gr.pdf, Graphics[Circle[]],ImageSize-> 300] A workaround is to use the option inside Graphics, like this: Export[gr.pdf, Graphics[Circle[],ImageSize-> 150]] > Export[gr.pdf, Graphics[Circle[],ImageSize-> 300]] but this is very inconvenient because it affects screen display too. Is it intentional thatImageSizedoes not work with PDFs (if yes, why?), > or is it a bug? So... is this the recommended practice to get a pdf of the desired size with 6.0? -- m === Subject: Branch Cuts and NDSolve So I need to teach Mathematica how to take a root of a complex number. The problem is that the way it does it in NDSolve (for a square root) is just to assume you want the first of the two possible solutions (ie. Sqrt[i]=Exp[i*Pi/4] and not Exp[5i*Pi/4]). I need to teach Mathematica to know which root to take by telling it to continue on the same trajectory that the solution was traveling previously. Im not sure how to go about that? Basically, some of the complex differential equations Im trying to solve should tie themselves in a knot, but that doesnt happen without Mathematica knowing which root to take. Is there any way someone could help me out with this problem? Im not sure how to get started. Alex === Subject: Re: Gudermannian Function It should be Table[{x, 2 ArcTan[Exp[x]] - Pi/2}, {x, 0, 1, 0.1}] Bhuvanesh, Wolfram Research === Subject: Re: NDSolve[] and Differential Equations: Problem solving two Hi Gopinath, consider: Table[NDSolve[{eqn1[[im]] == 0, icon1[[im]] == 0, icon2[[im]] == 0}, bdefmitr[[im]], {t, 0, 1 + sep/len}], {im, 1, nmx}]; This are nmx different calls to NDSolve that are completely independent. Say im==1, then bdefmitr[[im]]==vi[1][t]. That is, you are declaring that there is only ONE function to solve for. Here is a simple example of a coupled system: eqns={f1[t]== 2 f1[t]+f2[t],f2[t]==2 f1[t]+2 f2[t],f1[0]==1,f2[0]==2}; sol={f1,f2} /.NDSolve[eqns,{f1,f2},{t,0,1}][[1]]; Plot[{ sol[[1]][t],sol[[2]][t]},{t,0,1}] hope this helps, Daniel > I looked into the set of equations once again to verify it, but the equation phieq contains the phi terms and along with phicon1 and phicon2 (initial conditions) they are all included in the equation as shown below: eqn1 = Table[ > Flatten[{wdef1icon1, wdef1icon2, wdef2icon1, wdef2icon2, sdeficon1, > sdeficon2, phicon1, phicon2, phieq, v3eq, v1eq, v2eq, > modsetitr[[im]]}], {im, 1, nmx}]; So it is something I messed up with solving several different differential equations related to each other. I dont see any example in the Help section. All discusses one differential equation only. If you have any examples please post here. Also one problem I experienced is that in the definition (used in the code) like below: reactP1[t_] := ([Pi]^4 [Kappa] wrf1^2)/ > 24 (Chop[wdef1itr[t]] - Chop[func[t, t]]); or simply r1[t_]:=k*(a[x,t]-b[t]) for easy understanding, I am only checking if the entire term i.e., k(a[x,t]-b[t]) is positive and if not positive, substitute zero for that term. For that I am using the below syntax. r[t] = r[t] /. t_?Negative -> 0; (This only checks if the argument is negative or not. Isnt it? If so, then I have to store the a[x,t]-b[t] to another variable and check if that variable is negative). Problem is, if b[t] evaluates to negative, it removes it and shows only k*a[x,t] i.e. r1[t]=k*(a[x,t]-1) becomes r1[t]=k*a[x,t]. If the entire term is not computable i.e. a[x,t] is yet to be found, then I want it to be r1[t]=k*(a[x,t]-1) only and not k*a[x,t]. However in the later steps, (after I introduce Do loop) a[x,t] values will be available and hence it will evaluate the whole term and see if it is negative. That case works fine for me. Do you know workaround for that? Currently I can do one simple thing, I will check the step number, if step is zero (in the Do loop with step=0 in the beginning), I keep it as k*(a[x,t]-1), and as step increments, I do the check so it evaluates the whole term. > Gopinath Venkatesan > University of Oklahoma > === Subject: Re: Mathematica 6.0.2 update I have no idea how its made available to users. If you email support@wolfram.com, they should be able to help. Bhuvanesh === Subject: Re: Re: Mathematica Integration help > On Mar 3, 10:47 am, Jens-Peer Kuska >look what happens when you compute from: >>res = Integrate[ >> Product[1/(E^((Subscript[x, i] - [Mu])^2/(2*[Sigma]^2))* >> Sqrt[2*Pi*[Sigma]^2]), {i, 1, n}], [Mu]] >>D[res,[Mu]] >>and see that the result is *not* >>Product[1/(E^((Subscript[x, i] - [Mu])^2/(2*[Sigma]^2))* >> Sqrt[2*Pi*[Sigma]^2]), {i, 1, n}] >>this obvious a bug. > The result is: (1/(E^(([Mu] - Subscript[x, i])^2/(2*[Sigma]^2))*Sqrt[[Sigma]^2]))^ > n/(2*Pi)^(n/2) Do you mean that it cannot reconstitute the product? > He means that it is a bug. Specifically, the indefinite integral produced as res is garbage. This is the same bug that was reported to comp.soft-sys.math.mathematica by David Cantrell around 6 weeks ago: http://forums.wolfram.com/mathgroup/archive/2008/Jan/msg00341.html This has been fixed in the development kernel. Daniel Lichtblau Wolfram Research === Subject: Re: Mathematica Integration help What youre integrating doesnt make any sense as a statistical > quantity. Did you intend to have different mu_i and integrate over > each such variable? At the moment youre averaging the likelihood of > {x_i} arising from Gaussians centred on the diagonal {mu, mu, mu, mu} > for all mu. Yes this is called the integrated likelihood. There is one mu, one > sigma and many x_i(s). The x_i(s) are the data. In classical MLE > estimation the mean(xbar)=sum(x_i)/n. > and the sigma (standard deviation) is sqrt[(sum (x_i - xbar)^2)/ > (n-1)]. > What we are trying here is elimination of the nuisance parameter (mu) > so that we can estimate sigma directly from the data (x_i). See > Reference: > Berger. Integrated Likelihood Methods for Eliminating Nuisance > Parameters. Statistical Science 1999, Vol. 14, No. 1, 1-28. First, you need to compute the definite integral, {[Mu], -Infinity, Infinity}. (Use GenerateConditions -> False or Assumptions -> [Sigma] > 0.) Second, I dont think Mathematica will compute the integral for the symbolic product, so you will have to give a specific value to n. Third, you will have to make the substitution of xbar yourself. --Mark === Subject: Re: Pathological list for ListLinePlot? My apologies for a long post. I have a calculation which produces a > list of 1001 {x,y} pairs. All are positive reals. When I plot them with > ListPlot, no problem. When I plot them with ListLinePlot, my computer > hangs indefinitely with the MathKernel at 100% CPU, and I have to force > quit. I can plot the same list as a line with graphics primitives without problem. > I can also ListLinePlot randomly generated lists of 1001 points of > similar magnitude without problem. I havent visited this code for a while, so its possible the problem > surfaced with the upgrade to 6.0.1 (from 6.0), or Mac OS X 10.5.2. It > was working before then. Ive attached the list in FullForm. Would someone (running 6.0.1, and > ideally on a Mac) please try ListLinePlot[temp] and see if I have a > real bug? No problem plotting this in 6.0.1: temp=List[List[35227.275800768686`,3000.`], List[32260.329083488545`,3383.556702930117`], List[29121.16283349311`,3763.9622934531258`], List[25846.40899341479`,4114.448648243375`], List[22500.808801084917`,4400.550997147568`], List[19179.264771068396`,4583.338313439563`], List[16002.700632157856`,4626.276939237215`], List[13105.379723791912`,4505.355487735075`], List[10769.749359813633`,4238.213029020804`], List[12062.510489441334`,3984.993247891283`], List[13283.437582938832`,3746.9449273786227`], List[14436.478303254333`,3523.1565568974775`], List[15525.383084768091`,3312.771540801094`], List[16553.708496756084`,3114.9848809253676`], List[17524.823167411876`,2929.0400600932776`], List[18441.915020999724`,2754.226114377641`], List[19307.999140314503`,2589.8748826368046`], List[20125.92585845481`,2435.358422575368`], List[20898.388847136364`,2290.0865832143095`], List[21627.933061653202`,2153.50472427901`], List[22316.96245901615`,2025.091573589618`], List[22967.747440473457`,1904.3572140864644`], List[23582.431991605885`,1790.841192613623`], List[24163.04050699025`,1684.1107430912932`], List[24711.48429593327`,1583.7591171222857`], List[25229.567771736674`,1489.4040155321038`], List[25718.994330710684`,1400.6861147185227`], List[26181.371929802513`,1317.2676820726274`], List[26618.21837344694`,1238.8312750563643`], List[27030.966320832395`,1165.0785188798225`], List[27420.968025557282`,1095.7289580247107`], List[27789.499819977736`,1030.5189771141404`], List[28137.76635595588`,969.2007869597669`], List[28466.90461397518`,911.5414718208605`], List[28777.987692428924`,857.322094172844`], List[29072.02838800728`,806.3368535140296`], List[29349.982578194104`,758.3922959246446`], List[29612.752416127038`,713.3065713198014`], List[29861.189348022614`,670.9087355066621`], List[30096.096962379288`,631.0380943347468`], List[30318.233680351037`,593.5435873935751`], List[30528.315295620774`,558.2832088742575`], List[30273.518518321234`,525.5345444743426`], List[30058.82707410529`,494.7340341004158`], List[29880.50485626216`,465.793170377246`], List[29735.091215920955`,438.621958198763`], List[29619.386817442348`,413.1301026121278`], List[29530.43936526798`,389.2280005361096`], List[29465.52936335154`,366.82755236750097`], List[29422.156045252403`,345.8428111921293`], List[29398.02359050775`,326.19048828801874`], List[29391.027721583323`,307.79033293598883`], List[29399.242756086864`,290.56540426821766`], List[29420.909170875053`,274.44225142065636`], List[29454.42171917042`,259.3510170080071`], List[29498.318128010684`,245.22547748355996`], List[29551.268391472055`,232.00303240063965`], List[29612.064665039827`,219.62465251331736`], List[29679.611759090934`,208.03479623825075`], List[29752.918222051823`,197.18130188574415`], List[29831.087998892464`,187.0152620028944`], List[29913.312646588744`,177.49088535188238`], List[29998.864085362035`,168.56535094169942`], List[30087.087861756794`,160.1986575310369`], List[30177.396899049796`,152.35347169680398`], List[30269.26570904545`,144.99497662204806`], List[30362.22503926143`,138.0907234126017`], List[30455.856929780748`,131.6104863838118`], List[30549.79015402677`,125.52612322871757`], List[30643.69601855157`,119.81144071232244`], List[30737.284498044108`,114.44206652814132`], List[30830.30068241273`,109.39532755574733`], List[30922.521513626263`,104.65013455660552`], List[31013.752791843675`,100.18687348493299`], List[31103.826430583274`,95.98730319737822`], List[31192.597942529603`,92.0344594937552`], List[31279.944138451257`,88.31256527965822`], List[31365.761022613977`,84.80694658310487`], List[31449.96186955891`,81.50395421276095`], List[31532.475467810047`,78.39089074664`], List[31613.24451730869`,75.45594259646958`], List[31692.224168266424`,72.68811688074567`], List[31769.380689525915`,70.07718270979494`], List[31844.69025636195`,67.61361674280144`], List[31918.13784766209`,65.2885526870482`], List[31989.71624339696`,63.09373448023363`], List[32059.42511380104`,61.021472878190785`], List[32127.27019290728`,59.06460526634334`], List[32193.26252927941`,57.2164584883321`], List[32257.417806837195`,55.47081436805236`], List[32319.75573040705`,53.82187785170157`], List[32380.29947006477`,52.264247520866164`], List[32439.075159214182`,50.792888309227344`], List[32496.111441823312`,49.40310627984394`], List[32551.439064401085`,48.09052530260815`], List[32605.09050867401`,46.85106547122792`], List[32657.099661665026`,45.68092318284963`], List[32707.501519403108`,44.57655269777128`], List[32756.33192149075`,43.534649107146386`], List[32803.62731375326`,42.552132607489284`], List[32849.4245361838`,41.62613395837977`], List[32893.76063408689`,40.75398107082478`], List[32936.67268998567`,39.93318660921397`], List[32978.19767480765`,39.1614365863226`], List[33018.372315809196`,38.436579807193944`], List[33057.23298018455`,37.75661815741024`], List[33094.81557269241`,37.119697667768435`], List[33131.155445660675`,36.52410027144037`], List[33166.287321038144`,35.96823630197069`], List[33200.245221654295`,35.450637521947925`], List[33233.062412183135`,34.96995079266363`], List[33264.77134798334`,34.524932265028575`], List[33295.40363136489`,34.11444210164904`], List[33324.98997432745`,33.73743968426585`], List[33353.56016676348`,33.392979258712636`], List[33381.14304998017`,33.08020604029313`], List[33407.766494267504`,32.79835269609214`], List[33433.457380333675`,32.54673622562535`], List[33458.24158411979`,32.32475522183443`], List[33482.1439646309`,32.13188750980038`], List[33505.18835369104`,31.967688097183604`], List[33527.39754758263`,31.8317874532667`], List[33548.7933007282`,31.723890157476013`], List[33589.22626031882`,31.591288336734845`], List[33608.30172001908`,31.566355433287168`], List[33626.64023758666`,31.5689685503939`], List[33644.25828732932`,31.59919299711639`], List[33661.17127539397`,31.657166447910225`], List[33677.39353460706`,31.743099705852`], List[33692.9383191531`,31.85727783532424`], List[33707.81779765294`,32.000061574063906`], List[33722.04304544189`,32.171889117971766`], List[33735.62403485978`,32.37327821243243`], List[33748.569624078256`,32.604828620691954`], List[33760.88754387426`,32.867224959534425`], List[33772.58438215816`,33.161239918338325`], List[33783.6655662951`,33.48773790969337`], List[33794.13534225813`,33.847679105038864`], List[33803.99675133726`,34.242123968464824`], List[33813.25160337585`,34.67223824864997`], List[33821.90044673885`,35.13929849965699`], List[33829.94253397758`,35.6446980937378`], List[33837.37578433413`,36.189953898364756`], List[33844.19674101188`,36.77671349201024`], List[33850.40052425412`,37.40676309323114`], List[33855.98077905303`,38.08203616906277`], List[33860.929617344606`,38.804622795374`], List[33865.237554506064`,39.57677984866854`], List[33868.89343949019`,40.400942067624044`], List[33871.88437812552`,41.279734048881565`], List[33874.19564897055`,42.215983229179486`], List[33875.81061133073`,43.21273394440271`], List[33876.710605084474`,44.27326267525686`], List[33876.874841122975`,45.40109449411768`], List[33876.28028212705`,46.600020846847706`], List[33874.90151285656`,47.87411874831821`], List[33872.710599483114`,49.227771536137254`], List[33865.76708095515`,52.192942460331295`], List[33860.944572637265`,53.81496868548291`], List[33855.16973988321`,55.53761979511577`], List[33848.399489466196`,57.36718226622537`], List[33840.58707915739`,59.31041125419767`], List[33831.6818728858`,61.37456512976104`], List[33821.629076352794`,63.56744238907394`], List[33810.36945255373`,65.89742115662811`], List[33797.83901574178`,68.37350134175252`], List[33783.96870239734`,71.00534948945308`], List[33768.684018538224`,73.80334650664817`], List[33751.90466171396`,76.77863822166822`], List[33733.544116477744`,79.94318874316964`], List[33713.50922302088`,83.30983676576795`], List[33691.69971721627`,86.89235453624869`], List[33668.0077417776`,90.70550940119169`], List[33642.3173282406`,94.76512774476802`], List[33614.503849213914`,99.08816083582049`], List[33584.43344147983`,103.69275214407145`], List[33551.96240111898`,108.59830559916925`], List[33516.93655163633`,113.82555376323107`], List[33479.19058799065`,119.39662500515482`], List[33438.54739952053`,125.335108132301`], List[33394.8173771979`,131.66611309655872`], List[33347.79771072193`,138.41632539575164`], List[33297.27168428682`,145.61405197273328`], List[33243.00798071204`,153.28925527910576`], List[33184.7600075272`,161.47357224448825`], List[33055.24474322843`,179.5044379041367`], List[32983.402470522626`,189.42249678011638`], List[32906.42507658954`,199.99254022424245`], List[32823.981569232405`,211.25397848013637`], List[32735.7232649014`,223.24738864812755`], List[32641.283952751794`,236.01425701969018`], List[32540.280340817364`,249.59664562815905`], List[32432.312845658413`,264.0367706197141`], List[32316.96679504655`,279.37647916461674`], List[32193.81412161519`,295.65661095348196`], List[32062.415633446577`,312.9162296767838`], List[31922.323955343898`,331.19171044808394`], List[31773.08724081271`,350.5156696370797`], List[31614.253759289662`,370.9157252983584`], List[31445.377464839872`,392.413080183215`], List[31266.02464966978`,415.0209227860908`], List[31075.781778264434`,438.7426488698461`], List[30874.26458292413`,463.56991458531684`], List[30661.128477835224`,489.48054260894946`], List[30436.080315210955`,516.4363163236735`], List[30198.891461331248`,544.3807132663097`], List[29949.41211134714`,573.2366463605869`], List[29687.58668906842`,602.904302771125`], List[29413.470091396906`,633.2591888683969`], List[29127.244437759724`,664.1505129454289`], List[28829.235876558076`,695.4000512221585`], List[28519.93088733279`,726.8016585784653`], List[28199.991405932135`,758.1215892474648`], List[27870.268000300228`,789.0997863427267`], List[27531.81024736691`,819.4522813229537`], List[27185.87341852597`,848.8748085780578`], List[26833.920586475637`,877.0476879805575`], List[26477.619330608166`,903.6419594498194`], List[26118.83235025512`,928.3266699418585`], List[25759.601499552147`,950.7771215185797`], List[25402.125031565938`,970.6837924589535`], List[25048.728172795105`,987.7615579176015`], List[24701.82752146675`,1001.7587670293831`], List[24363.890150528834`,1012.4656909775007`], List[24037.388664207836`,1019.7218541797982`], List[23724.753773206212`,1023.42179582056`], List[23428.326182098965`,1023.5188909798686`], List[23150.309701398543`,1020.0269754117546`], List[22892.727485082127`,1013.0196616000493`], List[22657.3831525087`,1002.6273902212381`], List[22445.82828950285`,989.0324138453873`], List[22259.33746317971`,972.4620399466949`], List[22098.89145907762`,953.1805631787422`], List[21965.16899865724`,931.480372426647`], List[21858.546754328083`,907.6727362423508`], List[21779.107089332443`,882.0787391884758`], List[21726.65262878917`,855.0207832813146`], List[21700.72654131825`,826.8149798212219`], List[21700.637274110617`,797.7646622831729`], List[21725.486443201462`,768.1551481358671`], List[21774.1986172708`,738.2497870523929`], List[21845.551834302165`,708.2872543005642`], List[21938.20783558628`,678.479991394892`], List[22050.741175191397`,649.0136506945954`], List[22181.666545762415`,620.0473817436878`], List[22329.46384105877`,591.7147886462539`], List[22492.60064262731`,564.1253912457798`], List[22669.551964111775`,537.3664388830626`], List[22858.817209559194`,511.50494213707384`], List[23058.934400618797`,486.5898104867857`], List[23268.49180185768`,462.6540057435237`], List[23486.1371261018`,439.7166420761275`], List[23710.584536198097`,417.7849812806755`], List[23940.6196772586`,396.85629041253867`], List[24175.10297968535`,376.91953994341816`], List[24412.97146945642`,357.95693252563996`], List[24653.23931155422`,339.9452610882286`], List[24894.997297005597`,322.8570997812133`], List[25137.411465981633`,306.661836952455`], List[25379.721039446784`,291.32656060229317`], List[25621.235812373237`,276.8168098550135`], List[25861.33314132583`,263.0972054363521`], List[26099.45464102266`,250.1319725163168`], List[26335.102687409326`,237.88536932456162`], List[26567.836808469914`,226.32203336062062`], List[26797.270030635897`,215.4072569049529`], List[27023.065235471422`,205.1072016360146`], List[27244.931571162957`,195.38906204715602`], List[27462.620953104666`,186.2211854229756`], List[27675.924680559132`,177.57315574656312`], List[27884.67018901809`,169.4158476958168`], List[28088.717952428113`,161.72145619767838`], List[28287.958544460827`,154.46350603342438`], List[28482.30986428245`,147.61684557359834`], List[28671.714528842153`,141.15762780560507`], List[28856.13743151845`,135.06328169257137`], List[29035.563464253315`,129.31247589412607`], List[29209.995399596093`,123.88507707054657`], List[29379.451927331465`,118.76210432111723`], List[29543.965839363584`,113.92568095796642`], List[29703.5823563737`,109.35898479714908`], List[29858.357589200834`,105.04619784731612`], List[30008.35712737846`,100.97245600648014`], List[30153.654747636618`,97.12379938547036`], List[30294.33123475665`,93.48712361099427`], List[30430.473307820735`,90.05013252641369`], List[30562.172644335507`,86.80129239946069`], List[30689.524995861517`,83.72978794281498`], List[30812.629388120266`,80.82548015064428`], List[30931.587399706164`,78.07886611235824`], List[31046.502512971438`,75.48104073991361`], List[31157.479531831297`,73.02366049205602`], List[31264.62406100255`,70.69890904958113`], List[31368.042041394176`,68.4994648480103`], List[31467.83933764095`,66.41847055468293`], List[31564.12137255173`,64.44950426849228`], List[31656.99280496473`,62.58655247669374`], List[31746.55724712423`,60.82398469580017`], List[31832.9170177903`,59.15652967065532`], List[31916.172928106644`,57.57925310062042`], List[31996.42409697782`,56.087536793088184`], List[32073.767793099443`,54.67705915204908`], List[32148.299301513616`,53.343777001219394`], List[32220.111811741855`,52.08390858497554`], List[32289.29632580347`,50.89391775078965`], List[32355.94158356323`,49.77049916808885`], List[32420.134004011554`,48.71056458568002`], List[32481.957640712215`,47.711230053104465`], List[32541.494149658945`,46.76980402802019`], List[32598.82276835878`,45.88377634471702`], List[32654.020304707185`,45.050807972183264`], List[32707.161134433914`,44.26872151437212`], List[32758.317206164553`,43.53549242165843`], List[32807.558053049586`,42.8492408663837`], List[32854.95081010983`,42.20822425184334`], List[32900.560236350415`,41.61083029675227`], List[32944.448740908105`,41.05557067565856`], List[32986.67641290088`,40.54107520885303`], List[33027.30105392128`,40.06608653942696`], List[33066.37821251195`,39.62945525675335`], List[33103.96122100361`,39.23013553124194`], List[33140.101232854344`,38.86718110233712`], List[33174.84726156725`,38.539741752892745`], List[33208.246219487984`,38.247060117036206`], List[33240.34295712978`,37.988468909511944`], List[33271.180302074514`,37.76338850036311`], List[33300.799097302945`,37.571324839361246`], List[33329.238239095605`,37.41186775948452`], List[33356.534713386136`,37.28468956697256`], List[33382.723631335`,37.18954401182144`], List[33407.83826314447`,37.126265558401386`], List[33431.910070318336`,37.094768991147646`], List[33454.96873595328`,37.095049340196816`], List[33477.04219337585`,37.127182164944394`], List[33498.15665198472`,37.19132411637939`], List[33518.336620921094`,37.28771384977499`], List[33537.60493051356`,37.416673309126935`], List[33555.9827505811`,37.578609316582806`], List[33573.48960616206`,37.77401555222688`], List[33590.14338983205`,38.00347486047337`], List[33605.96037125202`,38.267661987361386`], List[33620.95520318459`,38.56734669851719`], List[33635.14092381274`,38.9033973013696`], List[33648.528955523085`,39.276784624979165`], List[33661.12909953415`,39.68858644004234`], List[33672.949526354154`,40.13999235255579`], List[33683.99676223603`,40.63230925569244`], List[33694.27567073175`,41.16696729130095`], List[33703.789429253964`,41.74552636831277`], List[33712.539501009414`,42.36968335280392`], List[33720.525600725625`,43.04127981566258`], List[33727.74565549819`,43.762310569561855`], List[33734.19575898223`,44.53493287993213`], List[33739.87011931057`,45.36147647627658`], List[33744.76100054264`,46.244454450175894`], List[33748.85865612935`,47.186574955574734`], List[33752.15125539553`,48.190753952867226`], List[33754.624801473976`,49.260128921937046`], List[33756.263041021484`,50.398073732677425`], List[33757.04736411612`,51.60821459665267`], List[33756.95669463173`,52.894447288299126`], List[33755.96737027981`,54.260955700187495`], List[33754.05301153437`,55.712231799487`], List[33751.18437859155`,57.25309703915796`], List[33747.32921601175`,58.88872538357301`], List[33742.45208401959`,60.62466798978606`], List[33736.51417553389`,62.4668796224198`], List[33729.473118389775`,64.42174693562946`], List[33721.28276169581`,66.49611869123201`], List[33711.892945331376`,68.69733796236065`], List[33701.24925200037`,71.03327647081439`], List[33689.292740289646`,73.51237098816684`], List[33675.95965880503`,76.14366205309645`], List[33661.181139643326`,78.93683488009418`], List[33644.882870495974`,81.9022624616729`], List[33626.98474497479`,85.05105093595652`], List[33607.400490130465`,88.39508705573631`], List[33586.0372708017`,91.94708768065007`], List[33562.79527063852`,95.72065117071222`], List[33537.567249306245`,99.73031031169793`], List[33510.238076180634`,103.99158641644338`], List[33480.684241523675`,108.52104424295653`], List[33448.77334605655`,113.336347093188`], List[33414.36357058713`,118.45631130902956`], List[33377.30312795928`,123.90095909065367`], List[33337.429701280096`,129.69156867906565`], List[33294.569872454034`,135.85072029655475`], List[33248.53854698037`,142.40233617049176`], List[33199.138381951656`,149.37171230348986`], List[33146.15922718683`,156.78553988672778`], List[33089.37758987834`,164.67191296632075`], List[33028.55613680681`,173.0603189282517`], List[32963.44325090208`,181.98160786060208`], List[32893.772661422365`,191.46793556731407`], List[32819.263172201965`,201.55267540080774`], List[32739.61851472977`,212.2702919619155`], List[32654.52735910836`,223.65616995919783`], List[32563.663520170852`,235.74639014251835`], List[32466.686401985913`,248.57744355588744`], List[32363.241729814923`,262.1858746847178`], List[32252.962624619224`,276.6078429561677`], List[32135.471081911783`,291.8785920986964`], List[32010.37992258954`,308.03181621387364`], List[31877.2952891712`,325.098912159793`], List[31735.819765256812`,343.1081068735971`], List[31426.1123227987`,382.0436797630432`], List[31257.106220103637`,403.0009122899835`], List[31078.172765218118`,424.9592333097692`], List[30888.97105053787`,447.91312184707584`], List[30689.192879442056`,471.84576715431564`], List[30478.572338962364`,496.72728810172055`], List[30256.89644515965`,522.512892765163`], List[30024.016810779376`,549.141027307383`], List[29779.86223243028`,576.5315770710226`], List[29524.452032284116`,604.5841985721928`], List[29257.909916918226`,633.1768762450896`], List[28980.4780360311`,662.164811327131`], List[28692.530838461706`,691.3797620644286`], List[28394.58823655146`,720.6299612679322`], List[28087.327508792263`,749.7007366586744`], List[27771.59330147913`,778.3559512129108`], List[27448.4050419297`,806.3403614514754`], List[27118.961056886503`,833.3829603500399`], List[26784.638709908842`,859.2013279440979`], List[26446.98993808589`,883.5069577449613`], List[26107.731687475884`,906.011460902392`], List[25768.730918206402`,926.4334822713511`], List[25431.984072610292`,944.5060909743692`], List[25099.591163937286`,959.9843445711138`], List[24773.724932390785`,972.6526801596622`], List[24456.595812499563`,982.3317554219252`], List[24150.413734760292`,988.884365767988`], List[23857.348022113834`,992.2200924453776`], List[23579.4868129599`,992.2983996095265`], List[23318.79752984764`,989.1299843042608`], List[23077.08990460781`,982.7762906516812`], List[22855.982963054605`,973.347217102949`], List[22656.877173855777`,960.997159174125`], List[22480.93269377035`,945.9196300827808`], List[22329.054316427537`,928.340782711426`], List[22201.88338453964`,908.5122014277229`], List[22099.796581650917`,886.7033533005371`], List[22022.911206618002`,863.1940716350282`], List[21971.09627408531`,838.2674030974033`], List[21943.98858522246`,812.2030949647163`], List[21941.01278939607`,785.2719208104143`], List[21961.404400535102`,757.7309734638833`], List[22068.43684762777`,701.7586223946765`], List[22152.831471323858`,673.7448321397891`], List[22256.15243565508`,645.9539189992826`], List[22377.07075151039`,618.53845845047`], List[22514.21703363452`,591.6287821340356`], List[22666.201897889303`,565.3339479566296`], List[22831.63414195617`,539.743064339463`], List[23009.13661897514`,514.9268558958771`], List[23197.359802153333`,490.9393719353201`], List[23394.99310846111`,467.8197572017299`], List[23600.774101655712`,445.594019317922`], List[23813.495731769635`,424.27674287504124`], List[24032.011791007822`,403.8727142706632`], List[24255.240777868526`,384.37843272189764`], List[24482.168363940273`,365.78349298482175`], List[24711.84865377446`,348.07183222092544`], List[24943.404419370916`,331.22284092381017`], List[25176.026477822743`,315.2123405933073`], List[25408.972367023638`,300.0134354968577`], List[25641.56445792343`,285.597246282774`], List[25873.18762690246`,271.93353622632526`], List[26103.28659571474`,258.99123978312804`], List[26331.363032214016`,246.73890432063945`], List[26556.972491158416`,235.14505460777016`], List[26779.721262358107`,224.17849038597677`], List[26999.263181333296`,213.80852514150544`], List[27215.29644866564`,204.00517467401124`], List[27427.56049474818`,194.73930273814779`], List[27635.832919132903`,185.98273017990135`], List[27839.926527212352`,177.70831341513548`], List[28039.686481309644`,169.8899973791514`], List[28234.987578312866`,162.50284717987083`], List[28425.731662435883`,155.5230625332983`], List[28611.84517778088`,148.92797796586405`], List[28793.27686330152`,142.69605181547257`], List[28969.995590135368`,136.80684627702968`], List[29141.988339729825`,131.24100056680146`], List[29309.25831944332`,125.98019871089852`], List[29471.823211964536`,121.00713357209965`], List[29629.713553478356`,116.30546817850464`], List[29782.97123504254`,111.85979529260872`], List[29931.64812155009`,107.65559608103402`], List[30075.80478178354`,103.6791983402026`], List[30215.509323918104`,99.91773501071026`], List[30350.83632974699`,96.35910318273292`], List[30481.865881793765`,92.99192401311217`], List[30608.682677272063`,89.80550378841835`], List[30731.375222861087`,86.78979625745367`], List[30850.035104769708`,83.93536638566601`], List[30964.75632877226`,81.2333556538113`], List[31075.634724763382`,78.67544887013092`], List[31182.76741119778`,76.25384259832353`], List[31286.252314632613`,73.96121515094738`], List[31386.18774010001`,71.79069818116113`], List[31482.67198795643`,69.73584978122122`], List[31575.80301376015`,67.79062913258755`], List[31665.678127085404`,65.94937257258061`], List[31752.39372634381`,64.20677110541408`], List[31836.045066104532`,62.557849233754034`], List[31916.726054351304`,60.997945120470725`], List[31994.52907671059`,59.522691970019594`], List[32069.544845079825`,58.12800056577687`], List[32141.86226884956`,56.810042988665515`], List[32211.568345747794`,55.565237317052336`], List[32278.748071424194`,54.390233441644014`], List[32343.48436456979`,53.281899711617996`], List[32405.858007428527`,52.23731060059671`], List[32465.947598860304`,51.253735147759336`], List[32523.829519301875`,50.328626239105674`], List[32579.57790595878`,49.45961063346342`], List[32633.264637279866`,48.644479717265654`], List[32684.959325617332`,47.88118096094184`], List[32734.729316788893`,47.16780998923198`], List[32782.63969572505`,46.50260325210268`], List[32828.753297819756`,45.88393131987262`], List[32873.130724502524`,45.3102926808612`], List[32915.830362817724`,44.78030807583578`], List[32956.90840834119`,44.29271534275263`], List[32996.41889057244`,43.84636471113214`], List[33034.41370044191`,43.440214543966206`], List[33070.94261957866`,43.07332753438573`], List[33106.0533507575`,42.74486731192654`], List[33139.791548766465`,42.45409540962965`], List[33203.3229152427`,41.983137076989564`], List[33233.197438241936`,41.80194170487478`], List[33261.862199358206`,41.65641340149042`], List[33289.35308383822`,41.546271506240934`], List[33315.70411306129`,41.47132306905138`], List[33340.947472018335`,41.431462379077225`], List[33365.1135352136`,41.4266708401599`], List[33388.23089076597`,41.45701717801648`], List[33410.326362771826`,41.52265803008959`], List[33431.42503117978`,41.62383884880717`], List[33451.550249494685`,41.76089518250752`], List[33470.72365986125`,41.934254316564015`], List[33488.96520531381`,42.14443727565667`], List[33506.29313941601`,42.39206125142675`], List[33522.724032458784`,42.67784239169569`], List[33538.27277444401`,43.00259901819479`], List[33552.952574648494`,43.36725528291637`], List[33566.77495727566`,43.77284525707146`], List[33579.749753480195`,44.22051752716029`], List[33591.88508894447`,44.71154025351182`], List[33603.18736735198`,45.24730678914314`], List[33613.6612489377`,45.829341818376236`], List[33623.30962461959`,46.459308137754206`], List[33632.133584280025`,47.139013977289785`], List[33640.13238031891`,47.8704210698504`], List[33647.30338469133`,48.655653326943785`], List[33653.64204049222`,49.49700634242964`], List[33659.14180673053`,50.39695764399699`], List[33663.79409618455`,51.35817777340461`], List[33667.5882061537`,52.38354227840724`], List[33670.51124153176`,53.47614465726394`], List[33672.54802952437`,54.63931028366821`], List[33673.681025985694`,55.876611440818024`], List[33673.89021209459`,57.19188340930553`], List[33673.152981840656`,58.5892418357772`], List[33671.444019059425`,60.07310135828133`], List[33668.7351632759`,61.64819551988464`], List[33664.995264211335`,63.319598130113214`], List[33660.190023961055`,65.09274609125397`], List[33654.28182634906`,66.9734637884066`], List[33647.229552627745`,68.96798910384992`], List[33638.98838268827`,71.08300108465367`], List[33629.50958131997`,73.32564938152245`], List[33618.74026834803`,75.70358540798131`], List[33606.62317253198`,78.22499538238239`], List[33593.0963680889`,80.89863519601788`], List[33578.09299318458`,83.73386708818386`], List[33561.54094992811`,86.74069812784599`], List[33543.36258539428`,89.92982044918138`], List[33523.4743532268`,93.31265313613605`], List[33501.78645531501`,96.90138549105903`], List[33478.202464327944`,100.70902172402732`], List[33452.61892624293`,104.74942644607931`], List[33424.924944399965`,109.03737086362717`], List[33395.001745486974`,113.58857903878298`], List[33362.72222885253`,118.41977353551617`], List[33327.95050188121`,123.54871997139188`], List[33290.541403118994`,128.99426910556565`], List[33250.34001797357`,134.77639582436967`], List[33207.18119027372`,140.91623305263076`], List[33160.889036806824`,147.43609944562908`], List[33111.27647132134`,154.35951860977335`], List[33058.14474708078`,161.71122757667422`], List[33001.28302876722`,169.51717174840977`], List[32940.468006905554`,177.80448325849517`], List[32875.46357000274`,186.6014388337012`], List[32806.02055303048`,195.93739299967015`], List[32731.876583938294`,205.84268186550926`], List[32652.75605325836`,216.34849197527154`], List[32568.370235833914`,227.48668793170387`], List[32478.417598505213`,239.2895924111522`], List[32382.58433126089`,251.7897105876374`], List[32280.54514541805`,265.01939164939876`], List[32171.964386108197`,279.01041832303224`], List[32056.497512431633`,293.7935161078017`], List[31933.79300260996`,309.39777334057993`], List[31803.49474586254`,325.84996333963585`], List[31665.244986327747`,343.17376114376947`], List[31518.68788595353`,361.3888482846419`], List[31363.47377354031`,380.5099010703922`], List[31199.26414469085`,400.5454609687571`], List[31025.73747163139`,421.4966895006642`], List[30842.59587173444`,443.35601536899065`], List[30649.572668905337`,466.10568729882465`], List[30446.440861091633`,489.71625475035773`], List[30233.022479255047`,514.145007494545`], List[30009.198787947018`,539.3344153770095`], List[29774.921234579557`,565.2106207857706`], List[29530.22300341655`,591.6820491610637`], List[29275.230971638335`,618.6382134738617`], List[29010.177800813537`,645.9488005558856`], List[28735.413828364777`,673.4631353757361`], List[28451.418355315625`,701.0101232392652`], List[28158.80986223738`,728.3987719322001`], List[27858.35462979891`,755.4193869686783`], List[27550.973202052934`,781.8455193525382`], List[27237.74411389958`,807.4367214713986`], List[26919.904318143515`,831.9421325324813`], List[26598.84579716077`,855.1048735080205`], List[26276.1079334991`,876.6671809621953`], List[25953.365345140894`,896.3761557684103`], List[25632.41106215326`,913.9899464268972`], List[25315.135126672612`,929.2841369412712`], List[25003.498926165477`,942.0580680511268`], List[24699.505808005473`,952.1407940092832`], List[24405.16875306925`,959.3963716201039`], List[24122.476087476087`,963.7281951151951`], List[23853.35636853704`,965.0821305285771`], List[23599.6436772218`,963.4482622720777`], List[23363.044571599254`,958.8611476762477`], List[23145.10790121836`,951.3985608361551`], List[22947.198555071398`,941.1787990714196`], List[22770.476021036542`,928.3567111193132`], List[22615.87839250284`,913.1186754512338`], List[22484.112185013277`,895.6768086918621`], List[22375.64804628746`,876.2627098242217`], List[22290.72217414284`,855.1210508733559`], List[22229.343022993653`,832.5033004994139`], List[22191.302687575837`,808.6618334195081`], List[22176.192214738672`,783.844625819937`], List[22183.420012791288`,758.2906789803058`], List[22212.232500231865`,732.2262561816589`], List[22261.736154908078`,705.861962841078`], List[22330.92018335982`,679.3906537349582`], List[22418.679117062162`,652.986112794522`], List[22523.834747445977`,626.8024252181816`], List[22645.15692511622`,600.9739451169929`], List[22781.38286354824`,575.6157527527997`], List[22931.23469516957`,550.8244982039571`], List[23093.435126769888`,526.6795301580261`], List[23266.721125606604`,503.2442215892433`], List[23449.855638337012`,480.5674131880564`], List[23641.63740117367`,458.6849092177858`], List[23840.908941331294`,437.6209737852034`], List[24046.562900238605`,417.3897859738013`], List[24257.54682763325`,397.9968245925292`], List[24472.86660588342`,379.4401611254876`], List[24691.58866666262`,361.7116488711888`], List[24912.841159168394`,344.7980010535738`], List[25135.81422254786`,328.68175667714695`], List[25359.75950503712`,313.34213601893185`], List[25583.98906119816`,298.7557905575548`], List[25807.873745773617`,284.89745379953047`], List[26030.841210123577`,271.7405006895335`], List[26252.37359447036`,259.2574238116772`], List[26472.004996964835`,247.4202345937511`], List[26689.318789400833`,236.20079808242372`], List[26903.944838587766`,225.57110880415385`], List[27115.55668311398`,215.5035152009874`], List[27323.868706662262`,205.97089951576584`], List[27528.63334136944`,196.94681927267166`], List[27729.638328192894`,188.40561591789324`], List[27926.704055366965`,180.32249556270125`], List[28119.680991327736`,172.67358629961953`], List[28308.4472240065`,165.4359759232454`], List[28492.906114772413`,158.58773325184234`], List[28672.984072894284`,152.10791627221866`], List[28848.628452948473`,145.9765692225991`], List[29019.80557660298`,140.17471105959152`], List[29186.4988778194`,134.68431697897128`], List[29348.70716967823`,129.48829462974103`], List[29506.44302937915`,124.57045611000473`], List[29659.73129827642`,119.91548715009637`], List[29808.607691801244`,115.50891404560079`], List[29953.11751512323`,111.33706936337457`], List[30093.314479042812`,107.3870568754832`], List[30229.259610909787`,103.64671621617515`], List[30361.020255541156`,100.10458778619466`], List[30488.669160462407`,96.7498780773071`], List[30612.28364038859`,93.57242573729145`], List[30731.944816123563`,90.56266864180195`], List[30847.73692213624`,87.7116118985443`], List[30959.74667881746`,85.01079711867025`], List[31068.062724590975`,82.45227294723189`], List[31172.77510301171`,80.02856678941549`], List[31273.9748015334`,77.73265795618958`], List[31371.75333722115`,75.55795204990841`], List[31466.202386295536`,73.49825672335757`], List[31557.41345334201`,71.54775864026503`], List[31645.477577533453`,69.70100174577026`], List[31730.48507266537`,67.95286679227712`], List[31812.525297845954`,66.29855201057842`], List[31891.68645637134`,64.73355494096486`], List[31968.05541997328`,63.253655302238506`], List[32041.717576928695`,61.85489901260712`], List[32112.75670095781`,60.533583148406`], List[32181.254839366604`,59.28624186326584`], List[32247.292218647435`,58.10963324403577`], List[32310.947165640588`,57.00072701847651`], List[32372.296042775757`,55.95669308964163`], List[32431.41319590505`,54.97489084810831`], List[32488.370913630784`,54.052859260345315`], List[32543.239396238623`,53.188307592591165`], List[32596.086734121105`,52.37910689107851`], List[32646.978893734402`,51.62328204261021`], List[32695.979710442483`,50.9190044357485`], List[32743.15088770598`,50.26458523813567`], List[32788.55200119879`,49.658469172129664`], List[32832.240507743525`,49.099228856734165`], List[32874.271757767514`,48.58555960379109`], List[32914.69901122185`,48.11627472309498`], List[32953.57345609361`,47.69030127994358`], List[32990.94422903678`,47.30667628769685`], List[33026.85843756045`,46.96454331897745`], List[33061.36118334766`,46.66314951191274`], List[33094.49558676481`,46.4018430257447`], List[33126.30281124156`,46.18007082009826`], List[33156.822087893226`,45.99737682624802`], List[33186.09074017498`,45.85340053039642`], List[33214.144207766636`,45.74787589729879`], List[33241.01606926212`,45.68063061322284`], List[33266.73806435308`,45.65158575740925`], List[33291.34011425957`,45.66075578996768`], List[33314.85034068286`,45.708248913426324`], List[33337.295082947596`,45.794267802765894`], List[33358.69891299328`,45.91911068929392`], List[33379.08464820063`,46.083172833163054`], List[33398.473361785145`,46.286948385162376`], List[33416.88439039671`,46.531032628045395`], List[33434.33533865048`,46.816124601035604`], List[33450.842081062554`,47.143030206832115`], List[33466.41876019414`,47.512665694188975`], List[33481.07778154864`,47.926061630682995`], List[33494.82980471588`,48.38436734739036`], List[33507.68373013269`,48.88885582985622`], List[33519.646682342674`,49.44092921767477`], List[33530.72398814947`,50.042124773321696`], List[33540.919150383284`,50.69412146914491`], List[33550.23381644983`,51.39874715406201`], List[33558.667741844656`,52.15798639794831`], List[33566.21874788572`,52.9739889891071`], List[33572.88267354621`,53.84907915703592`], List[33578.6533210449`,54.785765552491895`], List[33583.522394704545`,55.786752018497694`], List[33587.47943291939`,56.85494922579645`], List[33590.511732765975`,57.9934872230413`], List[33592.604266660295`,59.205728922224054`], List[33593.7395905537`,60.49528456026663`], List[33593.89774359287`,61.86602725550211`], List[33593.05613849368`,63.322109685019704`], List[33591.18944194036`,64.8679819031973`], List[33588.269444776226`,66.5084104135389`], List[33584.26492103826`,68.24849847331487`], List[33579.141475884295`,70.09370781343902`], List[33572.86138123286`,72.04988171033561`], List[33565.383398643`,74.12326948184256`], List[33556.66258913243`,76.3205525051137`], List[33546.65010876565`,78.64887166689685`], List[33535.292990177535`,81.11585642952801`], List[33522.533908809615`,83.72965536949023`], List[33508.31093379856`,86.49896827851948`], List[33492.557262642535`,89.43307967258363`], List[33475.20093975667`,92.54189375651048`], List[33456.16455841286`,95.83597067943838`], List[33435.36494590379`,99.32656389777833`], List[33412.71283248334`,103.02565860041638`], List[33388.11250354407`,106.94601064946508`], List[33361.461436564714`,111.10118597707135`], List[33332.64992312524`,115.50559980052014`], List[33301.56067778551`,120.17455523921035`], List[33268.06843520312`,125.12428044830575`], List[33232.03953914503`,130.37196394216457`], List[33193.331524784226`,135.9357863249765`], List[33151.79270048711`,141.83494813350708`], List[33107.261732645`,148.08969176079935`], List[33059.56724024169`,154.72131584844476`], List[33008.52740744709`,161.75218054156485`], List[32953.94962264198`,169.20570085409963`], List[32895.63015563581`,177.10632584142505`], List[32833.35388595458`,185.4795004141305`], List[32766.89409747996`,194.35160609845803`], List[32696.01235801048`,203.74987708972486`], List[32620.458504354472`,213.70228677879177`], List[32539.97075748685`,224.237399965659`], List[32454.27599553273`,235.38418532136026`], List[32363.090215689084`,247.1717819160009`], List[32266.119220535016`,259.6292131526661`], List[32163.059568448596`,272.78504172376927`], List[32053.59983115876`,286.66695826400485`], List[31937.422205614144`,301.30129634291603`], List[31814.20453104528`,316.712466971645`], List[31683.62276471364`,332.9223064687042`], List[31545.353971345357`,349.9493315624271`], List[31399.079882221926`,367.807898229631`], List[31244.49107800643`,386.50726193253143`], List[31081.29184572034`,406.05054086074034`], List[30909.205752879578`,426.43358634567375`], List[30727.98197137976`,447.6437707690334`], List[30537.402368022995`,469.6587075686089`], List[30337.28935865384`,492.44492640082194`], List[30127.514496177035`,515.9565334176289`], List[29908.007730527912`,540.1338959237904`], List[29678.767240135632`,564.9023995056075`], List[29439.869689340463`,590.1713362568553`], List[29191.480716505986`,615.8329903585806`], List[28933.86540304156`,641.7619968893392`], List[28667.398418163964`,667.8150534342482`], List[28392.57347947204`,693.8310677214653`], List[28110.011719735507`,719.6318220702045`], List[27820.468510499777`,745.0232268510393`], List[27524.838267916282`,769.7972218691436`], List[27224.15676114939`,793.7343617064876`], List[26919.60046433111`,816.6070928908961`], List[26612.482542493482`,838.1836954829761`], List[26304.245144694047`,858.2328192745882`], List[25996.44779286078`,876.5285024385021`], List[25690.75180114361`,892.8555161611822`], List[25388.90083151766`,907.0148412145172`], List[25092.697880034248`,918.8290491610469`], List[24803.97918096803`,928.1473451670023`], List[24524.585700734115`,934.8500250576749`], List[24256.333054244544`,938.8521155525153`], List[24000.980799489633`,940.106000126279`], List[23760.202140299545`,938.6028814534792`], List[23535.555083217863`,934.3729962100836`], List[23328.456048219086`,927.4845685124562`], List[23140.156829496173`,918.0415588967195`], List[22971.72564520296`,906.1803369857143`], List[22824.032819036784`,892.0654591605024`], List[22697.741416197907`,875.8847767115961`], List[22593.30292645773`,857.8441229004619`], List[22510.95786796458`,838.1618308457411`], List[22450.740988251953`,817.063321425712`], List[22412.49057628611`,794.7759733183191`], List[22395.8612779857`,771.5244476343876`], List[22400.339731968656`,747.5265938997319`], List[22425.262308376005`,722.9900208861083`], List[22469.834240709006`,698.1093671053517`], List[22533.149479737975`,673.0642704895862`], List[22614.210663344737`,648.0180015108834`], List[22711.94867840527`,623.1167016147166`], List[22825.241381654927`,598.489152556134`], List[22952.931140852645`,574.2469928742553`], List[23093.840948663583`,550.4852951848221`], List[23246.788946454657`,527.283421484106`], List[23410.60126927615`,504.7060787960749`], List[23584.12318713405`,482.8045071324576`], List[23766.22856968956`,461.6177397305292`], List[23955.827741825695`,441.1738880892294`], List[24151.87382715112`,421.4914122740216`], List[24353.367697355417`,402.580347211617`], List[24559.361657571302`,384.4434630736539`], List[24981.33058813644`,350.4733869088904`], List[25195.685526638506`,334.618684785445`], List[25411.301172829026`,319.4968460740056`], List[25627.507478102732`,305.0887004550053`], List[25843.688844964592`,291.3729263948702`], List[26059.282571316056`,278.3265955277345`], List[26273.776972843214`,265.92564181258524`], List[26486.7092599649`,254.14526197003582`], List[26697.663236081484`,242.96025403187105`], List[26906.266874636876`,232.34530088750415`], List[27112.1898235865`,222.27520484157088`], List[27315.140878507824`,212.72507953075907`], List[27514.865458293112`,203.67050449537052`], List[27711.1431113009`,195.08764757063972`], List[27903.78507437794`,186.95335963368393`], List[28092.631902305307`,179.2452457272081`], List[28277.551181345603`,171.94171619735562`], List[28458.435337027324`,165.02202117462392`], List[28635.199543063776`,158.46627097749214`], List[28807.77973607571`,152.2554449462557`], List[28976.13073878323`,146.37139088153518`], List[29140.22449228805`,140.79681674539248`], List[29300.04839688021`,135.51527619949684`], List[29455.603759936155`,130.51114942552672`], List[29606.904348087268`,125.76962020352866`], List[29753.975040483518`,121.27665021000684`], List[29896.85057930738`,117.01895130427931`], List[30035.574413668484`,112.98395653595273`], List[30170.197632241652`,109.15979033184057`], List[30300.77798020298`,105.53523831310834`], List[30427.378955957916`,102.09971713998083`], List[30550.068982986628`,98.84324465414653`], List[30668.920652128352`,95.75641049399042`], List[30784.01003023105`,92.83034749017776`], List[30895.416030404092`,90.05670384844363`], List[31003.2198399798`,87.42761631177126`], List[31107.504401773556`,84.93568426250354`], List[31208.353945432427`,82.5739449910137`], List[31305.853564534853`,80.3358499817866`], List[31400.088836316172`,78.21524232495342`], List[31491.14548086039`,76.20633527665021`], List[31579.109056212495`,74.30369187104093`], List[31664.064686859398`,72.50220563012634`], List[31746.096822587417`,70.79708229776543`], List[31825.289025647`,69.18382267861847`], List[31901.723782988764`,67.65820637308506`], List[31975.482342176845`,66.21627653736422`], List[32046.644568516`,64.85432555953321`], List[32115.28882129574`,63.568881587620666`], List[32181.491847751597`,62.356695939442986`], List[32245.328692861276`,61.214731319507315`], List[32306.872623400763`,60.140150805683184`], List[32366.19506473778`,59.130307545302074`], List[32423.36554950135`,58.18273520635412`], List[32478.451676511275`,57.29513909097442`], List[32531.51907884836`,56.465387868879596`], List[32582.631400100345`,55.69150592466985`], List[32631.850277987403`,54.971666307175276`], List[32679.23533429229`,54.30418422905374`], List[32724.844170397228`,53.68751110395681`], List[32768.73236735658`,53.120229058736584`], List[32810.95349052347`,52.601045993003154`], List[32851.55909740792`,52.128791072310484`], List[32890.59874838705`,51.702410670580136`], List[32928.12001989289`,51.320964756475874`], List[32964.16851960743`,50.98362372921992`], List[32998.78790271016`,50.689665608173115`], List[33032.01988951739`,50.43847368000823`], List[33063.904283456286`,50.22953450025575`], List[33094.4789894032`,50.06243629408651`], List[33123.78003178766`,49.9368677196278`], List[33151.84157231969`,49.85261701006874`], List[33178.69592726669`,49.80957152286254`], List[33204.37358328649`,49.807717602869324`], List[33228.90321241401`,49.847140874139015`], List[33252.311684948625`,49.92802682904134`], List[33274.62408121877`,50.05066188274356`], List[33295.86370099594`,50.21543476722219`], List[33316.05207055337`,50.422838302526294`], List[33335.20894746842`,50.67347159697931`], List[33353.3523227726`,50.96804266578712`], List[33370.49841998287`,51.30737145348745`], List[33386.661691135945`,51.69239331376721`], List[33401.854809285454`,52.12416292544644`], List[33416.08865754684`,52.60385870376503`], List[33429.372314335604`,53.132787719150976`], List[33441.71303418737`,53.71239108320182`], List[33453.11622473974`,54.34424995533292`], List[33463.58541874225`,55.03009207160808`], List[33473.1222411502`,55.771798864419935`], List[33481.726371385244`,56.57141326638917`], List[33489.39549969413`,57.431148117381255`], List[33496.1252781743`,58.35339533882267`], List[33506.73886376074`,60.39594987590212`], List[33510.603252758076`,61.52202915468864`], List[33513.48931112686`,62.72218852948074`], List[33515.381534345266`,63.99987956600781`], List[33516.26194279853`,65.35880464940202`], List[33516.10998198889`,66.80293222091767`], List[33514.90241335228`,68.33651297024483`], List[33512.61319601102`,69.96409717851647`], List[33509.21335854632`,71.69055318323521`], List[33504.670860345155`,73.52108700691987`], List[33498.95044204974`,75.46126318899009`], List[33492.013464826356`,77.51702691687555`], List[33483.817737448386`,79.69472735028589`], List[33474.317331327315`,82.00114231104773`], List[33463.462382495134`,84.44350420483241`], List[33451.19888045176`,87.02952725087843`], List[33437.46844346526`,89.76743598602256`], List[33422.208079952194`,92.66599498731325`], List[33405.34993533971`,95.73453960110889`], List[33386.82102530102`,98.98300787121633`], List[33366.54295416622`,102.42197314815391`], List[33344.43161974844`,106.06267748783819`], List[33320.396904138644`,109.91706529315285`], List[33294.34235224157`,113.99781724152604`], List[33266.16483775927`,118.31838364720473`], List[33235.75421890446`,122.89301699394312`], List[33202.992985786026`,127.73680310903828`], List[33167.755901457975`,132.8656900739739`]]; ListLinePlot[temp] === Subject: Re: Mathematica 6 obtains imaginary eigenvalues for a Hermitian I note that although N[Eigenvalues[matrix]] does not give correct results (with the bug that Daniel Lichtblau explains), Eigenvalues[N[matrix]] does indeed work as expected... --David > Eigenvalues or characteristic values of a are defined (or rather, can = > be defined) as the roots of the characteristic polynomial - and it > does not matter is the matrix is invertible or not. Indeed, for a > nilpotent matrix, such as M = {{-1, I}, {I, 1}} we have In[39]:= Eigenvalues[M] > Out[39]= {0, 0} and In[40]:= CharacteristicPolynomial[M, x] > Out[40]= x^2 Moreover, the problem has nothing to do with numerical precision > because in this case the exact eigenvalues do not satisfy the > characteristic polynomial and in fact are the exact roots of a > different polynomial of the same degree (as shown in my first post in > this thread). Very weird. Andrzej Kozlowski > Note that your matrix is not invertible (its determinant is zero). So= > this is the source of your problem... Hope that this helps... -David > A WorkLife FrameWork > E x t e n d i n g MATHEMATICAs Reach... >http://scientificarts.com/worklife/ > I have a 14x14 Hermitian matrix, posted at the bottom of this >> message. >> The eigenvalues that Mathematica obtains using the >> N[Eigenvalues[matrix]] include non-real numbers: >> {-9.41358 + 0.88758 [ImaginaryI], -9.41358 - >> 0.88758 [ImaginaryI], -7.37965 + 2.32729 [ImaginaryI], >> -7.37965 - >> 2.32729 [ImaginaryI], -4.46655 + 2.59738 [ImaginaryI], >> -4.46655 - >> 2.59738 [ImaginaryI], 4.36971, 3.21081, -2.32456 + >> 2.10914 [ImaginaryI], -2.32456 - 2.10914 [ImaginaryI], >> 2.04366+ 0.552265 [ImaginaryI], >> 2.04366- 0.552265 [ImaginaryI], -0.249588 + >> 1.29034 [ImaginaryI], -0.249588 - 1.29034 [ImaginaryI]}. >> However, if you do Eigenvalues[N[matrix]] it obtains different >> results >> {-9.09122, -7.41855, -7.41855, -7.2915, 4.33734, -4., -4., 3.2915, >> -3.24612, -2.38787, -2.38787, 1.80642, 1.80642, 0}. > These results agree with Solve[CharacteristicPolynomial[matrix,x],x]. >> Therefore I assume that the latter are correct. Has anyone seen this? >> I am using 6.0.0. > Here is the matrix: >> {{-6, 0, -Sqrt[3], 0, 0, Sqrt[3], 0, 0, 0, 0, 0, 0, 0, 0}, {0, -6, >> 0, -Sqrt[3], 0, 0, Sqrt[3], 0, 0, 0, 0, 0, 0, 0}, {-Sqrt[3], 0, = >> -4, >> 2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), 2 Sqrt[2/3], 0, 0, Sqrt[3], = >> 0, >> 0, 0, 0, 0, 0}, {0, -Sqrt[3], >> 2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), -4/3, -(2 Sqrt[2])/3, 0, 0, = >> 0, >> Sqrt[3], 0, 0, 0, 0, 0}, {0, 0, 2 Sqrt[2/3], -(2 Sqrt[2])/3, >> 7/3, 0, >> 0, 0, 0, Sqrt[3], 0, 0, 0, 0}, {Sqrt[3], 0, 0, 0, 0, -4, 0, >> 2 (-1/(4 Sqrt[3]) + Sqrt[3]/4), 0, 0, 2 Sqrt[2/3], 0, 0, 0}, {0, >> Sqrt[3], 0, 0, 0, 0, -4, 0, 2 (-1/(4 Sqrt[3]) + Sqrt[3]/4), 0, 0,= >> 2 Sqrt[2/3], 0, 0}, {0, 0, Sqrt[3], 0, 0, >> 2 (-1/(4 Sqrt[3]) + Sqrt[3]/4), 0, -14/3, >> 2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), 2 Sqrt[2/3], (2 Sqrt[2])/3, = >> 0, >> 0, 0}, {0, 0, 0, Sqrt[3], 0, 0, 2 (-1/(4 Sqrt[3]) + Sqrt[3]/4), >> 2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), -2, -(2 Sqrt[2])/3, 0, ( >> 2 Sqrt[2])/3, 0, 0}, {0, 0, 0, 0, Sqrt[3], 0, 0, >> 2 Sqrt[2/3], -(2 Sqrt[2])/3, -7/3, 0, 0, >> 2 (1/(3 Sqrt[2]) + (2 Sqrt[2])/3), Sqrt[10/3]}, {0, 0, 0, 0, 0, >> 2 Sqrt[2/3], 0, (2 Sqrt[2])/3, 0, 0, -16/3, >> 2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), 2 Sqrt[2/3], 0}, {0, 0, 0, = >> 0, 0, >> 0, 2 Sqrt[2/3], 0, (2 Sqrt[2])/3, 0, >> 2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), -8/3, -(2 Sqrt[2])/3, 0}, = >> {0, 0, >> 0, 0, 0, 0, 0, 0, 0, 2 (1/(3 Sqrt[2]) + (2 Sqrt[2])/3), >> 2 Sqrt[2/3], -(2 Sqrt[2])/3, 1/2, >> 2 (-Sqrt[5/3]/16 - Sqrt[15]/16)}, {0, 0, 0, 0, 0, 0, 0, 0, 0, = >> Sqrt[ >> 10/3], 0, 0, 2 (-Sqrt[5/3]/16 - Sqrt[15]/16), 7/2}} === Subject: Insufficient capacity I transfer large amount of data from Excel to Mathematica v.6 and try to do some matrix operations. The size of the matrces are (3500, 3500) with 10 digit numbers. However, Mathematica quits when I make the matrix operation. How can I make it possible to do the matrix operations of large sizes? Is Grid Math an option in this respect? If so, I like to know how large data sets Grid Math can handle? Tugrul Temel === Subject: Manipulate I just have started using Mathematica and was working on the Manipulate function. I have the following piece of code: Manipulate[ Print[value], {value, 1, 10, 1, ControlType -> Animator} ] which seems to work just fine. However, if I add the following line to it, it does not quite work. lst = {}; Manipulate[ lst = Append[lst, value]; Print[value], {value, 1, 10, 1, ControlType -> Animator} ] The values that are being printed for value are really weird and incorrect. Any suggestions on what I have done wrong? === Subject: Re: Finding a continuous solution of a cubic enabled me to simplify the problem. The response from David appears to do exactly what I want but I am completely mystified as to what he did to get these region boundaries. Please could you reveal the magic you used to find the regions? Hugh Goyder === Subject: Re: bug report: Mathematica 6.0.1.0 crashes hard when converting an inline I can confirm the problem below on 6.0.1 on Linux x86 (32 bits). > Is this a good place for bug reports? Or should I post this somewhere else? Here are the steps for reproducing this bug on Mathematica 6.0.1.0 on > Win32: 1. Start Mathematica and create a new notebook. > 2. Type Hello (or any text) into the first cell of the notebook. > 3. Select the cell (using Ctrl-A, Edit -> Select All, or some other > method). 4. Convert it to a text-styled cell by using Alt-7, or Format - Style -> Text. > 5. Click in the cell to put the cursor there, so you can type more input. > 6. Create an inline cell by using Ctrl-9 or Insert -> Typesetting - Start Inline Cell. The cursor should be within the inline cell now. > 7. Convert the cell to InputForm by using Ctrl-Shift-I or Cell - Convert To -> InputForm. At this point, on my machine, Mathematica crashes and loses all my work. -- Curtis Osterhoudt cfo@remove_this.lanl.and_this.gov PGP Key ID: 0x4DCA2A10 Please avoid sending me Word or PowerPoint attachments See http://www.gnu.org/philosophy/no-word-attachments.html === Subject: Integrate problem evaluating the integral Integrate[Sin[1/x]*(Exp[(-a)*x^2]/x), {x, 0, Infinity}, Assumptions -> a > 0] in Mathematica 6.0.1 produces (1/2)*Pi*HypergeometricPFQ[{}, {1/2, 1}, a/4] - Sqrt[a]*Sqrt[Pi]*HypergeometricPFQ[{}, {3/2, 3/2}, a/4] What is the meaning of the empty list in the first parameter of HypergeometricPFQ? Michael Weyrauch === Subject: 64-bit problems with Mac version This is a follow-up my posting from Tuesday, which included a large dataset. The dataset is not necessary! In Mac OS 10.5.2, with 64 bit Mathematica (either 6.0.1 with the 64-bit option turned on by hand, or 6.0.2 which is 64 bit by default), the following simple code gives a permanent hang with the MathKernel at 100% CPU. ListLinePlot[{35227,32260,29121}] It doesnt cause a problem in the 6.0.1 32-bit version. Ive confirmed the bug with another Mac user. 64-bit Mac version still not ready for prime time? Would anyone with 64-bit PC or Unix versions care to check what happens on those platforms? Im guessing this is a Mac-specific bug. Gareth -- Gareth Russell NJIT === Subject: Mathematica Yellow, Does anyone know all of the intermediate incantations to make Mathematica (3.0) work under Ubuntu (Gutsy Gibbon with all patches applied and real Java)? I can supply a multitude of error messages if needed. === Subject: Re: Bug in Interpolation for multi-d data? It is a bug in at least 6.0.0 and 6.0.1. I hope that it is fixed in > 6.0.2, since Wolfram knows about this. I confirm that it seems to be corrected in V6.0.2. You can test the bug with e.g. following code where 3D interpolation is made for ordered and non-onredered lists and 2D plots are drawn. In 6.0.1, the latter plot produces wrong result. t = Flatten[ Table[ {i, j, i (j + RandomReal[{-2, 2}])}, {i, 10}, {j, 10}], 1]; int1 = Interpolation[ t] Show[ Plot[ int1[ x, 5], {x, 1, 10}], ListPlot[ Cases[t, x_ /; x[[2]] == 5][[All, {1, 3}]]] ] t1 = t[[RandomSample[ Range[Length[ t]]]]]; int2 = Interpolation[ t1] Show[ Plot[ int2[ x, 5], {x, 1, 10}], ListPlot[ Cases[t1, x_ /; x[[2]] == 5][[All, {1, 3}]]] ] Antti === Subject: Mathematica Help Ive got this mail from the net.. My name is Sharon Rad, Im a 4th year student for material Engineering at Ben-Gurion University in Israel. As a part of my engineer project I am to bulid a model in Mathematica (Creep model of Ti alloy) Ive done so, and all I have left to do is to draw a text in each of my curves (which can move with Manipulate) Would you be able to help me with this Matter? I have Mathematica 6 and, if possible, I will send you the file. Ive tried to figure it out myself with no luck. I Hope you can assist me. Sharon Rad. Israel === Subject: Bold Script Characters in 6.0.2 I wonder how many people see this bug in Version 6.0.2? (Im on 32-bit Windows Vista.) Type (or paste in from the Special Characters Script palette): [ScriptCapitalF]//TraditionalForm and evaluate. Everything should be all right. Then select the output cell and use Menu, Format, Face, Bold to change the FontWeight to Bold. The output cell will go blank and you will obtain a Messages Window with the error: INTERNAL SELF-TEST ERROR: NoteFont2|c|1783. Alternatively, start a Section head and type: This section heading contains a Script [ScriptCapitalF]. Again you will obtain an error message and the Script F will not display. This happens for all Bold Script characters, but it does not happen for Bold Greek, Gothic or DoubleStruck. This problem did not occur prior to Version 6.0.2. Part of the reason for this behavior can be seen by going to WolframResearchMathematicaSystemFilesFontsTrueType and looking at Mathematica5.ttf (the Plain Script characters) and Mathematica5b.ttf (supposedly the Bold Script characters). The last file contains no characters and this seems to be the case going back to Version 5.2. But Mathematica5mb.ttf does appear to have Bold and probably monospaced characters. I dont know what the true source of this problem is or why there was no problem prior to Version 6.0.2 but it is certainly a bug. For me, on Windows Vista, Mathematica 6.0.2 has been the most annoying, buggy and time consuming non-major update I have ever seen. -- David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ === http://library.wolfram.com/infocenter/MathSource/725/ may help. Jens > Recently, I am trying to build up a model involving resolving some > time delay problem like the follow (for a simple example): NDSolve[{x[t] == t, y[t] == x[t + 2], x[0] == 0}, {x, y}, {t, 1, 2}] For this one, anybody can easily figure out the solution even at first > glance, but Mathematica replies me with NDSolve::ndinnt: Initial condition Automatic[1.] is not a number or a > rectangular > array of numbers. Could anybody give me a help? > Merci beaucoup! > === Subject: Loading large files I am trying to solve a Linear Program for which the matrix A is very very large. The size of the matrix A runs into GB (~1GB). I have broken it into smaller files of size ~100 MB each and would like to load the files in Mathematica (Basically copy paste them). I tried to open and paste into mathematica but I cannot paste beyond the first file (~100MB) My question is can Mathematica support such a large matrix ? Darth === Subject: Re: How do I reformulate my NDSolve program Maybe you could post some actual working code? For example, what is i, and what is the I double dot mu? -- David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ > So I am trying to run plots of the following coupled differential > equations, specifically for epsilon=1/2: solution = NDSolve[{x[t] == 2p[t], x[0] == 0, > p[t] == i*(2 + =CF=B5)(i*x[t])^(1 + =CF=B5), p[0] == 1}, {x, p}, {t,0,10}, > WorkingPrecision -> 40, MaxSteps ->Infinity][[1]]; I then want to plot the p[t] in the complex plane: ParametricPlot[{Re[p[t]] /. solution, Im[p[t]] /. solution}, > Evaluate[time],PlotRange -> {{-2, 2}, {-2, 2}}] The problem with this is that my plot has a sharp change in slope at (1,0) > (t=5.6 or so). What should happen is that the line continues past p=1 and > extends out into a small loop before coming back, crossing over itself, > and continuing along the larger loop. I know that the reason the graph > isnt appearing correct has to do with the fact that Im raising x[t] to a > fractional power (epsilon=1/2). Mathematica isnt realizing that it has > hit a branch cut and is taking the wrong root. I have two questions. 1) How would I be able to identify these points of > discontinuities in slope on a more complicated graph (I want to be able to > do this for any positive rational epsilon)? 2) How would I go about > fixing the problem so that Mathematica takes the correct root and > continues in the correct direction? Alex PS. I have version 5.2, but I have access to a better version if theres > something in it that would help me. > === Subject: RE: Version 6.0.2 > My initial impression of Mathematica Version 6.0.2 is a > disappointment. My too :-((( I was awaiting new version with the big hope, that the problem with paclets could be solved in it. But it is not!!! I have heared, that this problem occures on Czech version of Windows XP only. When somebody tries to download any paclet data, it says, that there is problem with Internet connectivity. For example: In[1]:= ChemicalData[Caffeine] ChemicalData::dlfail: Internet download of data for ChemicalData failed. Use Help > Internet Connectivity... to test or reconfigure internet connectivity. >> Out[1]= $Failed But internet connectivity on that machine is realy OK and also tests in Help/Internet connectivity are OK. I can test it, and already have tested it with and without proxy on our network and it is always the same. Does anybody have the same problem on other language versions of Windows XP? Does anybody know any workaround? I know, that paclet data are not so essential for pure mathematics, but as we are highschool and have bought universal license of M6, we have many more applications for Mathematica which are realy dependent on paclets. Jakub === Subject: RandomGraph Hello All, How can I construct a directed random graph with exactly 12 vertices and 31 edges, where the indegrees of the vertices are {1, 2, 2, 1, 4, 3, 2, 3, 5, 5, 2, 1} and outdegrees of the vertices are {2, 1, 1, 2, Nese Aral === Subject: Re: OptimizeExpression you should *not* process the result of Experimental`OptimizeExpression Compile[] will accept the result and generate a optimized Mathematica code from it. That is what the function is used/written for. So, ok let start with your example oexp = Experimental`OptimizeExpression[(3 + 3*a^2 + Sqrt[5 + 6*a + 5*a^2] + a*(4 + Sqrt[5 + 6*a + 5*a^2]))/6]; The result is an OptimzedExpression[] that Hold the expression, because otherwise it will (and must) evaluate to the original expression. While the variable definitions are uncritical the CompoundExpression[] in the Block[] must be kept unevaluated {locals, code} = ReleaseHold[(Hold @@ oexp) /. Verbatim[Block][vars_, seq_] :> {vars, Hold[seq]}] the code is Hold[CompoundExpression[__]] Since CForm[] is only a wrapper it will not prevent the evaluation and so one has to split the CompoundExpression[] code1 = code /. Hold[CompoundExpression[seq__]] :> Hold[{seq}] One need a Hold[] for every element in the statement sequence and than the outer Hold can be removed code2 = First[ code1 //. Hold[{a___Hold, b_, c___}] /; Head[Unevaluated[b]] =!= Hold :> Hold[{a, Hold[b], c}]] next we have to transform the individual statements to CForm[] and to strings, statements = StringReplace[ToString[CForm[#]], Hold( ~~ ShortestMatch[a___] ~~ ) :> a] & /@ code2 and now the statements are transformed into a single String with propper formating mycsequence=StringJoin @@ Riffle[statements, ;n] Now lets turn back to the local variables, my Mathematica 6. generate variables like Internal_$$198 but the $ sign is not supported by all compilers replacevar = Rule @@@ Transpose[ {ToString[CForm[#]] & /@ locals, StringReplace[ StringReplace[ToString[#], {__ ~~ ` ~~ a_ :> a }], $ -> _] & /@ locals}] and mycsequence1 = StringReplace[mycsequence, replacevar] replace the variables, and finally add the variable declaration and a C-block {ndouble <> StringJoin @@ Riffle[Last /@ replacevar, ,] <> ;nn <> mycsequence1 <> ;n}n and we end with { double __103,__105,__106,__107,__108; __103 = Power(a,2); __105 = 6*a; __106 = 5*__103; __107 = 5 + __105 + __106; __108 = Sqrt(__107); (3 + 3*__103 + __108 + a*(4 + __108)/6.); } now add in your C-editor the name of the variable for the result { double __103,__105,__106,__107,__108; __103 = Power(a,2); __105 = 6*a; __106 = 5*__103; __107 = 5 + __105 + __106; __108 = Sqrt(__107); optimizedExpression=(3 + 3*__103 + __108 + a*(4 + __108)/6.); } and you are done. Jens > Hi everyone, Experimental`OptimizeExpression[(3+3*a^2 + Sqrt[5 + 6*a + 5*a^2] + a*(4 + Sqrt[5 + 6*a + 5*a^2]))/6] generates Out[1]= Experimental`OptimizedExpression[Block[{$$11, $$13, $$14, $$15, 2 >> $$16}, $$11 = a ; $$13 = 6 a; $$14 = 5 $$11; $$15 = 5 + $$13 + $$14; 3 + 3 $$11 + $$16 + a (4 + $$16) >> $$16 = Sqrt[$$15]; --------------------------------]] > 6 Now, Id like to get out the individual set of statements: $$11 = a; > $$13 = 6a; > $$14 = 5 $$11; > $$15 = 5 + $$13 + $$14; > $$16 = Sqrt[$$15]; > (3 + 3$$11 + $$16 + a(4+$$16)/6 > But, if I were to look at the function in the optimized expression, I get the original function: In[2]:= %[[1]] 2 2 2 > 3 + 3 a + Sqrt[5 + 6 a + 5 a ] + a (4 + Sqrt[5 + 6 a + 5 a ]) > Out[2]= -------------------------------------------------------------- > 6 > I suppose part of the difficulty is that I dont see a way to treat a CompoundExpression as a list of statements to be CFormd. Can anyone tell me how Id do this? > Evan === Subject: Re: OptimizeExpression Hi Evan, the problem your are facing is to prevent evaluation of a semicolon separated list. I see two approaches to this, either you replace the semicolons by commas or you wrap the expression in Hold[..]. As C also uses semicolons, we will try the second approach. By ReplaceRepeated you can extract the lines of code and wrap them by Hold. Assume t1 is your expression Experimental`OptimizeExpression[...], then: t2=t1/.{HoldPattern[_[Block[{__}, x___]]]->Hold[x]} this gives you the lines of code wrapped in Hold. To get C code: t2 // CForm now you only need to remove Hold. hope this helps, Daniel > Hi everyone, Experimental`OptimizeExpression[(3+3*a^2 + Sqrt[5 + 6*a + 5*a^2] + a*(4 + Sqrt[5 + 6*a + 5*a^2]))/6] generates Out[1]= Experimental`OptimizedExpression[Block[{$$11, $$13, $$14, $$15, 2 >> $$16}, $$11 = a ; $$13 = 6 a; $$14 = 5 $$11; $$15 = 5 + $$13 + $$14; 3 + 3 $$11 + $$16 + a (4 + $$16) >> $$16 = Sqrt[$$15]; --------------------------------]] > 6 Now, Id like to get out the individual set of statements: $$11 = a; > $$13 = 6a; > $$14 = 5 $$11; > $$15 = 5 + $$13 + $$14; > $$16 = Sqrt[$$15]; > (3 + 3$$11 + $$16 + a(4+$$16)/6 > But, if I were to look at the function in the optimized expression, I get the original function: In[2]:= %[[1]] 2 2 2 > 3 + 3 a + Sqrt[5 + 6 a + 5 a ] + a (4 + Sqrt[5 + 6 a + 5 a ]) > Out[2]= -------------------------------------------------------------- > 6 > I suppose part of the difficulty is that I dont see a way to treat a CompoundExpression as a list of statements to be CFormd. Can anyone tell me how Id do this?