title: How to get the determinant and inverse of a large sparse symmetric matrix?

text: For example, the following is a $12\times 12$ symmetric matrix. `Det` and `Inverse` take too much time and don't even work on my computer. I don't consider the numerical case.               mat = {       {a[1, 1], 0, 0, a[1, 4], 0, 0, a[1, 7], 0, 0, a[1, 10], 0, 0},       {0, a[1, 1], 0, 0, a[1, 4], 0, 0, a[1, 7], 0, 0, a[1, 10], 0},        {0, 0, a[3, 3], 0, 0, a[1, 4], 0, 0, a[1, 7], 0, 0, a[1, 10]},        {a[1, 4], 0, 0, a[4, 4], 0, 0, a[4, 7], 0, 0, a[4, 10], 0, 0},        {0, a[1, 4], 0, 0, a[4, 4], 0, 0, a[4, 7], 0, 0, a[4, 10], 0},       {0, 0, a[1, 4], 0, 0, a[6, 6], 0, 0, a[4, 7], 0, 0, a[4, 10]},        {a[1, 7], 0, 0, a[4, 7], 0, 0, a[7, 7], a[7, 8], a[7, 9], a[7, 10], 0, 0},        {0, a[1, 7], 0, 0, a[4, 7], 0, a[7, 8], a[8, 8], a[8, 9], 0, a[7, 10], 0},       {0, 0, a[1, 7], 0, 0, a[4, 7], a[7, 9], a[8, 9], a[9, 9], 0, 0, a[7, 10]},       {a[1, 10], 0, 0, a[4, 10], 0, 0, a[7, 10], 0, 0,  a[10, 10], a[10, 11], a[10, 12]},        {0, a[1, 10], 0, 0, a[4, 10], 0, 0, a[7, 10], 0, a[10, 11], a[11, 11], a[11, 12]},        {0, 0, a[1, 10], 0, 0, a[4, 10], 0, 0, a[7, 10], a[10, 12], a[11, 12], a[12, 12]}     }


title: How to Use ProbabilityScalePlot with Censored Data?

text: I am trying to reproduce a ProbabilityScalePlot of censored data shown here (see Sample Analysis Plot). Here is my Mathematica code. First I deal with the uncensored case.               probscaleplotFix =      Graphics[Append[First@#, Epilog /. Options[#, Epilog]],      FilterRules[Options[#], Except[Epilog]]] &;     SetOptions[ProbabilityScalePlot,      DisplayFunction ->      probscaleplotFix]; (* Needed to fix a software bug, see solution \     by Alexey Popkov on StackExchange *)          data = {30, 49, 82, 90, 96};     distA = EstimatedDistribution[data,      WeibullDistribution[a, b], {{a, 3}, {b, 50}}]     plot1 = Plot[PDF[distA, t], {t, 0, 200}, Frame -> True,      FrameLabel -> {"Time", "PDF"},      PlotLabel -> "Distribution 1 (no censoring)", PlotRange -> All,      PlotStyle -> Red]      ![Plot 1](http://i.stack.imgur.com/OZfTu.jpg)               plot2 = ProbabilityScalePlot[data, "Weibull",      PlotRange -> {{10, 200}, {1, 90}}, PlotStyle -> Red, Frame -> True,      FrameLabel -> {"Time", "CDF"},      PlotLabel ->      "ProbabilityScalePlot for Distribution 1 (no censoring)",      GridLines -> Automatic]      ![Plot 2](http://i.stack.imgur.com/aQjBi.jpg) So far so good . . . now for the censored data.               eventdata =      EventData[{30, 49, 82, 90, 96, 10, 45, 100}, {None, None, None, None,     None, Right, Right, Right}]          dist2 = EstimatedDistribution[eventdata,      WeibullDistribution[a2, b2], {{a2, 3}, {b2, 50}}]          plot3 = Plot[PDF[dist2, t], {t, 0, 200}, Frame -> True,      FrameLabel -> {"Time", "PDF"},      PlotLabel -> "Distribution 2 (censoring)", PlotRange -> All]      ![Plot 3](http://i.stack.imgur.com/Elven.jpg)               plot4 = ProbabilityScalePlot[dist2, "Weibull",      PlotRange -> {{1, 100}, {1, 99}}, PlotStyle -> Blue, Frame -> True,      FrameLabel -> {"Time", "CDF"},      PlotLabel -> "ProbabilityScale Plot for Distribution 2 (censoring)"]      ProbabilityScalePlot::estmd: Unable to estimate a reference distribution from the data. >>               plot5 = ProbabilityScalePlot[eventdata, "Weibull",      PlotRange -> {{1, 100}, {1, 99}}, PlotStyle -> Blue, Frame -> True,      FrameLabel -> {"Time", "CDF"},      PlotLabel -> "ProbabilityScale Plot for Distribution 2 (censoring)"]      ProbabilityScalePlot::ldata: EventData[8] is not a valid dataset, distribution, or a valid list of datasets and distributions. >> Can someone tell me how to produce the ProbabilityScalePlot for either eventdata or dist2 ? Many Thanks.


title: How to solve this nonlinear 2 by 2 equations?

text: I have a equation (x^2 + q1^2 - y^2)/2*(x + q1 - y) + (1 - 2*a)*q + 2*F = 2*(1 - a)*c[q] in q(variable) with parameters q1,a,F and function c(in variable q also, and I define it outside Solve so I can change it easier), when q=x,y the equation will be satisfied. I am new to mathematica, and not sure whether I define c in right way, whether I write my question in correct code. Any suggestion will be appreciated! Thanks in advance.               a = 0.25     F = 0.015641     q1 = 5.3415     c[b_] = ln[b + 1]     Solve[{(x^2 + q1^2 - y^2)/2*(x + q1 - y) + (1 - 2*a)*x + 2*F -       2*(1 - a)*c[x] ==      0 && (x^2 + q1^2 - y^2)/2*(x + q1 - y) + (1 - 2*a)*y + 2*F -       2*(1 - a)*c[y] == 0}, {x, y}]      and the output is:               Solve::inex: Solve was unable to solve the system with inexact coefficients or the system           obtained by direct rationalization of inexact numbers present in the system. Since many of      the methods used by Solve require exact input, providing Solve with an exact version of      the system may help. >>     Solve[{0.031282 + 0.5 x +       1/2 (5.3415 + x - y) (28.5316 + x^2 - y^2) - 1.5 ln[1 + x] == 0 &&     0.031282 + 0.5 y + 1/2 (5.3415 + x - y) (28.5316 + x^2 - y^2) -       1.5 ln[1 + y] == 0}, {x, y}]      I do not understand the above paragraph, and what are inexact coefficients?


title: Why does Mathematica order polynomial forms in reverse from traditional order?

text: I could very well be missing something obvious, but this has always bugged me with Mathematica and I don't know why it does it or how to fix it. If I enter any polynomial, say, x^2 + x - 1 for example, the output is always in the form:               -1 + x + x^2      And again:               input: Expand[(x^2 - 1) ((-3 + x)^2 - 4)]     output: -5 + 6 x + 4 x^2 - 6 x^3 + x^4      I find this much more difficult to read than the traditional way, from highest power to lowest. Is there anything I can do to change this? I'm aware that TraditionalForm prints them properly, but it is generally not recommended to do calculations with TraditionalForm so I'd like to avoid that if possible. Then again, IS IT that bad to do calculations with TraditionalForm like it warns?


title: How do I switch between dashed and undashed styles in ParametricPlot?

text: I am trying to generate a parametric plot in _Mathematica_ 8 using the following:               pp1=ParametricPlot[{Evaluate[Qin[t]]*10^3,Evaluate[PhiOut[t]]},{t,0,1/f0},AspectRatio->1/1,PlotRange->All,AxesOrigin->{0,0},PlotStyle->Directive[Thickness[Medium],colour]];      This works fine but I was wondering if it is possible to switch the styling of the line from solid to dashed for a certain range of the plotting parameter `t` e.g. for `t>0.5*1/f0`. I know that this can be done by generating separate plots and then combining them. This is not very convenient in my case. Is it possible to do this in a single `ParametricPlot` command?


title: Display a labeled multigraph

text: Despite the integration of graphs and networks, multigraphs are not supported in Mathematica 8+. In Mathematica 9+, `GraphPlot` misbehaves for multigraphs having labelled parallel edges:               GraphPlot[{{1 -> 2, "a"}, {1 -> 2, "b"}, {2 -> 1, "c"}}]     GraphPlot[{{1 -> 2, "a"}, {1 -> 2, "b"}, {2 -> 1, "c"}}, DirectedEdges -> True]      ![GraphPlot multidigraph misbehavior](http://i.stack.imgur.com/x5DkF.png) ![GraphPlot multigraph misbehavior](http://i.stack.imgur.com/34Xum.png) `EdgeRenderingFunction` is passed the nonsense labels, so using it is out of the question. Due to this bug, it appears there is no easy way for Mathematica 9+ to render a multigraph with labels. Are there any workarounds, or should I look somewhere other than Mathematica?


title: Shrinking the size of exported 2D density, vector field, and streamline plots

text: My question concerns the size of exported eps files that were created using density, contour, vector-field, and/or streamline plots: these files are so huge that whenthey are are inserted into a LaTeX manuscript (using \includegraphics) and a PDF file is created for printing (or viewing on screen), the time to render those pages in the PDF plot is extreme. Typical file sizes range from on the order of 600,000 to 4,400,000, depending on how I tweak various options to the plot commands. At prior suggestions of various people I’ve tried tweaking many of the myriad options for these commands, both individually and in combination (including PlotPoints). By doing so, I can induce _minor_ changes in the size of exported files, but nowhere near enough to make this viable. [The, to me, obvious idea of wrapping the name of the plot in Rasterize (within the Export command) does radically shrink the size of the exported graphic but at way too high cost: of so much loss of clarity as to defeat the purpose of including the graph in the manuscript in the first place.] To illustrate the effects of a few of these tweaks I’ve tried, here is a little data table:               No tweaks:                          759,192         NormalsFunction->None           759,189         Mesh->Full                      759,189         MaxRecursions->2               4,460,439         Rasterize (in Export)           224,000      From my research on the internet, I deduce that this is a common problem. There to be no simple fix I have tried some things suggested by at various sites---multi-step methods involving generating the plots in four or five separate graphics commands (axes, content, color, etc.), then combining them using Show. So far, everything I’ve tried works on the test cases posted where I found the idea but not for my graphs, and because the explanations are absent or lacking, I’ve not been able to figure out how these fixes work well enough to adapt them intelligently to my needs. This issue is important for me: I'm preparing final graphs for a long book, which contains many tens of plots of this type. Yesterday, for example, I tried to print the draft of a chapter that contains four of these density plots. The printer hung when it hit the page of the PDF file that contained the first of these density plots and remained hung for 8 hours, after which time I killed the job. (When I used the option draft->true, to \includegraphics, the file printed in about 2 minutes. Of course, it contained none of the figures, since this option includes in your PDF file not the figure but the full file name of the figure---not what one would need while revising or to give to students or colleagues for comment or to post on a web site or to send to a journal). On reflection, I find it hard to believe that there is not some straightforward way within Mathematica to fix this problem. But, hunt as I might on Wolfram’s site, I’ve not been able to find enough guidance to reduce, let alone solve, the problem. My friend and colleague Paul Abbott, whom I queried about this issue, suggested that I post this information here. Any help would be most appreciated! Thanks a lot. A couple of people offered the useful suggestion that I try a fix posted elsewhere on this site, a fix designed for 3D plots that adds a Prolog to all 3D plots that forces the conversion to bitmap upon export. This does, indeed, shrink the size of 3D plots appreciably but does not affect the size of the 2D plots that are the topic of this question.


title: Package FiniteFields

text: In a _Mathematica_ session, I evaluate:               Needs["FiniteFields`"];     fld = GF[2];      Now, for example, I'd like to compute $a^3+a^5$ for $a \in{Z_2}$. The result I'd like to have is $0$, because in $Z_2$, $a^n=a$ and $a+a=0$. I tried:               fld[{a^3}] + fld[{a^2}]      But _Mathematica_ gives me:               Subscript[{Mod[a^2 + a^3, 2]}, 2]      How can I simplify $a^3+a^2$ in $Z_2$ to get zero?


title: Deleting all characters in a string that do not belong to a small set of elements

text: Say I have a string {100 aa bbc%j%b%wa ajjcj11j0%2wj fc} with a lot of undesired characters or spaces in it, for example: {" ", "%", "w", "j"}. I'd like to strip the string of these characters, with the provided example giving us the output string:               testString = "100 aa bbc%j%b%wa ajjcj11j0%2wj fc";     StringReplace[testString, {" ", "%", "w", "j"} -> ""]          out: "100aabbcbaac1102fc";      Now, say we don't have a convenient list of undesired characters / spaces / paragraph indicators / etc. Is there a way to select for certain characters instead of specifying that certain characters should be deleted (as in the example)?


title: How to prevent axes label and tick labels from being placed inside a 3D plot

text: Consider the following toy-code:               data = Table[{k, Sin[k], 0}, {k, 0, 1, 0.01}];          ListPointPlot3D[{data},      PlotStyle -> {Gray, PointSize[Small]},      Boxed -> False,      AxesOrigin -> {Floor[Min[data]], Floor[Min[data]], 0},      AxesLabel -> {"x", "y", "z"}     ]      which generates the following plot: ![enter image description here](http://i.stack.imgur.com/nQ95M.jpg) Note that the axis label "y" is inside the plot, i.e. to the right of the axis. How can I get the tick labels as well as the axis label to left of the axis?


title: ReadList error with negative very small numbers

text: When I try to import data with `ReadList` from a file containing very small numbers `(~10^-318)`, positive data is handled well, whereas negative data casts an error: > "General::digit: "Digit at position 1 in !(\"-5.5137726\") is too large to > be used in base 10." The actual number in the file is `-5.5137726e-318`. It works fine for positive numbers, or smaller exponents. I know `Import` handles well the data, but wanted to use `ReadList` since its ~10 times faster. I also tried truncating the data in the text file (in case it was a precission problem), to no avail. Using Mathematica 9.0.1 with Windows 7 Home Premium. **EDIT** Here is a sample of the data; its a list of the components of a 3D vector:                  124000            0            0        124000 -5.5137726e-318 4.9011312e-318        124000 -6.0038857e-317 -8.1481306e-317        124000 8.7730249e-316 -6.6839177e-316        124000 7.2959464e-315 9.1491867e-315        124000 -9.4449699e-314 7.9490222e-314        124000 -8.6193193e-313 -9.6701831e-313        124000 9.823401e-312 -9.2906591e-312        124000 9.9467387e-311 9.9039764e-311        124000 -9.9117558e-310 1.0571814e-309        124000 -1.1151265e-308 -9.8472336e-309        124000 9.7116423e-308 -1.1671959e-307        124000 1.2122543e-306 9.5070421e-307        124000 -9.2363979e-306 1.2493669e-305      I ran the processing code again, and it seems now that any numbers (positive or negative) smaller than `2e-318` (`$MinMachineNumber`) give the same error. The `Import` command automatically truncates small numbers to 0:               {124000, 0, 0}, {124000, 0., 0.}, {124000, 0., 0.}, {124000, 0., 0.}, {124000, 0., 0.},      {124000, 0., 0.}, {124000, 0., 0.}, {124000, 0., 0.}, {124000, 0., 0.}, {124000, 0., 0.},      {124000, 0., 0.}, {124000, 9.71164*10^-308, -1.1672*10^-307},      {124000, 1.21225*10^-306, 9.50704*10^-307},  {124000, -9.2364*10^-306, 1.24937*10^-305}      I was looking for an output in this way, but with `ReadList`.


title: Fastest way to sum pairwise potentials

text: I've been writing a function to sum a pairwise potential on two lists, i.e. two charged bodies, each containing `N >> 1` and `M >> 1` atoms respectively. I need to be able to calculate the potential of atom-atom, residue-residue or body-body potential. In order to do so, I've defined the atom-atom, residue-residue, and body-body potentials as               Caa[atom1_,atom2_]:= Coulomb[atom1,atom2];     Crr[res1_,res2_]:= Total[Outer[Caa,res1,res2,1],2]     Cbb[body1_,body2_]:= Total[Outer[Crr,body1,body2,1],2]      where               body1 = {res11,res12,res13,...}     body2 = {res21,res22,res32,...}          res11 = {atom111,atom112,atom113,...}     res12 = {atom121,atom122,atom123,...}     ...     res21 = {atom211,atom212,atom213,...}     res22 = {atom221,atom222,atom223,...}     ...          atom111 = {{x111,y111,z111},q111}     atom112 = {{x112,y112,z112},q112}     ...     atom211 = {{x211,y211,z211},q211}     atom212 = {{x212,y212,z212},q212}     ...      i.e, two lists (bodies) of residues, which in turn are lists of atoms, all properly indexed. My question is, what is the most efficient way to define `Crr`and `Cbb`? I've tried with loops, `Sum`, `Table`, and a the `Total[Outer[...],2]` definition shown, but all seem to take almost the same (very long) time when doing a `Timing` check. Needless to say, `Coulomb` is a radial function, i.e., it only depends on the distance between `atom1`and `atom2`, and `atom = {{x,y,z},q}`, where `q` is the charge. **\--EDIT 1--**               Coulomb[atom1_,atom2_]:= atom1[[2]] atom2[[2]]/Norm[atom1[[1]]-atom2[[1]]]      **\--EDIT 2--** In http://pastebin.com/Yf9TKSDx, you can find a _small_ example of `body1` and `body2`. Here, `body1[[i]]`, will give you the _ith_ residue of the first body, `body1[[i,j]]`, the _jth_ atom of the _ith_ residue of `body1`. The atom-atom potential is calculated by doing               Caa[body1[[i,j]],body2[[k,l]]]      the residue-residue potential               Crr[body1[[i]],body2[[j]]]      and the body-body potential               Cbb[body1,body2]      hope this clarifies the problem.


title: Can DSolve solve systems with unspecified function coefficients?

text: I am an economic research student with no previous experience with _Mathematica_ , so please pardon me if my questions sounds really stupid. I am hoping to solve a system of nonlinear ODEs symbolically. I heard that the `DSolve` utility is very handy for this sort of problem, but before I invest my time in it, I hope to make sure that _Mathematica_ is the answer I want. Specifically, my system contains some function coefficients, but I do not know their explicit expression as of now, and they are just expressed as $\phi(t), \;\psi(t)$ etc. It also contains some unspecified constant coefficient as well. Can `DSolve` handle this situation? If not, I'd very much appreciate it if someone could suggest any alternative methods. Thank you!! * * * **Edit:** My system looks something like this: $\beta\phi(t)\lambda(t)x(t)^{\alpha}y(t)^{\beta-1}-\psi(t)=0\\\ \frac{dx}{dt}=\phi(t)x(t)^{\alpha}y(t)^{\beta}-\gamma{}x(t)\\\ \frac{d\lambda}{dt}=k\psi(t)-\lambda(t)[\alpha\phi(t)x(t)^{\alpha-1}y(t)^{\beta}-\gamma]$ where $\lambda(t)\text{, }x(t)\text{ and }y(t)$ are the functions I want to solve for, and $\phi(t)$ and $\psi(t)$ are function coefficients without explicit expressions, $\alpha,\;\beta,\;\gamma$ and $k$ are unspecified coefficients. I hope the solutions can be expressed in terms of integrals of $\phi(t)$ and $\psi(t)$. Is that possible?


title: Is it possible to use RandomChoice to choose without other choices being evaluated?

text: I'm trying to do this:               i1 = 1;     i2 = 1;          RandomChoice[{       (i1 = i1 + 1),       (i1 = i1 - 1),       (i2 = i1 + 1),       (i2 = i2 - 1)}]      In order to chose randomly which variable is going to be incremented or decremented - but it's not working. I've also tried with `--` and `++` but I had the same problem. I am clueless about what may be the problem.


title: How do we turn off automatic smart quotes/special character substitution?

text: In Mathematica 8, whenever I enter "hello" into a cell of style "text", the quote marks are automatically converted to special characters: `\[OpenCurlyDoubleQuote]hello\[CloseCurlyDoubleQuote]` This automatic substitution does not happen in a cell of style "input" (good!). Because I use Mathematica notebooks as a front-end to LaTeX, for me this substitution is a disaster, no matter where it occurs. What is the preferred idiom for turning-off this smart-quote feature (and all similar automatic character substitution features) for all cells in a Notebook? The ASCII characters that I type, are precisely the characters that I want in the notebook! The Mathematica documentation is unhelpful ... or possibly I am not looking in the correct place.


title: Visiting nodes in a tree bottom up

text: I have a problem that can be reduced to this one: Suppose I have an unbalanced (almost random) tree. The leaves of the tree have one property already set, and all vertex (including the leaves) have another property that I have to update upon visiting. To update that property, I need to cast a function `f[father_Vertex,{son_Vertex..}]` in an ordered way, as shown below: Example               (*build some tree*)     s = KaryTree[23, 3, DirectedEdges -> True];     leaves = Flatten@Position[VertexDegree[s], 1];     (*Draw it*)     HighlightGraph[#, leaves, VertexLabels -> "Name", ImagePadding -> 20] &@s     (*Assign a property to the leaves*)     leaves = Flatten@Position[VertexDegree[s], 1]     s1 = Fold[SetProperty[{#1, #2}, "leavesProp" -> RandomInteger[{1, 5}]] &, s, leaves];     (*Assign another property to all Vertex*)     s2 = Fold[SetProperty[{#1, #2}, "toUpdateProp" -> ""] &, s1, VertexList[s1]];      ![Mathematica graphics](http://i.stack.imgur.com/66wRC.png) Now, to cast my function, I need to visit node sets updating the properties in a hierarchical order: ![Mathematica graphics](http://i.stack.imgur.com/d0iRt.png) Which is the easiest way to accomplish this navigation scheme? **Edit** The visiting order at each tree level is interchangeable {s1, s2, s3, s4} and {s5, s6, s7} **Edit2** Trying to be more clear. This is the desired order of invocation. All calls to `f` within the same round could be done in any order. The red one could be done in the first or second round. ![Mathematica graphics](http://i.stack.imgur.com/cvwpm.png)


title: Make an effective projection of matrix

text: To best explain my problem, I will take the following example: Consider the following matrix : `A = {{1, 2, 3, 4, ""}, {"", 2, 3, 4, ""}, {"", "", 3, 4, ""}, {"", "", "", 4, 5}}` I designed the following two algorithms :               ProjVt[x_, y_, pat_] :=          Block[                     {X = x, Y = y, Grid11, Grid21, Resvf1},                          Grid11 = PosGrid[X, pat];                          Grid21 = ConstantArray["", 10000];                          Table[                           Table[                                 Grid21[[ Grid11[[i, j]] ]] = X[[i, Grid11[[i, j]] [[1]]  ]],                                 {j, 1, Length[Grid11[[i]]], 1}                                ],                                 {i, 1, Length[X], 1}                         ];                           Resvf1 =  Grid21[[1 ;; Length[Y]]]                      ];      and               ProjHt[x_, y_, pat_] :=     Block[                    {X = x, Y = y, Grid12, Grid22, Resvf2},                          Grid12 = PosGrid[X, pat];                          Grid22 = ConstantArray["", 10000];                          Table[                            Grid22[[i]] = X[[ i , Grid12[[i, 1, 1]] ;; Grid12[[i, -1, 1]] ]],                            {i, 1, Length[X], 1}                          ];                          Resvf2 = DeleteCases[Grid22, ""]                      ];      The results provided by `ProjVt` and `ProjHt` in the case of matrix `A` are : > >     Resvf1 = {1,2,3,4,5} >     Resvf2 = {{1, 2, 3, 4}, {2, 3, 4}, {3, 4}, {4, 5}} >      Best known optimization : * * *               ProjHt[X_]:= Map[Select[#, NumberQ] &, X]          ProjVt[X_]:=     Block[           {step1, Res},            step1 = Tranpose[x];            Res = ProjHt[step1][[All,1]]          ]      .


title: Numerical Differentiation of an interpolated list.

text: I have a synthetic spectrum with a wavelength range of .3 to .7 microns. I have interpolated this spectrum for re-sampling purposes. However, I am also attempting to calculate the first and second derivatives of the interpolated spectrum to find the locations of local maxima. However, numerical differentiation keeps producing an error, claiming that my input value is outside of the range of the data in the interpolating function. The important parts of my code are:               Needs["NumericalCalculus`"]     template = Import["C:\\Users\\John\\Documents\\Research\\KOI89\\template.txt","Table"];     t = Interpolation[template, InterpolationOrder -> 1]     ND[t[x], x, .4]      my "template" dataset has a domain of 0.3 to 0.7, and contains about 250,000 data points. However, the ND command produces the error:               InterpolatingFunction::dmval: "Input value {1.4} lies outside the range of data in the interpolating function. Extrapolation will be used. "     InterpolatingFunction::dmval: Input value {0.9} lies outside the range of data in the interpolating function. Extrapolation will be used.      I either need to figure out what is causing that error, or figure out another way of finding the location of all the peaks in my spectra. I tried a simple peak-finding For-loop but it is not giving me good results.               peaks = {};     For[n = 4, n <= Length[template] - 4, n++,      If[0.08 < template[[n - 3, 2]] < template[[n - 2, 2]] < template[[n - 1, 2]] < template[[n, 2]] > template[[n + 1, 2]] >   template[[n + 2, 2]] > template[[n + 3, 2]] > 0.08, peaks = Append[peaks, template[[n, All]]]]]      I am looking for simple ideas on how to find the peaks of my spectrum.


title: How to extend dictionary.txt

text: How to extend the default dictionary.txt for `Dictionarylookup` to all words? For example, first I               wordsExtended=WordData[]~Join~DictionaryLookup["*"]//Union;     wordsExtended//Length      However, after reloading the dictionary.txt some words are omitted, for example:               In[73]:= DictionaryLookup["appals"]     Out[73]= {}     In[74]:= WordData["appals"]     Out[74]= {{appal,Verb,Frighten},{appal,Verb,Nauseate}}      How to add all such words like #appals# to dictionary.txt? One method: Tuples to create a word verified by WordData, which takes too much time. For               In[78]:= Binomial[26,7]     Out[78]= 657800      Second method:               listAlls = # <> "s" & /@ DictionaryLookup["*"];     wordsToExport = Select[listAlls, Length[WordData@#] > 1 &];     In[81]:= Complement[wordsToExport,DictionaryLookup["*"]]//Length     Out[81]= 2580      I get 2580 new words for dictionary.txt, but how to get all prefix and suffix such like `s` `pre` `es`... and so on.


title: Manipulating the axis on a ListLinePlot

text: I am trying to create a plot using `ListLinePlot` in which the x-axis is represented in a logarithmic scale, and is reversed (so larger values are on the right side). I have found that `ScalingFunctions -> {"Reverse"}` will reverse the axis and `ScalingFunctions -> {"Log"}` will scale the axis to a log scale, but the two commands will not work together. Does anyone have any ideas?


title: Need help evaluating definite integral to a function of Y

text: Suppose $Y = \sqrt{2T}\cos(U)$, $ 0 \le u \le \pi $, and $ 0 \le \cos^{-1}(\frac{y}{\sqrt {2t}}) \le \pi ) $, so $ -1 \le \frac{y}{\sqrt{2t}} \le 1 $, with all $ \mathbb{R}$. The iterated integral is $$ G(y)= P(Y \le y) =P(\sqrt{2T}\cos(U) \le y)=\int_{0}^{y}\int_{0}^{\cos^{-1}(\frac{y}{\sqrt {2t}})} \frac{e^{-t}}{\pi } \mathrm{d}u \mathrm{d}t$$ My Mathematica code is               Integrate[((E^-t)/(\[Pi])), {u, 0,  ArcCos[y/((2 t)^(1/2))]},       Assumptions ->        0 <= u <= \[Pi] && -1 <= ArcCos[y/((2 t)^(1/2))] <= 1 &&         Element[t, Reals] > 0]          Integrate[%, {t, 0, y},       Assumptions -> -1 <= ArcCos[y/((2 t)^(1/2))] <= 1 &&         Element[t, Reals] > 0]      but then Mathematica never seems to finish evaluating the second one, and so I have to Abort it. Is there any way to find this as a function of $y$? $G(y)$ is a CDF of $Y$.


title: Where does Documentation Center introduce the basics?

text: While helping a user who mistakenly thought that `log` rather than `Log` was the correct built-in function name, I included a gently-worded suggestion of a "RTFM" approach to learning basics such as that built-in function names begin with upper-case letters (or possibly `$`). Then I tried to determine where in the Documentation Center one in fact finds such basics. Where, indeed? And how would a rank beginner come across it? I tried some obvious places:   * the Get Started button, but that takes you to an on-line video touting all the things that Mathematica can do;   * The Core Language > Language Overview, but that didn't help;   * The Core Language > Mathematica Syntax, but that didn't mention it. Etc. Is something very basic missing from the docs? (I note that there are a couple of videos at the Video and Screencasts pages of the Learning Resources section on the Wolfram web site that do mention the upper-case requirement, along with using square-brackets to enclose arguments, etc. But these are not something a new user might encounter right at the start. Indeed, even once one gets to the Video and Screencasts pages it's not obvious where to start to obtain such basics.)


title: Integrate on a logarithmic grid

text: I am trying to solve numerically an integral equation, and from a couple of tests I can see that the result has a strong logarithmic divergence. For my specific problem it is very important to have accurate results in the region of very small arguments, but that doesn't work since I am forced to replace the lower limit of integration (zero, that is) with non-zero values (0.0001 or whatever) otherwise the program crashes. So I though about integrating on a logarithmic grid, but I don't know how that works in Mathematica. (I have searched in the mathematica references, but could not find an answer). Anyone has an idea?               α = 2.85;     g = (Pi/2) α;     Nf := 2;          cs[x_] := 2 ArcCos[x]/Sqrt[1 - x^2];     csh[x_] := 2 ArcCosh[x]/Sqrt[x^2 - 1];     prefB[p_, k_, d_] :=      (p^2 + k^2 (1 - 1/d^2))/Sqrt[p^2 d^4 - 1/4 ((p^2 + k^2) d^2/k - k )^2];     pieceB[k_, d_] :=        If[d B[k]/k^2 < 1, cs[d B[k]/k^2], If[d B[k]/k^2 > 1, csh[d B[k]/k^2], 2]];          B[p_] = p^2 ;     iterstep :=      (values =      Parallelize[     Table[{p, p^2 +  g/(Pi^3  Nf) (NIntegrate[             prefB[p, k, d] ((d^2 B[k]^2/k^4 - 1) (Pi - g pieceB[k, d]) +                 B[k ]/k^2 d  g^2 csh[g])/(d^2 B[k]^2/k^4 + g^2 - 1),             {d, 0, 1/(1 + p)}, {k, p d/(d + 1), p d/(1 - d)},             WorkingPrecision -> 16,             PrecisionGoal -> 2,             MaxRecursion -> 100,            AccuracyGoal -> 16,             Method -> {"SymbolicPreprocessing", "OscillatorySelection" -> False}] +            NIntegrate[            prefB[p, k, d] ((d^2 B[k]^2/k^4 - 1) (Pi - g pieceB[k, d]) +                 B[k ]/k^2 d  g^2 csh[g])/(d^2 B[k]^2/k^4 + g^2 -1),             {d, 1/(1 - p), Infinity},             {k, p d/(d + 1), p d/(d - 1)},              WorkingPrecision -> 16, PrecisionGoal -> 2,             MaxRecursion -> 100, AccuracyGoal -> 16,            Method -> {"SymbolicPreprocessing","OscillatorySelection" -> False}])},             {p, 0, 0.99999, 1/20}]];          B[p_] = Interpolation[values , p, InterpolationOrder -> 4,   Method -> "Hermite"])               Do[iterstep, {3}] // AbsoluteTiming


title: Poor performance from Graphics3D

text: I wrote a game -- 2048，Some codes are from http://blog.wolfram.com/. My codes are in notebook downloads I added code so that the game can play in 3D form, but when I play it, I find that it is too slow, so I write some test code to investigate performance. ![enter image description here](http://i.stack.imgur.com/oxxqV.jpg) The front end seems to be too slow to update the complex 3D graphics in real time. How can I deal with this? ## Edit 1: The main relevant codes               Clear["Global`*"];     SetOptions[Graphics3D, Boxed -> False, Axes -> False];     $empty = "";          colors = {"Color" -> #1, "Background" -> #2} & @@@ {{"#776e65",       "#eee4da"}, {"#776e65", "#ede0c8"}, {"#f9f6f2",       "#f2b179"}, {"#f9f6f2", "#f59563"}, {"#f9f6f2",       "#f67c5f"}, {"#f9f6f2", "#f65e3b"}, {"#f9f6f2",       "#edcf72"}, {"#f9f6f2", "#edcc61"}, {"#f9f6f2",       "#edc850"}, {"#f9f6f2", "#edc53f"}, {"#f9f6f2", "#edc22e"}};     hexToRGB[s_String] :=        RGBColor @@ (IntegerDigits[FromDigits[StringTake[s, -6], 16], 256, 3]/255.);     colorForNumber[n_Integer, s_] := hexToRGB[s /. colors[[Log[2, n]]]];     $emptyColor = RGBColor[0.75436, 0.701427, 0.642634];     $backgroundColor = RGBColor[0.676677, 0.616403, 0.559747];          (*draw 3D*)     drawTile[n_Integer, pos_: {0, 0}] :=       Module[{texture, x0, y0, z0, x1, y1, z1, r},        {{x0, y0}, {x1, y1}} = pos - # & /@ {0.45, -0.45};        z0 = -.1; z1 = Log[2, n]/11; r = 1/16;        texture =         Graphics[{colorForNumber[n, "Background"],           Polygon[{{-0.45, -0.45}, {-0.45, 0.45}, {0.45, 0.45}, {0.45, -0.45}}],           Text[Style[n, Bold, FontFamily -> "Helvetica",           FontSize -> Scaled@Switch[IntegerLength@n, 1 | 2, .5, 3, .4, _, .34],           colorForNumber[n, "Color"]]]}, PlotRangeClipping -> True, PlotRange -> 0.4];       Graphics3D[{EdgeForm@None,           colorForNumber[n, "Background"], {Texture@texture,           Polygon[{{x0 + r, y0 + r, z1}, {x1 - r, y0 + r, z1},            {x1 - r, y1 - r, z1}, {x0 + r, y1 - r, z1}},           VertexTextureCoordinates -> {{0, 1}, {0, 0}, {1, 0}, {1, 1}}]},       Cuboid[{x0, y0, z0} + #, {x1, y1, z1} - #] & /@ {{0, r, r}, {r, 0, r}},       Table[Tube[{{x0 + r, y, z}, {x1 - r, y, z}}, r],            {y, {y0 + r, y1 - r}}, {z, {z0 + r, z1 - r}}],        Table[Tube[{{x, y0 + r, z}, {x, y1 - r, z}}, r],           {x, {x0 + r, x1 - r}}, {z, {z0 + r, z1 - r}}],        Table[Tube[{{x, y, z0 + r}, {x, y, z1 - r}}, r],             {x, {x0 + r, x1 - r}}, {y, {y0 + r, y1 - r}}]}]      ];     drawTile[$empty, pos_: {0, 0}] :=            Module[{texture, x0, y0, z0, x1, y1, z1, r},            {{x0, y0}, {x1, y1}} = pos - # & /@ {0.45, -0.45};            z0 = -.1; z1 = 1/22; r = 1/16;           Graphics3D[{EdgeForm@None, $emptyColor, {Polygon[{{x0 + r, y0 + r, z1},              {x1 - r, y0 + r, z1}, {x1 - r, y1 - r, z1}, {x0 + r, y1 - r, z1}}]},             Cuboid[{x0, y0, z0} + #, {x1, y1, z1} - #] & /@ {{0, r, r}, {r, 0, r}},             Table[Tube[{{x0 + r, y, z}, {x1 - r, y, z}}, r],                {y, {y0 + r, y1 - r}}, {z, {z0 + r, z1 - r}}],              Table[Tube[{{x, y0 + r, z}, {x, y1 - r, z}}, r],                {x, {x0 + r, x1 - r}}, {z, {z0 + r, z1 - r}}],              Table[Tube[{{x, y, z0 + r}, {x, y, z1 - r}}, r],                 {x, {x0 + r, x1 - r}}, {y, {y0 + r, y1 - r}}]}]];         drawBottom = Graphics3D[{$backgroundColor,          Cuboid[{0.4, 0.4, -0.1}, {4.6, 4.6, 0}]}];     drawGrid[board_] := Show[drawBottom,         Table[drawTile[board[[i, j]], {i, j}], {i, 4}, {j, 4}],         PlotRange -> {{0.5, 4.5}, {0.5, 4.5}, {-0.05, 1}}, ImageSize -> 500,         ViewPoint -> {2.13, -0.69, 2.53}, Lighting -> "Neutral"];      I want to write the game -- 2048 in 3D form ,like this: ![enter image description here](http://i.stack.imgur.com/Hy3kA.jpg) So First I need to plot the cuboid with rounded corners and texture.So I used Polygon,Text,Texture to realize the texture，and use Polygon,Cuboid,Cuboid to realize the cuboid with rounded corners.This is the function drawTile[].Then I just need to draw 16 cubes with function drawGrid[].And then the trouble is coming.The drawGrid contains a large number of primitives.It is quickly calculate in kernel.But if show it in the front end ，it will cost a long time that can not negligible.Here is the test codes.               data = Partition[RandomSample@PadLeft[2^# & /@ Range[11], 16, $empty],4];     m = AbsoluteTime[];     Show[drawGrid[data], ImageSize -> 150] // AbsoluteTiming     AbsoluteTime[] - m     m = AbsoluteTime[];     Show[drawGrid[data], ImageSize -> 150]; // AbsoluteTiming     AbsoluteTime[] - m      ![enter image description here](http://i.stack.imgur.com/oxxqV.jpg) Actually when I press the arrow key ,it will be 0.5s delay before image update in 3D form games, while it will be less than 0.1s delay in 2D form games.My cpu is Intel Core i3 370M. I want to reduce the delay because 0.5s is too long.But now I have no idea. ## Edit 2: new version of the program notebook download ## Edit 3: the advises from the original author of “2048 Wolfram Style” I asked the original author to help me how to improve speed,and he give me three advises.It is very helpful!   1. Use graphics multi-primitives whenever you can. This means instead of writing something like {Sphere[point1, r], Sphere[point2, r]}, use {Sphere[{point1, point2}, r]}. This works with many graphics objects.   2. Use floating point arithmetic. This means instead of using 1/16 or Log[2, 5], use 1/16. or Log[2., 5.].   3. You could also try to Rasterize the textures and numbers in advance. his advises My lastest program can download here


title: Displaying an open Manipulator

text: Take something like:               Manipulate[N[Pi]*s, {{s, 5}, 0, 10}]      This results in the following: ![The + sign has not been clicked](http://i.stack.imgur.com/CNMkC.jpg) What I would really like is the following: ![The + sign has been clicked](http://i.stack.imgur.com/hpH4A.jpg) Is there any way to make this happen by default? In other words, is there a flag I can set so that the little `+` sign is clicked by default?


title: FrameLabel not printing completely

text: Running this code:               Histogram[{RandomVariate[NormalDistribution[1/4,0.12],100],      RandomVariate[NormalDistribution[3/4, 0.12], 100]},       Automatic, "Probability", PlotRange -> {{0, 1}, {0, 1}},      Frame -> True, PlotRangeClipping -> True,      FrameLabel -> {Style["x axis", 15], Style["probability", 15]}     ]      Gives me the following plot: ![enter image description here](http://i.stack.imgur.com/jYSLN.png) As you can see, the label on the right ("probability") is not printed correctly. The character "y" is missing. What's going on here? I am using Mathematica 9.0.0.0. I ran this on two laptops, one with Windows 7 and the other with Windows 8. **Update** : Judging by the comments, this seems to be a bug. So now the question becomes: **Is there a workaround?** **Update** : This seems to be bug, so I'll tag as such. In the meantime, see the answers for workarounds.


title: Command completion in Wolfram Workbench 2 vs command completion in Mathematica 9

text: I don't have access to Workbench 2, but I tried a trial version of _Mathematica_ 9\. On reading about the features of Workbench 2, I found that it also supports code completion. I am looking forward to buying it for student V8 I bought. My first question is: are they different or the same? My second question is: does Workbench 2 support graphics visualization and programming?


title: combined 3D graphics with no interface

text: I'd like to combine several 3D graphics, but the interface, indicated by the arrow in the figure attached between them is alway present. How to eliminate it? Thanks in advance. Here is my example:                 Graphics3D[{           {EdgeForm[None], Opacity[0.1], Gray,             Cylinder[{{0, 0, 0}, {0, 2, 0}}, 0.5]},            {EdgeForm[None], CapForm["Butt"], Opacity[0.1], Gray,             Tube[{{0, 2, 0}, {0, 3, 0}}, {0.5, 0.2}]},                }, ViewPoint -> {0.8677796780444739`, 2.2396029175520074`,             2.383513625315694`},           ViewVertical -> {-2.366747875495254`, -0.028635050478789906`,             1.8415006920431496`}, Boxed -> False]      ![enter image description here](http://i.stack.imgur.com/3ZoMo.jpg)


title: histogram fit for probability density

text: I am trying to fit the (probability density) histogram of some data with the exponential function, but I am having difficulties. My raw data are in file called `datachopped`. They are not 'probability density'. I want to fit the probability density histogram of this data with Exp[-x]. So I use the following command:               Histogram[datachopped, Automatic, "PDF",       Epilog -> First@Plot[Exp[-x], {x, 0, 4}, PlotStyle -> Red]]      This gives me this plot: ![enter image description here](http://i.stack.imgur.com/hJmNi.jpg) However, I don't know how well this plot fit, i.e., how to compute the chi- squared, etc. Any help would be appreciated.


title: Thread over uneven (ragged) expressions with full functionality?

text: There are a number of questions on this site about "threading" including several relating to uneven (ragged) lists. However, none that I could find deal with the full functionality of `Thread` but instead things like `MapThread`, or the ragged transpose of `Flatten[expr, {2}]`. `Thread` operates:   * Inside held expressions without errant evaluation   * On arbitrary heads as specified with the second parameter   * By distributing singlets across all subexpressions   * On only the first _n_ arguments (subexpressions) if given as third parameter For example:               expr = Hold[qq[2 + 2, 1/0, 8/4], qq[1, 2, 3], Sqrt[2 + 2]];          Thread[expr, qq]          Thread[expr, qq, 1]      > >     qq[Hold[2 + 2, 1, Sqrt[2 + 2]], Hold[1/0, 2, Sqrt[2 + 2]], Hold[8/4, 3, > Sqrt[2 + 2]]] >   >     qq[Hold[2 + 2, qq[1, 2, 3], Sqrt[2 + 2]], Hold[1/0, qq[1, 2, 3], Sqrt[2 > + 2]], >        Hold[8/4, qq[1, 2, 3], Sqrt[2 + 2]]] >   All of this breaks if we change `qq[1, 2, 3]` to `qq[1, 2]`. What is the most efficient way to extend `Thread` to ragged subexpressions?


title: Using PlotLegends with a numeric PointSize

text: Using `PlotLegends` with a `PlotStyle` containing (for instance) `PointSize[0.02]` creates a legend that does not match the plot.               ListPlot[Table[RandomReal[NormalDistribution[], {20, 2}], {2}],      PlotLegends -> {"a", "b"}, PlotStyle -> PointSize[0.02]]      ![enter image description here](http://i.stack.imgur.com/JVtXy.png) How can I get a sensible legend when using a number with `PointSize`? Solutions involving named sizes (like `PointSize[Medium]`) are inadmissible unless they somehow create points that have a constant size relative to the plot size.


title: can someone how to plot $x = c$ in a different color scheme?

text: Exactly as title says. I do not know why I am having so much trouble with this. I have googled many solutions and I cannot find a straightforward answer. Also, the only method I know is "Gridlines" and there is no option to change colour


title: Adding custom GridLines to the "automatic" ones

text: I need to add custom (vertical) grid lines to a plot (to a `DateListPlot`, to be precise). I know there is the option of `GridLines -> {xgrid, ygrid}`. However, this removes the automatic grid lines which I would like to keep. Is there a simple option to add _additional_ grid lines to the automatic ones? Thank you! * * * **Update:** Added a minimal working example. Take the following `DateListPlot`               DateListPlot[RandomReal[1, 20], {2000}, Joined -> True]      ![automatic grid lines](http://imgur.com/1SUSWgr.png) It automatically includes vertical grid lines for each year in grey, which I would like to keep. But let's say I'd like to add a grid line for Guy Fawkes Day 2007, e.g. because I need to later label the event in the plot. I could write                DateListPlot[RandomReal[1, 20], {2000}, Joined -> True,                   GridLines -> {{"5 Nov 2007"}, None}]      ![custom grid lines](http://imgur.com/SZRkVus.png) but this removes the yearly lines. So I was wondering whether it is possible to _add_ the custom grid lines to the automatic ones rather than to overwrite the latter. Of course, I could manually re-add the annual grid lines, but I hope to avoid this solution because the plots will have different date ranges so I do not always know for which years I'd need to include the lines.


title: Bug in Integrate for Mathematica

text: Consider the following:               regFunc[x_,y_]:=Boole[-5<4x+3y<5 && -2<3x+2y<2];     Integrate[regFunc[x,y]*((4x+3y)(3x+2y))^4,{x,-100,100},{y,-100,100}]//N     Integrate[regFunc[x,y]*(12x^2+17x*y+6y^2)^4,{x,-100,100},{y,-100,100}]//N      In the first example, Mathematica seems to figure out the correct substitution, and arrives at 16000, which is the correct answer. In the second integration, (integrating the same expression, but expanded), Mathematica gives 5885078144/382725, which is 15376.8. This is clearly a bug, is this well-known? I am using Mathematica 8.04, 64bit Linux. EDIT: I got an email from the tech support, and I took the answer as a confirmed bug.


title: Plotting problem

text: I was wondering why I keep receiving the error message > >     "Derivative should be a triple of numbers, or scaled form" >   from the following code               uT[t_] := Simplify[r'[t]/Norm[r'[t]]]          vN[t_] := Simplify[uT'[t]/Norm[uT'[t]]]          vB[t_] := Simplify[Cross[r'[t], r''[t]]/Norm[Cross[r'[t], r''[t]]]]          N[Evaluate[uT[7 Pi/2]]]      > >     {0., 0.894427, 0.447214} >                 N[Evaluate[vN[7 Pi/2]]]      > >     {-(2./Sqrt[4. + 0.00900633 Abs[2.23607 - 1. Derivative[1][Norm][{0., 3., > 1.5}]]^2]), >     0., ( 2.23607 - 1. Derivative[1][Norm][{0., 3., 1.5}])/Sqrt[444.132 + > Abs[2.23607 - 1. >     Derivative[1][Norm][{0., 3., 1.5}]]^2]} >                 N[Evaluate[vB[7 Pi/2]]]      > >     {0.0944772, -0.445213, 0.890426} >                 N[Evaluate[uT[13 Pi/2]]]      > >     {0., -0.607287, -0.794483} >                 N[Evaluate[vN[13 Pi/2]]]       > >     (*out56*)   >     {50696.9/Sqrt[2.57017*10^9 + 9. Abs[2534.84 + 1539.38 > Derivative[1][Norm][{0., >     -2.29314, -3.}]]^2], (3. (2534.84 + 1539.38 Derivative[1][Norm][{0., > -2.29314, >     -3.}]))/Sqrt[ 2.57017*10^9 + 9. Abs[2534.84 + 1539.38 > Derivative[1][Norm][{0., >     -2.29314, -3.}]]^2], 0.} >                 N[Evaluate[vB[13 Pi/2]]]      > >     {0.118335, -0.7889, 0.60302} >                 Cter = ParametricPlot3D[r[t], {t, 0, 10 Pi}, PlotStyle -> Directive[Blue, Thick]];          stp = Graphics3D[{Opacity[.5], Black, Sphere[r[0], .5]}];          TNBPlot = Graphics3D[{Arrowheads[.07], Thickness[.15], Yellow,                            Arrow[{N[uT[7 Pi/2]], N[uT[13 Pi/2]]}], Green,                            Arrow[{N[vN[7 Pi/2]], N[vN[13 Pi/2]]}], Blue,                            Arrow[{N[vB[7 Pi/2]], N[vB[13 Pi/2]]}]}];          Show[Cter, stp, TNBPlot, PlotRange -> All]      I did narrow it down to the equation to `(*out56*)`, the equation for the Normal Vector. I haven't posted the actual function, because there's a bunch of questions up already pertaining to it, and I didn't want to give the impression that I'm trying to offload my homework onto anyone. Additionally, when I did have it working, I couldn't get the vectors to display properly. Could that possibly be due to the program considering the vectors and the actual 3D-Parametric plot as separate entities or something?


title: LengthWhile until first duplication

text: I have the need to trim each of a large number of potentially very long lists (10^6+ elements) to the length where the last occurrence of any distinct element happens, or said another way, where the next element is the first duplication of any prior element of that list. Lists are simple integer elements, but will often be beyond machine precision. For example, given a list `{3, 24, 50, 41, 46, 21, 20, 3, 2, 5, 29, 28, 38, 22, 2}` it should return `7`. I'm using: `-Tr[Unitize[# - #2[[ ;; Length[#]]]] - 1] &[DeleteDuplicates[#], #] &[yourListHere]` which is reasonably swift. Wondering if there's a better solution.


title: Overlapping accurately Images and Graphics (without loss of resolution)

text: **Context** In a previous post, I learned how to produce these kind of plots, which are of interest in astrophysics and geophysics. ![Mathematica graphics](http://i.stack.imgur.com/kvqzh.png) ![Mathematica graphics](http://i.stack.imgur.com/ogxt3.png) I am now interested in combining them. **Attempt** For this purpose, @belisarius suggested using the command               ImageCompose[mollwide, grid /. Line[a__] :> {White, Line[a]}]      which produces this (note the incorrect scaling) ![Mathematica graphics](http://i.stack.imgur.com/2cjXJ.png) As an other example (to make this question self contained) let us look at `StreamPlot`                gr = StreamPlot[{-1 - x^2 + y, 1 + x - y^2}, {x, -Pi, Pi}, {y, -Pi/2,      Pi/2}, AspectRatio -> 1/2, Frame -> False];      cart[{lambda_, phi_}] :=  With[{theta = fc[phi]}, {2 /Pi*lambda Cos[theta],   Sin[theta]}];      fc[phi_] := Block[{theta}, If[Abs[phi] == Pi/2, phi,  theta /.       FindRoot[2 theta + Sin[2 theta] == Pi Sin[phi], {theta, phi}]]];           gr2 = gr /. Arrow[pts_] :> Arrow[(cart /@ pts)] /.       Point[pts_] :> Point[cart[ pts]] //       Show[#, PlotRange -> {{-2, 2}, {-1, 1}}] &;           i = Import["http://tpfto.files.wordpress.com/2012/02/firemap.png"];      invmollweide[{x_, y_}] := With[{theta = ArcSin[y]}, {Pi (x)/(2 Cos[theta]),       ArcSin[(2 theta + Sin[2 theta])/Pi]}];      moll = ImageTransformation[i, invmollweide, DataRange -> {{-Pi, Pi}, {-Pi/2, Pi/2}},       PlotRange -> {{-2, 2}, {-1, 1}}, Padding -> White];           ImageCompose[ImageResize[moll, 1200],       gr2 /. Arrow[a__] :> {AbsoluteThickness[3], White, Arrow[a]}]      ![Mathematica graphics](http://i.stack.imgur.com/08nOg.png) **Question**   1. How can I make sure the image size match?   2. How can I combine them so that the grid remains a vector image rather than a raster?


title: Avoiding re-evaluation of RegionPlot3D on a second computer

text: After running a `RegionPlot3D` named "testplot" on my desktop, I followed an earlier suggestion from the forum and saved it using:               DumpSave["testplot.mx"].      I then saved and closed the notebook, quit _Mathematica_ and copied the notebook to my laptop. At this point, I re-opened the (copied) notebook and tried to retrieve the plot by using `DumpGet["testplot.mx"]`, but this failed. The plot took 60 mins of run time, and would take even longer on my laptop. The procedure I followed must be incorrect because I am certain this simple transfer can be done successfully allowing me to open the plot on my laptop without re-running. Does anyone have any suggestions?


title: Generating an editable table that can be used as input

text: Say I have a number $n_{max}$. I want a command to generate a table like               1 1     2 2     3 3     4 4     ...     nmax nmax      where the second column is editable, and this table can be evaluated so that Mathematica treats the table as the set               replacement = { 1 -> 1, 2 -> 2, ...}      (The point of this is so that I can replace the original list using /.replacement). So for example, after generating the table above, I can edit the second column as follows               1 A     2 B     3 C     4 D     ...     nmax FF      and this output re-evaluates into set               replacement = { 1-> A, 2-> B, 3-> C, F-> D, ... , nmax-> FF}


title: Exporting Cyrillics in PDF on Linux

text: I'm using Mathematica from Ubuntu. I need a normal font to display cyrillics inside PDFs. Any default font is very ugly, letters are too close together:               ImportString@       ExportString[Style["Русский", FontFamily -> #, FontSize -> 50],         "PDF"]&/@ {"Times", "Courier", "Arial"}      ![enter image description here](http://i.stack.imgur.com/J2nRN.png) Here is the longer example with also Latin mixed in: ![enter image description here](http://i.stack.imgur.com/T38es.png) As you can see Cyrillics letters are much bigger somehow. It's happening to every text inside the notebook including graphics, even though it looks fine in the editor. This is how it looks on `MacOSX-x86-64` and Mathematica 8.0.4 which can be used as reference: ![Mathematica graphics](http://i.stack.imgur.com/6tNBJ.png)


title: Interpolation on large 2D list results in erratic function

text: Previously, I've had problems with _Mathematica_ interpolating and plotting 3D lists, but I finally managed to do so by rescaling the x and y-axes with the help of the methods proposed here. Now my problem is with interpolating 2D lists. I have a large 2D list that I'll call `data` of dimensions {4271,2} for which I need to find an interpolation. Using `f = Interpolation[data]` outputs an interpolating function without error messages or warnings. The problem arises first when comparing the curves produced by `ListLinePlot[data]` and `Plot[f[s], {s, Min[data[[All, 1]]], Max[data[[All, 1]]]}]` as shown below. The first plot looks like this: ![enter image description here](http://i.stack.imgur.com/Cqn6l.png) and the second like this: ![enter image description here](http://i.stack.imgur.com/pbLrD.png) The first plot produces the expected curve whilst the second shows erratic behaviour between points. Evaluating the interpolating function offers only sensible result at points present in `data` and incoherent results elsewhere. I've tried sorting, cleaning, introducing noise into the data, but the interpolation always produces an erratic function. I'll post an excerpt of the first 900 rows of the data below. Any help is much appreciated.               data[[1 ;; 900, All]] = {{1779.55, 9.9227*10^6}, {1784.38, 9.9225*10^6}, {1789.02,        9.92229*10^6}, {1793.49, 9.92208*10^6}, {1797.79,        9.92187*10^6}, {1808.57, 9.92165*10^6}, {1819.04,        9.92143*10^6}, {1829.07, 9.9212*10^6}, {1838.74,        9.92097*10^6}, {1848.07, 9.92074*10^6}, {1857.03,        9.9205*10^6}, {1865.69, 9.92026*10^6}, {1872.35,        9.92001*10^6}, {1875.87, 9.91976*10^6}, {1879.27,        9.91951*10^6}, {1882.56, 9.91925*10^6}, {1885.76,        9.91899*10^6}, {1888.86, 9.91872*10^6}, {1891.86,        9.91845*10^6}, {1896.6, 9.91818*10^6}, {1903.59,        9.9179*10^6}, {1910.38, 9.91762*10^6}, {1916.98,        9.91733*10^6}, {1923.36, 9.91704*10^6}, {1929.56,        9.91675*10^6}, {1935.6, 9.91645*10^6}, {1941.47,        9.91615*10^6}, {1947.16, 9.91584*10^6}, {1952.68,        9.91553*10^6}, {1958.05, 9.91522*10^6}, {1963.29,        9.9149*10^6}, {1968.4, 9.91458*10^6}, {1971.81,        9.91425*10^6}, {1974.01, 9.91392*10^6}, {1976.16,        9.91359*10^6}, {1978.26, 9.91325*10^6}, {1980.3,        9.91291*10^6}, {1982.3, 9.91256*10^6}, {1984.25,        9.91221*10^6}, {1986.15, 9.91186*10^6}, {1990.17,        9.9115*10^6}, {1994.44, 9.91114*10^6}, {1998.61,        9.91077*10^6}, {2002.69, 9.9104*10^6}, {2006.68,        9.91003*10^6}, {2010.59, 9.90965*10^6}, {2014.39,        9.90927*10^6}, {2018.11, 9.90888*10^6}, {2021.75,        9.90849*10^6}, {2025.31, 9.9081*10^6}, {2028.8,        9.9077*10^6}, {2032.23, 9.9073*10^6}, {2035.58,        9.90689*10^6}, {2038.86, 9.90648*10^6}, {2040.37,        9.90607*10^6}, {2041.84, 9.90565*10^6}, {2043.29,        9.90523*10^6}, {2044.7, 9.9048*10^6}, {2046.09,        9.90437*10^6}, {2047.45, 9.90394*10^6}, {2048.79,        9.9035*10^6}, {2050.1, 9.90306*10^6}, {2052.63,        9.90261*10^6}, {2055.48, 9.90216*10^6}, {2058.28,        9.90171*10^6}, {2061.03, 9.90125*10^6}, {2063.73,        9.90079*10^6}, {2066.38, 9.90032*10^6}, {2068.99,        9.89985*10^6}, {2071.56, 9.89938*10^6}, {2074.08,        9.8989*10^6}, {2076.55, 9.89842*10^6}, {2078.97,        9.89793*10^6}, {2081.35, 9.89744*10^6}, {2083.68,        9.89695*10^6}, {2085.98, 9.89645*10^6}, {2088.25,        9.89595*10^6}, {2090.47, 9.89544*10^6}, {2092.66,        9.89493*10^6}, {2094.82, 9.89442*10^6}, {2096.94,        9.8939*10^6}, {2099.03, 9.89338*10^6}, {2101.08,        9.89285*10^6}, {2102.83, 9.89232*10^6}, {2103.77,        9.89179*10^6}, {2104.7, 9.89125*10^6}, {2105.62,        9.89071*10^6}, {2106.52, 9.89016*10^6}, {2107.41,        9.88961*10^6}, {2108.28, 9.88906*10^6}, {2109.14,        9.8885*10^6}, {2109.98, 9.88794*10^6}, {2111.38,        9.88737*10^6}, {2113.19, 9.8868*10^6}, {2114.98,        9.88623*10^6}, {2116.74, 9.88565*10^6}, {2118.47,        9.88507*10^6}, {2120.19, 9.88448*10^6}, {2121.87,        9.88389*10^6}, {2123.54, 9.8833*10^6}, {2125.18,        9.8827*10^6}, {2126.8, 9.8821*10^6}, {2128.39,        9.88149*10^6}, {2129.97, 9.88088*10^6}, {2131.52,        9.88027*10^6}, {2133.05, 9.87965*10^6}, {2134.56,        9.87903*10^6}, {2136.05, 9.8784*10^6}, {2137.5,        9.87777*10^6}, {2138.94, 9.87714*10^6}, {2140.36,        9.8765*10^6}, {2141.76, 9.87586*10^6}, {2143.14,        9.87521*10^6}, {2144.5, 9.87456*10^6}, {2145.84,        9.87391*10^6}, {2147.17, 9.87325*10^6}, {2148.48,        9.87259*10^6}, {2149.78, 9.87192*10^6}, {2151.06,        9.87125*10^6}, {2152.32, 9.87058*10^6}, {2153.56,        9.8699*10^6}, {2154.79, 9.86922*10^6}, {2156.01,        9.86853*10^6}, {2157.21, 9.86784*10^6}, {2158.39,        9.86715*10^6}, {2159.57, 9.86645*10^6}, {2160.72,        9.86575*10^6}, {2161.33, 9.86504*10^6}, {2161.86,        9.86433*10^6}, {2162.38, 9.86362*10^6}, {2162.9,        9.8629*10^6}, {2163.41, 9.86218*10^6}, {2163.91,        9.86145*10^6}, {2164.4, 9.86072*10^6}, {2164.89,        9.85999*10^6}, {2165.39, 9.85925*10^6}, {2166.46,        9.85851*10^6}, {2167.51, 9.85776*10^6}, {2168.55,        9.85701*10^6}, {2169.58, 9.85626*10^6}, {2170.6,        9.8555*10^6}, {2171.6, 9.85474*10^6}, {2172.6,        9.85397*10^6}, {2173.58, 9.8532*10^6}, {2174.55,        9.85243*10^6}, {2175.52, 9.85165*10^6}, {2176.47,        9.85087*10^6}, {2177.41, 9.85008*10^6}, {2178.34,        9.84929*10^6}, {2179.26, 9.8485*10^6}, {2180.16,        9.8477*10^6}, {2181.06, 9.8469*10^6}, {2181.95,        9.84609*10^6}, {2182.83, 9.84528*10^6}, {2183.7,        9.84447*10^6}, {2184.56, 9.84365*10^6}, {2185.41,        9.84283*10^6}, {2186.26, 9.842*10^6}, {2187.09,        9.84117*10^6}, {2187.91, 9.84034*10^6}, {2188.73,        9.8395*10^6}, {2189.53, 9.83866*10^6}, {2190.32,        9.83781*10^6}, {2191.11, 9.83696*10^6}, {2191.88,        9.83611*10^6}, {2192.65, 9.83525*10^6}, {2193.41,        9.83439*10^6}, {2194.16, 9.83352*10^6}, {2194.91,        9.83265*10^6}, {2195.64, 9.83178*10^6}, {2196.37,        9.8309*10^6}, {2197.09, 9.83002*10^6}, {2197.8,        9.82913*10^6}, {2198.51, 9.82824*10^6}, {2199.21,        9.82735*10^6}, {2199.9, 9.82645*10^6}, {2200.58,        9.82555*10^6}, {2201.26, 9.82464*10^6}, {2201.93,        9.82373*10^6}, {2202.6, 9.82282*10^6}, {2203.25,        9.8219*10^6}, {2203.9, 9.82098*10^6}, {2204.55,        9.82005*10^6}, {2205.18, 9.81912*10^6}, {2205.82,        9.81819*10^6}, {2206.44, 9.81725*10^6}, {2207.06,        9.81631*10^6}, {2207.67, 9.81536*10^6}, {2208.28,        9.81441*10^6}, {2208.88, 9.81346*10^6}, {2209.47,        9.8125*10^6}, {2210.06, 9.81154*10^6}, {2210.64,        9.81057*10^6}, {2211.22, 9.8096*10^6}, {2211.6,        9.80863*10^6}, {2211.83, 9.80765*10^6}, {2212.05,        9.80667*10^6}, {2212.28, 9.80568*10^6}, {2212.5,        9.80469*10^6}, {2212.71, 9.8037*10^6}, {2212.93,        9.8027*10^6}, {2213.14, 9.8017*10^6}, {2213.61,        9.80069*10^6}, {2214.15, 9.79968*10^6}, {2214.69,        9.79867*10^6}, {2215.22, 9.79765*10^6}, {2215.74,        9.79663*10^6}, {2216.26, 9.7956*10^6}, {2216.77,        9.79457*10^6}, {2217.28, 9.79354*10^6}, {2217.78,        9.7925*10^6}, {2218.28, 9.79146*10^6}, {2218.78,        9.79041*10^6}, {2219.27, 9.78936*10^6}, {2219.75,        9.78831*10^6}, {2220.23, 9.78725*10^6}, {2220.71,        9.78619*10^6}, {2221.18, 9.78512*10^6}, {2221.64,        9.78405*10^6}, {2222.1, 9.78298*10^6}, {2222.56,        9.7819*10^6}, {2223.02, 9.78082*10^6}, {2223.46,        9.77973*10^6}, {2223.91, 9.77864*10^6}, {2224.35,        9.77755*10^6}, {2224.79, 9.77645*10^6}, {2225.22,        9.77535*10^6}, {2225.65, 9.77424*10^6}, {2226.07,        9.77313*10^6}, {2226.49, 9.77202*10^6}, {2226.91,        9.7709*10^6}, {2227.32, 9.76978*10^6}, {2227.73,        9.76865*10^6}, {2228.13, 9.76752*10^6}, {2228.53,        9.76639*10^6}, {2228.93, 9.76525*10^6}, {2229.32,        9.76411*10^6}, {2229.71, 9.76296*10^6}, {2230.1,        9.76181*10^6}, {2230.48, 9.76066*10^6}, {2230.86,        9.7595*10^6}, {2231.23, 9.75834*10^6}, {2231.6,        9.75717*10^6}, {2231.97, 9.756*10^6}, {2232.34,        9.75483*10^6}, {2232.69, 9.75365*10^6}, {2233.05,        9.75247*10^6}, {2233.4, 9.75128*10^6}, {2233.74,        9.75009*10^6}, {2234.09, 9.7489*10^6}, {2234.43,        9.7477*10^6}, {2234.77, 9.7465*10^6}, {2235.1,        9.74529*10^6}, {2235.43, 9.74408*10^6}, {2235.76,        9.74287*10^6}, {2236.08, 9.74165*10^6}, {2236.41,        9.74043*10^6}, {2236.72, 9.7392*10^6}, {2237.04,        9.73797*10^6}, {2237.35, 9.73674*10^6}, {2237.66,        9.7355*10^6}, {2237.97, 9.73426*10^6}, {2238.27,        9.73301*10^6}, {2238.57, 9.73176*10^6}, {2238.87,        9.73051*10^6}, {2239.17, 9.72925*10^6}, {2239.46,        9.72799*10^6}, {2239.75, 9.72672*10^6}, {2240.03,        9.72545*10^6}, {2240.32, 9.72418*10^6}, {2240.6,        9.7229*10^6}, {2240.88, 9.72162*10^6}, {2241.15,        9.72033*10^6}, {2241.43, 9.71904*10^6}, {2241.7,        9.71775*10^6}, {2241.96, 9.71645*10^6}, {2242.23,        9.71515*10^6}, {2242.49, 9.71384*10^6}, {2242.75,        9.71253*10^6}, {2243.01, 9.71122*10^6}, {2243.26,        9.7099*10^6}, {2243.51, 9.70858*10^6}, {2243.76,        9.70725*10^6}, {2244.01, 9.70592*10^6}, {2244.26,        9.70459*10^6}, {2244.5, 9.70325*10^6}, {2244.74,        9.70191*10^6}, {2244.98, 9.70056*10^6}, {2245.21,        9.69921*10^6}, {2245.44, 9.69786*10^6}, {2245.67,        9.6965*10^6}, {2245.9, 9.69514*10^6}, {2246.13,        9.69377*10^6}, {2246.35, 9.6924*10^6}, {2246.57,        9.69103*10^6}, {2246.79, 9.68965*10^6}, {2247.01,        9.68827*10^6}, {2247.22, 9.68688*10^6}, {2247.44,        9.68549*10^6}, {2247.65, 9.6841*10^6}, {2247.76,        9.6827*10^6}, {2247.78, 9.6813*10^6}, {2247.79,        9.67989*10^6}, {2247.8, 9.67848*10^6}, {2247.95,        9.67707*10^6}, {2248.16, 9.67565*10^6}, {2248.36,        9.67423*10^6}, {2248.56, 9.6728*10^6}, {2248.76,        9.67137*10^6}, {2248.96, 9.66994*10^6}, {2249.15,        9.6685*10^6}, {2249.34, 9.66706*10^6}, {2249.53,        9.66561*10^6}, {2249.72, 9.66416*10^6}, {2249.91,        9.66271*10^6}, {2250.09, 9.66125*10^6}, {2250.27,        9.65979*10^6}, {2250.45, 9.65832*10^6}, {2250.63,        9.65685*10^6}, {2250.81, 9.65538*10^6}, {2250.98,        9.6539*10^6}, {2251.16, 9.65242*10^6}, {2251.33,        9.65093*10^6}, {2251.5, 9.64944*10^6}, {2251.66,        9.64795*10^6}, {2251.83, 9.64645*10^6}, {2251.99,        9.64495*10^6}, {2252.15, 9.64344*10^6}, {2252.31,        9.64193*10^6}, {2252.47, 9.64042*10^6}, {2252.62,        9.6389*10^6}, {2252.78, 9.63738*10^6}, {2252.93,        9.63585*10^6}, {2253.08, 9.63432*10^6}, {2253.23,        9.63279*10^6}, {2253.38, 9.63125*10^6}, {2253.52,        9.62971*10^6}, {2253.67, 9.62816*10^6}, {2253.81,        9.62661*10^6}, {2253.95, 9.62506*10^6}, {2254.09,        9.6235*10^6}, {2254.22, 9.62194*10^6}, {2254.36,        9.62037*10^6}, {2254.49, 9.6188*10^6}, {2254.62,        9.61723*10^6}, {2254.75, 9.61565*10^6}, {2254.88,        9.61407*10^6}, {2255.01, 9.61248*10^6}, {2255.13,        9.61089*10^6}, {2255.26, 9.6093*10^6}, {2255.38,        9.6077*10^6}, {2255.5, 9.6061*10^6}, {2255.62,        9.60449*10^6}, {2255.74, 9.60288*10^6}, {2255.85,        9.60127*10^6}, {2255.97, 9.59965*10^6}, {2256.08,        9.59803*10^6}, {2256.19, 9.5964*10^6}, {2256.3,        9.59477*10^6}, {2256.41, 9.59314*10^6}, {2256.51,        9.5915*10^6}, {2256.62, 9.58986*10^6}, {2256.72,        9.58821*10^6}, {2256.82, 9.58656*10^6}, {2256.92,        9.58491*10^6}, {2257.02, 9.58325*10^6}, {2257.12,        9.58159*10^6}, {2257.22, 9.57992*10^6}, {2257.31,        9.57825*10^6}, {2257.4, 9.57658*10^6}, {2257.5,        9.5749*10^6}, {2257.58, 9.57322*10^6}, {2257.67,        9.57153*10^6}, {2257.75, 9.56984*10^6}, {2257.84,        9.56815*10^6}, {2257.92, 9.56645*10^6}, {2258.,        9.56475*10^6}, {2258.08, 9.56304*10^6}, {2258.16,        9.56133*10^6}, {2258.23, 9.55962*10^6}, {2258.39,        9.5579*10^6}, {2258.82, 9.55618*10^6}, {2259.26,        9.55445*10^6}, {2259.69, 9.55272*10^6}, {2260.13,        9.55099*10^6}, {2260.55, 9.54925*10^6}, {2260.98,        9.54751*10^6}, {2261.4, 9.54576*10^6}, {2261.82,        9.54401*10^6}, {2262.24, 9.54226*10^6}, {2262.65,        9.5405*10^6}, {2263.06, 9.53874*10^6}, {2263.47,        9.53697*10^6}, {2263.87, 9.5352*10^6}, {2264.28,        9.53343*10^6}, {2264.68, 9.53165*10^6}, {2265.07,        9.52987*10^6}, {2265.47, 9.52808*10^6}, {2265.86,        9.52629*10^6}, {2266.25, 9.5245*10^6}, {2266.63,        9.5227*10^6}, {2267.02, 9.5209*10^6}, {2267.4,        9.51909*10^6}, {2267.78, 9.51728*10^6}, {2268.17,        9.51547*10^6}, {2268.56, 9.51365*10^6}, {2268.94,        9.51183*10^6}, {2269.33, 9.51*10^6}, {2269.71,        9.50817*10^6}, {2270.09, 9.50634*10^6}, {2270.47,        9.5045*10^6}, {2270.84, 9.50266*10^6}, {2271.21,        9.50081*10^6}, {2271.58, 9.49896*10^6}, {2271.95,        9.49711*10^6}, {2272.31, 9.49525*10^6}, {2272.67,        9.49339*10^6}, {2273.03, 9.49152*10^6}, {2273.39,        9.48965*10^6}, {2273.74, 9.48778*10^6}, {2274.09,        9.4859*10^6}, {2274.44, 9.48402*10^6}, {2274.78,        9.48213*10^6}, {2275.13, 9.48024*10^6}, {2275.47,        9.47835*10^6}, {2275.81, 9.47645*10^6}, {2276.14,        9.47455*10^6}, {2276.48, 9.47264*10^6}, {2276.81,        9.47073*10^6}, {2277.14, 9.46882*10^6}, {2277.5,        9.4669*10^6}, {2277.93, 9.46498*10^6}, {2278.35,        9.46305*10^6}, {2278.77, 9.46112*10^6}, {2279.19,        9.45919*10^6}, {2279.61, 9.45725*10^6}, {2280.02,        9.45531*10^6}, {2280.4, 9.45336*10^6}, {2280.75,        9.45141*10^6}, {2281.1, 9.44946*10^6}, {2281.44,        9.4475*10^6}, {2281.79, 9.44554*10^6}, {2282.13,        9.44357*10^6}, {2282.47, 9.4416*10^6}, {2282.81,        9.43963*10^6}, {2283.14, 9.43765*10^6}, {2283.47,        9.43567*10^6}, {2283.8, 9.43368*10^6}, {2284.13,        9.43169*10^6}, {2284.46, 9.4297*10^6}, {2284.78,        9.4277*10^6}, {2285.1, 9.4257*10^6}, {2285.42,        9.42369*10^6}, {2285.73, 9.42168*10^6}, {2286.05,        9.41967*10^6}, {2286.36, 9.41765*10^6}, {2286.67,        9.41563*10^6}, {2286.97, 9.4136*10^6}, {2287.28,        9.41157*10^6}, {2287.58, 9.40954*10^6}, {2287.88,        9.4075*10^6}, {2288.18, 9.40546*10^6}, {2288.47,        9.40341*10^6}, {2288.77, 9.40136*10^6}, {2289.06,        9.39931*10^6}, {2289.35, 9.39725*10^6}, {2289.63,        9.39519*10^6}, {2289.92, 9.39312*10^6}, {2290.2,        9.39105*10^6}, {2290.48, 9.38898*10^6}, {2290.76,        9.3869*10^6}, {2291.04, 9.38482*10^6}, {2291.31,        9.38273*10^6}, {2291.58, 9.38064*10^6}, {2291.85,        9.37855*10^6}, {2292.12, 9.37645*10^6}, {2292.39,        9.37435*10^6}, {2292.65, 9.37224*10^6}, {2292.91,        9.37013*10^6}, {2293.17, 9.36802*10^6}, {2293.43,        9.3659*10^6}, {2293.68, 9.36378*10^6}, {2293.94,        9.36165*10^6}, {2294.19, 9.35952*10^6}, {2294.44,        9.35739*10^6}, {2294.69, 9.35525*10^6}, {2294.93,        9.35311*10^6}, {2295.18, 9.35096*10^6}, {2295.42,        9.34881*10^6}, {2295.66, 9.34666*10^6}, {2295.9,        9.3445*10^6}, {2296.23, 9.34234*10^6}, {2296.6,        9.34017*10^6}, {2296.96, 9.338*10^6}, {2297.32,        9.33583*10^6}, {2297.68, 9.33365*10^6}, {2298.03,        9.33147*10^6}, {2298.39, 9.32928*10^6}, {2298.74,        9.32709*10^6}, {2299.09, 9.3249*10^6}, {2299.39,        9.3227*10^6}, {2299.65, 9.3205*10^6}, {2299.9,        9.31829*10^6}, {2300.15, 9.31608*10^6}, {2300.4,        9.31387*10^6}, {2300.65, 9.31165*10^6}, {2300.9,        9.30943*10^6}, {2301.14, 9.3072*10^6}, {2301.38,        9.30497*10^6}, {2301.62, 9.30274*10^6}, {2301.86,        9.3005*10^6}, {2302.1, 9.29826*10^6}, {2302.33,        9.29601*10^6}, {2302.56, 9.29376*10^6}, {2302.8,        9.29151*10^6}, {2303.02, 9.28925*10^6}, {2303.25,        9.28699*10^6}, {2303.48, 9.28472*10^6}, {2303.7,        9.28245*10^6}, {2303.92, 9.28018*10^6}, {2304.14,        9.2779*10^6}, {2304.36, 9.27562*10^6}, {2304.57,        9.27333*10^6}, {2304.79, 9.27104*10^6}, {2305.,        9.26875*10^6}, {2305.21, 9.26645*10^6}, {2305.42,        9.26415*10^6}, {2305.62, 9.26184*10^6}, {2305.83,        9.25953*10^6}, {2306.03, 9.25722*10^6}, {2306.23,        9.2549*10^6}, {2306.43, 9.25258*10^6}, {2306.63,        9.25025*10^6}, {2306.83, 9.24792*10^6}, {2307.02,        9.24559*10^6}, {2307.21, 9.24325*10^6}, {2307.4,        9.24091*10^6}, {2307.59, 9.23856*10^6}, {2307.78,        9.23621*10^6}, {2307.96, 9.23386*10^6}, {2308.15,        9.2315*10^6}, {2308.33, 9.22914*10^6}, {2308.51,        9.22677*10^6}, {2308.69, 9.2244*10^6}, {2308.87,        9.22203*10^6}, {2309.04, 9.21965*10^6}, {2309.22,        9.21727*10^6}, {2309.39, 9.21488*10^6}, {2309.56,        9.21249*10^6}, {2309.73, 9.2101*10^6}, {2309.89,        9.2077*10^6}, {2310.06, 9.2053*10^6}, {2310.22,        9.20289*10^6}, {2310.38, 9.20048*10^6}, {2310.69,        9.19807*10^6}, {2311.04, 9.19565*10^6}, {2311.38,        9.19323*10^6}, {2311.63, 9.1908*10^6}, {2311.82,        9.18837*10^6}, {2312.01, 9.18594*10^6}, {2312.19,        9.1835*10^6}, {2312.38, 9.18106*10^6}, {2312.56,        9.17861*10^6}, {2312.74, 9.17616*10^6}, {2312.92,        9.17371*10^6}, {2313.1, 9.17125*10^6}, {2313.28,        9.16879*10^6}, {2313.45, 9.16632*10^6}, {2313.62,        9.16385*10^6}, {2313.79, 9.16138*10^6}, {2313.96,        9.1589*10^6}, {2314.13, 9.15642*10^6}, {2314.3,        9.15393*10^6}, {2314.46, 9.15144*10^6}, {2314.63,        9.14895*10^6}, {2314.84, 9.14645*10^6}, {2315.05,        9.14395*10^6}, {2315.25, 9.14144*10^6}, {2315.46,        9.13893*10^6}, {2315.66, 9.13642*10^6}, {2315.87,        9.1339*10^6}, {2316.07, 9.13138*10^6}, {2316.27,        9.12885*10^6}, {2316.47, 9.12632*10^6}, {2316.66,        9.12379*10^6}, {2316.86, 9.12125*10^6}, {2317.05,        9.11871*10^6}, {2317.25, 9.11616*10^6}, {2317.44,        9.11361*10^6}, {2317.63, 9.11106*10^6}, {2317.82,        9.1085*10^6}, {2318.01, 9.10594*10^6}, {2318.19,        9.10337*10^6}, {2318.38, 9.1008*10^6}, {2318.56,        9.09823*10^6}, {2318.74, 9.09565*10^6}, {2318.92,        9.09307*10^6}, {2319.1, 9.09048*10^6}, {2319.28,        9.08789*10^6}, {2319.46, 9.0853*10^6}, {2319.63,        9.0827*10^6}, {2319.81, 9.0801*10^6}, {2319.98,        9.07749*10^6}, {2320.15, 9.07488*10^6}, {2320.32,        9.07227*10^6}, {2320.49, 9.06965*10^6}, {2320.59,        9.06703*10^6}, {2320.67, 9.0644*10^6}, {2320.74,        9.06177*10^6}, {2320.81, 9.05914*10^6}, {2320.88,        9.0565*10^6}, {2320.95, 9.05386*10^6}, {2321.01,        9.05121*10^6}, {2321.08, 9.04856*10^6}, {2321.14,        9.04591*10^6}, {2321.21, 9.04325*10^6}, {2321.27,        9.04059*10^6}, {2321.48, 9.03792*10^6}, {2321.71,        9.03525*10^6}, {2321.94, 9.03258*10^6}, {2322.17,        9.0299*10^6}, {2322.4, 9.02722*10^6}, {2322.63,        9.02453*10^6}, {2322.86, 9.02184*10^6}, {2323.08,        9.01915*10^6}, {2323.31, 9.01645*10^6}, {2323.53,        9.01375*10^6}, {2323.75, 9.01104*10^6}, {2323.97,        9.00833*10^6}, {2324.19, 9.00562*10^6}, {2324.41,        9.0029*10^6}, {2324.62, 9.00018*10^6}, {2324.84,        8.99745*10^6}, {2325.05, 8.99472*10^6}, {2325.27,        8.99199*10^6}, {2325.48, 8.98925*10^6}, {2325.69,        8.98651*10^6}, {2325.89, 8.98376*10^6}, {2326.1,        8.98101*10^6}, {2326.31, 8.97826*10^6}, {2326.51,        8.9755*10^6}, {2326.72, 8.97274*10^6}, {2326.92,        8.96997*10^6}, {2327.12, 8.9672*10^6}, {2327.32,        8.96443*10^6}, {2327.52, 8.96165*10^6}, {2327.71,        8.95887*10^6}, {2327.91, 8.95608*10^6}, {2328.08,        8.95329*10^6}, {2328.12, 8.9505*10^6}, {2328.16,        8.9477*10^6}, {2328.2, 8.9449*10^6}, {2328.24,        8.94209*10^6}, {2328.28, 8.93928*10^6}, {2328.32,        8.93647*10^6}, {2328.35, 8.93365*10^6}, {2328.38,        8.93083*10^6}, {2328.42, 8.928*10^6}, {2328.45,        8.92517*10^6}, {2328.48, 8.92234*10^6}, {2328.51,        8.9195*10^6}, {2328.53, 8.91666*10^6}, {2328.56,        8.91381*10^6}, {2328.58, 8.91096*10^6}, {2328.61,        8.90811*10^6}, {2328.63, 8.90525*10^6}, {2328.65,        8.90239*10^6}, {2328.67, 8.89952*10^6}, {2328.69,        8.89665*10^6}, {2328.71, 8.89378*10^6}, {2328.72,        8.8909*10^6}, {2328.74, 8.88802*10^6}, {2328.75,        8.88513*10^6}, {2328.77, 8.88224*10^6}, {2328.78,        8.87935*10^6}, {2328.79, 8.87645*10^6}, {2328.8,        8.87355*10^6}, {2328.8, 8.87064*10^6}, {2328.81,        8.86773*10^6}, {2328.86, 8.86482*10^6}, {2328.94,        8.8619*10^6}, {2329.03, 8.85898*10^6}, {2329.11,        8.85605*10^6}, {2329.19, 8.85312*10^6}, {2329.27,        8.85019*10^6}, {2329.35, 8.84725*10^6}, {2329.43,        8.84431*10^6}, {2329.51, 8.84136*10^6}, {2329.59,        8.83841*10^6}, {2329.66, 8.83546*10^6}, {2329.73,        8.8325*10^6}, {2329.81, 8.82954*10^6}, {2329.88,        8.82657*10^6}, {2329.95, 8.8236*10^6}, {2330.02,        8.82063*10^6}, {2330.09, 8.81765*10^6}, {2330.15,        8.81467*10^6}, {2330.22, 8.81168*10^6}, {2330.28,        8.80869*10^6}, {2330.35, 8.8057*10^6}, {2330.41,        8.8027*10^6}, {2330.47, 8.7997*10^6}, {2330.53,        8.79669*10^6}, {2330.59, 8.79368*10^6}, {2330.64,        8.79067*10^6}, {2330.7, 8.78765*10^6}, {2330.76,        8.78463*10^6}, {2330.81, 8.7816*10^6}, {2330.86,        8.77857*10^6}, {2330.92, 8.77554*10^6}, {2330.97,        8.7725*10^6}, {2331.02, 8.76946*10^6}, {2331.07,        8.76641*10^6}, {2331.11, 8.76336*10^6}, {2331.16,        8.76031*10^6}, {2331.21, 8.75725*10^6}, {2331.25,        8.75419*10^6}, {2331.29, 8.75112*10^6}, {2331.33,        8.74805*10^6}, {2331.38, 8.74498*10^6}, {2331.42,        8.7419*10^6}, {2331.45, 8.73882*10^6}, {2331.49,        8.73573*10^6}, {2331.53, 8.73264*10^6}, {2331.56,        8.72955*10^6}, {2331.6, 8.72645*10^6}, {2331.63,        8.72335*10^6}, {2331.67, 8.72024*10^6}, {2331.7,        8.71713*10^6}, {2331.73, 8.71402*10^6}, {2331.76,        8.7109*10^6}, {2331.78, 8.70778*10^6}, {2331.86,        8.70465*10^6}, {2331.96, 8.70152*10^6}, {2332.05,        8.69839*10^6}, {2332.15, 8.69525*10^6}, {2332.24,        8.69211*10^6}, {2332.34, 8.68896*10^6}, {2332.39,        8.68581*10^6}, {2332.32, 8.68266*10^6}, {2332.25,        8.6795*10^6}, {2332.18, 8.67634*10^6}, {2332.11,        8.67317*10^6}, {2332.11, 8.67*10^6}, {2332.12,        8.66683*10^6}, {2332.12, 8.66365*10^6}, {2332.13,        8.66047*10^6}, {2332.13, 8.65728*10^6}, {2332.14,        8.65409*10^6}, {2332.14, 8.6509*10^6}, {2332.14,        8.6477*10^6}, {2332.14, 8.6445*10^6}, {2332.14,        8.64129*10^6}, {2332.14, 8.63808*10^6}, {2332.14,        8.63487*10^6}, {2332.15, 8.63165*10^6}, {2332.21,        8.62843*10^6}, {2332.26, 8.6252*10^6}, {2332.32,        8.62197*10^6}, {2332.37, 8.61874*10^6}, {2332.42,        8.6155*10^6}, {2332.48, 8.61226*10^6}, {2332.53,        8.60901*10^6}, {2332.58, 8.60576*10^6}, {2332.62,        8.60251*10^6}, {2332.67, 8.59925*10^6}, {2332.72,        8.59599*10^6}, {2332.76, 8.59272*10^6}, {2332.81,        8.58945*10^6}, {2332.85, 8.58618*10^6}, {2332.89,        8.5829*10^6}, {2332.93, 8.57962*10^6}, {2332.97,        8.57633*10^6}, {2333.01, 8.57304*10^6}, {2333.05,        8.56975*10^6}, {2333.09, 8.56645*10^6}, {2333.12,        8.56315*10^6}, {2333.16, 8.55984*10^6}, {2333.19,        8.55653*10^6}, {2333.22, 8.55322*10^6}, {2333.25,        8.5499*10^6}, {2333.28, 8.54658*10^6}, {2333.31,        8.54325*10^6}, {2333.34, 8.53992*10^6}, {2333.37,        8.53659*10^6}, {2333.4, 8.53325*10^6}, {2333.42,        8.52991*10^6}, {2333.45, 8.52656*10^6}, {2333.47,        8.52321*10^6}, {2333.49, 8.51986*10^6}, {2333.51,        8.5165*10^6}, {2333.53, 8.51314*10^6}, {2333.55,        8.50977*10^6}, {2333.57, 8.5064*10^6}, {2333.59,        8.50303*10^6}, {2333.6, 8.49965*10^6}, {2333.62,        8.49627*10^6}, {2333.63, 8.49288*10^6}, {2333.65,        8.48949*10^6}, {2333.66, 8.4861*10^6}, {2333.67,        8.4827*10^6}, {2333.68, 8.4793*10^6}, {2333.69,        8.47589*10^6}, {2333.7, 8.47248*10^6}, {2333.71,        8.46907*10^6}, {2333.71, 8.46565*10^6}, {2333.72,        8.46223*10^6}, {2333.72, 8.4588*10^6}, {2333.73,        8.45537*10^6}, {2333.73, 8.45194*10^6}, {2333.73,        8.4485*10^6}, {2333.73, 8.44506*10^6}, {2333.73,        8.44161*10^6}, {2333.73, 8.43816*10^6}, {2333.73,        8.43471*10^6}, {2333.72, 8.43125*10^6}, {2333.72,        8.42779*10^6}, {2333.71, 8.42432*10^6}, {2333.71,        8.42085*10^6}, {2333.7, 8.41738*10^6}, {2333.69,        8.4139*10^6}, {2333.69, 8.41042*10^6}, {2333.68,        8.40693*10^6}, {2333.66, 8.40344*10^6}, {2333.65,        8.39995*10^6}, {2333.64, 8.39645*10^6}, {2333.63,        8.39295*10^6}, {2333.61, 8.38944*10^6}, {2333.6,        8.38593*10^6}, {2333.58, 8.38242*10^6}, {2333.56,        8.3789*10^6}, {2333.55, 8.37538*10^6}, {2333.53,        8.37185*10^6}, {2333.51, 8.36832*10^6}, {2333.48,        8.36479*10^6}, {2333.46, 8.36125*10^6}, {2333.44,        8.35771*10^6}, {2333.41, 8.35416*10^6}, {2333.39,        8.35061*10^6}, {2333.36, 8.34706*10^6}, {2333.34,        8.3435*10^6}, {2333.31, 8.33994*10^6}, {2333.28,        8.33637*10^6}, {2333.25, 8.3328*10^6}, {2333.22,        8.32923*10^6}, {2333.19, 8.32565*10^6}, {2333.16,        8.32207*10^6}, {2333.12, 8.31848*10^6}, {2333.09,        8.31489*10^6}, {2333.06, 8.3113*10^6}, {2333.02,        8.3077*10^6}, {2332.98, 8.3041*10^6}, {2332.95,        8.30049*10^6}, {2332.91, 8.29688*10^6}, {2332.87,        8.29327*10^6}, {2332.83, 8.28965*10^6}, {2332.79,        8.28603*10^6}, {2332.74, 8.2824*10^6}, {2332.7,        8.27877*10^6}, {2332.66, 8.27514*10^6}, {2332.61,        8.2715*10^6}, {2332.55, 8.26786*10^6}, {2332.48,        8.26421*10^6}, {2332.42, 8.26056*10^6}, {2332.35,        8.25691*10^6}, {2332.29, 8.25325*10^6}, {2332.22,        8.24959*10^6}, {2332.15, 8.24592*10^6}, {2332.08,        8.24225*10^6}, {2332.01, 8.23858*10^6}, {2331.94,        8.2349*10^6}, {2331.87, 8.23122*10^6}, {2331.79,        8.22753*10^6}, {2331.72, 8.22384*10^6}, {2331.64,        8.22015*10^6}, {2331.57, 8.21645*10^6}, {2331.49,        8.21275*10^6}, {2331.42, 8.20904*10^6}, {2331.34,        8.20533*10^6}, {2331.26, 8.20162*10^6}, {2331.18,        8.1979*10^6}, {2331.1, 8.19418*10^6}, {2331.02,        8.19045*10^6}, {2330.94, 8.18672*10^6}, {2330.85,        8.18299*10^6}, {2330.77, 8.17925*10^6}, {2330.68,        8.17551*10^6}, {2330.6, 8.17176*10^6}, {2330.51,        8.16801*10^6}, {2330.43, 8.16426*10^6}, {2330.34,        8.1605*10^6}, {2330.25, 8.15674*10^6}, {2330.16,        8.15297*10^6}, {2330.07, 8.1492*10^6}, {2329.98,        8.14543*10^6}, {2329.89, 8.14165*10^6}, {2329.79,        8.13787*10^6}, {2329.7, 8.13408*10^6}, {2329.6,        8.13029*10^6}, {2329.51, 8.1265*10^6}}


title: Grid - problem with ItemSize being ignored

text: Still present in version 10. * * * I have run into another problem with `Grid` today.   An explicitly specified `ItemSize` is being ignored:               dot = Graphics[{Pink, Disk[]}, ImageSize -> 40];          tab = {{"Type", "Name", \[SpanFromLeft], \[SpanFromLeft],          Item[dot, ItemSize -> 2.7],          Item["Esculap",           Alignment ->            Left], \[SpanFromLeft], \[SpanFromLeft]}, {\[SpanFromAbove],          "Dia.", "Spec", \[SpanFromLeft], \[SpanFromAbove],          Item[8.3 "mm", ItemSize -> {3.5, 2.7}, Alignment -> Right],          Item[11, Alignment -> Right], "6.3"}, {Item[dot, ItemSize -> 2.7],          Item["Flycatcher",           Alignment -> Left], \[SpanFromLeft], \[SpanFromLeft],          Item[dot, ItemSize -> 2.7],          Item["Apus",           Alignment ->            Left], \[SpanFromLeft], \[SpanFromLeft]}, {\[SpanFromAbove],          Item[6.9 "mm", ItemSize -> {3.5, 2.7}, Alignment -> Right],          Item[17, Alignment -> Right], "9.8", \[SpanFromAbove],          Item[7.8 "mm", ItemSize -> {3.5, 2.7}, Alignment -> Right],          Item[8, Alignment -> Right], "6.7"}};          Grid[tab,      Spacings -> {Automatic, {{0, -1.1}}},      Alignment -> {Center, Center},      Dividers -> All     ]      ![Mathematica graphics](http://i.stack.imgur.com/ywAOm.png) Please note `Item[8.3 "mm", ItemSize -> {3.5, 2.7}, Alignment -> Right]` where a vertical ItemSize is explicitly specified, yet it is ignored in the layout. If the "Spec" cell is not spanned this does not happen:               tab[[2, 4]] = "X";          Grid[tab,      Spacings -> {Automatic, {{0, -1.1}}},      Alignment -> {Center, Center},      Dividers -> All     ]      ![Mathematica graphics](http://i.stack.imgur.com/7c2kT.png)   * Is this another bug in `Grid`?   * Is it still present in version 8?   * How can I best work around it?


title: How can we tell Series to treat the expansion parameter as an integer?

text: It is simple for Mathematica to find an asymptotic expansion for $\frac{1}{-1+p}$ as $p \rightarrow \infty$. However, if we want to restrict $p$ to be an integer and also include some terms that simplify for integer p (but not generally) then Series by itself will no longer do the job (without some prodding, I expect). Is there a simple way to use Series to find the asymptotic expansion of $$\frac{1}{(-1)^p+p}$$ as $p \rightarrow \infty$, assuming integer $p$?


title: How do I speed up Plot when the independent variable is in the Numerical expression

text: In the following               HH = H /. {μ -> 1, Δ -> .3, L -> 11, ky -> 0};     Plot[Re[Sort[Eigenvalues[HH]]], {kx, -2 π/11, 2 π/11}, PlotPoints -> 10]      where `H` is a matrix expression that depends on `kx, ky, μ, L, Δ`. Is there a faster way to plot the numerical eigenvalues of this matrix as a function of `kx`, for example? Any help would be really appreciated. **Update** I'd like to state, I want to do this purely numerical. My issue is that I want to solve the eigenvalue problem for MANY values of `kx`. H can be large in this case, sometimes 400 by 400. I only used 10 `PlotPoints` just as an example. I found that `Table` is very quick and I can do a `ListLinePlot`. I just naively thought this same operation would be done in `Plot`. This is where my confusion still lies if someone wants to help :) **Second Update** Here is `H` as requested.               NN = 40;     MM = 2 NN + 1;     kM = Table[           Boole[m == n] (ky + I (kx + m 2 π/L)),            {m, -NN, NN, 1}, {n, -NN, NN, 1}];          kM2 = Table[            Boole[m == n] (ky - I (kx + m 2 π/L)),             {m, -NN, NN, 1}, {n, -NN, NN, 1}];          μM = IdentityMatrix[MM] μ;          ΔM = (Δ I/2 )                  * Table[ (KroneckerDelta[m, n - 1] - KroneckerDelta[m, n + 1]),                           {m, -NN, NN, 1}, {n, -NN, NN, 1}];          H = ArrayFlatten[{          {-μM, kM,0 μM, ΔM},           {kM2, -μM, -ΔM, 0 μM},           {0 μM, -ΔM, μM, kM2},           {ΔM, 0 μM, kM, μM}         }];      **Third update**   This is initially represented as $h= \vec{\sigma} \cdot \vec{k}-\mu$ $h_\tau= \vec{\sigma^{\ast}} \cdot \vec{k}+\mu$ $H=\left(\begin{array}{cc} h & i \Delta \sigma_y\\\ -i \Delta\sigma_y & h_\tau \end{array}\right)$ where $\sigma$ are the Pauli matrices. The individual values change do to some implications from a physical system. I didn't want to get too deep into the physics, as there is another stack for that. The block elements don't commute because the Pauli matrices don't commute, but if you see any symmetries that I don't see please do enlighten me. So far I've always done this numerically.


title: Find variable name from DumpSave on a scoped variable

text: I saved an `InterpolationFunction` in a ".mx" files using `DumpSave` on a variable that was scoped by a `Module`. Here is a stripped-down example:               Module[{interpolation},        interpolation=Interpolation[Range[10]];        DumpSave["interpolation.mx", interpolation];     ]      Is there a way to find out the variable name, presumably of the form `interpolation$nnn`, of the expression when I `Get` the interpolation? It is not apparent what the variable is when using               <<"interpolation.mx"      Next time I will not use a `Module` for scoping the save variable, but meantime I'd like to access the saved data and assign it to a new variable.


title: Mathematica won't simplify multiplication by zero

text: I'm getting a huge output, but it appears that almost every term should actually be zero, unless I'm misunderstanding the expression. For example, part of the output reads > >     a (0.25 + 0. b) + b^2 (0. + 0./c) + b (-1. + 0. c) - 0.5 c + (b (-1. b - > 0.5 c) c)/a^2 >   `Simplify` and `FullSimplify` won't get rid of these zero terms even with assumptions that `a,b` and `c` are real and non-zero. Suggestions ?


title: Using DeleteCases with multiple AstronomicalData properties

text: I am attempting to use `AstronomicalData` and `DeleteCases` together to remove invalid cases of two properties while listing the corresponding name which the data belongs to. I can only selectively choose one of the two properties in which to remove invalid cases from. An example of two selected properties with the first property being filtered;               DeleteCases[Transpose[{      AstronomicalData["Exoplanet", P1], AstronomicalData["Exoplanet", P2], AstronomicalData["Exoplanet"]      }],{_Missing,_,_}],      The issue is having a limitation of defining either `P1` or `P2` as the chosen property to remove invalid cases from. I have tried various ways of correcting this and can't apply it to both properties. I can switch which property it acts upon by swapping the slot _Missing is defined in like this;               {_Missing,_,_}     {_,_Missing,_}      Defining both slots doesn't apply the function to either individual property like this;               {_Missing,_Missing,_}      How can I achieve being able to filter the results where if either property has an invalid value the data is dismissed?


title: Another fractional part related question

text: Having known the fact that the evaluation of the integrals containing fractional parts often contains   errors, I wonder if the integral below possibly evaluates to $0.7$ or this is just a coincidence that               N[Integrate[Tan[x] - Floor[Tan[x]], {x, 0, Pi/2}], 16]      yields $0.6991518856432281$. How could I check if $0.7$ is or isn't the right answer?


title: Solving symbolic matrix equation

text: I have this equation, $$f(x)=Ax-diag(x)(Ax+b)$$, where $x\in \mathbb{R}^n$, $A\in \mathbb{R}^{n\times n}$ and $b\in \mathbb{R}^n$, for which I need to find the zeros. $x=0$ is an obvious solution, but I would like to see if there are other solutions as well. Is there an explicit way to get the solution in terms of, $A$ and $b$ without specifying the matrices completely?


title: Projection of curve 3D (x,y,z) on the x-y plane

text: I have a following systeme : \begin{equation} \left\\{ \begin{array}{rcr} (\beta+\frac{1}{2}\delta^{2})\nu_{1}(u)-\delta\nu_{2}(u)+\nu_{3}(u)& = &0\\\ (\beta+\frac{1}{2}\delta^{2})\upsilon_{1}(u)-\delta\upsilon_{2}(u)+\upsilon_{3}(u)& < &0\\\ \end{array} \right. \end{equation} where \begin{align*} &\nu_{1}(u)= q(u)f[q(u)],\\\ &\nu_{2}(u)= f[q(u)]^2 + F(x)q(u)f[q(u)],\\\ &\nu_{3}(u)= \left(u (f[q(u)])^2 + \frac{1}{2}u^2q(u)f[q(u)]\right),\\\ &q[u] := Quantile[NormalDistribution[0, 1], u], \ (the \ quantale \ at \ u)\\\ &f[q(u)]=PDF[NormalDistribution[0, 1], q(u)] \ (the \ density \ at \ q(u)), \end{align*} and for the inequality, $\upsilon_{i}(u)=\nu_{i}^\prime(u)$ with respect $q(u)$ for $ i\in \\{1,2,3\\}$ with $(\beta,\delta,u)\in [0.1]\times[0.1]\times[0.1]$. I would like to look at the projection of this system of equation onto the plane $(\beta,\delta)$ and $(u,\delta)$ in Mathematica or in r. My code sets up the full 3-d view of the 3D plot, which is not what I want. And I think there are some thing wrong in my picture. I'd like to see two of the views $(\beta,\delta)$ and $(u,\delta)$ on different figure.               q[u_] := Quantile[NormalDistribution[0, 1], u]     f[x_] := PDF[NormalDistribution[0, 1], x]     h1[u_, a_, e_] := ((((a^2)/2 + e)*(-q[u])*(f[q[u]])) -      a*(-q[u]*f[q[u]]*u  +   f[q[u]]^2) +      u*f[q[u]]^2 - (u^2)/2*q[u]*f[q[u]])/(1/6 - a/2 + (a^2)/2 + e)     h2[u_, a_, e_] := (((a^2)/2 + e)*((q[u]^2) - 1)*f[q[u]]) -      a*(u*(q[u]^2 - 1)*f[q[u]] - 3* q[u]*  f[q[u]]^2) + f[q[u]]^3 -      2*u*q[u]*f[q[u]]^2 -      u*q[u]*f[q[u]]^2 + ((u^2)/2)*(q[u]^2 - 1)*f[q[u]]     ContourPlot3D[ h1[u, a, e] == 0,      {a, 0, 1}, {u, 0.1, 0.9}, {e, 0, 1.5},      RegionFunction -> Function[{u, a, e}, h2[u, a, e] > 0]]      The graph 3D : ![enter image description here](http://i.stack.imgur.com/iWWIZ.jpg) I want to try do verify if my plot 3D is true and if it is possible to have the projection on both plan $(\beta,\delta)$ and $(u,\delta)$. Any thoughts on the best way to do this?


title: Can I have Mathematica show intermediate forms before final evaluation?

text: If I have               x = 2      and I want to evaluate               y = x^2      I would like to the output to show               y = (2)^2      before evaluating to 4.


title: Ideas on how to improve the rendering of the letter B in this 3D region plot?

text: I have been playing with the RegionPlot3D idea from this question and have been trying to approximate the Gödel, Escher, Bach logo, but I am a little bit stuck on how to improve the rendering of the letter B. Here is the code so far:               Letter[s_String] :=       ClusteringComponents[       Rasterize[Style[s, 128, Bold], "Image", RasterSize -> {100, 100}]]          Gödel = Letter["G"];     Escher = Letter["E"];     Bach = Letter["B"];          SetOptions[RegionPlot3D, Axes -> False, Boxed -> False,       PlotPoints -> 100, Mesh -> False, Lighting -> "Neutral",       Background -> Black, PlotStyle -> Orange];          RegionPlot3D[      Gödel[[Round[i], Round[j]]] > 1 &&       Escher[[Round[i], Round[k]]] > 1 &&      Bach[[Round[j], Round[k]]] > 1,       {i, 1, 100}, {j, 1, 100}, {k, 1, 100}]      This works nicely for the letter E and G as can be seen here: ![Mathematica graphics](http://i.stack.imgur.com/RKlEp.png) ![Mathematica graphics](http://i.stack.imgur.com/ja9Al.png) But the letter B is not looking as nice, I think because of the shape of the letter G: ![Mathematica graphics](http://i.stack.imgur.com/cpRlM.png) I am wondering if anyone has any good suggestions to correct the rendering of the letter B?


title: Undocumented syntax of FilledCurve

text: > **Possible Duplicate:**   >  Undocumented form for FilledCurve[] A nice trick to get the outline paths of letters is to use the PDF exporter/importer               el=      First[       First[         ImportString[           ExportString[             Style["L", Italic, FontSize -> 24, FontFamily -> "Arial"],              "PDF"           ],            "PDF",            "TextMode" -> "Outlines"          ]        ]     ];          Graphics[{EdgeForm[Black], LightBlue, el}];      ![Mathematica graphics](http://i.stack.imgur.com/xKY39.png) The outline paths are given in a `FilledCurve` construction (new in MMA8):               el          (*     ===>     {Thickness[0.07507507507507508],       Style[        {FilledCurve[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}}},                      {{{12.887695983062486, 5.160000000000004},                        {1.8237311169604027, 5.160000000000004},                        {5.496094644083314, 22.410000000000004},                        {7.823731116960403, 22.410000000000004},                        {4.5834973678187225, 7.222500000000004},                        {13.319824330510414, 7.222500000000004}                     }}         ]        },         Thickness -> 0.07507507507507508       ]}      *)      This syntax variant is not given in the `FilledCurve` help page:` ![Mathematica graphics](http://i.stack.imgur.com/MgqoO.png)   with _segments_ defined as: ![Mathematica graphics](http://i.stack.imgur.com/iTvG1.png) (The doc page doesn't give a formal definition of _components_ , BTW) While the second argument of `FilledCurve` in the undocumented output above is pretty obvious (the coordinates of the outline), the first part is not. My hypothesis is that it has something to do with bezier control points or so. Anyone got an idea about this?


title: Use of JoinedCurve with list only

text: When I `Import` an EPS file, bezier curves are converted into something like this:               Graphics[JoinedCurve[       {{{1, 4, 3}}}, {{{0., 0.}, {1., -1.}, {2., 1.}, {3.,  0.}}}, CurveClosed -> {0}]]      Here `JoinedCurve` contains no curve segments but two lists, but such a representation is not documented in the reference: http://reference.wolfram.com/mathematica/ref/JoinedCurve.html I can see that the latter list represents the list of control points, and `{{1, 4, 3}}` seems to do with something like dimensions of the points, but what is the exact use of it?


title: How to save numbers that are in Mathematica messages

text: I have a program that calls FindDistributionParameters and I get the Mathematica message FindMaximum::eit each time I call the function. The message is FindMaximum::eit: The algorithm does not converge to the tolerance of _4.641588833612792`*^-9_ in _517_ iterations. The best estimated solution, with feasibility residual, KKT residual, or complementary residual of _{8.785431001660695650243387×10-19,7.654089593359381289428268×10-7,3.755486893336661804848494×10-19}_ , is returned.  I want to save the numbers in the messages, so I setup a list to hold the messages as follows: AppendTo[messagelist, {General::eit}]; This saves the following, with none of the numbers in the original message: The algorithm does not converge to the tolerance of `1` in `2` iterations. The best estimated solution, with feasibility residual, KKT residual, or complementary residual of `3`, is returned. How can I access the numbers in the message and save them to a list or something else? Secondarily, is there a way to increase the number of iterations in FindDistributionParameters?


title: interpolating function over dates

text: I've got a bunch of readings at various dates and times. I'd like to be able to interpolate and then integrate over, say days. I can do this by converting my date/time to `AbosluteTime` and get the interpolating function that way. Then by integrating and plugging in seconds as my limits of integration I get what I want. Also, since seconds in really finer than I need, I convert all of the `AbsoluteTimes` to the number of hours since the first reading. I was wondering if there might be a way to do this directly using dates. For what it's worth, my readings last for about 2 months and the values are between about 90 and 300. **SAMPLE DATA**                x[[1 ;; 5]]      > {{{2014, 8, 4, 10, 36, 0.}, 257.},{{2014, 8, 4, 16, 28, 0.}, 385.}, > > {{2014, 8, 4, 22, 53, 0.}, 176.}, {{2014, 8, 5, 6, 52, 0.}, 148.}, {{2014, > 8, 5, 11, 19, 0.}, 192.}}


title: How to fill only a plotting area with Background

text: With               ListLinePlot [      {13, 6, 2, 2, 3},      AxesOrigin -> {1, 0},Background -> GrayLevel@0.95,      GridLines -> None, ImageSize -> 300,      ImageMargins -> 0, PlotLabel -> "XYZ",      Filling -> Bottom, PlotMarkers -> Automatic, Frame -> True]      I obtained: ![enter image description here](http://i.stack.imgur.com/8zcxS.jpg)   1. I would like to move the `PlotLabel` `"XYZ"` into the upperright corner of the plotting area.   2. The `Background`-option also colors the background of the axes-values and the label, but I only want to color (like in Excel) the actual plotting-area. I could think of some complicated ways to achieve this, but would like to see a short and handy solution. Thanks in advance for your help.


title: Function to select a row whose kth element is closest to a given number

text: I'm trying to write a function that picks out the row of a Matrix whose `kth` element is closest to some given number that will be given to me. So for example,               list = Table[{i, FromCharacterCode[70 + i]}, {i, 1, 10}]     {{1, "G"}, {2, "H"}, {3, "I"}, {4, "J"}, {5, "K"}, {6, "L"}, {7,"M"}, {8, "N"}, {9, "O"}, {10, "P"}}      ![enter image description here](http://i.stack.imgur.com/SZhuE.jpg)               b = RandomReal[{0, 6}]     4.42427      So I want to pick the row whose 1st element is closest to 4.42427. The function should spit out               {4,"J"}      **Edit** Btw, thanks to Mr. Wizard's help, my crappy code works!!               disT[l_List, bb_?NumericQ, cc_Integer] := Table[Abs[bb - l[[j, cc]]], {j, 1,Dimensions[l][[1]]}]          srcH[ll_List, bb_?NumericQ, cc_Integer] := Drop[First[Sort[Transpose[    Prepend[Transpose[ll], disT[ll, bb, cc]]], #1[[1]] < #2[[1]] &]],1]               disT[list,b,1]     {3.42427, 2.42427, 1.42427, 0.42427, 0.57573, 1.57573, 2.57573,3.57573, 4.57573,5.57573}          srcH[list, b, 1]     {4, "J"}      Now I will Implement Mr. Wizard's code or Daniel's code for my actual problem. Thanks!! **Edit2** To expand on what I wrote under Mr. Wizard's answer. The actual task that I am trying to accomplish involves many lists $list_k \; k \; \in \\{1,100\\}$ and many comparison lists $b_k = (b_{k1},...,b_{kj}), \; \; k \; \in \\{1,100\\}$ . So For example:                list[57]=  {{1, "G"}, {2, "H"}, {3, "I"}, {4, "J"}, {5, "K"}, {6, "L"}, {7,"M"}, {8, "N"}, {9, "O"}, {10, "P"}}           b[57]={0.1,7.3,9.8}           list[79]=  {{2.8, "G"}, {3.4, "H"}, {4.5, "I"}, {5.1, "J"}, {6.05, "K"}, {7.1, "L"}, {8.3,"M"}, {8.5, "N"}, {9, "O"}, {10, "P"}}           b[79]={5,7.2,8.1}      and my final output, as index goes from 1 to 100, will find rows where the first element is close to the elements of b[k] respectively:                output[57]={{1,G},{7,M},{10,P}}      output[79]={{5.1,J},{7.1,L},{8.3,M}}      I was planning on using the function I got from the help here at mma.se inside a table or something but since Mr. Wizard has mentioned speeding up computation, I figured it would be best if I described the exact problem I am working on.


title: Animating mathematica.se logo

text: As we all know our site's logo was completely generated by Mathematica. I suppose it is quite natural to make the next step -- to generate the animated version of this logo. There's a lot of space for creativity here, and I suggest to consider the following options.   1. Animated process of construction from scratch, as it is described in Verbeia's blog post.   2. Animated morphing of original pentagonal star to the current heptagonal one (J.M.'s idea in the comment)   3. Some less fussy, a neutral animation of the logo itself, more suitable for placing on webpages.


title: PowersRepresentations Algorithm

text: I'm trying to understand the mathematics behind counting the number of representations of a positive integer by $n$ distinct $k$th powers, i.e. I would really like to know how to do the Mathematica function PowersRepresentations by hand. Any explanations, references, even special cases (I'm particularly interested in $k=2$) would be appreciated. Thanks.


title: The same range on each plot in a grid

text: Suppose I have a bunch of graphics that I want to display in a grid:               GraphicsGrid[{       {Graphics[Circle[], Frame -> True],        Graphics[{Circle[], Circle[{2, 2}]}, Frame -> True]},       {Graphics[{Circle[{5, 5}, 2], Circle[{9, 9}, 2]}, Frame -> True],        Graphics[Circle[{100, 100}, 2], Frame -> True]}}]      ![1](http://i.stack.imgur.com/mN7ED.png) Each graphic is roughly the same size, but the range they cover differs. You can only see this by looking at the numbers on the axes. What I'd like to do is automatically replot the graphics over the same range so that objects are correctly sized relative to each other. Something like: ![2](http://i.stack.imgur.com/ReL5o.png) So given an array of graphics, how would I extract all the plot ranges and determine a new plot range for each one?