A137 === Subject: Re: Strange Solve result after previous bad input retrospect, it was so trivial that I am even sorry to have asked... AC === Subject: extract coefficients Hello all, I have an expression that is nonlinear with respect to variables q [i]. I need to transform it into equation with respect to unknown q[]. Multipliers near each of such combination of q[] are functions that must be extracted for integration. I'm having problem with Coefficient [] because it does not allow extract multipliers near q[i] of just 1- order, combination of the type q[i]q[j] or near q[i]q[j]q[k] Please, help Below there is an example of the expression. I need to transform it into equation with respect to unknown q[1], q[4] and q[7]. w1,v1,u1 are functions of polynomial type that must be integrated numerically to perform a coefficients at q[]. Everything else is numbers in reality. -((EE*h*q[7]*w1[x, y]*Derivative[0, 1][v1][x, y])/(b*R*(-1 + [Nu] ^2))) - (EE*h*[Nu]*q[4]*w1[x, y]*Derivative[1, 0][u1][x, y])/(b*R*(-1 + [Nu]^2)) - (3*q[1]^2*(EE*h*w1[x, y]*Derivative[0, 1][w1][x, y]^2 + EE*h*[Nu]*w1 [x, y]*Derivative[1, 0][w1][x, y]^2))/(2*b^2*R*(-1 + [Nu]^2)) + (q[1]^3*((-EE)*h*Derivative[0, 1][w1][x, y]^4 - 2*EE*h*Derivative[0, 1][w1][x, y]^2*Derivative[1, 0][w1][x, y]^2 - EE*h*Derivative[1, 0][w1] [x, y]^4))/ (2*b^4*(-1 + [Nu]^2)) + q[1]*((q[7]*((-EE)*h*Derivative[0, 1][v1] [x, y]*Derivative[0, 1][w1][x, y]^2 - EE*h*Derivative[0, 1][w1][x, y] *Derivative[1, 0][v1][x, y]* Derivative[1, 0][w1][x, y] + EE*h*[Nu]*Derivative[0, 1][w1] [x, y]*Derivative[1, 0][v1][x, y]*Derivative[1, 0][w1][x, y] - EE*h*[Nu]*Derivative[0, 1][v1][x, y]*Derivative[1, 0][w1][x, y] ^2))/(b^3*(-1 + [Nu]^2)) + (q[4]*((-EE)*h*[Nu]*Derivative[0, 1][w1][x, y]^2*Derivative[1, 0] [u1][x, y] - EE*h*Derivative[0, 1][u1][x, y]*Derivative[0, 1][w1][x, y] *Derivative[1, 0][w1][x, y] + EE*h*[Nu]*Derivative[0, 1][u1][x, y]*Derivative[0, 1][w1][x, y] *Derivative[1, 0][w1][x, y] - EE*h*Derivative[1, 0][u1][x, y] *Derivative[1, 0][w1][x, y]^2))/ (b^3*(-1 + [Nu]^2)) + (-12*b^4*EE*h*w1[x, y]^2 - EE*h^3*R^2*Derivative[0, 2][w1][x, y]^2 - 2*EE*h^3*R^2*Derivative[1, 1] [w1][x, y]^2 + 2*EE*h^3*R^2*[Nu]*Derivative[1, 1][w1][x, y]^2 - 2*EE*h^3*R^2* [Nu]*Derivative[0, 2][w1][x, y]*Derivative[2, 0][w1][x, y] - EE*h^3*R^2*Derivative[2, 0][w1][x, y]^2)/ (12*b^4*R^2*(-1 + [Nu]^2))) === Subject: Re: SphericalHarmonics strange behavior It's a precision issue diffY[l_, m_, t_, p_] := Module[{val1, val2}, val1 = SphericalHarmonicY[l, m, t, p]; val2 = Sqrt[(2*l + 1) (l - m)!/(4*Pi (l + m)!)]* LegendreP[l, m, Cos[t]]*E^(I*m*p); Abs[val1 - val2]]; th1 = 1.324; ph1 = 5.231; {diffY[1, 1, th1, ph1], diffY[1, -1, th1, ph1]} // Chop {0,0.670051} th1 = 1.324`20; ph1 = 5.231`20; {diffY[1, 1, th1, ph1], diffY[1, -1, th1, ph1]} // Chop {0,0} Your definition would need to include an option for setting the working precision. Bob Hanlon Hi all, working with some spherical harmonics and have some questions about the code as implemented in mathematica. based on http://mathworld.wolfram.com/SphericalHarmonic.html I put together the following code to see what is implemented th1 = 1.324; ph1 = 5.231; diffY[l_, m_, t_, p_] := Module[{val1, val2}, val1 = SphericalHarmonicY[l, m, t, p]; val2 = Sqrt[((2*l + 1)*(l - m)!)/((4*Pi)*(l + m)!)]* LegendreP[l, m, Cos[t]]*E^(I*m*p); Print[{val1, val2, Abs[val1 - val2]}]; Return[Abs[val1 - val2]]; ]; diffY[1, 1, th1, ph1] diffY[1, -1, th1, ph1] Clearly there is some sign error somewhere I was wondering if anyone had any suggestions. === Subject: Re: Text and multiple calculations in an IF condition Hi everybody, I have a small problem, and haven't found any solution yet. So I hope you can help me. I'd like to have describing text, comments and multiple calculations when one condition is true, and others when it's false. For example: If[a>b, do something here; and something else here; insert a text here; else do something; and more; ] As far as I tried this is not possible with the if condition provided?! But I also think this quite easy to do, if you know how to. Pascal try this: a = 3; b = 2; If[a > b, Print[do something here; and something else here; insert a text here], Print[do something; and more]]; a = 3; b = 4; If[a > b, Print[do something here; and something else here; insert a text here], Print[do something; and more]]; do something here; and something else here; insert a text here do something; and more Have success, Alexei -- Alexei Boulbitch, Dr., habil. Senior Scientist IEE S.A. ZAE Weiergewan 11, rue Edmond Reuter L-5326 Contern Luxembourg Phone: +352 2454 2566 Fax: +352 2454 3566 Website: www.iee.lu === Subject: TeX output via TeXForm: variable name translation I am trying to find a good way to interoperate between Mathematica and LaTeX (or LyX). Typically, I am workign with multi-character variable names, which TeXForm interprets as text: In[65]:= TeXForm[e1] Out[65]//TeXForm= text{e1} To get around this, I am trying to create a translation table of sorts: e.g. TranslationTable1 = {{e1, epsilon_1}, {e0, epsilon_0}, {kz0t, tilde{k^{(0)}_z}}, {kz1t, tilde{k^{(1)}_z}}}; I would like, if possible, to perform those replacements in Mathematica, without writing and invoking external scripts. The first thing I tried was this: TeXReplacements := (Rule[#[[1]], ToExpression[#[[2]], TeXForm, HoldForm]] & /@ TranslationTable1) In[67]:= (e1*kz0t) /. TeXReplacements // TeXForm Out[67]//TeXForm= epsilon _1 tilde{k_z^0} (This simply does the following: In[69]:= (e1*kz0t) /. {e1 -> ToExpression[epsilon_1, TeXForm, HoldForm], kz0t -> ToExpression[tilde{k^{(0)}_z}, TeXForm, HoldForm]} // TeXForm Out[69]//TeXForm= epsilon _1 tilde{k_z^0} ) Notice how this doesn't work: Take a look at the translation table above and notice parentheses around in k_z^{(0)}. Mathematica discards these parentheses. So the question to the group is: (1) is it possible to preserve the formatting exactly how I specified it in the translation table before converting to TeXForm or (2) is it possible to do a replacement using my translation table after I had converted to TeXForm or (3) is there a better solution altogether? === Subject: Re: TeX output via TeXForm: variable name translation set up the boxes for you symbol in a proper way and Mathematica does the rest, i.e. e1 /: MakeBoxes[e1, fmt_: StandardForm] := SubscriptBox[[Epsilon], 1] and TeXForm[e1] gives epsilon _1 Jens > I am trying to find a good way to interoperate between Mathematica and > LaTeX (or LyX). > Typically, I am workign with multi-character variable names, which > TeXForm interprets as text: In[65]:= TeXForm[e1] > Out[65]//TeXForm= > text{e1} To get around this, I am trying to create a translation table of > sorts: e.g. TranslationTable1 = {{e1, epsilon_1}, {e0, epsilon_0}, {kz0t, > tilde{k^{(0)}_z}}, {kz1t, tilde{k^{(1)}_z}}}; I would like, if possible, to perform those replacements in > Mathematica, without writing and invoking external scripts. The first > thing I tried was this: TeXReplacements := (Rule[#[[1]], ToExpression[#[[2]], TeXForm, > HoldForm]] & /@ TranslationTable1) In[67]:= (e1*kz0t) /. TeXReplacements // TeXForm Out[67]//TeXForm= > epsilon _1 tilde{k_z^0} (This simply does the following: > In[69]:= (e1*kz0t) /. {e1 -> ToExpression[epsilon_1, TeXForm, > HoldForm], > kz0t -> ToExpression[tilde{k^{(0)}_z}, TeXForm, HoldForm]} // > TeXForm Out[69]//TeXForm= > epsilon _1 tilde{k_z^0} > ) Notice how this doesn't work: Take a look at the translation table > above and notice parentheses around in k_z^{(0)}. Mathematica > discards these parentheses. So the question to the group is: (1) is it possible to preserve the > formatting exactly how I specified it in the translation table before > converting to TeXForm or (2) is it possible to do a replacement using > my translation table after I had converted to TeXForm or (3) is there > a better solution altogether? === Subject: Re: TeX output via TeXForm: variable name translation > I am trying to find a good way to interoperate between Mathematica and > LaTeX (or LyX). > Typically, I am workign with multi-character variable names, which > TeXForm interprets as text: In[65]:= TeXForm[e1] > Out[65]//TeXForm= > text{e1} Perhaps, you could work with typeset expressions directly in Mathematica. They should then convert naturally to LaTeX. For example: In[1]:= TeXForm[Subscript[[Epsilon], 1]] Out[1]//TeXForm= epsilon _1 Of course, you needn't type the whole Subscript[[Epsilon], 1] thing in verbatim; there are shortcuts that you get used to. The new V7 palettes are very helpful in this regard. Mark McClure === Subject: compress lists with mean for equal elements I have a nested list of this form: {{{1, 13}, 97.6493}, {{1, 13}, 97.9511}, {{1, 14}, 99.3002}, {{1, 14}, 99.4602}, {{1, 14}, 99.6193}, {{1, 15}, 100.513}, {{1, 15}, 101.149}, {{1, 15}, 101.483}, {{1, 15}, 101.494}, {{1, 16}, 101.51}, {{1, 16}, 101.895}} I want to shrink the list in the way that I calculate the mean over the second part for all elements where the first part is equal. so e.g. the first element of the new list will be {{1,13}, 97.8002}, because they both have {1,13} and the mean of 97.6493 and 97.9511 is 97.8002. The problem is that there is no fixed number for the equal elements (so e.g. two elements with {1,13}, three elements with {1,14} and so on). The number is random. Can anybody please provide me with a statement or hint how to accomplish that task. Holger === Subject: Re: compress lists with mean for equal elements > I have a nested list of this form: {{{1, 13}, 97.6493}, {{1, 13}, 97.9511}, {{1, 14}, 99.3002}, {{1, 14}, > 99.4602}, {{1, 14}, 99.6193}, {{1, 15}, 100.513}, {{1, 15}, 101.149}, > {{1, 15}, 101.483}, {{1, 15}, 101.494}, {{1, 16}, 101.51}, {{1, 16}, > 101.895}} I want to shrink the list in the way that I calculate the mean over > the second part for all elements where the first part is equal. so > e.g. the first element of the new list will be {{1,13}, 97.8002}, > because they both have {1,13} and the mean of 97.6493 and 97.9511 is > 97.8002. The problem is that there is no fixed number for the equal elements > (so e.g. two elements with {1,13}, three elements with {1,14} and so > on). The number is random. Can anybody please provide me with a statement or hint how to > accomplish that task. > Holger > In Mathematica 7 you can do this with: ls={{{1, 13}, 97.6493}, {{1, 13}, 97.9511}, {{1, 14}, 99.3002}, {{1, 14}, 99.4602}, {{1, 14}, 99.6193}, {{1, 15}, 100.513}, {{1, 15}, 101.149}, {{1, 15}, 101.483}, {{1, 15}, 101.494}, {{1, 16}, 101.51}, {{1, 16}, 101.895}} ({#1[[1, 1]], Mean[#1[[All, 2]]]} & ) /@ GatherBy[ls, First] {{{1, 13}, 97.80019999999999}, {{1, 14}, 99.4599}, {{1, 15}, 101.15975}, {{1, 16}, 101.7025}} Andrzej Kozlowski === Subject: Re: compress lists with mean for equal elements data = {{{1, 13}, 97.6493}, {{1, 13}, 97.9511}, {{1, 14}, 99.3002}, {{1, 14}, 99.4602}, {{1, 14}, 99.6193}, {{1, 15}, 100.513}, {{1, 15}, 101.149}, {{1, 15}, 101.483}, {{1, 15}, 101.494}, {{1, 16}, 101.51}, {{1, 16}, 101.895}}; and {#, Mean[Last /@ Cases[data, {#, _}, Infinity]]} & /@ Union[First /@ data] ? Jens > I have a nested list of this form: {{{1, 13}, 97.6493}, {{1, 13}, 97.9511}, {{1, 14}, 99.3002}, {{1, 14}, > 99.4602}, {{1, 14}, 99.6193}, {{1, 15}, 100.513}, {{1, 15}, 101.149}, > {{1, 15}, 101.483}, {{1, 15}, 101.494}, {{1, 16}, 101.51}, {{1, 16}, > 101.895}} I want to shrink the list in the way that I calculate the mean over > the second part for all elements where the first part is equal. so > e.g. the first element of the new list will be {{1,13}, 97.8002}, > because they both have {1,13} and the mean of 97.6493 and 97.9511 is > 97.8002. The problem is that there is no fixed number for the equal elements > (so e.g. two elements with {1,13}, three elements with {1,14} and so > on). The number is random. Can anybody please provide me with a statement or hint how to > accomplish that task. > Holger > === Subject: Re: compress lists with mean for equal elements > I have a nested list of this form: {{{1, 13}, 97.6493}, {{1, 13}, 97.9511}, {{1, 14}, 99.3002}, {{1, 14}, > 99.4602}, {{1, 14}, 99.6193}, {{1, 15}, 100.513}, {{1, 15}, 101.149}, > {{1, 15}, 101.483}, {{1, 15}, 101.494}, {{1, 16}, 101.51}, {{1, 16}, > 101.895}} I want to shrink the list in the way that I calculate the mean over > the second part for all elements where the first part is equal. so > e.g. the first element of the new list will be {{1,13}, 97.8002}, > because they both have {1,13} and the mean of 97.6493 and 97.9511 is > 97.8002. The problem is that there is no fixed number for the equal elements > (so e.g. two elements with {1,13}, three elements with {1,14} and so > on). The number is random. Can anybody please provide me with a statement or hint how to > accomplish that task. > Holger Further to my previous suggestion, Reap[ Sow[#[[2]],{#[[1]]}]&/@data, _, {#1,Mean@#2}&][[2]] will also give what you want, without needing 'data' to be sorted. === Subject: Re: compress lists with mean for equal elements > I have a nested list of this form: {{{1, 13}, 97.6493}, {{1, 13}, 97.9511}, {{1, 14}, 99.3002}, {{1, 14}, > 99.4602}, {{1, 14}, 99.6193}, {{1, 15}, 100.513}, {{1, 15}, 101.149}, > {{1, 15}, 101.483}, {{1, 15}, 101.494}, {{1, 16}, 101.51}, {{1, 16}, > 101.895}} I want to shrink the list in the way that I calculate the mean over > the second part for all elements where the first part is equal. so > e.g. the first element of the new list will be {{1,13}, 97.8002}, > because they both have {1,13} and the mean of 97.6493 and 97.9511 is > 97.8002. The problem is that there is no fixed number for the equal elements > (so e.g. two elements with {1,13}, three elements with {1,14} and so > on). The number is random. Can anybody please provide me with a statement or hint how to > accomplish that task. > Holger data = {{{1,13},97.6493}, {{1,13},97.9511}, {{1,14},99.3002}, {{1,14},99.4602}, {{1,14},99.6193}, {{1,15},100.513}, {{1,15},101.149}, {{1,15},101.483}, {{1,15},101.494}, {{1,16},101.51}, {{1,16},101.895}}; {#[[1,1]],Mean[#[[All,2]]]}& /@ Split[data,#1[[1]]==#2[[1]]&] {{{1,13},97.8002},{{1,14},99.4599},{{1,15},101.16},{{1,16},101.703}} Note: if 'data' is not already sorted then use Split[Sort@data,...]. === Subject: Re: Strange Behaviour: CellAutoOverwrite If it only happens in this notebook, then it almost certainly is an option which is set at the notebook level. You should, in the notebook, evaluate: Options[EvaluationNotebook[]] Perhaps something will be obvious. If not, feel free to send either the output of this command or, somewhat preferably, the entire notebook my way and I'll check into it. John Fultz jfultz@wolfram.com User Interface Group Wolfram Research, Inc. I encountered the following strange and nasty behaviour, currently with > Mathematica 7.0.1: > In a Notebook suddenly the output cells had the attribute > CellAutoOverwrite->False, which had 2 nasty side-effects: > The output of subsequent commands in one cell was displayed in the wrong > order: > a=1 > b=2 > gives > Out[2]=2 > Out[1]=1 > which can be quite confusing, if one expects the answers in the usual > order. And further the previous output wasn't overwritten, but the new > output was prepended to it, making the Notebook larger and larger. For this notebook I could cure the problem by cutting and pasting the > problematic cells to new cells, which then behaved normally. What could I have done to evoke this behaviour? > How would one reset it, without to have to copy and paste all involved > cells? Alois === Subject: Re: ContourPlot3D and NIntegrate If you use the following defintion VV[x_?NumericQ, y_?NumericQ, z_?NumericQ] := Module[{u, phi}, NIntegrate[(x^2 + y^2 + z^2)^(-3)*u*phi, {u, 0, 1}, {phi, 0, 2 Pi}, Method -> {Automatic, SymbolicProcessing -> 0}, PrecisionGoal -> 6]] then the plot computation ContourPlot3D[ VV[x, y, z], {x, 1, 2}, {y, 1, 2}, {z, 1, 2}] // AbsoluteTiming takes 44 seconds on my 2 year old MacBook Pro Note that I have put the symbolic processing time to zero. You can further see if using smaller precision gives satisfactory and faster results for you. Anton Antonov On Jun 5, 4:09 pm, Henning Heiberg-Andersen I don't understand what goes wrong in this sequence: * In[1]:=VV[x_,y_,z_]:= Module[{u,phi},NIntegrate[(x^2+y^2+z^2)^(-3)*u*phi,{u,0,1},{phi,0,2Pi}] ] In[2]:= ContourPlot3D[VV[x,y,z],{x,1,2},{y,1,2},{z,1,2}], AND THEN: NIntegrate::inumr: The integrand [NoBreak](phi$12637167 > u$12637167)/(x^2+y^2+z^2)3[NoBreak] has evaluated to non-numerical value= s > for all sampling points in the region with boundaries > [NoBreak]{{0,1},{0,6.28319}}[NoBreak]. > =87 Can anybody help? > Henning Heiberg-Andersen === Subject: Re: Time for an integration Try using the NIntegrate option Method->{Automatic, SymbolicProcessing- >0} and smaller precision goal. Also, you might consider using the MonteCarlo method, or different rule of integration. E.g. NIntegrate[<, <, Method -> {GlobalAdaptive, Method -> {MultiDimensionalRule, Generators -> 9}, SymbolicProcessing -> 0}, PrecisionGoal -> 2] Anton Antonov > Hello ! I have an integral to perform 4096 times: it is a 3dimensionnal integral over a matrix of 4096.4096 points. It takes many hours and I still does not have the result. I made a loop w ithNIntegrate. Is it possible that an integration loop in mathematica takes so long ? Is there any ways to improve it ? > Lena === Subject: Re: Plotting surface with thickness Bill, this is a way in which your type of result can be achieve with Mathematica 7.0. I think it should work also in version 6. ClearAll[fronty]; fronty[yv_] := Module[{l1, l2}, {l1, l2} = Cases[gy[yv], Line[x_] -> x, Infinity]; Graphics3D[Polygon[Insert[#, yv, 2] & /@ (Join[l1, Reverse[l2]])]] ]; ClearAll[frontx]; frontx[xv_] := Module[{l1, l2}, {l1, l2} = Cases[gx[xv], Line[x_] -> x, Infinity]; Graphics3D[Polygon[Insert[#, xv, 1] & /@ (Join[l1, Reverse[l2]])]] ]; top = Plot3D[Sin[x y], {x, -1, 1}, {y, -1, 1}]; bottom = Plot3D[Sin[x y] - 0.5, {x, -1, 1}, {y, -1, 1}]; g3D = Plot3D[{Sin[x y], Sin[x y] - 0.5}, {x, -1, 1}, {y, -1, 1}]; gy[-1] = Plot[{Sin[x y], Sin[x y] - 0.5} /. y -> -1 // Evaluate, {x, -1, 1}]; gy[1] = Plot[{Sin[x y], Sin[x y] - 0.5} /. y -> 1 // Evaluate, {x, -1, 1}]; gx[-1] = Plot[{Sin[x y], Sin[x y] - 0.5} /. x -> -1 // Evaluate, {y, -1, 1}]; gx[1] = Plot[{Sin[x y], Sin[x y] - 0.5} /. x -> 1 // Evaluate, {y, -1, 1}]; Show[g3D, fronty[-1], fronty[1], frontx[-1], frontx[1]] The last command produces walls on all the sides of the floor and ceiling surfaces. ADL > Plotting surface with thickness Hi: Using the following code with Mathematica 5.2 works without any problem. > Using it with Mathematica 6.0.1 doesn't work. top = Plot3D[Sin[x y], {x, -1, 1}, {y, -1, 1}] > bottom = Plot3D[Sin[x y] - 0.5, {x, -1, 1}, {y, -1, 1}] > g = Plot[{Sin[x y], Sin[x y] - 0.5} /. y -> -1 // Evaluate, {x, -1, 1}] (* Mathematica 5.2 works with the following line, Mathematica 6.0.1 does = not. *) front = Graphics3D[ > Polygon[Insert[#, -1, 2] & /@ > Join[g[[1, 1, 1, 1, 1]], Reverse[g[[1, 2, 1, 1, 1]]]]]] Question: How can the code (front) be modified to run in Mathematica 6.0.= 1? > Bill Ref: http://forums.wolfram.com/student-support/topics/7384 === Subject: My first calculator =) Hello. I just started to learn mathematica a few days ago. Im trying to make a calculator that can graphically represent the relationship between: savings interest time the mathematical formula im using you can see below. this is what I've written sofar... Manipulate[ **%% Here i would like to make a ListLinePlot using this function: (#1*(1 + #2/#3)^(#3*#4) - 1)/(#2/#3) &[d, g, f, n] then I would like to use the below controlls to manipulate the values of d,g,f and n. How is this done? I understand that there has to be some kind of list or table that contains the accumulated sum at certain times. But I have no clue how to make this list. The problem with my function is that it only calculates the correct final answer. for example if i invest 1000=80 per month with 5% interest for 8 years, what is the accumulated sum? GridLines -> Automatic, {{f, 1, Frequency}, {1 -> Annually, 1/4 -> Quarterly, 1/12 -> Monthly}}, Delimiter, {{a, 5000, Initial Investment}, 0, 10000000, 1000, Appearance -> {Open, Labeled}}, {{d, 0, Added Contributions/yr}, -500000, 500000, 1000, Appearance -> {Open, Labeled}}, {{g, 0.05, Growth(%/100)}, 0, 1, 0.05, Appearance -> {Open, Labeled}}, {{n, 5, Years}, 1, 100, 1, Appearance -> {Open, Labeled}}, ControlPlacement -> Left] === Subject: FileNameSetter[], Dynamic[] My objective is to make an interface that allows a user to select a file and then that file will be opened by Mathematica and actions (i.e., data processing) will be taken. If the user changes the file selection, all actions will be repeated on new file. Here's what I have tried: FileNameSetter[Dynamic[filename], Open] data = Dynamic[Import[filename, Byte]] The Notebook indeed displays the updated data as a cell, yet other actions don't work, e.g., Length[data] always returns 1 and FullForm[data] shows Dynamic[Import[filename,Byte]]. Am I approaching this problem incorrectly? === Subject: Re: weird escaping problem with StringPattern inside I have never coded RuleDelayed[] because I do not understand it well enough. The examples in the doc are still opaque for me. But one of the examples for this in the documentation does mention a specific behavior relating to Module[]. Like with lots of my stuff, the code works now and months from now, I will probably understand why completely! Roger Williams Franklin Laboratory > When in doubt, use RuleDelayed: a ~~ x_ ~~ c :> x Bobby === Subject: Re: SphericalHarmonics strange behavior Hi Bob, With some additional investigation yesterday I tracked the problem to the LegendreP and while i agree there is also a precision issue(which is discussed in some other bugs online), there seems to be an actual bug in the legendreP code dealing with negative m values. This bug is exposed when working with machine precision numbers. For example. LegendreP[1, 1, Cos[Pi/7]] // N Returns -0.433884 LegendreP[1, -1, Cos[Pi/7]] // N should be -1/2 LegendreP[1, 1, Cos[Pi/7]] = 0.216942 This is what is returned by LegendreP[1, -1, Cos[Pi/7]] // N However, LegendreP[1, -1, Cos[Pi/7.]] // N returns -0.216942 So it seems like the (-1)^m sign convention is not present in the machine precision routine that is run. -Luke > It's a precision issue diffY[l_, m_, t_, p_] := > Module[{val1, val2}, > val1 = SphericalHarmonicY[l, m, t, p]; > val2 = Sqrt[(2*l + 1) (l - m)!/(4*Pi (l + m)!)]* > LegendreP[l, m, Cos[t]]*E^(I*m*p); > Abs[val1 - val2]]; th1 = 1.324; > ph1 = 5.231; {diffY[1, 1, th1, ph1], diffY[1, -1, th1, ph1]} // > Chop {0,0.670051} th1 = 1.324`20; > ph1 = 5.231`20; {diffY[1, 1, th1, ph1], diffY[1, -1, th1, ph1]} // > Chop {0,0} Your definition would need to include an option for setting the working precision. > Bob Hanlon > Hi all, working with some spherical harmonics and have some questions about the code as implemented in mathematica. based on http://mathworld.wolfram.com/SphericalHarmonic.html I put together the following code to see what is implemented th1 = 1.324; > ph1 = 5.231; diffY[l_, m_, t_, p_] := > Module[{val1, val2}, val1 = SphericalHarmonicY[l, m, t, p]; > val2 = > Sqrt[((2*l + 1)*(l - m)!)/((4*Pi)*(l + m)!)]* > LegendreP[l, m, Cos[t]]*E^(I*m*p); > Print[{val1, val2, Abs[val1 - val2]}]; > Return[Abs[val1 - val2]]; ]; diffY[1, 1, th1, ph1] diffY[1, -1, th1, ph1] Clearly there is some sign error somewhere I was wondering if anyone had any suggestions. Luke > === Subject: Re: SphericalHarmonics strange behavior On Jun 19, 10:46 am, lb...@seas.upenn.edu ph1 = 5.231; diffY[l_, m_, t_, p_] := > Module[{val1, val2}, val1 = SphericalHarmonicY[l, m, t, p]; > val2 = > Sqrt[((2*l + 1)*(l - m)!)/((4*Pi)*(l + m)!)]* > LegendreP[l, m, Cos[t]]*E^(I*m*p); > Print[{val1, val2, Abs[val1 - val2]}]; > Return[Abs[val1 - val2]]; ]; diffY[1, 1, th1, ph1] diffY[1, -1, th1, ph1] Clearly there is some sign error somewhere I was wondering if anyone had any suggestions. Luke I hate to jump to conclusions, but to me this looks suspiciously like a bug in the LegendreP function (which appears in the definition of SphericalHarmonicY). The suspicious behaviour can be reduced to the following: In[94]:= theta = 1.324; l = 1; m = -1; eps = 10^-6; LegendreP[l, m, Cos[theta]] (*direct computation*) LegendreP[l, m, Cos[t]] /. t -> theta (*evaluate symbolically then substitute numeric value*) $Version Out[95]= -0.48485 Out[96]= 0.48485 Out[97]= 7.0 for Microsoft Windows (32-bit) (February 18, 2009) So it looks like direct evaluation may be incorrect. Even more suspiciously, if we try nearby non-integer l, they have the correct value: In[106]:= LegendreP[l + #, m, Cos[th1]] & /@ {-eps, 0, eps} Out[106]= {0.48485, -0.48485, 0.48485} So it seems something subtle and incorrect may be going on in the evaluation for integer l. Peter. === Subject: Re: SphericalHarmonics strange behavior there is *no* sign error. Mathematica don't know that your polar angle can only take values 0<=th1<=Pi and diffY[1, 1, th1, ph1] // FullSimplify[#, 0 <= th1 <= Pi] & work as expected. Jens > Hi all, working with some spherical harmonics and have some questions about the code as implemented in mathematica. based on http://mathworld.wolfram.com/SphericalHarmonic.html I put together the following code to see what is implemented th1 = 1.324; > ph1 = 5.231; diffY[l_, m_, t_, p_] := > Module[{val1, val2}, val1 = SphericalHarmonicY[l, m, t, p]; > val2 = > Sqrt[((2*l + 1)*(l - m)!)/((4*Pi)*(l + m)!)]* > LegendreP[l, m, Cos[t]]*E^(I*m*p); > Print[{val1, val2, Abs[val1 - val2]}]; > Return[Abs[val1 - val2]]; ]; diffY[1, 1, th1, ph1] diffY[1, -1, th1, ph1] Clearly there is some sign error somewhere I was wondering if anyone had any suggestions. Luke > === Subject: Re: Solving Polynomial equation Kosal ________________________________ === Subject: Re: Solving Polynomial equation Let's say your Excel spreadsheet is abc.xls and it's in directory e:temp. Assume it has column headers a, b, c in row 1 and then the data in columns below. (You didn't mention values of the constant c in your quadratic, but I'll assume you have those, too; if not, you can readily modify the following.) (* say where file is *) SetDirectory[e:/temp] (* import spreadsheet data *) abc = Import[abc.xls,{Data,1}] (* strip off first element, which is column headers *) abc = Rest[abc] (* set up form of quadratic eq'n in pure function... *) (* ... and map onto the abc values *) Solve[#[[1]] x^2+#[[2]] x + #[[3]]==0,x]&/@abc As usual in Mathematica, you'll get the solutions in the form of lists of rules, one list for each {a,b,c} triple. > Hello I need help and I am new to Mathematica. Suppose I want to solve for the equation: aX^2 + bx +c ==0, however > I have a list of parameters a and b in my microsoft excel where a and b are columns and its value are in rows. I dont want to key every a and b each time to find the root of above equation. Are there anyway to tell Mathematica to import each a and b value from excel, put it in the above equation, and find its root > and it export the list of results back to excel? > Kosal -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: Solving Polynomial equation >I need help and I am new to Mathematica. >Suppose I want to solve for the equation: aX^2 + bx +c ==0, however >I have a list of parameters a and b in my microsoft excel where a >and b are columns and its value are in rows. >I dont want to key every a and b each time to find the root of above >equation. >Are there anyway to tell Mathematica to import each a and b value >from excel, put it in the above equation, and find its root and it >export the list of results back to excel? Yes. First. to move the data from Excel to Mathematica use Import. That is, doing data = Import[filename, XLS]; will read the data from filename. Now assuming there is only one sheet in the workbook and it only has the three columns described above with numeric data, the Mathematica variable data will be a n X 3 array of numbers. I will also assume a, b and c are in columns 1,2 and 3 respectively. Given those assumptions, roots of the quadratic equations can be found by doing sol={x/.First[#],x/.Last[#]}&@NSolve[#==0,x]&/@(data.{x^2,x,1}) Note, I've used NSolve here since you indicated the solutions are to be sent back to Excel. Excel will not like Mathematica's exact solutions that Solve will return if the coefficients a,b and c are integers. Also, if you don't want the solutions displayed by Mathematica you should terminate the above with a semicolon. =46inally, the solutions can be returned to Excel using Export. Doing Export[solutions.xls, sol, XLS] will create an Excel spreadsheet with the desired data. === Subject: Software for annotated globe? A couple of professional organizations I'm associated with would like to have a annotated on-screen globe on which they could place clickable links marking local chapters or sections around the world.. Idea would be that you could view this 3D globe on a web page, or maybe in a free-standing app; rotate it with the mouse; see the locations of local units marked on it; and click on these. Anyone know of available software, or a Mathematica package, to create something like this? (Obviously, could also be done more easily -- in fact, _is_ quite often done -- using one or more planar maps, without the 3D glitz. Pointers to not too complex software to create this kind of thing on your own would also be appreciated.) === Subject: Re: Text and multiple calculations in an IF condition On 6/18/09 at 8:47 PM, mail@pascal-schulthess.de (Pascal Schulthess) >I have a small problem, and haven't found any solution yet. So I >hope you can help me. >I'd like to have describing text, comments and multiple calculations >when one condition is true, and others when it's false. >For example: >If[a>b, >do something here; >and something else here; >insert a text here; >else >do something; >and more; >] >As far as I tried this is not possible with the if condition >provided?! But I also think this quite easy to do, if you know how >to. You really should post the Mathematica code you actually tried to use. Then it would be possible to see what is wrong. It is certainly possible to have code do as you've described. In correct Mathematica syntax what you described would be done as follows If[a>b, expr1;expr2;expr3, expr4;expr5] For this to work as intended a and b must have values that make sense to compare. If no values are assigned, then Mathematica will not be able to determine whether a is less than b or not. Note, there is no semicolon after expr3 or expr5. If you want text returned, it is essential not to terminate the expression that returns the text with a semicolon. And finally, if you want the If statement to evaluate to something even when a and b have not been assigned values, the syntax is If[a>b, expr1;expr2;expr3, expr4;expr5, expr6] The last item, expr6 will evaluate when Mathematica is unable to determine whether a multiplication operator. Suppose a={a1,a2,a3},P={{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}. I want > to get the explicit expression of a'Pa, where a' is the transpose of > vector > a. Since there is no transpose concept for vector, my expression in > mathematica is > a.P.a > However, it just > returns > {a1,a2,a3}.{{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}.{a1,a2,a3}, > seems nothing is done about this, why? > I use mathematica v7.0 > Haibo Min > yshdfeng@gmail.com > === Subject: Re: expression form It works for me. a = {a1, a2, a3}; P = {{p11, p12, p13}, {p21, p22, p23}, {p31, p32, p33}}; a.P.a Giving... a1 (a1 p11 + a2 p21 + a3 p31) + a2 (a1 p12 + a2 p22 + a3 p32) + a3 (a1 p13 + a2 p23 + a3 p33) Copy and paste and try it again. Maybe you didn't type in the expression you thought you did. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ multiplication operator. Suppose a={a1,a2,a3},P={{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}. I want to get the explicit expression of a'Pa, where a' is the transpose of vector a. Since there is no transpose concept for vector, my expression in mathematica is a.P.a However, it just returns {a1,a2,a3}.{{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}.{a1,a2,a3}, seems nothing is done about this, why? I use mathematica v7.0 Haibo Min yshdfeng@gmail.com === Subject: Re: expression form I get a different result: In[1]:= a={a1,a2,a3};P={{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}; In[2]:= a.P.a Out[2]= a1 (a1 p11+a2 p21+a3 p31)+a2 (a1 p12+a2 p22+a3 p32)+a3 (a1 p13+a2 p23+a3 p33) > multiplication operator. Suppose a={a1,a2,a3},P={{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}. I want > to get the explicit expression of a'Pa, where a' is the transpose of vector > a. Since there is no transpose concept for vector, my expression in > mathematica is > a.P.a > However, it just > returns {a1,a2,a3}.{{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}.{a1,a2,a3}, > seems nothing is done about this, why? > I use mathematica v7.0 > Haibo Min > yshdfeng@gmail.com > === Subject: Re: expression form It does work in this simple case. However, It still doesn't work when the elements in vector or matrix is a little bit complicated. For example, when P={{Subscript[k, p], -Subscript[m, f] Subscript[[Epsilon], 1], 0}, {-Subscript[m, f] Subscript[[Epsilon], 1], Subscript[m, f], -Subscript[m, f] Subscript[[Epsilon], 1]}, {0, -Subscript[m, f] Subscript[[Epsilon], 1], Subscript[k, d]/b}}, and a={{Subscript[e, p]}, {Subscript[e, v]}, {[CurlyTheta]}} Using your method: Transpose[a].P the result is still: Transpose[a].P But the weird thing is, when P is less complicated, say, P = {{Subscript[k, p], Subscript[m, f], 0}, {Subscript[m, f], Subscript[m, f], Subscript[m, f]}, {0, -Subscript[[Epsilon], 1] Subscript[m, f], Subscript[k, d]/b}} still using Transpose[a].P or just a.P they both work! I am wondering why? Is there a specific setting command which requires the results are explicit expressions? Haibo Min > Hello Mr. Haibo Min: INPUT: > Clear[a, p] > a = {{a1}, {a2}, {a3}}; > p = {{p11, p12, p13}, {p21, p22, p23}, {p31, p32, p33}}; > Transpose[a] . p OUTPUT: > {{a1*p11 + a2*p21 + a3*p31, a1*p12 + a2*p22 + a3*p32, a1*p13 + a2*p23 + > a3*p33}} Is this the result you intended? > MATTHIAS BODE > Las Lomas de Aranjuez > -------------------------------------------------- === > Subject: expression form > multiplication operator. > Suppose a={a1,a2,a3},P={{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}. I want > to get the explicit expression of a'Pa, where a' is the transpose of > vector > a. Since there is no transpose concept for vector, my expression in > mathematica is > a.P.a > However, it just > returns {a1,a2,a3}.{{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}.{a1,a2,a3}, > seems nothing is done about this, why? > I use mathematica v7.0 > Haibo Min > yshdfeng@gmail.com > === Subject: expression form multiplication operator. Suppose a={a1,a2,a3},P={{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}. I want to get the explicit expression of a'Pa, where a' is the transpose of vector a. Since there is no transpose concept for vector, my expression in mathematica is a.P.a However, it just returns {a1,a2,a3}.{{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}.{a1,a2,a3}, seems nothing is done about this, why? I use mathematica v7.0 Haibo Min yshdfeng@gmail.com === Subject: Re: expression form > Suppose a={a1,a2,a3},P={{p11,p12,p13},{p21,p22,p23},{p31,p32,p33}}. > I want to get the explicit expression of a'Pa, where a' is the transpose > of vector a. One approach is represent a as a column vector. For example: a = {{a1}, {a2}, {a3}}; P = { {p11, p12, p13}, {p21, p22, p23}, {p31, p32, p33} }; Transpose[a].P.a Note that Transpose[a] can also be entered as a[Transpose] to nicely typeset working transpose operator. Mark McClure === Subject: Looping- Programming We want to make a demonstration about population and cities. Firstly we chose an initial condition, let's say we have 5 cities with population {1000,300,7000,60,550} respectively. After that we give a decision population growth rate with selection random number. After we find new population of cities we decide whether a city divide or not, and how they will divide. We again give a random number to these cities population, and if this random number 0.0<=x<=0.1 it will divide, if 0.1 y]; pocwNbd = Cases[cwNbd, {x_, y_} -> y]; pocadF = IntegerPart[Cases[cwbd, {x_, y_} -> y]* Table[Random[], {Count[pocwbd, _Integer]}]]; pocadS = pocwbd - pocadF; poc[1]= Join[pocwNbd, pocadF, pocadS]; poc[2]=poc[1]+poc[1]*IntegerPart [Table[Random[],{Count[poc[1],_Integer]}]]; s= Table[Random[], {Count[poc[2], _Integer]}]; p = Partition[Riffle[s, poc[2]], 2]; cwbd = Cases[p, {x_, y_} /; 0.0 <= x <= 0.1]; cwNbd = Cases[p, {x_, y_} /; 0.1 < x <= 1.0]; pocwbd = Cases[cwbd, {x_, y_} -> y]; pocwNbd = Cases[cwNbd, {x_, y_} -> y]; pocadF = IntegerPart[Cases[cwbd, {x_, y_} -> y]* Table[Random[], {Count[pocwbd, _Integer]}]]; pocadS = pocwbd - pocadF; poc[3]= Join[pocwNbd, pocadF, pocadS]; poc[Y]=poc[Y-1]+IntegerPart[poc[Y-1]*Table[Random[],{Count[poc[Y-1],_Integer ]}]]; s= Table[Random[], {Count[poc[Y], _Integer]}]; p = Partition[Riffle[s, poc[Y]], 2]; cwbd = Cases[p, {x_, y_} /; 0.0 <= x <= 0.1]; cwNbd = Cases[p, {x_, y_} /; 0.1 < x <= 1.0]; pocwbd = Cases[cwbd, {x_, y_} -> y]; pocwNbd = Cases[cwNbd, {x_, y_} -> y]; pocadF = IntegerPart[Cases[cwbd, {x_, y_} -> y]* Table[Random[], {Count[pocwbd, _Integer]}]]; pocadS = pocwbd - pocadF; poc[Y+1]= Join[pocwNbd, pocadF, pocadS] Y's initial value is 4, how can we repeat this loop until 20th step. I want to find poc[5],poc[7],poc[9] etc... Osman Tuna === Subject: Re: Plotting surface with thickness Hi David: Bill === Subject: Re: Integrate[], Sort[] and Hold[] Try this: Clear[f, g] f[a_] := Min[2^a, 3^a] g[a_] := Max[2^a, 3^a] Integrate[{f@a, g@a}, {a, -1, 1}] N@% {(2 Log[2] + Log[27])/(Log[2] Log[27]), (Log[3] + 2 Log[4])/( Log[3] Log[4])} {2.04952, 2.54183} NIntegrate[{f@a, g@a}, {a, -1, 1}] {2.04952, 2.54183} Bobby > I am having trouble integrating a function which contains Sort[]. Here > is a > stripped down (if slightly odd) example: In = Integrate[Sort[{2, 3}^a], {a, -1, 1}] > Out = {3/Log[4], 8/Log[27]} Mathematica is evaluating this as follows. First, Sort[{2, 3}^a] is > evaluated as {2^a, 3^a}. Then Integrate[2^a, {a, -1, 1}] gives the first > term 3/Log[4]. Finally Integrate[3^a, {a, -1, 1}] gives the second term > 8/Log[27]. Note here that Sort[] is sorting 2^a and 3^a without knowing > the > value of a. That is, sort is sorting the raw symbolic expressions. I would prefer Sort[] to wait until it knows the value of a before > sorting. > For example, when a is -1, then 2^a = 1/2 and 3^a = 1/3, so Sort[{2, > 3}^a] > would be {1/3, 1/2}. However when a is 1, then 2^a = 2 and 3^a = 3, so > Sort[{2, 3}^a] would be {2, 3}. That is, in the first case the terms are > swapped, but in the second case they are not. So what I'm after is In = Integrate[Sort[{2, 3}^a], {a, -1, 1}] > Out = {2/Log[3] + 1/Log[4], 1/Log[2] + 2/Log[27]} > (* This does not actually happen *) [If you prefer to picture this, Plot[{2^a, 3^a}, {a, -1, 1}] draws two > increasing lines that cross at a = 0. Mathematica is integrating under > each > curve. I'm trying to integrate under the line made from the two lower > segments, and under the line made from the two upper segments.] I've tried using Hold[], ReleaseHold[], and Evaluate[] but have got > myself > into a terrible mess. Obviously with this trivial example I could just > split > the integral up myself, but is there a way to achieve delaying Sort[] > until > a is known? I would be very grateful for any comments. > -- DrMajorBob@bigfoot.com === Subject: Re: Integrate[], Sort[] and Hold[] I was somewhat surprised that the following worked: Integrate[Min[2^a, 3^a], {a, -1, 1}] % // N (2 Log[2] + Log[27])/(Log[2] Log[27]) 2.04952 NIntegrate[Min[2^a, 3^a], {a, -1, 1}] 2.04952 David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ I am having trouble integrating a function which contains Sort[]. Here is a stripped down (if slightly odd) example: In = Integrate[Sort[{2, 3}^a], {a, -1, 1}] Out = {3/Log[4], 8/Log[27]} Mathematica is evaluating this as follows. First, Sort[{2, 3}^a] is evaluated as {2^a, 3^a}. Then Integrate[2^a, {a, -1, 1}] gives the first term 3/Log[4]. Finally Integrate[3^a, {a, -1, 1}] gives the second term 8/Log[27]. Note here that Sort[] is sorting 2^a and 3^a without knowing the value of a. That is, sort is sorting the raw symbolic expressions. I would prefer Sort[] to wait until it knows the value of a before sorting. For example, when a is -1, then 2^a = 1/2 and 3^a = 1/3, so Sort[{2, 3}^a] would be {1/3, 1/2}. However when a is 1, then 2^a = 2 and 3^a = 3, so Sort[{2, 3}^a] would be {2, 3}. That is, in the first case the terms are swapped, but in the second case they are not. So what I'm after is In = Integrate[Sort[{2, 3}^a], {a, -1, 1}] Out = {2/Log[3] + 1/Log[4], 1/Log[2] + 2/Log[27]} (* This does not actually happen *) [If you prefer to picture this, Plot[{2^a, 3^a}, {a, -1, 1}] draws two increasing lines that cross at a = 0. Mathematica is integrating under each curve. I'm trying to integrate under the line made from the two lower segments, and under the line made from the two upper segments.] I've tried using Hold[], ReleaseHold[], and Evaluate[] but have got myself into a terrible mess. Obviously with this trivial example I could just split the integral up myself, but is there a way to achieve delaying Sort[] until a is known? I would be very grateful for any comments. === Subject: Integrate[], Sort[] and Hold[] I am having trouble integrating a function which contains Sort[]. Here is a stripped down (if slightly odd) example: In = Integrate[Sort[{2, 3}^a], {a, -1, 1}] Out = {3/Log[4], 8/Log[27]} Mathematica is evaluating this as follows. First, Sort[{2, 3}^a] is evaluated as {2^a, 3^a}. Then Integrate[2^a, {a, -1, 1}] gives the first term 3/Log[4]. Finally Integrate[3^a, {a, -1, 1}] gives the second term 8/Log[27]. Note here that Sort[] is sorting 2^a and 3^a without knowing the value of a. That is, sort is sorting the raw symbolic expressions. I would prefer Sort[] to wait until it knows the value of a before sorting. For example, when a is -1, then 2^a = 1/2 and 3^a = 1/3, so Sort[{2, 3}^a] would be {1/3, 1/2}. However when a is 1, then 2^a = 2 and 3^a = 3, so Sort[{2, 3}^a] would be {2, 3}. That is, in the first case the terms are swapped, but in the second case they are not. So what I'm after is In = Integrate[Sort[{2, 3}^a], {a, -1, 1}] Out = {2/Log[3] + 1/Log[4], 1/Log[2] + 2/Log[27]} (* This does not actually happen *) [If you prefer to picture this, Plot[{2^a, 3^a}, {a, -1, 1}] draws two increasing lines that cross at a = 0. Mathematica is integrating under each curve. I'm trying to integrate under the line made from the two lower segments, and under the line made from the two upper segments.] I've tried using Hold[], ReleaseHold[], and Evaluate[] but have got myself into a terrible mess. Obviously with this trivial example I could just split the integral up myself, but is there a way to achieve delaying Sort[] until a is known? I would be very grateful for any comments. === Subject: Re: Slow performance gathering property data from fitted Did you do something equivalent to this? data := Table[{3 + i + RandomReal[{-3, 7}], i + RandomReal[{-2, 5}]}, {i, 1, 20}] Timing[models = Array[LinearModelFit[data, x, x] &, 70000];] {90.2283, Null} Timing[rsquares = Through[models@RSquared];] {40.3059, Null} ListPlot@rsquares Notice, the RSquare values came out faster than the model fitting. Bobby Hi All, During some recent research I asked Mathematica to calculate 70,000 > simple linear regression fits to 70,000 small datasets. This worked > well and resulted in a list of 70,000 fitted model objects being > finished in under 5 minutes. My next step was to collect the RSquared property for each of the > 70,000 fits contained in the list, and Mathematica took over 3 hours to > accomplish this. This seems horrendously slow simply to gather values > from a list. Has anyone ran into a similar problem? Any suggestions > how I might be able to significantly speed the gathering of properties > from large lists of fitted model objects? > The snippet of code I was using to gather the RSquared values is below: piedlrRsquared = > Table[piedlrmodels[[i]][RSquared], {i, 1, Length[piedlrmodels]}] // > Timing; Todd > -- DrMajorBob@bigfoot.com === Subject: Re: Slow performance gathering property data from fitted objects >During some recent research I asked Mathematica to calculate 70,000 >simple linear regression fits to 70,000 small datasets. This >worked well and resulted in a list of 70,000 >fitted model objects being finished in under 5 minutes. >My next step was to collect the RSquared property for each of the >70,000 fits contained in the list, and Mathematica took over 3 >hours to accomplish this. This seems >horrendously slow simply to gather values from a list. Has anyone >ran into a similar problem? Any suggestions how I might be able to >significantly speed the gathering of properties from large lists of >fitted model objects? >The snippet of code I was using to gather the RSquared values is >below: >piedlrRsquared = Table[piedlrmodels[[i]][RSquared], {i, 1, Length[pied= lrmodels]}] >// Timing; Consider: In[15]:= data = RandomReal[1, {1000, 5}]; In[16]:= Timing[models = LinearModelFit[#, {1, x}, x] & /@ data;] Out[16]= {0.536635,Null} In[17]:= Timing[#[RSquared] & /@ models;] Out[17]= {0.555774,Null} In[18]:= Timing[Table[models[[n]][RSquared], {n, Length@models}];] Out[18]= {1.10845,Null} In[19]:= Timing[Correlation[#, Range[Length@#]]^2 & /@ data;] Out[19]= {0.223803,Null} Use of Table and Part involves some overhead that is avoided using a different method. === Subject: Re: compress lists with mean for equal elements >I have a nested list of this form: >{{{1, 13}, 97.6493}, {{1, 13}, 97.9511}, {{1, 14}, 99.3002}, {{1, >14}, 99.4602}, {{1, 14}, 99.6193}, {{1, 15}, 100.513}, {{1, 15}, >101.149}, {{1, 15}, 101.483}, {{1, 15}, 101.494}, {{1, 16}, 101.51}, >{{1, 16}, 101.895}} >I want to shrink the list in the way that I calculate the mean over >the second part for all elements where the first part is equal. so >e.g. the first element of the new list will be {{1,13}, 97.8002}, >because they both have {1,13} and the mean of 97.6493 and 97.9511 is >97.8002. Here is one way In[23]:= data = {{{1, 13}, 97.6493}, {{1, 13}, 97.9511}, {{1, 14}, 99.3002}, {{1, 14}, 99.4602}, {{1, 14}, 99.6193}, {{1, 15}, 100.513}, {{1, 15}, 101.149}, {{1, 15}, 101.483}, {{1, 15}, 101.494}, {{1, 16}, 101.51}, {{1, 16}, 101.895}}; In[24]:= {#[[1, 1]], Mean[#[[All, 2]]]} & /@ SplitBy[data, First] Out[24]= {{{1, 13}, 97.80019999999999}, {{1, 14}, 99.4599}, {{1, 15}, 101.15975}, {{1, 16}, 101.7025}} === Subject: Re: BarChart and Ticks > I am trying to make the Version 7 BarChart function have the same > Ticks capability as what was so easily done in Version 6 using the > Ticks option. Examples of what worked using the Ticks option in > Version 6 Example: (1) << BarCharts` > BarCharts`BarChart[{{1, 2, 3}, {2, 3, 4}}, Ticks -> {{1, 2, 3}, > Automatic}] Example: (2) Sometimes it is necessary to skip priniting every > other number on the X-axis > when the X-axis becomes too clutered with numbers. << BarCharts` > BarCharts`BarChart[{{1, 2, 3,4,5}, {2, 3, 4,5,6}}, Ticks -> {{1, > 3,5}, Automatic}] > The Ticks option does not work in Version 7: System`BarChart[Transpose[{{1, 2, 3}, {2, 3, 4}}], Ticks -> {{1, 2, > 3}, Automatic}] (Note that one has to Transpose the data to get the same grouping in > the bar chart as Version 6, but this is easily done.) Is there a way to get the same Tick marks as in Examples (1) and > (2) above > uisng the Version 7 BarChart function with its options? [If Ticks is completely not working for you (ie. you're getting a BarChart::ticks message) then you should update your version from 7.0.0 to 7.0.1.] Jaebum has already shown how to get the exact same ticks as V6, but I wonder if you're really interested in getting something like one of the following: System`BarChart[Transpose[{{1, 2, 3}, {2, 3, 4}}], ChartLabels -> {{1, 2, 3}, None}] System`BarChart[Transpose[{{1, 2, 3}, {2, 3, 4}}], ChartLabels -> {Placed[{1, 2, 3}, Below], None}] with the label below each group of bars, instead of centered on the first bar in each group? Brett Champion Wolfram Research === Subject: Re: BarChart and Ticks One way is to specify coordinates in Ticks: System`BarChart[Transpose[{{1, 2, 3}, {2, 3, 4}}], Ticks -> {Transpose@{Table[.5 + 2.3 i, {i, 0, 2}], {1, 2, 3}}, Automatic}] System`BarChart[Transpose@{{1, 2, 3, 4, 5}, {2, 3, 4, 5, 6}}, Ticks -> {Transpose@{Table[.5 + 4.6 i, {i, 0, 2}], {1, 3, 5}}, Automatic}] Note that default spacing is .1 between bars in group and .2 between groups. - Jay > I am trying to make the Version 7 BarChart function have the same Ticks > capability as what was so easily done in Version 6 using the Ticks option. > Examples of what worked using the Ticks option in Version 6 Example: (1) << BarCharts` > BarCharts`BarChart[{{1, 2, 3}, {2, 3, 4}}, Ticks -> {{1, 2, 3}, > Automatic}] Example: (2) Sometimes it is necessary to skip priniting every other > number on the X-axis > when the X-axis becomes too clutered with numbers. << BarCharts` > BarCharts`BarChart[{{1, 2, 3,4,5}, {2, 3, 4,5,6}}, Ticks -> {{1, 3,5}, > Automatic}] > The Ticks option does not work in Version 7: System`BarChart[Transpose[{{1, 2, 3}, {2, 3, 4}}], Ticks -> {{1, 2, 3}, > Automatic}] (Note that one has to Transpose the data to get the same grouping in > the bar chart as Version 6, but this is easily done.) Is there a way to get the same Tick marks as in Examples (1) and (2) > above > uisng the Version 7 BarChart function with its options? === Subject: BarChart and Ticks I am trying to make the Version 7 BarChart function have the same Ticks capability as what was so easily done in Version 6 using the Ticks option. Examples of what worked using the Ticks option in Version 6 Example: (1) << BarCharts` BarCharts`BarChart[{{1, 2, 3}, {2, 3, 4}}, Ticks -> {{1, 2, 3}, Automatic}] Example: (2) Sometimes it is necessary to skip priniting every other number on the X-axis when the X-axis becomes too clutered with numbers. << BarCharts` BarCharts`BarChart[{{1, 2, 3,4,5}, {2, 3, 4,5,6}}, Ticks -> {{1, 3,5}, Automatic}] The Ticks option does not work in Version 7: System`BarChart[Transpose[{{1, 2, 3}, {2, 3, 4}}], Ticks -> {{1, 2, 3}, Automatic}] (Note that one has to Transpose the data to get the same grouping in the bar chart as Version 6, but this is easily done.) Is there a way to get the same Tick marks as in Examples (1) and (2) above uisng the Version 7 BarChart function with its options? === Subject: Re: Text and multiple calculations in an IF condition the word you need to search for in the documentation is comment, as in commenting code. Typing comment into the documentation centre gives a fewf links. You then choose The Syntax of the Mathematica Language (Mathematica Tutorial) and near the top of that page you'll see: (*comment*) input to be ignored 2009/6/19 Pascal Schulthess : > Hi everybody, I have a small problem, and haven't found any solution yet. So I hope you > can help me. I'd like to have describing text, comments and multiple calculations when > one condition is true, and others when it's false. For example: If[a>b, > do something here; > and something else here; > insert a text here; > else > do something; > and more; > ] As far as I tried this is not possible with the if condition provided?! > But I also think this quite easy to do, if you know how to. > Pascal -- Peter Lindsay === Subject: Re: Text and multiple calculations in an IF condition f[x_, y_] := If[x > y, Print[a]; z = x + y, Print[b]; z = x - y] -Francesco > Hi everybody, I have a small problem, and haven't found any solution yet. So I hope you > can help me. I'd like to have describing text, comments and multiple calculations when > one condition is true, and others when it's false. For example: If[a>b, > do something here; > and something else here; > insert a text here; > else > do something; > and more; > ] As far as I tried this is not possible with the if condition provided?! > But I also think this quite easy to do, if you know how to. > Pascal > === Subject: Re: Text and multiple calculations in an IF condition > Hi everybody, I have a small problem, and haven't found any solution yet. So I hope you > can help me. I'd like to have describing text, comments and multiple calculations when > one condition is true, and others when it's false. For example: If[a>b, > do something here; > and something else here; > insert a text here; > else > do something; > and more; > ] As far as I tried this is not possible with the if condition provided?! > But I also think this quite easy to do, if you know how to. Here is the proper syntax for If, straight from the Documentation. If[condition,t,f] gives t if condition evaluates to True, and f if it evaluates to False. Use a comma to separate t and f, not else, like this. If[a>b, do something here; and something else here; insert a text here, do something; and more; ] For example, f[x_] := If[x > 3, Print[x^2]; Print[Hello], Print[x^3]; Print[Goodbye]] f[2] 8 Goodbye f[4] 16 Hello -- Helen Read University of VErmont === Subject: Re: Text and multiple calculations in an IF condition do you mean: If[a>b, (*Then*) do something here; and something else here; insert a text here, (* Else *) do something; and more ] ? Have you not founs how to make a comment (* *) or have you not found that If[] has a third argument (and a fourth) ? Jens > Hi everybody, I have a small problem, and haven't found any solution yet. So I hope you > can help me. I'd like to have describing text, comments and multiple calculations when > one condition is true, and others when it's false. For example: If[a>b, > do something here; > and something else here; > insert a text here; > else > do something; > and more; > ] As far as I tried this is not possible with the if condition provided?! > But I also think this quite easy to do, if you know how to. > Pascal > === Subject: Re: Help with Hold If I understood your question correctly here is another solution: expr = Hold[x, Null, y, Null, Null] ls = List @@ (ToString /@ Unevaluated /@ expr) /. Null -> Null ls // InputForm 2009/6/18 Erich Neuwirth : > How can I transform > Hold[x,Null,y,Null,Null] > into > {x,Null,y,Null,Null} > even if x and/or y have assigned values? -- Yuri Kandrashkin === Subject: Re: Slow performance gathering property data from fitted Don't use Table data = {{0, 1}, {1, 0}, {3, 2}, {5, 4}}; lm = LinearModelFit[data, x, x]; piedlrmodels = Table[lm, {10000}]; (piedlrRsquared = Table[piedlrmodels[[i]][RSquared], {i, 1, Length[piedlrmodels]}]); // Timing {15.5082,Null} (piedlrRsquared2 = (#[RSquared] & /@ piedlrmodels)); // Timing {6.09562,Null} piedlrRsquared == piedlrRsquared2 True (%%/%%%)[[1]] 0.393057 Bob Hanlon Hi All, During some recent research I asked Mathematica to calculate 70,000 simple linear regression fits to 70,000 small datasets. This worked well and resulted in a list of 70,000 fitted model objects being finished in under 5 minutes. My next step was to collect the RSquared property for each of the 70,000 fits contained in the list, and Mathematica took over 3 hours to accomplish this. This seems horrendously slow simply to gather values from a list. Has anyone ran into a similar problem? Any suggestions how I might be able to significantly speed the gathering of properties from large lists of fitted model objects? The snippet of code I was using to gather the RSquared values is below: piedlrRsquared = Table[piedlrmodels[[i]][RSquared], {i, 1, Length[piedlrmodels]}] // Timing; Todd === Subject: a yellow generally orthogonal Hadamard matrix type Yesterday, by using my ideas of product self-similat matrices I got: The matrix products work: Hadamard ( boson like) h2 = {{1, 1}, {1, -1}} Triangular Hadamard ( lepton like) ht2 = {{1, 0}, {1, -1}} Product one way: h = h2.ht2 {{2, -1}, {0, 1}} Product the other way: h1 = ht2.Transpose[h2] {{1, 1}, {0, 2}} h.h1 {{2, 0}, {0, 2}} I found that hy=ht.h2.ht was better! The matrix type {2,-1}, {2,-2}} self-similar matrices gave me this idea: If the original Haramard were white, this would be yellow? {{a,-1} {a,-a}} The square is generally:a>=2, Integer {{-a + a2, 0}, {0, -a+ a2}} Table[n2 - n, {n, 2, 10}] {2, 6, 12, 20, 30, 42, 56, 72, 90} Since it used itself instead of the transpose for orthogonality, it is like the triangular Hadamard (not the original boson sort). That it is orthogonal and works as a self-similar matrix I did using a=Prime[n]: {{2, -1}, {2, -2}}, {{9, -3, -3, 1}, {9, -9, -3, 3}, {9, -3, -9, 3}, {9, -9, -9, 9}}, {{125, -25, -25, 5, -25, 5, 5, -1}, {125, -125, -25,25, -25, 25, 5, -5}, {125, -25, -125, 25, -25, 5, 25, -5}, {125, -125, -125, 125, -25, 25, 25, -25}, {125, -25, -25, 5, -125, 25, 25, -5}, {125, -125, -25, 25, -125, 125, 25, -25}, {125, -25, -125, 25, -125, 25, 125, -25}, {125, -125, -125, 125, -125, 125, 125, -125}} The squares are: {{2, 0}, {0, 2}}, {{36, 0, 0, 0}, {0, 36, 0, 0}, {0, 0, 36, 0}, {0, 0, 0, 36}}, {{8000, 0, 0, 0, 0, 0, 0, 0}, {0, 8000, 0, 0, 0,0, 0, 0}, {0, 0, 8000, 0, 0, 0,0, 0}, {0, 0, 0, 8000, 0, 0, 0, 0}, {0, 0, 0, 0, 8000, 0,0, 0}, {0, 0, 0, 0, 0, 8000, 0, 0}, {0, 0, 0, 0, 0, 0, 8000, 0}, {0, 0, 0, 0, 0, 0, 0, 8000}} So my ideas about product sets hasn't been without some results. http://vids.myspace.com/index.cfm?fuseaction=vids.individual&videoid=5928637 3 I couldn't get it up to webMathematica so I tried this. Mathematica for animation: Clear[HadamardMatrix, HadamardMatrix1] MatrixJoinH[A_, B_] := Transpose[Join[Transpose[A], Transpose[B]]] KroneckerProduct[M_, N_] := Module[{M1, N1, LM, LN, N2}, M1 = M; N1 = N; LM = Length[M1]; LN = Length[N1]; Do[M1[[i, j]] = M1[[i, j]]N1, {i, 1, LM}, {j, 1, LM}]; Do[M1[[i, 1]] = MatrixJoinH[M1[[i, 1]], M1[[i, j]]], {j, 2, LM}, { i, 1, LM}]; N2 = {}; Do[AppendTo[N2, M1[[i, 1]]], {i, 1, LM}]; N2 = Flatten[N2]; Partition[N2, LM*LN, LM*LN]] HadamardMatrix[0] := {{1}} HadamardMatrix[2] := {{2, -1}, {2, -2}} HadamardMatrix[n_] := Module[{m}, m = {{2, -1}, {2, -2}}; KroneckerProduct[m, HadamardMatrix[n/2]]] HadamardMatrix1[n_] := If[Mod[n, 2] == 0 && IntegerQ[ Log[2, n]], HadamardMatrix[n], Table[HadamardMatrix[2^(Floor[ Log[2, n]] + 1)][[i, j]], {i, n}, {j, n}]] a = Table[ListDensityPlot[HadamardMatrix1[n], Mesh -> False, AspectRatio -> Automatic, ColorFunction -> Hue, Axes -> False, Frame -> False], { n, 2, 32}] Respectfully, Roger L. Bagula 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :http://www.geocities.com/rlbagulatftn/Index.html alternative email: rlbagula@sbcglobal.net === Subject: graph recursion of a cube sort http://www.geocities.com/rlbagulatftn/5d_cube.gif I figured out a way to make a recursive square-cube like graph product: here are the matrices : Line: {{0, 1}, {1, 0}}, Square: {{0, 1, 1, 0}, {1, 0, 0, 1}, {1, 0, 0, 1}, {0, 1, 1, 0}}, Cube: {{0, 1, 1, 0, 1, 0,0, 0}, {1, 0, 0, 1, 0, 1, 0, 0}, {1, 0, 0, 1, 0, 0, 1, 0}, {0, 1, 1, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0,1, 1, 0}, {0, 1, 0, 0, 1, 0, 0, 1}, {0, 0, 1, 0, 1, 0, 0, 1}, {0, 0, 0, 1, 0, 1, 1, 0}}, 4d cube ( Tesseract): {{0, 1, 1, 0, 1, 0, 0, 0,1, 0, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0}, {1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0}, {0, 1, 1, 0, 0, 0, 0, 1, 0, 0,0, 1, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0}, {0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0}, {0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0}, {0, 0, 0, 1,0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1}, {1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0}, {0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0}, {0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0}, {0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0}, {0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1}, {0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0}}} As I said before they are a lot like Hadamards. But not orthogonal or block form that I can find. Triangle from the polynomial is: {{-1, 0, 1}, {0, 0, -4, 0, 1}, {9, 0, -28, 0, 30, 0, -12, 0,1}, {0, 0, 0, 0, 0, 0, -4096, 0, 4352, 0, -1792, 0, 352, 0, -32, 0, 1}} {1476225, 0, -15641424, 0, 75436920, 0, -218887920, 0,425462940, 0, -583700560, 0, 580113224, 0, -421986160, 0, 224447430, 0, -86417520, 0, 23674440, 0, -4516176, 0, 586140, 0, -50160, 0, 2680, 0, -80, 0, 1}} As you can see it is the odd levels that don't have a lot of zeros. Mathematica: << DiscreteMath`GraphPlot`; << DiscreteMath`ComputationalGeometry` << DiscreteMath`Combinatorica` Clear[g, n, gm] g[0] := CompleteGraph[2] g[1] := GraphProduct[CompleteGraph[2], g[0]] g[n_] := g[n] = GraphProduct[g[n - 1], g[0]] Table[g[n], {n, 0, 3}] gm = Table[ToAdjacencyMatrix[g[n]], {n, 0, 4}] Table[CoefficientList[CharacteristicPolynomial[ToAdjacencyMatrix[g[n]], x], x], {n, 0, 4}] Table[ToAdjacencyMatrix[g[n]].Transpose[ToAdjacencyMatrix[g[n]]], {n, 0, 3}] Table[Dimensions[gm[[n]]], {n, 1, 4}] Table[GraphPlot3D[gm[[n]]], {n, 1, 5}] -- Respectfully, Roger L. Bagula 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :http://www.geocities.com/rlbagulatftn/Index.html alternative email: rlbagula@sbcglobal.net > === Subject: Re: FileNameSetter[], Dynamic[] > My objective is to make an interface that allows a user to select a file > and then that file will be opened by Mathematica and actions (i.e., data > processing) will be taken. If the user changes the file selection, all > actions will be repeated on new file. Here's what I have tried: FileNameSetter[Dynamic[filename], Open] data = Dynamic[Import[filename, Byte]] The Notebook indeed displays the updated data as a cell, yet other= actions > don't work, e.g., Length[data] always returns 1 and FullForm[data] shows > Dynamic[Import[filename,Byte]]. Am I approaching this problem incorrectly? I answered exactly this question a few months ago in this post... http://forums.wolfram.com/mathgroup/archive/2009/Feb/msg00424.html John Fultz jfultz@wolfram.com User Interface Group Wolfram Research, Inc. === Subject: Re: Plotting surface with thickness Hi: Bill PS. Can this method be used with Contour and parametric plots too? === Subject: laptop recommendation to run mathematica fast? hello, perhaps someone can recommend me a laptop to run Mathematica fast? i bought a asus eee pc 901 recently, which tho very cute pink and quiet, (when the fan is off anyway!) it does return a rather disappointing internal benchmark of around 0.32 for both Mathematica v7 and v5.2 with windows XP. what with Moore's law and all that i had vaguely reckoned that in 2009 a new machine should be running a lot faster than that since i have a circa 2001, 8 years old 1 GHz pentium dell inspiron laptop with that the small increase in speed that i do see could be wholly put down to the intel atom N270 in the asus running that little bit faster at 1.6 GHz. anyway, i am looking to buy a somewhat bigger screened laptop in the next few weeks, so if you have, or know, of something that will run the internal Mathematica v7.0 benchmark at, well, lets say, 3.0 or more?, i.e. about ten times faster than what i have now, i would be very interested to know what make and model it is, as i have had little luck so far trawling the web for such info, and tho the wolfram benchmark report mentions various intel xeons running at speeds of 3.75 or more i cant say ive ever seen a laptop with one of these chipsets inside it, and no mention whatever is made of these ubiquitous intel core 2 duo things, quadcore or not, or what i could expect from them. thankyou f.c (oh, i would just add that since i will be using the machine for other things besides mathematica it would be best for me to continue with windows a while longer, but if you get a nice turn of speed under linux or mac OS please feel free to say so!) === Subject: Re: laptop recommendation to run mathematica fast? Hi f.c., If you want the best laptop for Mathematica you should seriously look at the new Apple MacBook Pro when OS Snow Leopard comes out this September. Snow Leopard will allow WRI to take advantage of CPU & GPU performance WRI will be one of the first apps to support Snow Leopard. Then if you can spring for a desk side as well go for a Mac Pro with 8 Nehalem CPUs and 16 threads supported as well as room for two GPUs ... this will be a state of the art workstation for the next few years. Have fun ... Syd Syd Geraghty B.Sc, M.Sc. sydgeraghty@mac.com Mathematica 7.0.1 for Mac OS X x86 (64 - bit) (18th February 2009) MacOS X V 10.5.6 > hello, perhaps someone can recommend me a laptop to run Mathematica fast? i bought a asus eee pc 901 recently, which tho very cute pink and > quiet, (when the fan is off anyway!) it does return a rather > disappointing internal benchmark of around 0.32 for both Mathematica > v7 and > v5.2 with windows XP. what with Moore's law and all that i had vaguely reckoned that in 2009 > a new machine should be running a lot faster than that since i have a > circa 2001, 8 years old 1 GHz pentium dell inspiron laptop with > windows ME, so > that the small increase in speed that i do see could be wholly put > down to the intel atom N270 in the asus running that little bit faster > at 1.6 GHz. anyway, i am looking to buy a somewhat bigger screened laptop in the > next few weeks, so if you have, or know, of something that will run > the internal Mathematica v7.0 benchmark at, well, lets say, 3.0 or > more?, i.e. > about ten times faster than what i have now, i would be very > interested to know what make and model it is, as i have had little > luck so far trawling the web for such info, and tho the wolfram > benchmark report mentions various intel xeons running at speeds of > 3.75 or more i cant say ive ever seen a laptop with one of these > chipsets inside it, and no mention whatever is made of these > ubiquitous intel core 2 duo things, quadcore or not, or what i could > expect from them. > thankyou f.c (oh, i would just add that since i will be using the machine for other > things besides mathematica it would be best for me to continue with > windows a while longer, but if you get a nice turn of speed under > linux or mac OS please feel free to say so!) > === Subject: Re: laptop recommendation to run mathematica fast? > hello, perhaps someone can recommend me a laptop to run Mathematica fast? i bought a asus eee pc 901 recently, which tho very cute pink and > quiet, (when the fan is off anyway!) it does return a rather > disappointing internal benchmark of around 0.32 for both Mathematica v7 a= nd > v5.2 with windows XP. what with Moore's law and all that i had vaguely reckoned that in 2009 > a new machine should be running a lot faster than that since i have a > circa 2001, 8 years old 1 GHz pentium dell inspiron laptop with so > that the small increase in speed that i do see could be wholly put > down to the intel atom N270 in the asus running that little bit faster > at 1.6 GHz. anyway, i am looking to buy a somewhat bigger screened laptop in the > next few weeks, so if you have, or know, of something that will run > the internal Mathematica v7.0 benchmark at, well, lets say, 3.0 or more?,= i.e. > about ten times faster than what i have now, i would be very > interested to know what make and model it is, as i have had little > luck so far trawling the web for such info, and tho the wolfram > benchmark report mentions various intel xeons running at speeds of > 3.75 or more i cant say ive ever seen a laptop with one of these > chipsets inside it, and no mention whatever is made of these > ubiquitous intel core 2 duo things, quadcore or not, or what i could > expect from them. thankyou f.c (oh, i would just add that since i will be using the machine for other > things besides mathematica it would be best for me to continue with > windows a while longer, but if you get a nice turn of speed under > linux or mac OS please feel free to say so!) I got a BenchMark of 3.65 on my Lenovo W500 using version 7.0.1. I'm Core Duo T9600 @ 2.8GHz. The laptop is about 9 months old. I'm guessing you can do better with the newer chips. --Mark === Subject: Putting an If in my function #5 (1 + ((E^#2 - 1) - (E^#6 - 1))/#3)^(#3*#4) + (#1*((1 + (((E^#2 - 1) - (E^#6 - 1))/#3))^(#3*#4) - 1))/(((E^#2 - 1) - (E^#6 - 1))/#3) &[a, g, f, x, d, w] in the case when w==g the denominator equals zero. in this case i would like to rewrite the formula above to the much simpler d+a*n. How is this done? I've tried If[w == g, % = d + a*n], but this is not working. Another thing is where to put the If === Subject: 2 plots in the same Manipulate Hi I've made one Maniipulate showing a ListLinePlot where i can vary a couple of different parameters. the ListLinePlot. I want this PieChart to be manipulated at the same time, showing just next to my ListLinePlot. How is this done? I've been trying a bit with Grid but found nothing that works. === Subject: Two questions about modification of a matrix. Suppose there is a N*N matrix. 1. How can I change all elements that satisfy i*j>N to 0 ? (Here i, j is position of this element, as in mat[[i,j]]) 2. How can I change all negative elements in that matrix to 0 ? I know a for loop can be used, I just wonder if there is any more concise and beautiful ways. (I doubt Mathematica doesn't have a 'find' function as in another system which conveniently returns indice of elements that satisfy a certain condition) === Subject: solving integral equations I need to solve numerically an integral equation. The Wolfram library archive contains a package NISolve.nb (http://library.wolfram.com/ infocenter/MathSource/817) but I failed to run it on Mathematica 6.0. Did someone have such a problem? Are there any other packages === Subject: Ansatz? Wolfram MathWorld says: An ansatz is an assumed form for a mathematical statement that is not based on any underlying theory or principle. SEE ALSO: Conjecture, Hypothesis, Principle, Proposition Somewhere I've picked up the idea that ansatz can also be used to indicate the form or the approach -- more specifically, something like the choice of coordinates and variables and equations -- the geometry and notation so to speak -- in which one sets up a problem or a calculation. The underlying theory or principles in my interpretation can be perfectly clear, and no Conjectures or Hypotheses need be involved. One is simply setting up the calculation using this ansatz, in order to calculate certain consequences or numerical results (a calculation which one, of course, carries out using Mathematica). Is my interpretation of this term off the mark? (Wikipedia's explanation of the term seems to me considerably closer to my understanding than to Wolfram's definition.) === Subject: Re: When to use Module inside Manipulate Bobby, from Quality to Speed, the animations run much smoother/faster, and with much less of a delay in using the play/pause button. Quoting DrMajorBob : > I'd start more like this: Clear[T, Psi, anima] > Psi[x_, y_, amp_, phase_, a_, b_, T_] = > Sqrt[1 - amp^2] Exp[-I [Pi]^2/2 (4/a^2 + 1/b^2) T] 2/Sqrt[a b] Sin[ > 2 Pi x/a] Sin[Pi y/b] + > amp Exp[I phase] Exp[-I [Pi]^2/2 (9/a^2 + 1/b^2) T] 2/ > Sqrt[a b] Sin[3 Pi x/a] Sin[Pi y/b]; > anima[x_, y_, amp_, phase_, a_, b_] := > Animate[GraphicsRow[{Plot3D[ > Re[Psi[x, y, amp, phase, 1, 1, t]], {x, 0, 1}, {y, 0, 1}, > PlotRange -> {{0, 1}, {0, 1}, {-3, 3}}, > PerformanceGoal -> Quality, ColorFunction -> Rainbow, > Mesh -> None], > Plot3D[Im[Psi[x, y, amp, phase, 1, 1, t]], {x, 0, 1}, {y, 0, 1}, > PlotRange -> {{0, 1}, {0, 1}, {-3, 3}}, > ColorFunction -> Rainbow, PerformanceGoal -> Quality, > Mesh -> None]}, ImageSize -> 600], {t, 0.001, 5}, > AnimationRunning -> False, AnimationRate -> .05] DynamicModule[{amp, phase}, > Manipulate[ > anima[x, y, amp, phase, 1, 1], > {{amp, 0.5}, 0, 1, Appearance -> Labeled, ImageSize -> Small}, > {phase, 0, 2 Pi, Appearance -> Labeled, ImageSize -> Small}, > ControlPlacement -> Left, > SaveDefinitions -> True] > ] Bobby > I have defined a 2D complex function, and made side-by-side animations > of the Re/Im parts inside a Manipulate. > As written, I have the function definition as well as the animation > wrapped in Module, and the animation/manipulate commands work fine > (albeit slowly). However, if I remove that Module (it seems redundant > to me), leaving only the outer DynamicModule, the cell where the > graphs appear is highlighted, and the animate/manipulate no longer work. > Any ideas about what I'm doing wrong? I suspect I'm not understanding > how to localize variables properly. > Porscha > DynamicModule[{amp, phase, a, b}, > Manipulate[a = 1; b = 1; > Module[{Psi, T}, > Psi[x_, y_] = > Sqrt[1 - amp^2] Exp[-I [Pi]^2/2 (4/a^2 + 1/b^2) T] 2/ > Sqrt[a b] Sin[(2 Pi x)/a] Sin[(Pi y)/b] + > amp Exp[I phase] Exp[-I [Pi]^2/2 (9/a^2 + 1/b^2) T] 2/ > Sqrt[a b] Sin[(3 Pi x)/a] Sin[(Pi y)/b] ; > Animate[ > GraphicsRow[{Plot3D[Re[Psi[x, y] /. T -> t], {x, 0, 1}, {y, 0, 1}, > PlotRange -> {{0, 1}, {0, 1}, {-3, 3}}, > PerformanceGoal -> Quality, ColorFunction -> Rainbow, > Mesh -> None], > Plot3D[Im[Psi[x, y] /. T -> t], {x, 0, 1}, {y, 0, 1}, > PlotRange -> {{0, 1}, {0, 1}, {-3, 3}}, > ColorFunction -> Rainbow, PerformanceGoal -> Quality, > Mesh -> None]}, ImageSize -> 600], > {t, 0.001, 5}, AnimationRunning -> False, AnimationRate -> .05]], > {{amp, 0.5}, 0, 1, Appearance -> Labeled, > ImageSize -> Small}, {phase, 0, 2 Pi, Appearance -> Labeled, > ImageSize -> Small}, ControlPlacement -> Left, > SaveDefinitions -> True]] > > -- > DrMajorBob@bigfoot.com > === Subject: Re: When to use Module inside Manipulate I'd start more like this: Clear[T, Psi, anima] Psi[x_, y_, amp_, phase_, a_, b_, T_] = Sqrt[1 - amp^2] Exp[-I [Pi]^2/2 (4/a^2 + 1/b^2) T] 2/Sqrt[a b] Sin[ 2 Pi x/a] Sin[Pi y/b] + amp Exp[I phase] Exp[-I [Pi]^2/2 (9/a^2 + 1/b^2) T] 2/ Sqrt[a b] Sin[3 Pi x/a] Sin[Pi y/b]; anima[x_, y_, amp_, phase_, a_, b_] := Animate[GraphicsRow[{Plot3D[ Re[Psi[x, y, amp, phase, 1, 1, t]], {x, 0, 1}, {y, 0, 1}, PlotRange -> {{0, 1}, {0, 1}, {-3, 3}}, PerformanceGoal -> Quality, ColorFunction -> Rainbow, Mesh -> None], Plot3D[Im[Psi[x, y, amp, phase, 1, 1, t]], {x, 0, 1}, {y, 0, 1}, PlotRange -> {{0, 1}, {0, 1}, {-3, 3}}, ColorFunction -> Rainbow, PerformanceGoal -> Quality, Mesh -> None]}, ImageSize -> 600], {t, 0.001, 5}, AnimationRunning -> False, AnimationRate -> .05] DynamicModule[{amp, phase}, Manipulate[ anima[x, y, amp, phase, 1, 1], {{amp, 0.5}, 0, 1, Appearance -> Labeled, ImageSize -> Small}, {phase, 0, 2 Pi, Appearance -> Labeled, ImageSize -> Small}, ControlPlacement -> Left, SaveDefinitions -> True] ] Bobby I have defined a 2D complex function, and made side-by-side animations > of the Re/Im parts inside a Manipulate. As written, I have the function definition as well as the animation > wrapped in Module, and the animation/manipulate commands work fine > (albeit slowly). However, if I remove that Module (it seems redundant > to me), leaving only the outer DynamicModule, the cell where the > graphs appear is highlighted, and the animate/manipulate no longer work. Any ideas about what I'm doing wrong? I suspect I'm not understanding > how to localize variables properly. Porscha DynamicModule[{amp, phase, a, b}, Manipulate[a = 1; b = 1; Module[{Psi, T}, Psi[x_, y_] = > Sqrt[1 - amp^2] Exp[-I [Pi]^2/2 (4/a^2 + 1/b^2) T] 2/ > Sqrt[a b] Sin[(2 Pi x)/a] Sin[(Pi y)/b] + > amp Exp[I phase] Exp[-I [Pi]^2/2 (9/a^2 + 1/b^2) T] 2/ > Sqrt[a b] Sin[(3 Pi x)/a] Sin[(Pi y)/b] ; Animate[ GraphicsRow[{Plot3D[Re[Psi[x, y] /. T -> t], {x, 0, 1}, {y, 0, 1}, > PlotRange -> {{0, 1}, {0, 1}, {-3, 3}}, > PerformanceGoal -> Quality, ColorFunction -> Rainbow, > Mesh -> None], Plot3D[Im[Psi[x, y] /. T -> t], {x, 0, 1}, {y, 0, 1}, > PlotRange -> {{0, 1}, {0, 1}, {-3, 3}}, > ColorFunction -> Rainbow, PerformanceGoal -> Quality, > Mesh -> None]}, ImageSize -> 600], {t, 0.001, 5}, AnimationRunning -> False, AnimationRate -> .05]], {{amp, 0.5}, 0, 1, Appearance -> Labeled, > ImageSize -> Small}, {phase, 0, 2 Pi, Appearance -> Labeled, > ImageSize -> Small}, ControlPlacement -> Left, > SaveDefinitions -> True]] > -- DrMajorBob@bigfoot.com === Subject: When to use Module inside Manipulate I have defined a 2D complex function, and made side-by-side animations of the Re/Im parts inside a Manipulate. As written, I have the function definition as well as the animation wrapped in Module, and the animation/manipulate commands work fine (albeit slowly). However, if I remove that Module (it seems redundant to me), leaving only the outer DynamicModule, the cell where the graphs appear is highlighted, and the animate/manipulate no longer work. Any ideas about what I'm doing wrong? I suspect I'm not understanding how to localize variables properly. Porscha DynamicModule[{amp, phase, a, b}, Manipulate[a = 1; b = 1; Module[{Psi, T}, Psi[x_, y_] = Sqrt[1 - amp^2] Exp[-I [Pi]^2/2 (4/a^2 + 1/b^2) T] 2/ Sqrt[a b] Sin[(2 Pi x)/a] Sin[(Pi y)/b] + amp Exp[I phase] Exp[-I [Pi]^2/2 (9/a^2 + 1/b^2) T] 2/ Sqrt[a b] Sin[(3 Pi x)/a] Sin[(Pi y)/b] ; Animate[ GraphicsRow[{Plot3D[Re[Psi[x, y] /. T -> t], {x, 0, 1}, {y, 0, 1}, PlotRange -> {{0, 1}, {0, 1}, {-3, 3}}, PerformanceGoal -> Quality, ColorFunction -> Rainbow, Mesh -> None], Plot3D[Im[Psi[x, y] /. T -> t], {x, 0, 1}, {y, 0, 1}, PlotRange -> {{0, 1}, {0, 1}, {-3, 3}}, ColorFunction -> Rainbow, PerformanceGoal -> Quality, Mesh -> None]}, ImageSize -> 600], {t, 0.001, 5}, AnimationRunning -> False, AnimationRate -> .05]], {{amp, 0.5}, 0, 1, Appearance -> Labeled, ImageSize -> Small}, {phase, 0, 2 Pi, Appearance -> Labeled, ImageSize -> Small}, ControlPlacement -> Left, SaveDefinitions -> True]] === Subject: Non-converging integral with linear transformation?! Hi! I have a question regarding the Integral over the product of the two functions AiryAi and AiryAiPrime. Lets look at the following integrals: f[x_] = AiryAi[-1 + 10^5 x] AiryAiPrime[-500 + 10^5 x] NIntegrate[f[x], {x, 0, Infinity}] 10^-5*NIntegrate[f[x] /. x -> (10^-5 x), {x, 0, Infinity}] Mathematica 6 seems to be unable to evaluate the first one; the result is 0 and a warning about to slow convergence is issued. The second one is - as far as I know - the same as the first one but with a linear variable transformation applied -> this time the result is given without any warning. So basically my question is: what is going on there? Am I doing something wrong? === Subject: from the list select from this list select the person who has P in the third position namedata = {{Aardsma, David, P},{Bay, Jason, OF}} === Subject: Re: Number format You could try AccountingForm, although that represents negative numbers in parentheses and with no negative sign. > Hi > i dont want my outbput to be presented using 10^n. I just want it to > print the the entire sum like 10000000 rather than 1*10^7 > How do i fix it? Ive experimented with NumberForm but i can't find the > solution > -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: Number format v = Table[1.234*10^n, {n, -18, 18, 3}] NumberForm[v, ExponentFunction -> (If[Abs[#] <= 15, Null, #] &)] Bob Hanlon Hi i dont want my outbput to be presented using 10^n. I just want it to print the the entire sum like 10000000 rather than 1*10^7 How do i fix it? Ive experimented with NumberForm but i can't find the solution === Subject: Needs[], BeginPackage[], filename Needs[] allows the context and filename to be specified. BeginPackage[] allows a context and not a file name. Then, my packages require two steps, as in the following example: ** start ** Needs[sizedistribution`, size functions.m] BeginPackage[tandemdma`, {sizedistribution`}] ** stop ** Are two steps really necessary or am I missing something very simple? My goal would be to just forego Needs[] and handle everything in one step with BeginPackage, but I cannot figure out a way to feed the filename to BeginPackage[]. I had a search on the MathArchives, but I did not succed in locating any material addressing this question. === Subject: Re: Startingpoint and Initial region in Nminimize > Hi All, I have 2 problems : + I don't know if one can assign ONE Startingpoint when using Nminimize. Example: f[S_, T_] := S^2 + (T - 10)^2; > NMinimize[f[S, T], {{S, 2, 2.000001}, {T, 4, 4.00001}}, > Method -> {NelderMead, InitialPoints -> {{-2, 30}}}]; As you see, here i have an Initial region: {{S, 2, 2.000001}, {T, 4, 4.00001}}. The > InitialPoints serve only as a reference for the final result. Now, i want Nminimize to take Exactly one Starting point (that i give For example {2,4}, not one region). Is it possible??? Sory if the question was already asked. ++ In addition, i observe that the Nminimize's iterations strongly depend on that Initial region. (Not in this simple case but in what i'm doing). Meaning: We can have different result when the Initial region is larger (For example) > {{S, 2, 4}, {T, 4, 6}} > or smaller {{S, 2, 2.0000001}, {T, 4, 4.000001}}. I do not see why??? because i think that this is just a starting point and the Initial region > can not influence the result of the optimization. If someone have experiences about that two questions? Anh. NMinimize chooses pseudorandom points in its starting region. Hence the region specification will change those starting points, and thus can have an effect on the final outcome both in terms of quality and speed. Daniel Lichtblau Wolfram Research === Subject: Eye of Ra :ellipse_self_similar http://www.geocities.com/rlbagulatftn/ellipse_self_similar.jpg I orginially did this in the 60's inspired by the CBS logo of a eye. This is the first time I figured out a mathematical form for a self-similar ellipse of thios sort: The figure alternates ellipses and inscribed ellises. It also tiles a disk in an hyperbolic reduction scaling of scale of powers of two. I really doubt this is a new fractal, but it is pretty anyway. I call it the Eye of Ra as reading about Akhenaten made me think of it. Mathematica: Clear[x, y, i, t, g] x[i_, t_] = If[Mod[i, 2] == 0, Cos[t]/2^(i - 1), Cos[t]/2^i] y[i_, t_] = If[Mod[i, 2] == 0, Sin[t]/2^(i + 1), Sin[t]/2^i] g = Table[ParametricPlot[{x[i, t], y[i, t]}, {t, - Pi, Pi}, Axes -> False], {i, 0, 10}] Show[g, PlotRange -> All] Respectfully, Roger L. Bagula 11759Waterhill Road, Lakeside,Ca 92040-2905,tel: 619-5610814 :http://www.geocities.com/rlbagulatftn/Index.html alternative email: rlbagula@sbcglobal.net === Subject: Trianguloid as an Eye of Ra type fractal http://local.wasp.uwa.edu.au/~pbourke/fractals/trianguloid/ http://www.geocities.com/rlbagulatftn/trianguloid_ifs.gif Mathematica: Clear[f, dlst, pt, cr, ptlst, x, y] dlst = Table[ Random[Integer, {1, 3}], {n, 50000}]; f[1, {x_, y_}] := N[ {2*x*y/(x2 + y2) , (y2 - x2)/(y2 + x2)}]; f[2, {x_, y_}] := N[ {2/(x + 2) - 1, 2/(y + 2) - 1}]; f[3, {x_, y_}] := N[ {-(y2 - x2)/(y2 + x2), 2*x*y/(x2 + y2) }]; pt = {0.5, 0.75}; cr[n_] := If[ n - 1 == 0, RGBColor[0, 0, 1], If[n - 2 == 0, RGBColor[0, 1, 0], If[n - 3 == 0, RGBColor[1, 0, 0], RGBColor[0, 0, 0]]]] ptlst = Table[{cr[dlst[[j]]], Point[pt = f[dlst[[j]], Sequence[pt]]]}, {j, Length[dlst]}]; Show[Graphics[Join[{PointSize[.001]}, ptlst]], AspectRatio -> Automatic, PlotRange -> All] === Subject: Re: stirring chocolate pudding backwards: identifying coordinates Ray, Thx for the input. I've started working through your solution for my first question -- the point associated with the highest value at each interval -- and it makes sense to me, so far. I may have further questions about it as I push my way through it, but it looks spot-on. I do have questions about your answer to my second question, probably because I may have miss-stated what I want to do. Using 3 coordinates as in my original example, as the sample size increases the Mean[samples] approaches {.333..., .333..., .333...}. This makes sense as the Mean of the indexes of the population from which I sample would give us the same list of coordinates. But this point may or may not correspond to the value of what I need to know. I want to find the coordinates at each time increment of the weighted average of all samples with the weights in proportion to their performance or values in the time series data. Wouldn't this point vary, over time, across the plane from which I select the samples (especially as in its projected application I'll have values for thousands of time increments and they may have far greater variance than my simple example)? Also, it seems like it wouldn't have to correspond to any specific point in the list of samples. I have a penchant for making things more complicated than necessary, but I think what I want differs from the Mean[samples]. Any insight much appreciated. A === Subject: Re: stirring chocolate pudding backwards: identifying coordinates > Ray, Thx for the input. I've started working through your solution for > my first question -- the point associated with the highest value at > each interval -- and it makes sense to me, so far. I may have further > questions about it as I push my way through it, but it looks spot-on. I do have questions about your answer to my second question, > probably because I may have miss-stated what I want to do. Using 3 coordinates as in my original example, as the sample size > increases the Mean[samples] approaches {.333..., .333..., .333...}. > This makes sense as the Mean of the indexes of the population from > which I sample would give us the same list of coordinates. But this point may or may not correspond to the value of what I need > to know. I want to find the coordinates at each time increment of the weighted > average of all samples with the weights in proportion to their > performance or values in the time series data. Wouldn't this point > vary, over time, across the plane from which I select the samples > (especially as in its projected application I'll have values for > thousands of time increments and they may have far greater variance > than my simple example)? Also, it seems like it wouldn't have to > correspond to any specific point in the list of samples. I have a penchant for making things more complicated than necessary, > but I think what I want differs from the Mean[samples]. Any insight > much appreciated. A Dimensions[samples] = {p,d} = {# of points, # of dimensions}. If each sample point has a value associated with it at each of t time intervals, then Dimensions[values] should be either {p,t} or {t,p}. Assume it's {t,p}, with each row corresponding to a time interval. Then values.samples/(Tr/@values) will give a matrix whose dimensions are {t,d}, with each row containsing the weighted average coordinates for a time interval. === Subject: Re: Concatenating of Graphicsprimitives? >Any command akin to the Join[list1, list2] command for Joining >(concatenating) two Graphics[{}] lists into a single Graphics[] >list? >Executing >g1 = Graphics[Table[Circle[{0,0},r],{r,1,3}]]; >g2 = Graphics[Table[Circle[{0,0},r],{r,4,5}]]; >g={g1, g2}; >g (* A new cell *) >Show[g] (* Another new cell *) >is entertaining -- if not exactly educational. Your comment here is puzzling. Were you expecting something different? If so, what? Additionally, I have trouble making sense of your question. Combining two *lists* into one list is done with Join regardless of whether the elements of the lists are graphics or something else. Combining two graphics into a single graphic is done with Show. === Subject: Re: Maximize returning approximate values > Hello. > * Maximize will return exact results if given exact input. I've tried to maximize n/n! without success: In[8]:= Maximize[n/n!, n] > Out[8]= Maximize[n/n!, n] But a Plot shows that the maximum is around 1.5, so I tried: In[9]:= Maximize[{n/n!, 0 <= n <= 3}, n] > During evaluation of In[9]:= Maximize::nint: Warning: Maximize used > numeric integration to show that the result is a global maximum. > Out[9]= {Root[{-#1! + Gamma[1 + #1] PolyGamma[0, 1 + #1] #1 &, > 1.46163214496836234126265954233}]/ > Root[{-#1! + Gamma[1 + #1] PolyGamma[0, 1 + #1] #1 &, > 1.46163214496836234126265954233}]!, {n - Root[{-#1! + Gamma[1 + #1] PolyGamma[0, 1 + #1] #1 &, > 1.46163214496836234126265954233}]}} > It is partially symbolic, partially numeric. > Is it a bug? > What makes you think this could be a bug? What other answer could you possibly imagine? Mathematica since version 7 is able to find solutions of transcendental (analytic) equations which it expresses in symbolic form providing as a last argument an approximate value, which is sufficient to isolate the root from other roots of the same equation. A root given in this way can be computed to arbitrary precision, e.g. N[Root[{-#1! + Gamma[1 + #1] PolyGamma[0, 1 + #1] #1 &, 1.46163214496836234126265954233}], 100] 1.46163214496836234126265954232572132846819620400644635129598840859878644035 38 01810243074992733725593 Here you have got it with 100 digits; you can get 1000 or more if you like. You can do the same sort of things with this representation as you can do with Pi or E, which are also exact representations. The presence of the approximate number just gives you additional information - how could additional information be a bug? Andrzej Kozlowski === Subject: bug in the transformation to .nbp? Hello When im transforming my .nb to .nbp through the website. One thing changes - The alignment of my graphics. in my .nb the sliders are to the right and graphics to the left. in the .nbp the sliders are to the top and graphics on the bottom. Anybody knows why, and if this can be solved, or is this a bug in the transformation? === Subject: questions on webmathematica hello I'm thinking of getting webmathematica, but i have a few questions about how it works. have i understood this correctly: *webmathematica is a program that is to be installed on the webserver right? *If i have a mathematica notebook can i just upload it on the webserver through mathematica and it will function and look the same way as when you play it for instance in mathematica player? to what extent do you need to program the interface and serverconnections yourself? === Subject: Re: questions on webmathematica webMathematica is a collection of tools that allow a web page to interact with Mathematica. You'll need to set up a server and a servlet container. Wolfram recommends some open-source (i.e. free) software for these, but you'll need to download and configure yourself. If you follow all the Wolfram recommendations, the installation instructions are very good. I managed it, and I'm not really a networks person or hard-core computer systems person. Your server computer will also have a copy of Mathematica running. Now you create web pages that interact with Mathematica. You can call Mathematica functions, and there are utilities for gathering user input data. The magic is that webMathematica will build a page on the fly that represents the output of a Mathematica function. Wolfram provides tools for building pages, and lots of examples, but you pretty much have to be willing to do some HTML/Javascript programming to get what you want. Notebook pages can be converted to web pages with good fidelity, but they will not be live in the webMathematica sense. I usually make documentation pages straight from notebooks, and program live pages by hand. Gerry F. > hello I'm thinking of getting webmathematica, but i have a few questions > about how it works. have i understood this correctly: > *webmathematica is a program that is to be installed on the webserver > right? *If i have a mathematica notebook can i just upload it on the > webserver through mathematica and it will function and look the same > way as when you play it for instance in mathematica player? to what extent do you need to program the interface and > serverconnections yourself? > === Subject: Re: questions on webmathematica > hello I'm thinking of getting webmathematica, but i have a few questions > about how it works. have i understood this correctly: > *webmathematica is a program that is to be installed on the webserver > right? *If i have a mathematica notebook can i just upload it on the > webserver through mathematica and it will function and look the same > way as when you play it for instance in mathematica player? to what extent do you need to program the interface and > serverconnections yourself? The current version of webMathematica is 2.3 and works only with Mathematica version 5.2, although they are working on an update (called version 3) that will work with 7.0 that is supposed to be out soon (see http://www.wolfram.com/products/webmathematica/newfeatures.html for more info). It comes in a Professional version as well as an Amateur version (free copy of Amateur is available with Wolfram Premier Support I think). Differences between the two are listed at http://www.wolfram.com/products/webmathematica/versions/ and there are also restrictions on what you can do (see same versions page for more info). You need to set up a servlet container (e.g. Tomcat) with a full JDK and Java as part of the webMathematica installation. Because of the need for version 5.2, you really need a separate system to run it on, as mixing two versions of Mathematica on the same system can cause problems, but doable I think if you maintain them in two separate trees and have a way of switching the folders or directories where the system libraries are stored, or keeping them from interfering with each other. Yes, you need a webserver running somewhere but not necessarily on the same system as webMathematica (and does not need to be dedicated to just webMathematica). Check out some examples at http://www.wolfram.com/products/webmathematica/examples/ I think the best thing, if you have Wolfram support, is to just get a free copy and play around and see how you like it. -Bob === Subject: Re: questions on webmathematica > hello I'm thinking of getting webmathematica, but i have a few questions > about how it works. have i understood this correctly: > *webmathematica is a program that is to be installed on the webserver > right? Yes *If i have a mathematica notebook can i just upload it on the > webserver through mathematica and it will function and look the same > way as when you play it for instance in mathematica player? No to what extent do you need to program the interface and > serverconnections yourself? This is indeed what you have to do. === Subject: Barchart number output Hi i have a barchart and the form is something like this... BarChart[{y = 2000 + 500}, PlotLabel -> Style[$ per month required: , Bold], NumberForm[N[y], {6,0}]] i want it to say $ per month required: 2500 in this case. the real function y is much more complex and includes variables... why does not the above work? The reason is either my way of defining the function. im not sure if you just can put a y= in front of it and then use the y in another place... otherwise it is the NumberForm which is not in the correct way. please help /Tommy === Subject: Re: Barchart number output > Hi i have a barchart and the form is something like this... BarChart[{y = 2000 + 500}, PlotLabel -> Style[$ per month required: > , Bold], NumberForm[N[y], {6,0}]] i want it to say $ per month required: 2500 in this case. the real function y is much more complex and includes > variables... why does not the above work? The reason is either my way of defining the function. im not sure if > you just can put a y= in front of it and then use the y in another > place... otherwise it is the NumberForm which is not in the correct > way. please help > /Tommy The two parts of your label were not grouped PlotLabel -> Row[{Style[$ per month required:, Bold], NumberForm[N [y], {6, 0}]}] Mike === Subject: Re: Applying lists to FindRoot of a NIntegrate I wasn't able to devise data for which the equations seemed solvable, but the basic idea would be something like f[r_] = r^2 + r + 2/(r^2 + r); g[r_, x_, a_] = Exp[a*Exp[-x*r]]; w[x_?NumericQ, a_?NumericQ] := NIntegrate[f[r]*g[r, x, a], {r, 0.1, 100}] solve1[x_?NumericQ, y_?NumericQ] := Module[{a}, a /. NSolve[w[x, a] == y, a]] solve2[a0_?NumericQ][x_?NumericQ, y_?NumericQ] := Module[{a}, a /. FindRoot[w[x, a] - y, {a, a0}]] Module[{a}, a /. FindRoot[w[x, a] - y, {a, a0}]] data = {{1, 2}, {1.1, 3}, {1.2, 5}}; solve1 @@@ data (* error messages omitted *) {{InverseFunction[w, 2, 2][1, 2.0000000000000000000000000000000]}, {InverseFunction[w, 2, 2][1.1, 3.0000000000000000000000000000000]}, {InverseFunction[w, 2, 2][ 1.2, 5.0000000000000000000000000000000]}} solve2[1] @@@ data {-1.75308*10^44, -3.60158*10^48, -7.2559*10^52} solve2 (and FindRoot) need an initial guess, preferably a good one. (I used 1.) Judge for yourself whether those are reasonable results. OTOH, I doubt that NSolve will work at all. It's intended for polynomial equations. Bobby > Hi Bobby, > look > into my problrm! Well, the list consists of pairs of data points, something like > data={{1,2}, > {1.1,3}, {1.2,5},..., {x[[i]],y[[i]]}}. These are my input for the > fitting > of the corresponding values of a. > Chris > -----Urspr.9fngliche Nachricht----- > Von: DrMajorBob [mailto:btreat1@austin.rr.com] > Gesendet: Dienstag, 30. Juni 2009 20:07 > An: Christian Schneider; mathgroup@smc.vnet.net > Betreff: Re: Applying lists to FindRoot of a NIntegrate > function See the list of data points? I don't. Bobby I have serious difficulties in solving the following problem in > Mathematica > (v.6) and would very appreciate it if anyone could give me a helping > hand with > that. > To start with, I have a list of data points {{x[[i]],y[[i]]}}. > Also, I have the function W. W consists of two single functions f[r] and > g[r, > x, a]: > f[r_] = r^2+r+2/(r^2+r) > g[r_, x_, a_] = Exp[a*Exp[-x*r]] > W := NIntegrate[f[r]*g[r, x, a], {r, 0.1, 100}] > What I have given for every pair of data is W[x[[i]]] == y[[i]] (see the > list > of data points). What I do not have is the corresponding value of > a[[i]]. > So, I want to use FindRoot to give me the value of a[[i]] for each of my > data > pairs {x[[i]],y[[i]]}. > Although I have found many examples quite similar to this problem, I > have been > unable to adjust those to work in my case. > I would be very grateful if somebody could provide me with the proper > syntax > for this. > Chris > -- DrMajorBob@bigfoot.com === Subject: Re: Applying lists to FindRoot of a NIntegrate function See the list of data points? I don't. Bobby I have serious difficulties in solving the following problem in > Mathematica > (v.6) and would very appreciate it if anyone could give me a helping > hand with > that. To start with, I have a list of data points {{x[[i]],y[[i]]}}. Also, I have the function W. W consists of two single functions f[r] and > g[r, > x, a]: f[r_] = r^2+r+2/(r^2+r) g[r_, x_, a_] = Exp[a*Exp[-x*r]] W := NIntegrate[f[r]*g[r, x, a], {r, 0.1, 100}] What I have given for every pair of data is W[x[[i]]] == y[[i]] (see the > list > of data points). What I do not have is the corresponding value of > a[[i]]. So, I want to use FindRoot to give me the value of a[[i]] for each of my > data > pairs {x[[i]],y[[i]]}. > Although I have found many examples quite similar to this problem, I > have been > unable to adjust those to work in my case. I would be very grateful if somebody could provide me with the proper > syntax > for this. Chris > -- DrMajorBob@bigfoot.com === Subject: matrix equation Suppose T is a inversible matrix, and its elements are functions of t. Consequently, we may denote this matrix as T[t], and its first and second derivative is denoted as T'[t] and T''[t]. I want to solve a equation as follows: (A+B)T+T'==(a+b)T+2T', (A+B)T'+aBT==aT'+(ab+b)T+T''; where a,b are known constants, and A,B is what I want to get. How to express it in matrix form and solve it? === Subject: Re: Distributing square-root (1/2) power through Hi Steven, Mathematica can not simplify your expression further since it does not know what your parameters Mu, Sy , Y1 ,Y2 are: if they are general complex numbers, square root can not be taken unambiguously without indicating which branch you want. This will do what you probably want: In = result = Assuming[Mu > 0 && Sy > 0 && Y1 > 0 && Y2 > 0, Simplify[Dist]]; result // InputForm Out = Abs[E^((Mu - Y1)^2/(2*Sy^2)) - E^((Mu - Y2)^2/(2*Sy^2))]/ (E^(((Mu - Y1)^2 + (Mu - Y2)^2)/(2*Sy^2))*Sqrt[2*Pi]*Sy) Leonid > I'm playing with normal distributions, Two random points 1 and 2 with x and > y coordinates given by: px1=PDF[NormalDistribution[Mu,Sx],X1] > px2=PDF[NormalDistribution[Mu,Sx],X1] > py1=PDF[NormalDistribution[Mu,Sy],Y1] > py2=PDF[NormalDistribution[Mu,Sy],Y2] The square of the Euclidean Distance between them is SqD = (px2-px1)^2+(py2-py1)^2 Take the square root and expand of that to get Dist = Sqrt[Expand[SqD]] Now the question: How do I get the square root to act just like another power so I can > simplify this mess? I have tried PowerExpand, FullSimplify, Expand, > Simplify, and various combinations. Not sure what I'm missing here. === Subject: Re: Wolfram | Alpha: Acres per square mile? (oddities) > Unless, that is, you're more interested in stirring > up some sort of public fuss than you are in making a useful suggestion > to Wolfram|Alpha or register a complaint with them. My useful suggestion was that WRI should assign some knowledgeable person to scan this group periodically, pull out useful user feedback (taking advantage of the fact that the posts on at least some reported problems will already be collected as multiple threaded posts that will be much more useful than individual bug reports coming in randomly and separately), and then immediately distribute to the right people in WRI -- and I've since been assured privately the WRI does do more or less exactly that. === Subject: Re: Wolfram | Alpha: Acres per square mile? (oddities) ust type square miles to acres in Alpha and you're done. The Units package expects kilometer to be written as Kilo Meter. One of the first paragraphs of the documentations says so. Kilogram is the odd man out, but that's probably because its part of the CMS/SI system. === Subject: Problem with fitting Hi there, I encounter the following problem when fitting a complicated function using FindFit: when running BBWorigin = FindFit[Data2, {CHFSorigin[x] /. ABWorigin /. ABW /. BBW /. CBW /. DBW /. FGW} , {{COorigin, 4.3}}, {x}, MaxIterations -> 1000] where I previously defined the function CHFSorigin and where the rules ABWorigin, ABW, BBW, CBW, DBW and FGW were also defined, I obtain the following output by mathematica: {COorigin -> 4.3} FindFit::fmgz: Encountered a gradient that is effectively zero. The result returned may not be a minimum; it may be a maximum or a saddle point. > My first reaction was to change COorigin to a different value, but that did not change the result, i.e. the fit always stopped at the initial value. Does anybody have any ideas about how to progress from here? Christian === Subject: Re: Distributing square-root (1/2) power through exponential equation Dist = Sqrt[SqD] // PowerExpand does not what you want ? Jens > I'm playing with normal distributions, Two random points 1 and 2 with x and y coordinates given by: px1=PDF[NormalDistribution[Mu,Sx],X1] > px2=PDF[NormalDistribution[Mu,Sx],X1] > py1=PDF[NormalDistribution[Mu,Sy],Y1] > py2=PDF[NormalDistribution[Mu,Sy],Y2] The square of the Euclidean Distance between them is SqD = (px2-px1)^2+(py2-py1)^2 Take the square root and expand of that to get Dist = Sqrt[Expand[SqD]] Now the question: How do I get the square root to act just like another power so I can simplify this mess? I have tried PowerExpand, FullSimplify, Expand, Simplify, and various combinations. Not sure what I'm missing here. > === Subject: Re: Distributing square-root (1/2) power through exponential equation > I'm playing with normal distributions, Two random points 1 and 2 with x and y coordinates given by: px1=PDF[NormalDistribution[Mu,Sx],X1] > px2=PDF[NormalDistribution[Mu,Sx],X1] > py1=PDF[NormalDistribution[Mu,Sy],Y1] > py2=PDF[NormalDistribution[Mu,Sy],Y2] The square of the Euclidean Distance between them is SqD = (px2-px1)^2+(py2-py1)^2 Take the square root and expand of that to get Dist = Sqrt[Expand[SqD]] Now the question: How do I get the square root to act just like another power so I can simplify this mess? I have tried PowerExpand, FullSimplify, Expand, Simplify, and various combinations. Not sure what I'm missing here. I think the general answer is that you CAN'T get square root to behave like just another power -- if by that you mean an integer power. For example: Sqrt[x^2] is NOT the same thing as x (try x=-1), and it is one of the great advantages of Mathematica's implementation that this distinction is carefully respected. More generally, branch cuts of complex-valued functions are handled in a consistent manner, which can lead to some bewildering expressions in simple cases, but can be extremely powerful. One thing that you may find useful is to provide Assumptions when you think that will help to simplify an expression. So, in the trivial case I just mentioned, if x > 0 then you can get Mathematica to simplify appropriately: Simplify[Sqrt[x^2], x > 0] There are many cases where this is useful (e.g. Sin[n*Pi], (-1)^(2*n +1), where n is an integer). However, for the example you mention, I can't see how you would expect it to simplify? The best that I can imagine is pretty much what's returned when you give assumptions (I'm assuming there was a typo in your definition of px2? and note that the built-in EuclideanDistance function): px1=PDF[NormalDistribution[Mu,Sx],X1]; px2=PDF[NormalDistribution[Mu,Sx],X2]; py1=PDF[NormalDistribution[Mu,Sy],Y1]; py2=PDF[NormalDistribution[Mu,Sy],Y2]; assumptions = Element[{Mu,X1,X2,Y1,Y2}, Reals] && Sx>0 && Sy>0; FullSimplify[EuclideanDistance[{px1,py1}, {px2,py2}], assumptions] === Subject: Re: Manipulate suggestions Tony, I think you are correct that the StepLeft and StepRight Buttons should FIRST put the animation into a pause state. There is another problem with AppearanceElements in Animator. That is that the elements always appear in a fixed order - no matter what order they are specified in the list of elements. It would be really nice if the user could control the order. However, it is always possible to make a custom dynamic presentation, and much more fun because you don't have to waste your time trying to figure out how you can screw around Manipulate to your liking. One of the principles to variable. So we just write multiple Animators, each with their own AppearanceElements, and an InputField, all controlling n. DynamicModule[ {n = 2}, Panel[ Column[ {Row[{Animator[Dynamic[n], {1, 5}, AnimationRunning -> False, AnimationRate -> 4/5, Appearance -> Small, AppearanceElements -> PlayPauseButton], Animator[Dynamic[n], {1, 5}, AnimationRunning -> False, AnimationRate -> 4/5, Appearance -> Tiny, AppearanceElements -> ProgressSlider, ImageSize -> Tiny], Animator[Dynamic[n], {1, 5}, AnimationRunning -> False, AnimationRate -> 4/5, Appearance -> Small, AppearanceElements -> {StepLeftButton, StepRightButton}], Spacer[5], Enter n:, Spacer[5], InputField[Dynamic[n], FieldSize -> {4, 1}] }] (* Animator Row *), Dynamic@Plot[x^n, {x, 0, 1}, PlotRange -> {0, 1}, ImageSize -> 300] }](* Column *), Style[Custom Dynamic Presentation for AES, 16], BaseStyle -> {FontSize -> 16}] ] David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ Now that I've finally gotten around to learning and using Manipulate (admittedly late to the table), I have to agree that it truly does deserve the Steve Jobs/Apple appellation, Insanely great. But, a few minor gripes/suggestions: 1) Executing Manipulate[ Plot[x^n, {x, 0, 1}], {{n,2}, 1, 5, Animator}] without the Animator and then clicking the inverted + icon gives me the icon control buttons and the numeric value/data entry box (which is very valuable). Adding the Animator as above auto-opens the icon control buttons, but not the numeric field. Why not? (That is, is there a good and necessaru reason it doesn't) Is there a way to build an automated Auto-click the inverted + button for me into the Manipulate command? 2) Does anyone else agree with me that - and + single-step buttons should be side by side (just like the Slow/Fast vertical double arrows), with the Start/Stop button either at the very left end, or over just to the left of the Slow/Fast arrows)? Trivial point, perhaps, but seems like a more natural ordering. 3) And would anyone else agree that the default action if you click the single-step buttons while an animation is running should be to _stop_ the animation, and wait for further single steps (and let you click the Start arrow when you're ready to re-start). Seems to me this is the way many if not most other video and movie apps work -- and the natural way that a user would want it to work. (Otherwise, what would be the point of clicking the single step buttons during a running animation?) 4) Any simple way -- repeat, simple! -- to link the single step buttons to Left and Right (or Up/Down) Arrow keys on your keyboard. (Should that maybe be the built-in default? Doesn't nearly every keyboard have arrow keys?) Anyway, despite my other continuing critiques of Mathematica, Manipulate is a great concept, very neatly executed, and a real credit to the Wolfram team. === Subject: Re: palettes: Mathematica input > E.g. I have all the letters ready in the palette Basic Typesetting, > and I thought that right-click -> Generate Notebook was what I > wanted, but it simply copies the palette in a notebook, while I need > all the lines ButtonBox[...] // DisplayForm; .... NotebookGet[] will get you what you're asking for, but this is so easy to do with a Mathematica command I'm not sure I'd recommend that. For instance, a palette for pasting in lowercase Greek letters: CreatePalette[Grid[Partition[ (PasteButton[ToExpression[#1, StandardForm, Defer]] & ) /@ CharacterRange[[Alpha], [Omega]], 4]]] Pillsy === Subject: Re: palettes: Mathematica input > On Jun 30, 6:38 am, alexxx.ma...@gmail.com E.g. I have all the letters ready in the palette Basic Typesetting, > and I thought that right-click -> Generate Notebook was what I > wanted, but it simply copies the palette in a notebook, while I need > all the lines ButtonBox[...] // DisplayForm; .... NotebookGet[] will get you what you're asking for, but this is so easy > to do with a Mathematica command I'm not sure I'd recommend that. For > instance, a palette for pasting in lowercase Greek letters: CreatePalette[Grid[Partition[ > (PasteButton[ToExpression[#1, StandardForm, Defer]] & ) /@ > CharacterRange[[Alpha], [Omega]], 4]]] Pillsy thank you everybody, that's what I needed! alessandro === Subject: Re: palettes: Mathematica input On Jun 30, 4:38 am, alexxx.ma...@gmail.com common patterns, e.g. I'd like my custom palette to contain also all > the lower/uppercase greek letters. > There is some quick way to have the Mathematica input used to > generate an already-existing palette? > E.g. I have all the letters ready in the palette Basic Typesetting, > and I thought that right-click -> Generate Notebook was what I > wanted, but it simply copies the palette in a notebook, while I need > all the lines ButtonBox[...] // DisplayForm; .... alessandro Try putting //InputForm after the palette you just created from the right-click Generate Notebook -- and you get all the code that it takes to generate the palette. But for some reason when you re-execute this code you don't get back as good a looking palette as what the original was - can someone explain why that is? -Bob === Subject: Re: Concatenating of Graphics[] primitives? Unprotect[Graphics] Graphics[l1__, l2__, gopts : OptionsPattern[Graphics]] := Graphics[{l1, l2}, gopts] Protect[Graphics] and g1 = Graphics[Table[Circle[{0, 0}, r], {r, 1, 3}]]; g2 = Graphics[Table[Circle[{0, 0}, r], {r, 4, 5}]]; Join[g1, g2] work. Jens > Any command akin to the Join[list1, list2] command for Joining > (concatenating) two Graphics[{}] lists into a single Graphics[] list? Executing g1 = Graphics[Table[Circle[{0,0},r],{r,1,3}]]; > g2 = Graphics[Table[Circle[{0,0},r],{r,4,5}]]; > g={g1, g2}; g (* A new cell *) Show[g] (* Another new cell *) is entertaining -- if not exactly educational. > === Subject: Re: Concatenating of Graphics[] primitives? G'day, Guessing that you are looking for GraphicsRow et.al. Yas > Any command akin to the Join[list1, list2] command for Joining > (concatenating) two Graphics[{}] lists into a single Graphics[] list? Executing g1 = Graphics[Table[Circle[{0,0},r],{r,1,3}]]; > g2 = Graphics[Table[Circle[{0,0},r],{r,4,5}]]; > g={g1, g2}; g (* A new cell *) Show[g] (* Another new cell *) is entertaining -- if not exactly educational. === Subject: Re: Concatenating of Graphics[] primitives? > Any command akin to the Join[list1, list2] command for Joining > (concatenating) two Graphics[{}] lists into a single Graphics[] list? > G'day, > Guessing that you are looking for GraphicsRow et.al. > Yas === Subject: Re: Manipulate without plus symbol Manipulate[ ParametricPlot[{Cos[(1 + w)*t], Sin[w*t]}, {t, 0, 2 Pi}], {{w, 1}, 0.5, 10}, AppearanceElements -> None] what plus symbol ? Jens > Does anyone know how to get rid of the plus symbol in the top right > corner of Manipulate? I am writing a Demonstration which will run on a > public touchscreen terminal. Users should not be able to perform > Paste Bookmarks, because that would mess up the demonstration. === Subject: Re: Manipulate without plus symbol > Does anyone know how to get rid of the plus symbol in the top right > corner of Manipulate? I am writing a Demonstration which will run on a > public touchscreen terminal. Users should not be able to perform > Paste Bookmarks, because that would mess up the demonstration. > Axel Correction: You need to put the option in quotes, like HideControlsButton not HideControlsButton -- am guessing that invalid options default to None (which also works without quotes so why doesn't HideControlsButton (ie Mathemaitica leaves in blue for unknown). But come to think of it you get slightly different results with the None option vs the HideControlsButton option - both of which might e what Axel was looking for. -Bob === Subject: Re: Manipulate without plus symbol > Does anyone know how to get rid of the plus symbol in the top right > corner of Manipulate? I am writing a Demonstration which will run on a > public touchscreen terminal. Users should not be able to perform > Paste Bookmarks, because that would mess up the demonstration. > Axel You can use the option called AppearanceElements- >HideControlsButton, e.g. Manipulate[Plot[Sin[x (1 + a x)], {x, 0, 6}], {a, 0, 2}, AppearanceElements -> HideControlsButton] -Bob === Subject: Bugs in FullGraphics and AbsoluteOptions and temporary workaround There is one major bug in FullGraphics (as well as in Absolute Options): FullGraphics uses PlotRange from the AbsoluteOptions and fully ignores PlotRangePadding (new in Mathematica version 6) and AxesOrigin (new in 2) options. This is the reason for clipping the X-axis that we see here: g = Plot[Sin[x], {x, 0.2, 10}] Show[FullGraphics[g], AspectRatio -> 1/GoldenRatio] And this is also reason for wrong Ticks specifications generated by FullGraphics and AbsoluteOptions. I have developed a program for generating explicit values of PlotRange with respect to AxesOrigin and PlotRangePadding options. It is assumed in this program that PlotRangePadding has it's default value {Scaled [0.02], Scaled[0.02]}. The code follows: g = Plot[Cos[x], {x, 0.2, 10}] (*Generating explicit PlotRange with respect to PlotRangePadding and AxesOrigin*) axsOr = AxesOrigin /. AbsoluteOptions[g]; pltR = PlotRange /. AbsoluteOptions[g]; pltRPad = PlotRangePadding /. Options[g]; Which[ [CapitalDelta]x = 0.02 (pltR[[1, 2]] - pltR[[1, 1]]); [CapitalDelta]y = 0.02 (pltR[[2, 2]] - pltR[[2, 1]]); pltR = pltR + {{-[CapitalDelta]x, [CapitalDelta]x}, {-[CapitalDelta] y, [CapitalDelta]y}}; ] Do[ pltR[[i, 1]] = Min[axsOr[[i]], pltR[[i, 1]]]; pltR[[i, 2]] = Max[axsOr[[i]], pltR[[i, 2]]], {i, {1, 2}}] (*Generating the list of necessary options*) options = Table[opt -> (opt /. AbsoluteOptions[g]), {opt, {AxesOrigin, Axes, AspectRatio}}]~Join~{PlotRange -> pltR}; (*We recreate original plot, but with explicit PlotRange option*) gg = Graphics[g[[1]], options] (*FullGraphics*) ggg = Show[FullGraphics[gg], AspectRatio -> (AspectRatio /. Options [g])] (*Overlapping FullGraphics and original plot*) Graphics[{g[[1, 1]], FullGraphics[gg][[1]]}, options, ImageSize -> {260, 154}] (*Generating explicit Ticks specification*) (*This uses CustomTicks packege from http://library.wolfram.com/infocenter/MathSource/5599*) Needs[CustomTicks`] options = Append[options, Ticks -> (LinTicks @@ # & /@ pltR)]; (*We recreate original plot, but with explicit PlotRange and Ticks options*) gg2 = Graphics[g[[1]], options] (*FullGraphics*) ggg2 = Show[FullGraphics[gg2], AspectRatio -> (AspectRatio /. Options [g])] (*Overlapping FullGraphics and original plot*) Graphics[{g[[1, 1]], FullGraphics[gg2][[1]]}, options, ImageSize -> {260, 154}] And what I have also found about FullGraphics function: It doesn't appear to have been updated since V2: see bottom of the page http://reference.wolfram.com/mathematica/ref/FullGraphics.html :( === Subject: DynamicModule Timeout Does anyone know if DynamicModule has a timeout for the Initialization option, and if so what is it? I have a DynamicModule that first needs to load a large amount of data from disk before displaying, and I'm using the Initialization option in DynamicModule to do this. However, it's not working, as after a little while I get a messed up dynamic expression in the notebook. If the amount of data being loaded is small however, it does work. Mohammed === Subject: Re: LogLinearPlot strange features You essentially found the answer. The separately plotted Points have to be converted to the underlying log plot coordinates. (And these are not the same as the labeled values.) It'd be nice to have all the graphics primitives in the same coordinate, wouldn't it? Yes. Here is one way to work from the same basic data, in fact the same basic plot primitives, for all four plot types. I'm using the Presentations package DrawingTransform to transform a set of pre-computed graphics primitives to the various log plot types. The one down side of this method is that we have to use CustomTicks and CustomGridLines to specify the proper ticks and grids. However, especially with the Grids, the Mathematica choice is quite poor anyway. Besides a poor choice of values, they make the Grid lines way too dark. Grid lines should be barely visible so they don't stomp all over the data. (The following plots don't generate any out of domain messages, but you could just use Quiet on your plots anyway. If Mathematica can normally ignore non-real plot points, why can't they also ignore points outside an InterpolatingFunction domain?) Needs[Presentations`Master`] list = {{0.528, 3.3}, {0.75, 6}, {1.0607, 10}, {1.5, 15.3}, {2.121, 21.9}, {3, 29.1}, {4.243, 36.5}, {6.008, 44.1}}; f[x_] = Interpolation[list][x] Pre-compute the curve and points. basicgraphics = {Draw[f[x], {x, 0.53, 6}], AbsolutePointSize[4], Point[list]}; Regular Plot xgrids = CustomGridLines[Identity, {0, 6, 1}, {GrayLevel[.8]}]; ygrids = CustomGridLines[Identity, {0, 40, 10}, {GrayLevel[.8]}]; Draw2D[ {basicgraphics}, AspectRatio -> .5, Frame -> True, GridLines -> {xgrids, ygrids}, PlotLabel -> Linear - Linear Plot, ImageSize -> 350] LogLinearPlot xgrids = CustomGridLines[ Log[10, #] &, {-1, 1, {1, 1.5, 2, 3, 4, 5, 7}}, {GrayLevel[.8]}]; ygrids = CustomGridLines[Identity, {0, 40, 10}, {GrayLevel[.8]}]; xticks = CustomTicks[ Log[10, #] &, {-1, 1, {1, 1.5, 2, 3, 4, 5, 7} // N, {}}]; yticks = Automatic; Draw2D[ {basicgraphics /. DrawingTransform[Log[10, #1] &, #2 &] }, AspectRatio -> .5, Frame -> True, FrameTicks -> {{yticks, yticks}, {xticks, xticks // NoTickLabels}}, GridLines -> {xgrids, ygrids}, PlotLabel -> Log - Linear Plot, ImageSize -> 350] LogPlot xgrids = CustomGridLines[Identity, {0, 6, 1}, {GrayLevel[.8]}]; ygrids = CustomGridLines[ Log[10, #] &, {0, 2, Range[9]}, {GrayLevel[.8]}]; xticks = CustomTicks[Identity, {0, 6, 1, 5}]; yticks = CustomTicks[ Log[10, #] &, {0, 2, {1, 2, 3, 4, 5, 8}, {6, 7, 9}}]; Draw2D[ {basicgraphics /. DrawingTransform[#1 &, Log[10, #2] &] }, AspectRatio -> .5, Frame -> True, FrameTicks -> {{yticks, yticks // NoTickLabels}, {xticks, xticks // NoTickLabels}}, GridLines -> {xgrids, ygrids}, PlotLabel -> Linear - Log Plot, ImageSize -> 350] LogLogPlot xgrids = CustomGridLines[ Log[10, #] &, {-1, 1, {1, 1.5, 2, 3, 4, 5, 7}}, {GrayLevel[.8]}]; ygrids = CustomGridLines[ Log[10, #] &, {0, 2, Range[9]}, {GrayLevel[.8]}]; xticks = CustomTicks[ Log[10, #] &, {-1, 1, {1, 1.5, 2, 3, 4, 5, 7} // N, {}}]; yticks = CustomTicks[ Log[10, #] &, {0, 2, {1, 2, 3, 4, 5, 8}, {6, 7, 9}}]; Draw2D[ {basicgraphics /. DrawingTransform[Log[10, #1] &, Log[10, #2] &] }, AspectRatio -> .5, Frame -> True, FrameTicks -> {{yticks, yticks // NoTickLabels}, {xticks, xticks // NoTickLabels}}, GridLines -> {xgrids, ygrids}, PlotLabel -> Log - Log Plot, ImageSize -> 350] David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ I spend a lot of time working on graphics questions, but I don't spend any time working on email addresses. Is it me or Epilog doesn't work as expect with Log plots: (*a list of points*) list = {{0.528, 3.3}, {0.75, 6}, {1.0607, 10}, {1.5, 15.3}, {2.121, 21.9}, {3, 29.1}, {4.243, 36.5}, {6.008, 44.1}}; (* This works OK but *) Plot[{Interpolation[list][x]}, {x, 0.53, 6}, GridLines -> Automatic, Epilog -> {PointSize[Medium], Point[list]}] (*Those don't *) LogLinearPlot[{Interpolation[list][x]}, {x, 0.53, 6}, GridLines -> Automatic, Epilog -> {PointSize[Medium], Point[list]}] LogPlot[{Interpolation[list][x]}, {x, 0.53, 6}, GridLines -> Automatic, Epilog -> {PointSize[Medium], Point[list]}] LogLogPlot[{Interpolation[list][x]}, {x, 0.53, 6}, GridLines -> Automatic, Epilog -> {PointSize[Medium], Point[list]}] (* This does the job *) LogLin = {Log[#[[1]]], #[[2]]} & LogLinearPlot[{Interpolation[list][x]}, {x, 0.53, 6}, GridLines -> Automatic, Epilog -> {PointSize[Medium], Point[LogLin/@list]}] It'd be nice to have all the graphics primitives in the same coordinate, wouldn't it? I also keep getting that message: InterpolatingFunction::dmval: Input value {-0.634829} lies outside the range of data in the interpolating function. Extrapolation will be used. which I guess is plain wrong since Exp[-0.6348286996935327`] = 0.5300262742047284` Mathematica 7.01 / XP 32b -- Fred. === Subject: LogLinearPlot strange features Is it me or Epilog doesn't work as expect with Log plots: (*a list of points*) list = {{0.528, 3.3}, {0.75, 6}, {1.0607, 10}, {1.5, 15.3}, {2.121, 21.9}, {3, 29.1}, {4.243, 36.5}, {6.008, 44.1}}; (* This works OK but *) Plot[{Interpolation[list][x]}, {x, 0.53, 6}, GridLines -> Automatic, Epilog -> {PointSize[Medium], Point[list]}] (*Those don't *) LogLinearPlot[{Interpolation[list][x]}, {x, 0.53, 6}, GridLines -> Automatic, Epilog -> {PointSize[Medium], Point[list]}] LogPlot[{Interpolation[list][x]}, {x, 0.53, 6}, GridLines -> Automatic, Epilog -> {PointSize[Medium], Point[list]}] LogLogPlot[{Interpolation[list][x]}, {x, 0.53, 6}, GridLines -> Automatic, Epilog -> {PointSize[Medium], Point[list]}] (* This does the job *) LogLin = {Log[#[[1]]], #[[2]]} & LogLinearPlot[{Interpolation[list][x]}, {x, 0.53, 6}, GridLines -> Automatic, Epilog -> {PointSize[Medium], Point[LogLin/@list]}] It'd be nice to have all the graphics primitives in the same coordinate, wouldn't it? I also keep getting that message: InterpolatingFunction::dmval: Input value {-0.634829} lies outside the range of data in the interpolating function. Extrapolation will be used. which I guess is plain wrong since Exp[-0.6348286996935327`] = 0.5300262742047284` Mathematica 7.01 / XP 32b -- Fred. === Subject: Re: Manipulate subtleties? Why not? circlegraphics[r_] := Graphics[{Circle[{0, 0}, 1], Circle[{0, 0}, r]}, PlotRange -> 2.2, ImageSize -> 2*72] Manipulate[ circlegraphics[r], {{r, 0.5}, 0, 2, Appearance -> Labeled}] Although I guess there is nothing that says you have to do it, it always seems good practice to me to define functions with arguments so they actually do have arguments. In an Animation or Manipulate statement, graphics should have a defined fix PlotRange, else it might be changing from frame to frame, and with your example no outward indication of it. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ If I type in (as three separate cells) makeFig := Graphics[{ Circle[{0,0}, 1], Circle[{0,0}, r]}]; Manipulate[ g1 = makeFig; Show[g1, ImageSize->1*72], {{r, 0.5}, 0,2}] Manipulate[ r = rc; (* rc short for control variable *) g1 = makeFig; Show[g1, ImageSize->1*72], {{rc, 0.5}, 0,2}] the second and third cells both produce Manipulate-type output cells that appear to be OK. The slider in the second cell output isn't active: Moving it doesn't cause anything to happen The slider in the third cell animates *both* cells. Reversing the order of the second and third cells gives the same behavior. Intriguing! If I change g1 to g2 in the third line, the second cell gives a Manipulate output cell with an error msg: Radius r should be a positive number or pair of positive numbers, or a Scaled or Offset form. If I remove the initial values for the slider from both lines, the second line still gives an error but the third doesn't, apparently using 0 as the default value for rc (or does it use the 2nd value in {rc,0,1}?) Seems like the second line might have done the same for r? I guess my working rule from now on will be: The control variable(s) of Manipulate slider(s) MUST appear explicitly in the body of a Manipulate definition. [But note that this is not logically necessary: Any intelligent human, presented with either the second or the third cell would have all the information needed to do what's desired.] Meta-question: _Where_ in the user documentation would the mythical ordinary user have been expected to learn that the second line wouldn't work? === Subject: Manipulate subtleties? If I type in (as three separate cells) makeFig := Graphics[{ Circle[{0,0}, 1], Circle[{0,0}, r]}]; Manipulate[ g1 = makeFig; Show[g1, ImageSize->1*72], {{r, 0.5}, 0,2}] Manipulate[ r = rc; (* rc short for control variable *) g1 = makeFig; Show[g1, ImageSize->1*72], {{rc, 0.5}, 0,2}] the second and third cells both produce Manipulate-type output cells that appear to be OK. The slider in the second cell output isn't active: Moving it doesn't cause anything to happen The slider in the third cell animates *both* cells. Reversing the order of the second and third cells gives the same behavior. Intriguing! If I change g1 to g2 in the third line, the second cell gives a Manipulate output cell with an error msg: Radius r should be a positive number or pair of positive numbers, or a Scaled or Offset form. If I remove the initial values for the slider from both lines, the second line still gives an error but the third doesn't, apparently using 0 as the default value for rc (or does it use the 2nd value in {rc,0,1}?) Seems like the second line might have done the same for r? I guess my working rule from now on will be: The control variable(s) of Manipulate slider(s) MUST appear explicitly in the body of a Manipulate definition. [But note that this is not logically necessary: Any intelligent human, presented with either the second or the third cell would have all the information needed to do what's desired.] Meta-question: _Where_ in the user documentation would the mythical ordinary user have been expected to learn that the second line wouldn't work? === Subject: Re: Manipulate subtleties? The problem you are experiancing is mentioned in the manipulate documentation under possible issues, where it also says Manipulate only notices explicit visible parameters. The possible issues sections isn't the first thing you read about functions naturally, but when you find yourself confuesed its a good place to start, and often the problems detailed reveal a little more about the working nature of the functions. > If I type in (as three separate cells) makeFig := Graphics[{ Circle[{0,0}, 1], Circle[{0,0}, r]}]; Manipulate[ > g1 = makeFig; > Show[g1, ImageSize->1*72], > {{r, 0.5}, 0,2}] Manipulate[ > r = rc; (* rc short for control variable *) > g1 = makeFig; > Show[g1, ImageSize->1*72], > {{rc, 0.5}, 0,2}] the second and third cells both produce Manipulate-type > output cells that appear to be OK. The slider in the second cell output isn't active: Moving it > doesn't cause anything to happen The slider in the third cell animates *both* cells. Reversing the order of the second and third cells gives > the same behavior. Intriguing! If I change g1 to g2 in the third line, the second cell gives > a Manipulate output cell with an error msg: Radius r should be a > positive number or pair of positive numbers, or a Scaled or Offset form. If I remove the initial values for the slider from both lines, the > second line still gives an error but the third doesn't, apparently using > 0 as the default value for rc (or does it use the 2nd value in {rc,0,1}?) Seems like the second line might have done the same for r? I guess my working rule from now on will be: The control variable(s) of Manipulate slider(s) MUST > appear explicitly in the body of a Manipulate definition. [But note that this is not logically necessary: Any intelligent human, > presented with either the second or the third cell would have all the > information needed to do what's desired.] Meta-question: _Where_ in the user documentation would the mythical > ordinary user have been expected to learn that the second line > wouldn't work? === Subject: Precision problem in analytic expression I have a problem with some analytic expressions. I want to plot them for different parameters. However, for a certain range of parameters some out in the end, numerical precision seems to be too small resulting in some differences to the expected result: where it should be (almost) exactly one in the end the result is actually 1.000056 (= desaster...). There is one term (a csch^2) that goes with 10^15, other elementary terms range up to 10^9. I tried to set $MinPrecision to higher values but that changed nothing. I also splitted the term in smaller units and simplified them - same result. How can get a higher precision in the calculation and how can I find the term that produces the troubles. I'm not able to localize the problem. With best greetings from germany, Wieland === Subject: Re: Bug Report: Excessively thin Thin? You drew the thick line on top of the thin line. Try Graphics[{Line[{{0, 0.5}, {1, 0.5}}], Thin, Line[{{0, 0}, {1, 1}}], Thick, Line[{{1, 1}, {1, 0}}]}] Bob Hanlon Can you post a specific example of a Graphics expression which > produces no visible line on your computer? The example you mention > from the Thin documentation page (Graphics[{Thin, Line[{{0, 0}, {2, > 1}}]}]) appears correctly for me in 7.0.1 on Mac OS X 10.5.7. > Just typed in Graphics[{ Line[{{0, 0.5}, {1, 0.5}}], Thin, Line[{{0, 0}, {1, 1}}], Thick, Line[{{1, 1}, {0, 0}}]}] executed it, no visible Thin line. Selected and Saved output cell as PDF, opened with Illustrator, Selected All in Illustrator -- no Thin line there (even invisible or transparent objects appear when you Select All in Illustrator). Opened Help for Thin. First Example in the Help document, as opened, shows no Thin line, but does show Thick line. Inserted Red, directive in both parts of this Example, re-executed it. Thick line turned red, still no Thin line. Thin line does show in following Example, which uses Graphics3D. (Note: Already did and reported this same observation in original post.) Basically vanilla MacBook with Apple Cinema external display, OS 10.4.11, Mathematica 7.0.1.0, no other current glitches with Mathematica or anything else I've been running on this machine. === Subject: Re: Is Orange translucent? - Hi Syd, I am sure you will get better solutions, but here is what I did: This makes a list of all doc files that describe symbols (names of Mathematica built-in functions) In[1] = docfiles = FileNames[*.nb, $InstallationDirectory <> $PathnameSeparator <> ToFileName[{Documentation, English, System, ReferencePages, Symbols}]]; In[2] = Length[docfiles] Out[2] = 2338 (This is for M6). Then I used brute force (took about 2.5 mins on my 5 year old laptop): In[3] = (methodFiles = StringReplace[ Select[docfiles, MemberQ[Import[#], ButtonBox[Method, ___], Infinity] &], LongestMatch[__ ~~ $PathnameSeparator] :> ]) // Timing Out[3] = {145.219, {ButtonBoxOptions.nb, Button.nb, ContourPlot3D.nb, ContourPlot.nb, DensityPlot.nb, Discriminant.nb, EvaluationMonitor.nb, FindClusters.nb, FindFit.nb, FindMaximum.nb, FindMinimum.nb, Graphics3D.nb, Graphics.nb, GraphPlot3D.nb, GraphPlot.nb, Inverse.nb, LeastSquares.nb, LinearProgramming.nb, LinearSolve.nb, ListContourPlot3D.nb, ListContourPlot.nb, ListDensityPlot.nb, ListLinePlot.nb, ListPlot3D.nb, ListSurfacePlot3D.nb, method.nb, NCache.nb, NDSolve.nb, NIntegrate.nb, NMaximize.nb, NMinimize.nb, NProduct.nb, NSum.nb, NullSpace.nb, Orthogonalize.nb, ParametricPlot3D.nb, ParametricPlot.nb, PerformanceGoal.nb, PiecewiseExpand.nb, Plot3D.nb, Plot.nb, PolarPlot.nb, PossibleZeroQ.nb, RandomChoice.nb, RandomComplex.nb, RandomInteger.nb, RandomReal.nb, RandomSample.nb, RegionPlot3D.nb, RegionPlot.nb, ReliefPlot.nb, RevolutionPlot3D.nb, RowReduce.nb, SeedRandom.nb, SphericalPlot3D.nb, StepMonitor.nb, Total.nb}} In[4] = methodFiles // Length Out[4] = 57 This seems to be it (again, M6). Further automatic processing seems to be hard (but not impossible), so it is probably easier to just read through these files - there are not so many. There is also a possibility that some Method settings are not described in the file dedicated to a particular function of interest, but rather given as parts of examples in some other doc file - these are missed in this simplistic approach. But such cases, if they exist, would IMO indicate flaws in the documentation anyway, since Method settings should be described, in the first place, in the doc for a given function for which we wish to set the Method option. What I did was only to filter the docs, but everything really depends on the consistency of the documentation. Leonid > Hi David, Method -> {AxesInFront -> False} applicable to Plot[]. My question to you and the group is how can one find out what Methods > exist in general in Mathematica. I have found no searchable, consistent, way to find out what methods > exist for given functions or are applicable in general for a group of > functions. It appears to be a generic problem in the searchable Mathematica > documentation (Online or shipped documentation). Is there a simple solution? It would be very helpful to know it! Syd Geraghty B.Sc, M.Sc. sydgeraghty@mac.com Mathematica 7.0.1 for Mac OS X x86 (64 - bit) (18th February 2009) > MacOS X V 10.5.6 > PS I did quite a lot of different Internet and Mathematica search > queries and for instance found one of the few references to > identifying a new Method option: Re: Serious Problem with GridLines > === > Subject: Re: Serious Problem with GridLines > I reveived a nice answer from Chris Chiasson who passed on an answer > from James Mulnix at WRI Technical Support. It appears that Graphics now has Method as an option and among the > methods are the following: Method -> {AxesInFront -> True/False} > Method -> {GridLinesInFront -> True/False} and that gives the control we need. > The way you discovered the two Method options above was local > knowledge from James Mulnix via Chris Chiasson to you. I think this points to the fact that Methods are added in an ad hoc > way and not integrated into the documentation in a consistent way that > I can find. Also I seem to recall a previous post to this group complaining about > the Among the methods are .... without being able to get to the > complete list. > Plot[Max[0, Sin[x]], {x, 0, 2 [Pi]}, > PlotStyle -> Directive[Thick, Orange], > Method -> {AxesInFront -> False}] > > David Park > djmpark@comcast.net > http://home.comcast.net/~djmpark/ === Subject: Re: Is Orange translucent? - What Methods exist? > The AxesInFront and GridLinesInFront options should be documented in > Graphics. But should they be documented in every 2D plot type? That's > probably a lot of work. It's one of the disadvantages of organizing the > graphics around set-piece plot types. David Park Do you have to turn every one of your posts into an advertisment? :/ -- m === Subject: Re: Is Orange translucent? My suggestion would be to extend the Options function to allow a third argument Properties so that, for example, Options[Plot, Method, Values] would list all the legitimate targets for Method when it is used as an option for Plot. (This does raise a question, though, as to what form the result should take in the case of an option that does not take just one of a fixed set of values but rather values of a certain form. For example, what should the result be of Options[Plot, PlotStyle, Values]?) Perhaps there's a more descriptive word than Values. Better yet, of course, would be actual documentation in the Documentation Center! > The AxesInFront and GridLinesInFront options should be documented in > Graphics. But should they be documented in every 2D plot type? That's > probably a lot of work. It's one of the disadvantages of organizing the > graphics around set-piece plot types. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ > Hi David, {AxesInFront -> False} applicable to Plot[]. My question to you and the group is how can one find out what Methods exist > in general in Mathematica. I have found no searchable, consistent, way to find out what methods exist > for given functions or are applicable in general for a group of functions. It appears to be a generic problem in the searchable Mathematica > documentation (Online or shipped documentation). Is there a simple solution? It would be very helpful to know it! > Syd Geraghty B.Sc, M.Sc. sydgeraghty@mac.com Mathematica 7.0.1 for Mac OS X x86 (64 - bit) (18th February 2009) > MacOS X V 10.5.6 PS I did quite a lot of different Internet and Mathematica search queries > and for instance found one of the few references to identifying a new Method > option: Re: Serious Problem with GridLines === > . Subject: Re: Serious Problem with GridLines > _____ I reveived a nice answer from Chris Chiasson who passed on an answer from > James Mulnix at WRI Technical Support. It appears that Graphics now has Method as an option and among the methods > are the following: Method -> {AxesInFront -> True/False} > Method -> {GridLinesInFront -> True/False} and that gives the control we need. The way you discovered the two Method options above was local knowledge from > James Mulnix via Chris Chiasson to you. I think this points to the fact that Methods are added in an ad hoc way and > not integrated into the documentation in a consistent way that I can find. Also I seem to recall a previous post to this group complaining about the > Among the methods are .... without being able to get to the complete list. > Plot[Max[0, Sin[x]], {x, 0, 2 [Pi]}, > PlotStyle -> Directive[Thick, Orange], > Method -> {AxesInFront -> False}] > David Park > djmpark@comcast.net > http://home.comcast.net/~djmpark/ -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: Is Orange translucent? - What Methods exist? The AxesInFront and GridLinesInFront options should be documented in Graphics. But should they be documented in every 2D plot type? That's probably a lot of work. It's one of the disadvantages of organizing the graphics around set-piece plot types. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ {AxesInFront -> False} applicable to Plot[]. My question to you and the group is how can one find out what Methods exist in general in Mathematica. I have found no searchable, consistent, way to find out what methods exist for given functions or are applicable in general for a group of functions. It appears to be a generic problem in the searchable Mathematica documentation (Online or shipped documentation). Is there a simple solution? It would be very helpful to know it! Syd Geraghty B.Sc, M.Sc. sydgeraghty@mac.com Mathematica 7.0.1 for Mac OS X x86 (64 - bit) (18th February 2009) MacOS X V 10.5.6 PS I did quite a lot of different Internet and Mathematica search queries and for instance found one of the few references to identifying a new Method option: Re: Serious Problem with GridLines === . Subject: Re: Serious Problem with GridLines _____ I reveived a nice answer from Chris Chiasson who passed on an answer from James Mulnix at WRI Technical Support. It appears that Graphics now has Method as an option and among the methods are the following: Method -> {AxesInFront -> True/False} Method -> {GridLinesInFront -> True/False} and that gives the control we need. The way you discovered the two Method options above was local knowledge from James Mulnix via Chris Chiasson to you. I think this points to the fact that Methods are added in an ad hoc way and not integrated into the documentation in a consistent way that I can find. Also I seem to recall a previous post to this group complaining about the Among the methods are .... without being able to get to the complete list. Plot[Max[0, Sin[x]], {x, 0, 2 [Pi]}, PlotStyle -> Directive[Thick, Orange], Method -> {AxesInFront -> False}] David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ === Subject: Re: Is Orange translucent? - What Methods Hi David, Method -> {AxesInFront -> False} applicable to Plot[]. My question to you and the group is how can one find out what Methods exist in general in Mathematica. I have found no searchable, consistent, way to find out what methods exist for given functions or are applicable in general for a group of functions. It appears to be a generic problem in the searchable Mathematica documentation (Online or shipped documentation). Is there a simple solution? It would be very helpful to know it! Syd Geraghty B.Sc, M.Sc. sydgeraghty@mac.com Mathematica 7.0.1 for Mac OS X x86 (64 - bit) (18th February 2009) MacOS X V 10.5.6 PS I did quite a lot of different Internet and Mathematica search queries and for instance found one of the few references to identifying a new Method option: Re: Serious Problem with GridLines === Subject: Re: Serious Problem with GridLines I reveived a nice answer from Chris Chiasson who passed on an answer from James Mulnix at WRI Technical Support. It appears that Graphics now has Method as an option and among the methods are the following: Method -> {AxesInFront -> True/False} Method -> {GridLinesInFront -> True/False} and that gives the control we need. The way you discovered the two Method options above was local knowledge from James Mulnix via Chris Chiasson to you. I think this points to the fact that Methods are added in an ad hoc way and not integrated into the documentation in a consistent way that I can find. Also I seem to recall a previous post to this group complaining about the Among the methods are .... without being able to get to the complete list. > Plot[Max[0, Sin[x]], {x, 0, 2 [Pi]}, > PlotStyle -> Directive[Thick, Orange], > Method -> {AxesInFront -> False}] > David Park > djmpark@comcast.net > http://home.comcast.net/~djmpark/ === Subject: Re: Is Orange translucent? - What Methods My question to you and the group is how can one find out what Methods > exist in general in Mathematica. > It appears that Graphics now has Method as an option and among the > methods are the following: Method -> {AxesInFront -> True/False} > Method -> {GridLinesInFront -> True/False} and that gives the control we need. > The way you discovered the two Method options above was local > knowledge from James Mulnix via Chris Chiasson to you. If the two Method options listed just above were simply noted -- briefly would be fine -- near the top in the Help page for Graphics, that would: 1) Give someone working on a graphic the immediate help they needed. 2) And gently alert them to the fact that an option called Method existed, so they could dig further into it if they wanted to. (This is, in fact, the way humans learn language, isn't it?) WRI documentation all too often seems to think that if the Help page for FunctionA contains two dozen clickable links, some one of which eventually leads to a definition of ImportantOptionB, that's all that's needed. The user is apparently expected to click, read, and absorb all of what's in all of those links before using FunctionA (or break off the task on which they're trying to use FunctionA for a couple of days, until they can send a query to c.s-s.m.m and get an answer back). === Subject: Re: Bug Report: Excessively thin Thin? The thin line does not appear because it has the same position of the thick one. Graphics[{Line[{{0, 0.5}, {1, 0.5}}], Thin, Line[{{0, 0.6}, {1, 0.6}}], Thick, Line[{{1, 0}, {0, 1}}]}] works as expected in 7.0 for Microsoft Windows (32-bit) (February 18, 2009). ADL > ... > Just typed in Graphics[{ > Line[{{0, 0.5}, {1, 0.5}}], > Thin, Line[{{0, 0}, {1, 1}}], > Thick, Line[{{1, 1}, {0, 0}}]}] executed it, no visible Thin line. > .... === Subject: Re: Bug Report: Excessively thin Thin? File this one under D'oh! Using your code below, you'll see that the thin line is on *the same* line as the regular one. As such, the thick line over plots it.... > Graphics[{ > Line[{{0, 0.5}, {1, 0.5}}], > Thin, Line[{{0, 0}, {1, 1}}], > Thick, Line[{{1, 1}, {0, 0}}]}] Try, Graphics[{Line[{{0, 0.5}, {1, 0.5}}], Thin, Line[{{0, 0}, {1, 1}}], Thick}] And you'll see the line. t. === Subject: Re: Bug Report: Excessively thin Thin? > Can you post a specific example of a Graphics expression which > produces no visible line on your computer? The example you mention > from the Thin documentation page (Graphics[{Thin, Line[{{0, 0}, {2, > 1}}]}]) appears correctly for me in 7.0.1 on Mac OS X 10.5.7. Just typed in Graphics[{ > Line[{{0, 0.5}, {1, 0.5}}], > Thin, Line[{{0, 0}, {1, 1}}], > Thick, Line[{{1, 1}, {0, 0}}]}] executed it, no visible Thin line. Selected and Saved output cell as PDF, opened with Illustrator, Selected > All in Illustrator -- no Thin line there (even invisible or transparent > objects appear when you Select All in Illustrator). Opened Help for Thin. First Example in the Help document, as opened, > shows no Thin line, but does show Thick line. Inserted Red, directiv= e > in both parts of this Example, re-executed it. Thick line turned red, > still no Thin line. Thin line does show in following Example, which > uses Graphics3D. (Note: Already did and reported this same observat= ion > in original post.) Basically vanilla MacBook with Apple Cinema external display, OS > 10.4.11, Mathematica 7.0.1.0, no other current glitches with Mathematica > or anything else I've been running on this machine. Interesting. This example displays correctly for me on both 10.5 and 10.4. The fact that it also happens with Save As PDF leads me to believe the problem isn't in the rendering, but something about the graphic itself. Either it's not being generated correctly or maybe you have some global/stylesheet option set that is causing the line not to appear. Here's a few things to try to help narrow down the problem. Show Cell Expression on the resulting graphic. It should look like the following expression. Does it? Cell[BoxData[ GraphicsBox[{LineBox[{{0, 0.5}, {1, 0.5}}], {Thickness[Tiny], LineBox[{{0, 0}, {1, 1}}]}, {Thickness[Large], LineBox[{{1, 1}, {0, 0}}]}}]], Output] Does the mouse cursor change when you move it over where the line should be? Are you able to click on the invisible line to select it? Try running Mathematica with clean preferences. Quit, move ~/Library/ Mathematica/FrontEnd/init.m to a different location, start Mathematica. -Rob === Subject: Re: Bug Report: Excessively thin Thin? Can you post a specific example of a Graphics expression which > produces no visible line on your computer? The example you mention > from the Thin documentation page (Graphics[{Thin, Line[{{0, 0}, {2, > 1}}]}]) appears correctly for me in 7.0.1 on Mac OS X 10.5.7. > Just typed in Graphics[{ Line[{{0, 0.5}, {1, 0.5}}], Thin, Line[{{0, 0}, {1, 1}}], Thick, Line[{{1, 1}, {0, 0}}]}] executed it, no visible Thin line. Selected and Saved output cell as PDF, opened with Illustrator, Selected All in Illustrator -- no Thin line there (even invisible or transparent objects appear when you Select All in Illustrator). Opened Help for Thin. First Example in the Help document, as opened, shows no Thin line, but does show Thick line. Inserted Red, directive in both parts of this Example, re-executed it. Thick line turned red, still no Thin line. Thin line does show in following Example, which uses Graphics3D. (Note: Already did and reported this same observation in original post.) Basically vanilla MacBook with Apple Cinema external display, OS 10.4.11, Mathematica 7.0.1.0, no other current glitches with Mathematica or anything else I've been running on this machine. === Subject: Re: Bug Report: Excessively thin Thin? > > Can you post a specific example of a Graphics expression which > produces no visible line on your computer? The example you mention > from the Thin documentation page (Graphics[{Thin, Line[{{0, 0}, {2, > 1}}]}]) appears correctly for me in 7.0.1 on Mac OS X 10.5.7. Just typed in Graphics[{ > Line[{{0, 0.5}, {1, 0.5}}], > Thin, Line[{{0, 0}, {1, 1}}], > Thick, Line[{{1, 1}, {0, 0}}]}] executed it, no visible Thin line. You have asked for 1. A line from {0,0.5} to {1,0.5} with default thickness 2. A Thin line from {0,0} to {1,1} and 3. a Thick line from {1,1} to {0,0} Lines 2 and 3 are the _same line_, and cannot be simultaneously Thin and Thick. I get the expected output, namely a default (Thin) line from {0,0.5} to {1,0.5} and a Thick line from {1,1} to {0,0}. Perhaps you meant something like this: Graphics[{{Thin, Line[{{0, 0.5}, {1, 0.5}}]}, {Thick, Line[{{1, 1}, {0, 0}}]}}] which does produce a thin line from {0,0.5} to {1,0.5} and a thick line from {1,1} to {0,0}. -- Helen Read University of Vermont === Subject: FullForm of Plot? I know this is kind of a technical question, but I'd like to have a clearer understanding of this if someone is willing to help. A Plot expression Plot[f,List[x,xmin,xmax]] itself appears to be in FullForm. Yet, its FullForm is actually a Graphics expression. I understand that all graphics in Mathematica have the FullForm head Graphics (or Graphics3D), and that apparently curved plots (like Sin) are actually groupings of graphics primitives (Lines). But my question is, if the FullForm of a Plot expression is actually Graphics[List[Line [...],...] ], then what Mathematica *form* are Plot expressions themselves considered to be in (if not FullForm)? === Subject: Ability to match balanced parentheses using string patterns / regular I am curious, does Mathematica have the capability to match strings involving balanced parentheses? In particular, would it be possible to translate the following Perl code into Mathematica? #!/usr/bin/perl my $bal; $bal = qr /[(] # match opening paren [^()]* # match stuff that doesn't involve parens (?:(??{ $bal }) [^()]* )* # matched balanced parens + non- # parens characters [)]/x; # match closing paren # usage example: replace the argument to sqrt() function, where the argument is a string containing balanced # parens s/(sqrt)( (??{ $bal }) )/Sqrt[2]/gx; === Subject: Re: Problem with BinLists for large lists > I've been trying to use BinLists to bucket large (approx. a million > elements) lists of 3 dimensional vectors. I've noticed that BinLists > runs pretty slowly when working with large lists in general, and for > lists of this size and dimensionality actually runs out of memory. I've worked up an alternative implementation which runs pretty > quickly, and works by partitioning component-wise, then finding > intersections of each bucket. I thought it might be worth posting to > see if anyone has encountered this issue and knows more about why it > happens... Example implementation: (* generate some large lists of reals *) > {x,y,z} = RandomReal[{0,1}, {3,10^6}]; > xyz = Transpose[{x, y, z}]; (* define bin intervals *) > int = Range[0,1,0.1]; (* calculate buckets for each variable *) > {xBins, yBins, zBins} = Table[Flatten@Position[#, _?(int[[i]] <= # < > int[[i+1]] &)], {i, Length[int]-1}] & /@ {x, y, z}; (* get 3x3 grid of bins by taking intersections of the single-variable > bins *) > xyzBins = Table[Intersection[xBins[[i]], yBins[[j]], zBins[[k]]], > {i,Length@xBins}, {j,Length@yBins}, {k,Length@zBins}]; (* look at the length of each bins *) > Map[Length, xyzBins, {3}] (* get the actual points in each bin *) > binContents = Map[xyz[[#]] &, xyzBins, {3}]; (* look at points from a particular bin *) > ListPlot[Transpose[xyz[[xyzBins[[1,2,3]]]]]] (* the equivalent call to BinLists runs out of memory on my machine > (32-bit windows) *) > BinLists[xyz, {int}, {int}, {int}]; I'm not sure why BinLists doesn't use an approach like this. My > suspicion is that it may be using something like (using above > definitions): xyzBins = Outer[Intersection, xBins, yBins, zBins]; the problem being that the Outer function will effectively cause > multiple copies of each list to be generated and thus runs out of > memory. This too is about 11x faster. It goes directly to the trivariate bins and takes advantage of the bin structure. If space is a problem it doesn't need xyz; just change xyz[[L]] to {x[[L],y[[L]],z[[L]]}. (* generate some large lists of reals *) {x,y,z} = RandomReal[{0,1}, {3, n = 10^6}]; xyz = Transpose[{x,y,z}]; (* define bin intervals *) m = 10; int = N@Range[0,1,1/m]; (* calculate buckets for each variable *) Timing[{xBins, yBins, zBins} = Table[Flatten@Position[#, _?(int[[i]] <= # < int[[i+1]] &)], {i,m}] & /@ {x,y,z};] {229.94 Second, Null} (* get 3x3 grid of bins by taking intersections of the single-variable bins *) Timing[xyzBins = Table[Intersection[xBins[[i]],yBins[[j]],zBins[[k]]], {i,Length@xBins},{j,Length@yBins},{k,Length@zBins}];] {113.43 Second, Null} Timing[c = Table[{},{m},{m},{m}]; Do[h = Sequence@@Ceiling[m*xyz[[L]]]; c[[h]] = {c[[h]],L}, {L,n}]; c = Map[Flatten,c,{3}]/.{}->Sequence[];] {30.3 Second, Null} True === Subject: Re: Problem with BinLists for large lists > I've been trying to use BinLists to bucket large (approx. a million > elements) lists of 3 dimensional vectors. I've noticed that BinLists > runs pretty slowly when working with large lists in general, and for > lists of this size and dimensionality actually runs out of memory. I've worked up an alternative implementation which runs pretty > quickly, and works by partitioning component-wise, then finding > intersections of each bucket. I thought it might be worth posting to > see if anyone has encountered this issue and knows more about why it > happens... Example implementation: (* generate some large lists of reals *) > {x,y,z} = RandomReal[{0,1}, {3,10^6}]; > xyz = Transpose[{x, y, z}]; (* define bin intervals *) > int = Range[0,1,0.1]; (* calculate buckets for each variable *) > {xBins, yBins, zBins} = Table[Flatten@Position[#, _?(int[[i]] <= # < > int[[i+1]] &)], {i, Length[int]-1}] & /@ {x, y, z}; (* get 3x3 grid of bins by taking intersections of the single-variable > bins *) > xyzBins = Table[Intersection[xBins[[i]], yBins[[j]], zBins[[k]]], > {i,Length@xBins}, {j,Length@yBins}, {k,Length@zBins}]; (* look at the length of each bins *) > Map[Length, xyzBins, {3}] (* get the actual points in each bin *) > binContents = Map[xyz[[#]] &, xyzBins, {3}]; (* look at points from a particular bin *) > ListPlot[Transpose[xyz[[xyzBins[[1,2,3]]]]]] (* the equivalent call to BinLists runs out of memory on my machine > (32-bit windows) *) > BinLists[xyz, {int}, {int}, {int}]; > I'm not sure why BinLists doesn't use an approach like this. My > suspicion is that it may be using something like (using above > definitions): xyzBins = Outer[Intersection, xBins, yBins, zBins]; the problem being that the Outer function will effectively cause > multiple copies of each list to be generated and thus runs out of > memory. for a future version. As an important side note, when bins have regular spacing, it will always be faster to use the {min,max,dx} spec than the {{c1,c2,...}} cutoff spec because the dx spec can take advantage of the knowledge that the bins are regularly spaced. In this particular example, BinLists[xyz, {0, 1, 0.1}, {0, 1, 0.1}, {0, 1, 0.1}] is about 11 times faster than the suggested code. Darren Glosemeyer Wolfram Research === Subject: Re: Problem with BinLists for large lists > I've been trying to use BinLists to bucket large (approx. a million > elements) lists of 3 dimensional vectors. I've noticed that BinLists > runs pretty slowly when working with large lists in general, and for > lists of this size and dimensionality actually runs out of memory. I've worked up an alternative implementation which runs pretty > quickly, and works by partitioning component-wise, then finding > intersections of each bucket. I thought it might be worth posting to > see if anyone has encountered this issue and knows more about why it > happens... Example implementation: (* generate some large lists of reals *) > {x,y,z} = RandomReal[{0,1}, {3,10^6}]; > xyz = Transpose[{x, y, z}]; (* define bin intervals *) > int = Range[0,1,0.1]; (* calculate buckets for each variable *) > {xBins, yBins, zBins} = Table[Flatten@Position[#, _?(int[[i]] <= # < > int[[i+1]] &)], {i, Length[int]-1}] & /@ {x, y, z}; (* get 3x3 grid of bins by taking intersections of the single-variable > bins *) > xyzBins = Table[Intersection[xBins[[i]], yBins[[j]], zBins[[k]]], > {i,Length@xBins}, {j,Length@yBins}, {k,Length@zBins}]; (* look at the length of each bins *) > Map[Length, xyzBins, {3}] (* get the actual points in each bin *) > binContents = Map[xyz[[#]] &, xyzBins, {3}]; (* look at points from a particular bin *) > ListPlot[Transpose[xyz[[xyzBins[[1,2,3]]]]]] (* the equivalent call to BinLists runs out of memory on my machine > (32-bit windows) *) > BinLists[xyz, {int}, {int}, {int}]; I'm not sure why BinLists doesn't use an approach like this. My > suspicion is that it may be using something like (using above > definitions): xyzBins = Outer[Intersection, xBins, yBins, zBins]; the problem being that the Outer function will effectively cause > multiple copies of each list to be generated and thus runs out of > memory. After encoutering similar issues, I had to roll my own. Effectively, it's an efficient GatherBy with replacement (to allow for overlapping bins) and an optional reduction immediately after each bin production. It incrementally consumes a single local copy of the original data, to avoid duplicating that original more than once. I technical support), but find that uselessly slow and inefficient for my actual data volumes. I hope WRI offers something similar in the future (a hyper-efficient GatherBy with replacement). Vince Virgilio === Subject: Polynomial rewriting question Consider the following polynomials: Here x,y,z,w,h are variables; rest are constants. (1) x*z-y*z, (2) x^2*w -2*x*y*w +y^2w + p, (3) 2*s+h+x-y When we look closely at these, we notice that everywhere x and y occur, they occur as x-y. Suppose we let t= x-y, then we can rewrite the above polynomials as (1) tz (2) t^2*w (3) 2*s+h+t. How can do this in Mathematica? i.e., given the above 3 polynomials and the set of variables as input, I should get output of x-y and the 3 rewritten polynomials tz, t^2*w, 2*s+h+t. Note that the above is an example. When I apply the program to any arbitrary and large number of polynomials, in place of x-y above, I would like to get the largest polynomial (maximum number of monomial terms) with as many variables in it as possible. Andrew. === Subject: NDSolve to solve a set of loop equations I am new to mathematica and recently I am intrigued by the convenience of NDSolve function, since there is no need to write the Runge-kutta like functions myself to solve ODEs. However, if what I want to solve is a list of equations expressed in a loop way, I have no idea how to express it. For example, a set of simple equations are: Subscript[y, i]'[x] = Subscript[y, i][x] Cos[x + Subscript[y, i][x]] + i, where i=1,2,...,N; if N is small, of course I can write the equations separately, i.e. Subscript[y,1]'[x] = Subscript[y,1][x] Cos[x + Subscript[y,1][x]] + 1 Subscript[y,2]'[x] = Subscript[y,2][x] Cos[x + Subscript[y,2][x]] + 2 ... Subscript[y,N]'[x] = Subscript[y,N][x] Cos[x + Subscript[y,N][x]] + N But if N is large, this method seems clumsy, so I would like to express this kind of loop equations in a neat way. I have tried to nest do or for to control this loop, but the problem is that they can not be incorporated into the NDSolve function. Does anyone have a better solution? Haibo === Subject: Re: Compile Function Hi Christian, The reason that Integrate is slow seems that it attempts to compute the integral analytically. Why don't you use NIntegrate? You seem to be interested in numerical result anyway. In[1] = Clear[numQ]; numQ[x_?NumericQ] := NIntegrate[Qm[x, m]*g[m], {m, -[Infinity], [Infinity]}]; In[2] = numQ[0.5] // Timing Out[2] = {0.02,0.691462} I don't think that using Compile will speed up this significantly, in this particular case, Leonid I am trying to compile a function to speed up execution times. > numerical value in order to be compileable. I think this condition is met. > Still the compile function does not seem to work: > (*This example calculates the distribution of X = w * M + Z *) (* Distribution of the stochastic variable M*) g = PDF[NormalDistribution[0, 1]]; G = CDF[NormalDistribution[0, 1]]; > (* Distribution of the stochastic variable Z*) h = PDF[NormalDistribution[0, 1]]; H = CDF[NormalDistribution[0, 1]]; > (* Weight of M in X*) > w = 0.5; (*Conditional distribution of the stochastic variable X at point x=#1 > conditional on M=#2 *) Qm = Evaluate[H[(#1 - w * #2)/(Sqrt[1 - w^2])]] & > (*Unconditional distribution of the stochastic variable X at point x*) Q = Integrate[Qm[#1, m]* g[m], {m, -[Infinity], [Infinity]}]& compiledQ = Compile[{x}, Integrate[Qm[x, m]* g[m], {m, -[Infinity], > [Infinity]}]] compiledQ[1] > CompiledFunction::cfse: Compiled expression 1/2 (1+Erf[0.816497 (1.-0.5 > m)]) > should be a machine-size real number. > CompiledFunction::cfex: Could not complete external evaluation at > instruction 2; proceeding with uncompiled evaluation. > > Comments and tipps are highly welcome :)! Christian === Subject: Compile Function I am trying to compile a function to speed up execution times. numerical value in order to be compileable. I think this condition is met. Still the compile function does not seem to work: (*This example calculates the distribution of X = w * M + Z *) (* Distribution of the stochastic variable M*) g = PDF[NormalDistribution[0, 1]]; G = CDF[NormalDistribution[0, 1]]; (* Distribution of the stochastic variable Z*) h = PDF[NormalDistribution[0, 1]]; H = CDF[NormalDistribution[0, 1]]; (* Weight of M in X*) w = 0.5; (*Conditional distribution of the stochastic variable X at point x=#1 conditional on M=#2 *) Qm = Evaluate[H[(#1 - w * #2)/(Sqrt[1 - w^2])]] & (*Unconditional distribution of the stochastic variable X at point x*) Q = Integrate[Qm[#1, m]* g[m], {m, -[Infinity], [Infinity]}]& compiledQ = Compile[{x}, Integrate[Qm[x, m]* g[m], {m, -[Infinity], [Infinity]}]] compiledQ[1] CompiledFunction::cfse: Compiled expression 1/2 (1+Erf[0.816497 (1.-0.5 m)]) should be a machine-size real number. > CompiledFunction::cfex: Could not complete external evaluation at instruction 2; proceeding with uncompiled evaluation. > Comments and tipps are highly welcome :)! Christian === Subject: Re: Plot contour regions over a globe what is so complicated on plt = ContourPlot[ Re[SphericalHarmonicY[6, 3, th, phi]], {th, 0, Pi}, {phi, 0, 2 Pi}, ContourShading -> False, ContourStyle -> {Red, Green, Blue, Yellow}] Graphics3D[ {Cases[plt, _GraphicsComplex, Infinity] /. GraphicsComplex[pnts_, more___] :> GraphicsComplex[ Function[{th, phi}, 1.01*{Cos[phi]*Sin[th], Sin[phi]*Sin[th], Cos[th]}] @@@ pnts, more], Sphere[{0, 0, 0}, 1]} ] And plt = ContourPlot[ Re[SphericalHarmonicY[6, 3, th, phi]], {th, 0, Pi}, {phi, 0, 2 Pi}] Graphics3D[ {Cases[plt, _GraphicsComplex, Infinity] /. GraphicsComplex[pnts_, more___] :> GraphicsComplex[ Function[{th, phi}, 1.01*{Cos[phi]*Sin[th], Sin[phi]*Sin[th], Cos[th]}] @@@ pnts, more]} ] are also working. Jens I'm in need of some advice and any help would be appreciated. I'm trying to use Mathematica to plot a representation of coverage areas on top of a representation of a globe. But I would like to have countries outlined on the sphere. I tried the new Geo plot toolbox and to show all the countries uses a enormous amount of resources. This is not quite the solution I am hoping for. The contour regions plotted over the globe will be inputted as latitude and longitude which brings me to another missing piece of Mathematica. There doesn't seem to be a tool to plot coordinates in 3D. I believe these were all new features in v7 so I hope for many more features to come in the future. > -Mike > === Subject: Re: Plot contour regions over a globe Hi Mike, As aof v7 there are some useful geo coordinate conversion tools built- in. The following code will do the trick (be prepared to wait a minute or so): Map[ GeoPositionXYZ[GeoPosition[Reverse[#], WGS84], WGS84][[1]] &, CountryData[#, SchematicPolygon] & /@ CountryData[Countries], {4} ] // Graphics3D I don't understand your remark about plotting in 3D. Many graphics primitives can be used for 3D plotting. Just don't forget to use Graphics3D instead of Graphics to envelope them. I'm in need of some advice and any help would be appreciated. I'm trying to use Mathematica to plot a representation of coverage areas = on top of a representation of a globe. But I would like to have countries o= utlined on the sphere. I tried the new Geo plot toolbox and to show all the= countries uses a enormous amount of resources. This is not quite the solut= ion I am hoping for. The contour regions plotted over the globe will be inputted as latitude a= nd longitude which brings me to another missing piece of Mathematica. There= doesn't seem to be a tool to plot coordinates in 3D. I believe these were = all new features in v7 so I hope for many more features to come in the futu= re. > -Mike === Subject: Re: Take away the sliders > I just want to use the boxes below the sliders to enter the parameter > values. I dont want to use the sliders or the other functions coming > with Manipulate. Is there another commando i can use than manipulate, > or just a way to remove the sliders? You can use the ControlType option, either on a variable-by-variable bases or for the entire Manipulate form. Pillsy === Subject: Re: Take away the sliders You get controls for any parameter listed in the kast part of the Manipulate construct. If you don't want the control (a slider in this case) don't list it in the parmeter section of the Manipulate section and give the parameter a fixed value yourself. A bit of documentation reading and thinking also works wonders, I might add. > Hi > I just want to use the boxes below the sliders to enter the parameter > values. I dont want to use the sliders or the other functions coming > with Manipulate. Is there another commando i can use than manipulate, > or just a way to remove the sliders? === Subject: Re: Take away the sliders Manipulate[x, {x, 0, 1, InputField}] ? Jens > Hi > I just want to use the boxes below the sliders to enter the parameter > values. I dont want to use the sliders or the other functions coming > with Manipulate. Is there another commando i can use than manipulate, > or just a way to remove the sliders? > === Subject: Plot with x value in Log I need to plot an Integral, that i need to solve numerically. I need to plot 10Log10[x] versus result of integral. If i plot Plot[nIntegrate[],{x,100,1,-1}] is easy, but the plot is wrong. i need to do 10Log10 of x, not only x. But if i plot Breno === Subject: Re: Plot with x value in Log The problem statement is a bit unclear, but you might be looking for LogPlot or LogLogPlot. The {x,100,1,-1} for the x range is wrong. The format is {x, xmin, xmax}. On Jun 25, 1:12 pm, Breno Tresoldi Minzon I need to plot an Integral, that i need to solve numerically. I need to plot 10Log10[x] versus result of integral. If i plot Plot[nIntegrate[],{x,100,1,-1}] is easy, but the plot is wrong. i need to do 10Log10 of x, not only x. But if i plot Breno === Subject: Re: Plot with x value in Log you have serious problem with the correct syntax. Do you mean a double log plot, i.e., LogLogPlot[Exp[x], {x, 1, 100}] ? Jens I need to plot an Integral, that i need to solve numerically. I need to plot 10Log10[x] versus result of integral. If i plot Plot[nIntegrate[],{x,100,1,-1}] is easy, but the plot is wrong. i need to do 10Log10 of x, not only x. But if i plot Breno > === Subject: TSV files as a list of list of lists? I am loading a few GPS data files as TSV (tab separated). What I would like to do is make the loading of files a bit more dynamic, so I make a list of the file contents. But since the file contents is a list in itself, I get in trouble when I want to manipulate the data. It just takes too long. First, here is how I do it for one file only: GPS1 = Import[F:DocumentsJobbSLUxyuvwGPS.txt, TSV] (* Remove column-headers *) GPS1 = Drop[GPS1, 1] (* Make sure row 1 of column 2 or 3 doesn't contain spaces so they can be interpreted as numbers (I use swedish RT90 grid which gives coordinates in meters). *) If[Head[GPS1[[1, 2]]] == String, GPS1[[All, 2]] = ToExpression[StringReplace[GPS1[[All, 2]], -> ]]]; If[Head[GPS1[[1, 3]]] == String, GPS1[[All, 3]] = ToExpression[StringReplace[GPS1[[All, 3]], -> ]]]; (* Sort the GPS data (first column is time) *) Sort[GPS1] Now, what I would like to do; make an array of file contents (actually a list): GPS[1] = Import[F:DocumentsJobbSLUxyuvwGPS.txt,TSV]; Do[GPS[1] = ReplacePart[GPS[1], {i,2} -> ToExpression[StringReplace[GPS1[[All, 2]], -> ]]], {i, 1, Length[GPS[1]]}]; Sort[GPS[1]] This second part takes a very long time to do, because ReplacePart[] has to work through every line one at a time rather than using [All, x] as I do in the first example. Is there any way of doing this faster? === Subject: Re: *slowing down* a Mathematica process (Dynamic/Refresh question) Hi Michael, Here is a slightly modified version of your code. I replaced your outside source with Random[] to get some live 'data'. FinishDynamic should only be necessary if you want to display all updates of high frequency events. The key here is to set TrackedSymbols to {} because every change in holder causes an additional trigger event. I've added the variable c that is incremented all the time to show that execution and display occur with the same rate. c = 1; DynamicModule[{holder}, Dynamic[Refresh[{c++, holder = Random[]}, UpdateInterval -> 1, TrackedSymbols -> {}]]] To see why this works examine the following example in which holder remains the same and : c = 1; DynamicModule[{holder}, Dynamic[Refresh[{c++, holder = 1}, UpdateInterval -> 1, TrackedSymbols -> {holder}]]] and here were c = 1; DynamicModule[{holder}, Dynamic[Refresh[{c++, holder = 1}, UpdateInterval -> 1, TrackedSymbols -> {holder, c}]]] BTW UpdateInterval->t only asks for an update MINIMALLY once every t seconds (if possible). It does not force the update interval to be t seconds. > I hope to use Mathematica as an interface to an outside process, in > which it periodically polls an outside data source and performs > calculations on the data. The problem is, the loop is quick and > Mathematica polls the outside datasource too often. UpdateInterval does > not help (I think it effects how often the updated results are > displayed, but the polling continues as quickly as Mathematica can do > it). Adding a call to Pause[] doesn't help either, as it causes the > entire session to freeze and become unusable. I have tried this a variety of ways, getting the same behavior each > time. A schematic of one version of the code appears below DynamicModule[{holder}, > Dynamic[Refresh[FinishDynamic[]; holder = callToOutsideDataFeed[], > UpdateInterval -> 1]] Are there any Dynamic/Refresh gurus out there who can help? > Michael Stern === Subject: stirring chocolate pudding backwards: identifying coordinates Some background to start, which I'll follow with two questions: The following function samples sets of coordinates from a multi-dimensional simplex: sampleSimplex[sampleSize_, dimensions_] := Normalize[#, Total](*)*)& /@ RandomReal[ExponentialDistribution[2], {sampleSize, dimensions}] Each set of coordinates (sub-lists in the output) totals 1. The following graphs the coordinates so you can see what the code does: Graphics3D[Point /@ sampleSimplex[1000, 3, 0, 1], ImageSize -> 250, ViewPoint -> {Pi, Pi/2, 2}] To keep things simple let's generate 4 sets of coordinates, each with 3 dimensions: samples = sampleSimplex[4, 3] { {0.375153,0.412505,0.212342}, {0.470678,0.360788,0.168533}, {0.0510186,0.828575,0.120407}, {0.24481,0.00851303,0.746677} } Again note: each sub-list totals 1. Also in an actual application I would take many more samples from the simplex. Next, I generate time series data for just 3 intervals with the same dimensionality as the above: values = RandomReal[{.08, 1.2}, {3, 3}] { {0.518072,0.490701,0.813364}, {0.404083,0.356724,0.362498}, {0.507292,0.436016,0.247148}, } The next function calculates a weighted average of all the sets of coordinates, with the weights in proportion to the corresponding time series values. Note: each sub-list of values corresponds to a single time interval whereas the following function will average the values of the entire set of sub-lists in the list samples at each time interval. weightedAverage[values_, samples_] := Mean[(t = #; 1 + Inner[Times, t, # - 1, Plus] & /@ values) & /@ samples] weightedAverages = weightedAverage[values, samples] { 0.599181 0.372042 0.397434 } Next I need to determine 2 things. I need to identify the specific coordinates associated with: 1. the weighted average value at each interval and 2. the highest value at each interval. To help clarify this (I hope), I think of the triangular surface depicted in the Graphics3D[] above and imagine a value axis extending perpendicular to it. This represents a single time interval. I picture that the weightedAverage[] function calculates a value for each point on the surface hovering above the samples triangle. It then averages them. So one can imagine a second surface hovering above the first representing the values associated with each point of the first. So, again I need to identify the point associated with the highest value at each interval (this could only come from the highest values point from the list, samples) and similarly the point associated with the weighted average value (this might or might not be a point within the list, samples because the weighted average value might fall at a point between the samples). Any help much appreciated, I hope everyone hasn't disappeared for the summer. A === Subject: Re: *slowing down* a Mathematica process (Dynamic/Refresh question) > I hope to use Mathematica as an interface to an outside process, in > which it periodically polls an outside data source and performs > calculations on the data. The problem is, the loop is quick and > Mathematica polls the outside datasource too often. UpdateInterval does > not help (I think it effects how often the updated results are > displayed, but the polling continues as quickly as Mathematica can do > it). Adding a call to Pause[] doesn't help either, as it causes the > entire session to freeze and become unusable. I have tried this a variety of ways, getting the same behavior each > time. A schematic of one version of the code appears below DynamicModule[{holder}, > Dynamic[Refresh[FinishDynamic[]; holder = callToOutsideDataFeed[], > UpdateInterval -> 1]] Are there any Dynamic/Refresh gurus out there who can help? > Michael Stern To restate your problem in a way which can be observed without your code, I think you're looking for this... x = 0; Dynamic[Refresh[x++, UpdateInterval -> 1]] to update at 1 second intervals rather than the minimum of 1 second and the amount of time it takes to change x (which, in this case, is far less than 1 second). To do this, you should do something like... x = 0; Dynamic[Refresh[Refresh[x++, None], UpdateInterval -> 1]] I.e., you're removing entirely the trigger of the changing value of x that causes the Dynamic to update, then adding a new trigger which causes an update every second. John Fultz jfultz@wolfram.com User Interface Group Wolfram Research, Inc. === Subject: Re: Take away the sliders Manipulate[a + b, {{a, 0}, ControlType -> InputField}, {{b, 0}, ControlType -> InputField}, FrameLabel -> {None, None, a + b, None}] Manipulate[a + b, {{a, 0}, InputField}, {{b, 0}, InputField}, FrameLabel -> {None, None, a + b, None}] Bob Hanlon Hi I just want to use the boxes below the sliders to enter the parameter values. I dont want to use the sliders or the other functions coming with Manipulate. Is there another commando i can use than manipulate, or just a way to remove the sliders? === Subject: Re: *slowing down* a Mathematica process (Dynamic/Refresh John, that's great. One question -- why the nested calls to Refresh[]? Michael > To restate your problem in a way which can be observed without your code, I > think you're looking for this... x = 0; Dynamic[Refresh[x++, UpdateInterval -> 1]] to update at 1 second intervals rather than the minimum of 1 second and the > amount of time it takes to change x (which, in this case, is far less than 1 > second). To do this, you should do something like... x = 0; Dynamic[Refresh[Refresh[x++, None], UpdateInterval -> 1]] I.e., you're removing entirely the trigger of the changing value of x that > causes the Dynamic to update, then adding a new trigger which causes an update > every second. > John Fultz > jfultz@wolfram.com > User Interface Group > Wolfram Research, Inc. === Subject: changing color, size etc on text Hi I want to modify text and numbers here and there. These are the places where i want to change color, size etc... Isn't there just one way of doing this?? ive tried using Style which works in some places, but not here... 1:In the PlotLabel for my ListLinePlot: I have modified the words, but i dont know how to make the numbers and $ to be changed into the same style PlotLabel -> Style[Accumulated Amount, Bold, Italic, Blue] NumberForm[Last[#], ExponentFunction -> (If[Abs[#] <= 15, Null, #] &), NumberSigns -> {-$ , $}, NumberPadding -> {, 0}] 2: In the labels for my BarChart. I want the number and the text to be changed ChartLabels -> Style[Accumulated Amount, Bold, Italic, Blue] Placed[{$ per month required }, Top], LabelingFunction -> Above 3: Finally in the ChartLegends of my piechart. ChartLegends -> {Added Contributions, Initial Investment, Growth, Target Amount}], === Subject: Re: changing color, size etc on text Ad 1: you multiplied Style[ ] with NumberForm[ ]. Actually, you probably want Accumulated Amount to be joined with the NumberForm. You can use the StringJoin operator (infix form <>) to do that. But first convert the NumberForm to a string using ToString. The # is Last doesn't make sense. There's no corresponding &. Don't know what you want to do there. So, for the time being it should look like Plot[x, {x, 0, 2}, PlotLabel -> Style[Accumulated Amount <> ToString[ NumberForm[ Last[#], ExponentFunction -> (If[Abs[#] <= 15, Null, #] &), NumberSigns -> {-$ , $}, NumberPadding -> {, 0} ] ], Bold, Italic, Blue] ] > Hi > I want to modify text and numbers here and there. These are the places > where i want to change color, size etc... > Isn't there just one way of doing this?? ive tried using Style which > works in some places, but not here... 1:In the PlotLabel for my ListLinePlot: I have modified the words, but > i dont know how to make the numbers and $ to be changed into the > same style PlotLabel - Style[Accumulated Amount, Bold, Italic, Blue] NumberForm[Last[#], > ExponentFunction -> (If[Abs[#] <= 15, Null, #] &), > NumberSigns -> {-$ , $}, NumberPadding -> {, 0}] 2: In the labels for my BarChart. I want the number and the text to be > changed ChartLabels -> Style[Accumulated Amount, Bold, Italic, Blue] > Placed[{$ per month required }, Top], LabelingFunction -> Above 3: Finally in the ChartLegends of my piechart. > ChartLegends -> {Added Contributions, Initial Investment, > Growth, Target Amount}], === Subject: InputString dialog with ENTER-key for inserting end of line I need to create custom Input-dialog with possibility to enter multiline texts. InputString[] requires to use Shift+Enter for inserting the end of line. I would want to use simply Enter. Is it possible? === Subject: Points In/Out in 3D shapes Hallo All Mathematica gurus, I have the following code which helps to find if a point is inside or outside the 2D polygon. pnPoly[{testx_, testy_}, pts_List] := Xor @@ ((Xor[#[[1, 2]] > testy, #[[2, 2]] > testy] && ((testx - #[[2, 1]]) < (#[[1, 1]] - #[[2, 1]]) (testy - #[[2, 2]])/(#[[1, 2]] - #[[2, 2]]))) & /@ Partition[pts, 2, 1, {2, 2}]) pol = {{-1, -1}, {0, 0}, {1, -1}, {0, 1}, {1, 0}}; Graphics[{PointSize[Large], {FaceForm[LightGray], EdgeForm[Black], Polygon[pol]}, If[pnPoly[#, pol], {Blue, Point[#]}, {Red, Point[#]}] & /@ RandomReal[{-1, 1}, {400, 2}]}] Clear[pol] Ok. this works really good!. How can I test if a random point is inside or outside in a given volume of any 3D shaped object. I need to count the points that are inside the volume. Any suggestons ? === Subject: Re: Points In/Out in 3D shapes if your shaped object is an implicit function like x^2+y^2+z^2-1 for a sphere of radius 1 than the sign of this implicit function serve as inside/ outside indicator. If you object is build up from tetrahedrons you mist check if the point is in one of the tetrahedrons. If you have just the surface of the 3d object you must split the object into tetrahedrons first. Jens > Hallo All Mathematica gurus, > I have the following code which helps to find if a point is inside or > outside the 2D polygon. pnPoly[{testx_, testy_}, pts_List] := > Xor @@ ((Xor[#[[1, 2]] > testy, #[[2, 2]] testy] && ((testx - #[[2, > 1]]) < (#[[1, 1]] - #[[2, > 1]]) (testy - #[[2, 2]])/(#[[1, 2]] - #[[2, 2]]))) & /@ > Partition[pts, 2, 1, {2, 2}]) > pol = {{-1, -1}, {0, 0}, {1, -1}, {0, 1}, {1, 0}}; > Graphics[{PointSize[Large], {FaceForm[LightGray], EdgeForm[Black], > Polygon[pol]}, > If[pnPoly[#, pol], {Blue, Point[#]}, {Red, Point[#]}] & /@ > RandomReal[{-1, 1}, {400, 2}]}] > Clear[pol] Ok. this works really good!. > How can I test if a random point is inside or outside in a given > volume of any 3D shaped object. > I need to count the points that are inside the volume. Any > suggestons ? === Subject: Re: Points In/Out in 3D shapes A brute force approach: 1. Find an arbitrary point outside the volume (for instance by finding the Max of all coordinates and adding 1). 2. Count the number of intersections of a line connecting this point and the test point with the polygons making up the volume. 3. If the number of intersections is odd, the test point is in the volume, otherwise it's not. > Hallo All Mathematica gurus, > I have the following code which helps to find if a point is inside or > outside the 2D polygon. pnPoly[{testx_, testy_}, pts_List] := > Xor @@ ((Xor[#[[1, 2]] > testy, #[[2, 2]] testy] && ((testx - #[[2, > 1]]) < (#[[1, 1]] - #[[2, > 1]]) (testy - #[[2, 2]])/(#[[1, 2]] - #[[2, 2]]))) & /@ > Partition[pts, 2, 1, {2, 2}]) pol = {{-1, -1}, {0, 0}, {1, -1}, {0, 1}, {1, 0}}; > Graphics[{PointSize[Large], {FaceForm[LightGray], EdgeForm[Black], > Polygon[pol]}, > If[pnPoly[#, pol], {Blue, Point[#]}, {Red, Point[#]}] & /@ > RandomReal[{-1, 1}, {400, 2}]}] > Clear[pol] Ok. this works really good!. > How can I test if a random point is inside or outside in a given > volume of any 3D shaped object. > I need to count the points that are inside the volume. Any > suggestons ? > === Subject: Re: FindInstance over Integers > Hello -- I'm working on a project which requires the program to determine > whether a given set of equalities and inequalities is satisfiable over > the integers. Of course, this problem is not decidable in general. > But I just need a good enough function that will at least report > that a set of constraints is satisfiable only if it actually is, and > work across some fairly easy cases. FindInstance is the obvious > function to use, but it seems to fail for constraints that are very > easy to satisfy. The simplest example I can come up with is this: FindInstance[x == 2^y && x > 2, {x, y}, Integers] Clearly, {x->4, y->2} would satisfy these constraints, but Mathematica > reports that the methods available to FindInstance are > insufficient.... It may be relevant that if I change x > 2 to x > 1, then > Mathematica has no problem finding a solution. Are there any workarounds or alternatives to this approach? -Zac Good day, A modest proposal : In[1]:= myFindInstance[ex_, vars_List, Integers, n_:1, m_:100]:= Module[{tup = Tuples[Range[-m, m], Length[vars]], fun, sel, res}, fun = Function[vars, {vars, ex}]; sel = Select[fun[#[[1]], #[[2]]]& /@ tup, Last] [[All,1]]; res = Thread[{x,y}->#]& /@ sel; res[[1 ;; n]] ]; In[2]:= myFindInstance[x == 2^y && x > 2, {x, y}, Integers, 2] Out[2]= {{x -> 4, y -> 2}, {x -> 8, y -> 3}} In[3]:= FindInstance[x == 2^y && x > 2, {x, y}, Integers, 2] FindInstance::nsmet: The methods available to FindInstance are insufficient to find the requested instances or prove they do not exist. > Out[3]= FindInstance[x == 2^y && x > 2, {x, y}, Integers, 2] -- V.Astanoff === Subject: Re: FindInstance over Integers > Hello -- > I'm working on a project which requires the program to determine > whether a given set of equalities and inequalities is satisfiable over > the integers. Of course, this problem is not decidable in general. > But I just need a good enough function that will at least report > that a set of constraints is satisfiable only if it actually is, and > work across some fairly easy cases. FindInstance is the obvious > function to use, but it seems to fail for constraints that are very > easy to satisfy. The simplest example I can come up with is this: > FindInstance[x == 2^y && x > 2, {x, y}, Integers] > Clearly, {x->4, y->2} would satisfy these constraints, but Mathematica > reports that the methods available to FindInstance are > insufficient.... > It may be relevant that if I change x > 2 to x > 1, then > Mathematica has no problem finding a solution. > Are there any workarounds or alternatives to this approach? > -Zac Good day, A modest proposal : In[1]:= myFindInstance[ex_, vars_List, Integers, n_:1, m_:100]:= > Module[{tup = Tuples[Range[-m, m], Length[vars]], fun, sel, res}, > fun = Function[vars, {vars, ex}]; > sel = Select[fun[#[[1]], #[[2]]]& /@ tup, Last] [[All,1]]; > res = Thread[{x,y}->#]& /@ sel; > res[[1 ;; n]] > ]; In[2]:= myFindInstance[x == 2^y && x > 2, {x, y}, Integers, 2] > Out[2]= {{x -> 4, y -> 2}, {x -> 8, y -> 3}} In[3]:= FindInstance[x == 2^y && x > 2, {x, y}, Integers, 2] > FindInstance::nsmet: The methods available to FindInstance > are insufficient to find the requested instances or prove they do not > exist. > Out[3]= FindInstance[x == 2^y && x > 2, {x, y}, Integers, 2] -- > V.Astanoff- Masquer le texte des messages pr=E9c=E9dents - - Afficher le texte des messages pr=E9c=E9dents - I omitted to replace {x,y} by 'vars' but I need some help because there is still something wrong with vars : local scope conflict. What should I modify ?... === Subject: Re: solving integral equations Hi Eugene, I think the best approach is to convert the Integral equation to a Differential equation and then solve that numerically with NDSolve (this will spare you the trouble of searching for packages that work etc). There is an excellent site called EqWorld The World of Mathematical Equations by Andrei D. Polyanin which has a lot of related material on how to go from Int. Eqs-> ODEs. The site is this: http://eqworld.ipmnet.ru/ Sorry, if I didn't answer your question exactly, but that's what I did when I had a similar problem. === Subject: Re: soap films I don't know how we are to see the example you give below. Is that a web address? I'm certain it is possible to represent soap film surfaces with Mathematica. Here is an example of a minimal surface parametrization (Enneper's minimal surface) and a plot of it: enneper[u_, v_] := {u - u^3/3 + u v^2, -v + v^3/3 - v u^2, u^2 - v^2} ParametricPlot3D[enneper[u, v], {u, -3, 3}, {v, -3, 3}] This is from an excellent book: Alfred Gray, Modern Differential Geometry of Curves and Surfaces with Mathematica, Second Edition, 1998, CRC Press. Specifically with: Chapter 30. Minimal Surfaces Chapter 31. Minimal Surfaces and Complex Variables David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ Hi All, I'm an architect and I trying to apply complex geometry for buildings. Now I'm engaged in simulating of soap films, and my question is how it's possible to simulate soap films(see the picture)/Users/dimitrydemin/Pictures/iPhoto Library/Originals/2009/ stadel/Picture 10.png with mathematica? Dimitry === Subject: Re: ListLinePlot Marker Location I think it's a rounding error when going from numbers to pixels. Try the following and play with the size of the graphic. s1 = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0}; ListLinePlot[s1, PlotRange -> All, PlotMarkers -> Graphics[{AbsolutePointSize[8], Point[{0, 0}]}], Prolog -> {AbsolutePointSize[10], Red, Point[{7, 1}]}] > I believe that the markers in ListLinePlot are not centered on the > actual points. Please see the following example: s1 = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0}; > ListLinePlot[s1, PlotRange -> All, PlotMarkers -> Automatic, > Prolog -> {AbsolutePointSize[10], Red, Point[{7, 1}]}] Any ideas? > Kevin === Subject: Re: ListLinePlot Marker Location something like s1 = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0}; ListLinePlot[s1, PlotRange -> All, PlotMarkers -> [ThinSpace][EmptyCircle], Prolog -> {AbsolutePointSize[10], Red, Point[{7, 1}]}] should improve it. Jens > I believe that the markers in ListLinePlot are not centered on the > actual points. Please see the following example: > s1 = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0}; > ListLinePlot[s1, PlotRange -> All, PlotMarkers -> Automatic, > Prolog -> {AbsolutePointSize[10], Red, Point[{7, 1}]}] > Any ideas? > Kevin > === Subject: Re: ListLinePlot Marker Location Oh... sorry I think I see what you mean now. 2009/6/24 Kevin J. McCann : > I believe that the markers in ListLinePlot are not centered on the > actual points. Please see the following example: > s1 = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0}; > ListLinePlot[s1, PlotRange -> All, PlotMarkers -> Automatic, > Prolog -> {AbsolutePointSize[10], Red, Point[{7, 1}]}] > Any ideas? > Kevin -- Peter Lindsay === Subject: Re: Ansatz? > Wolfram MathWorld says: An ansatz is an assumed form for a mathematical statement > that is not based on any underlying theory or principle. SEE ALSO: Conjecture, Hypothesis, Principle, Proposition Somewhere I've picked up the idea that ansatz can also be used to > indicate the form or the approach -- more specifically, something > like the choice of coordinates and variables and equations -- the > geometry and notation so to speak -- in which one sets up a problem or > a calculation. The underlying theory or principles in my interpretation can be > perfectly clear, and no Conjectures or Hypotheses need be involved. > One is simply setting up the calculation using this ansatz, in order to > calculate certain consequences or numerical results (a calculation which > one, of course, carries out using Mathematica). Is my interpretation of this term off the mark? (Wikipedia's > explanation of the term seems to me considerably closer to my > understanding than to Wolfram's definition.) Also, ansatz might relate etymologically to ersatz, which means cheap substitute. Vince Virgilio === Subject: Re: Ansatz? > Wolfram MathWorld says: > An ansatz is an assumed form for a mathematical statement > that is not based on any underlying theory or principle. > SEE ALSO: Conjecture, Hypothesis, Principle, Proposition > Somewhere I've picked up the idea that ansatz can also be used to > indicate the form or the approach -- more specifically, something > like the choice of coordinates and variables and equations -- the > geometry and notation so to speak -- in which one sets up a problem or > a calculation. > The underlying theory or principles in my interpretation can be > perfectly clear, and no Conjectures or Hypotheses need be involved. > One is simply setting up the calculation using this ansatz, in order to > calculate certain consequences or numerical results (a calculation which > one, of course, carries out using Mathematica). > Is my interpretation of this term off the mark? (Wikipedia's > explanation of the term seems to me considerably closer to my > understanding than to Wolfram's definition.) Also, ansatz might relate etymologically to ersatz, which means > cheap substitute. Ansatz in German etymologically refers to put a tool in working position, eg the scalpell by the doctor or the pencil of a painter. One uses it in cocking and chemistry, where you put some ingredients in a pot, make fire and look what is boiling out. And finally one makes an Ansatz in order to speak a sentence or to proof a theorem (both words mean Satz in German) -- but you fail because you forgot to switch on your brain. Always the Ansatz is meant as crucial for the outcome. The Ansatz generally means a bundle of methods and ideas applied to solve a given problem. In mathematics it is used for a setting of special class of solutions with some free parameters, if one is able to solve the complexity reduced problem in the parameter space. Standard examples are reductions of linear differential equations to algebraic equations by a Fourier ansatz with a system of functions fitting the boundary conditions or the solution of nonlinear ones fitting the symmetries with a Bethe ansatz. -- Roland Franzius === Subject: Re: Ansatz? Also, ansatz might relate etymologically to ersatz, which means > cheap substitute. No it doesn't. Ersatz can be translated in many ways. But it doesn't inherently involve any assessment, or quality statement. Some common translations are: replacement alternative compensation reimbursement reparation substitute Markus === Subject: Re: Ansatz? > Somewhere I've picked up the idea that ansatz can also be used to > indicate the form or the approach -- more specifically, > something > like the choice of coordinates and variables and equations -- the > geometry and notation so to speak -- in which one sets up a > problem o= > r > a calculation. > I would say, that this is the common understanding of ansatz in > science (at least for a native german speaker). An example would be > the > german word Loesungsansatz, meaning the initial choice of how to > approach > (and solve) a given problem, > e.g. the starting point of a mathematical proof or the set of initial > assumptions. > Wolfram MathWorld says: > An ansatz is an assumed form for a mathematical statement > that is not based on any underlying theory or principle. > SEE ALSO: Conjecture, Hypothesis, Principle, Proposition > So, to assume something without any prior derivation could be an > ansatz, but > usually an ansatz would be based on some reasonable assumptions or > additional > knowledge, so not based on ANY underlying theory or principle > sounds > too > much like a crystal ball. > Markus I agree with Markus. > An Ansatz is an assumption, that is a statement which is considered > (at least temporarily) true. > The description given in wikipedia not based on ANY underlying theory > or principle sounds to me more like the definition of Axiom, which > is a statement considered true permanently (at least within a given > theory) > During the course of a demonstration an Ansatz could turn out to be > self-contradictory and therefore false (this happens in reductio ad > absurdum proofs), while an Axion should never turn out self- > contradictory (unless your theory is incoherent). > Could you give an reference to any use of Ansatz (in English language papers) in which an Ansatz could turn out to be self- contradictory and therefore false ? In my experience, in English, the word Ansatz is never used in this sense. The most common use of Ansatz occurs in the context of solving PDE's and boundary value problems where it takes the following form: you assume that there is a solution having some special form with some unknown parameters, you substitute this in the equation and then find the parameters. Once you have found the parameters the form is justified - a priori there was no reason to assume that a solution of this form must exist. Of course this approach could fail in principle but it never does - if it did nobody would call this an Ansatz. This kind of meaning of ansatz seems to be most common in physics and applied mathematics (for example the Bethe Ansatz. By the way, not that here http://en.wikipedia.org/wiki/Bethe_ansatz Wikipedia suggests the words conjecture and guess. Actually educated guess seems to be more like it). There are also some named Ansatzes in mathematics: for example the Langlands Ansatz in the theory of elliptic curves, the Sinai-Chernov Ansatz in the ergodic theory of billiards, which are actually theorems which are used as starting point of some procedure. However, I have never heard of an Ansatz that fails, i.e. an incorrect guess. Of course many such would-be ansatzes are invented every day but they generally to not survive long enough to be called an ansatz. Andrzej Kozlowski === Subject: Re: display of graphics primitives Why should the grass be green, why do I have to press 'send' when sending mail and why can't I leave my microwave oven door open while it's doing its job? And why, just why don't I ever win the lottery? Count your blessings. Before V6, you had to enclose Graphics with Show to actually generate visible graphics. > Why do you have to place graphics primitives in the Graphics[ ] > expression in order for them to be displayed graphically? Why doesn't, > for example, Circle[ ] display as a graphic in StandardForm? Why must > it be Graphics[Circle[ ]]? === Subject: Re: display of graphics primitives On Jun 25, 7:09 am, Sjoerd C. de Vries sending mail and why can't I leave my microwave oven door open while > it's doing its job? And why, just why don't I ever win the lottery? LOL! But I think you forgot the classic, Why is the sky blue? the thinking (principles) behind Mathematica's language design. Count your blessings. Before V6, you had to enclose Graphics with Show > to actually generate visible graphics. Show... now there's another command I don't really understand the point of! For another day, perhaps. > === Subject: Re: display of graphics primitives Because Graphics is the image and Circle is one of many primitives that can be part of the image. If Circle itself produced an image, how could you combine it with other Circles or primitives in one image? The Presentations package also allows the primitives produced by all the plot types to be treated directly as graphics primitives and combined directly with other graphics directives and primitives. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ Why do you have to place graphics primitives in the Graphics[ ] expression in order for them to be displayed graphically? Why doesn't, for example, Circle[ ] display as a graphic in StandardForm? Why must it be Graphics[Circle[ ]]? === Subject: Re: display of graphics primitives > If Circle itself produced an image, how could you > combine it with other Circles or primitives in one image? Well, I might be going out on a limb here, but why can't a primitive itself produce an image *and* primitives enclosed in Graphics also produce an image? What's the hurt (disadvantage) if the StandardForm of primitive expressions were graphical? The Presentations package also allows the primitives produced by all the > plot types to be treated directly as graphics primitives and combined > directly with other graphics directives and primitives. David Park > djmp...@comcast.nethttp://home.comcast.net/~djmpark/ === Subject: Re: display of graphics primitives because you are not identical to your photo. Jens > Why do you have to place graphics primitives in the Graphics[ ] > expression in order for them to be displayed graphically? Why doesn't, > for example, Circle[ ] display as a graphic in StandardForm? Why must > it be Graphics[Circle[ ]]? > === Subject: Re: display of graphics primitives On Jun 25, 7:12 am, Jens-Peer Kuska because you are not identical to your photo. Yes, but the symbolic expression Graphics[Circle[ ] ] is no more identical to an actual circle than the symbolic expression Circle[ ] is, so I'm not sure I follow your thought. > Jens === Subject: Re: Possible bug in Mathematica 7 using ColorFunction but you don't mean the greek mu, you mean a micro and that is SetOptions[Plot, Frame -> True, FrameLabel -> Wavelength ([Micro]m)]; Jens > Problem: use of ColorFunction affects spacing of Greek characters in Frame label. Here is a simple example of the problem: SetOptions[Plot, Frame -> True, FrameLabel -> Wavelength ([Mu]m)] > Plot[y = x, {x, 1, 1000}, > ColorFunction -> (ColorData[VisibleSpectrum][#] &), > ColorFunctionScaling -> False, Filling -> Axis] Notice the space between the Greek character [Mu] and the m, causing the m to overlap the right parantheses. The space disappears if you remove the ColorFunction gradient from the plot parameters. Also, if you change [Mu] to a standard character like m, the formatting looks perfectly acceptable. To be honest, I don't really understand the reason for the [#] & following the ColorData tag, but the gradient doesn't seem to work properly without it. Is my syntax correct? > === Subject: Re: Possible bug in Mathematica 7 using ColorFunction I noticed that by putting a space between the mu and m in setoptions, it looks OK 2009/6/24 Jeff Lawlis : > Problem: use of ColorFunction affects spacing of Greek characters in Frame label. Here is a simple example of the problem: SetOptions[Plot, Frame -> True, FrameLabel -> Wavelength ([Mu]m)] > Plot[y = x, {x, 1, 1000}, > ColorFunction -> (ColorData[VisibleSpectrum][#] &), > ColorFunctionScaling -> False, Filling -> Axis] Notice the space between the Greek character [Mu] and the m, causing them to overlap the right parantheses. The space disappears if you remove the ColorFunction gradient from the plot parameters. Also, if you change [Mu] to a standard character like m, the formatting looks perfectly accep table. To be honest, I don't really understand the reason for the [#] & following the ColorData tag, but the gradient doesn't seem to work properly without it. Is my syntax correct? -- Peter Lindsay === Subject: Re: Possible bug in Mathematica 7 using ColorFunction Hi Jeff, I don't have the problem with the overlapping m. The impact of the presence of the color function seems to be that the font is replaced by a bitmapped version or so. Without the color function the font is smoothed and anti-aliased, with the color function it's not. Looks like a clear bug to me. You might consider reporting this to support@wolfram.com. I don't seem to need the [#]& behind the colorfunction. It's a redundant notation anyways. I used a slightly modified version of your code: Plot[x, {x, 1, 1000}, ColorFunction -> (ColorData[VisibleSpectrum]), ColorFunctionScaling -> False, Filling -> Axis, Frame -> True, FrameLabel -> Wavelength ([Mu]m)] The y=x in the Plot argument was probably erroneous. On Jun 24, 12:32 pm, Jeff Lawlis True, FrameLabel -> Wavelength ([Mu]m)] > Plot[y = x, {x, 1, 1000}, > ColorFunction -> (ColorData[VisibleSpectrum][#] &), > ColorFunctionScaling -> False, Filling -> Axis] Notice the space between the Greek character [Mu] and the m, causing them to overlap the right parantheses. The space disappears if you remove the ColorFunction gradient from the plot parameters. Also, if you change [Mu] to a standard character like m, the formatting looks perfectly acceptable. To be honest, I don't really understand the reason for the [#] & following the ColorData tag, but the gradient doesn't seem to work properly without it. Is my syntax correct? === Subject: Re: Possible bug in Mathematica 7 using ColorFunction > Problem: use of ColorFunction affects spacing of Greek characters in F rame label. Here is a simple example of the problem: SetOptions[Plot, Frame -> True, FrameLabel -> Wavelength ([Mu]m)] > Plot[y = x, {x, 1, 1000}, > ColorFunction -> (ColorData[VisibleSpectrum][#] &), > ColorFunctionScaling -> False, Filling -> Axis] Notice the space between the Greek character [Mu] and the m, causing them to overlap the right parantheses. The space disappears if you remove the ColorFunction gradient from the plot parameters. Also, if you change [Mu] to a standard character like m, the formatting looks perfectly acceptable. To be honest, I don't really understand the reason for the [#] & following the ColorData tag, but the gradient doesn't seem to work properly without it. Is my syntax correct? I got it to render ok (V7.0.1 on OS X 10.5.7) by adding an invisible space: ([Mu][VeryThinSpace]m) ...but I'm not sure why the problem you've reported occured. ColorFunction -> VisibleSpectrum is all you need. Mike === Subject: Wolfram Alpha and Mathematica As we all know the engine behind Wolfram Alpha is Mathematica, but there seem to be some restrictions on the kind of problems Wolfram Alpha is willing to solve. They do not seem to be documented and it is not clear whether they are based on some complexity of the problem, the time it takes to solve or something else. Here is a typical example. Note that Expand[(1 - a^2)*(1 - b^3)] a^2*b^3 - a^2 - b^3 + 1 now type into Wolfram Alpha: factor a^2*b^3 - a^2 - b^3 + 1 you will get the expected factorization. Now multiply the previous input by (1-c) and type: factor -(a^2*b^3*c) + a^2*b^3 + a^2*c - a^2 + b^3*c - b^3 - c + 1 you will again get the expected factorization but now replace the factor 1-c by a-c and try: factor a^3*b^3 - a^3 - a^2*b^3*c + a^2*c - a*b^3 + a + b^3*c - c Wolfram Alpha will tell: Wolfram|Alpha isn't sure what to do with your input. Really? So what's the great difference between this input and the previous ones? Moreover, you will be asked: Are you an expert on this topic? Find out how you can help. Common guys. You don't need my help on this topic. There is obviously some other reason for this, and if so I think it should be stated. Andrzej Kozlowski === Subject: Re: Non-converging integral with linear transformation?! > Hi! I have a question regarding the Integral over the product of the two func= tions AiryAi and AiryAiPrime. Lets look at the following integrals: f[x_] = AiryAi[-1 + 10^5 x] AiryAiPrime[-500 + 10^5 x] > NIntegrate[f[x], {x, 0, Infinity}] > 10^-5*NIntegrate[f[x] /. x -> (10^-5 x), {x, 0, Infinity}] Mathematica 6 seems to be unable to evaluate the first one; the result is= 0 and a warning about to slow convergence is issued. Actually two messages are issued NIntegrate:slwcon and NIntegrate::ncvb. The second message says that NIntegrate failed to converge to prescribed accuracy because the maximum recursion depth is reached. If we increase the value given to MaxRecursion convergence is reached: NIntegrate[f[x], {x, 0, Infinity}, MaxRecursion -> 20] NIntegrate::slwcon:Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small. > -3.8906667557047874*^-7 > The second one is - as far as I know - the same as the first one but with= a linear variable transformation applied -> this time the result is given = without any warning. So basically my question is: what is going on there? The integrand oscillates around zero. We can see that with the following plots: 1. First integrand Plot[f[x], {x, 0, 0.0001}, PlotRange -> All] 2. Second integrand Plot[Evaluate[f[x] /. x -> (10^-5 x)], {x, 0, 10}, PlotRange -> All] Note the plot ranges. (With your transformation the second integrand is stretched.) The oscillation of the integrand around 0 is some sort of singularity which makes the integration harder. With your linear transformation the singularity is stretched and flattened and the work for NIntegrate's bisection adaptive algorithm is made easier. (Because nothing interesting is happening at the infinity end.) These plots might be instructive: Needs[Integration`NIntegrateUtilities`] NIntegrateSamplingPoints[NIntegrate[f[x], {x, 0, 0.002}]] NIntegrateSamplingPoints[NIntegrate[f[x] /. x -> (10^-5 x), {x, 0, 20}]] Note that for the transformed integrand the work of the adaptive algorithm is more spread out across the integration range. (And that is why I said the integration is easier with it.) > Am I doing something wrong? The mistake not increase the maximum recursion seems to be common... Anton Antonov === Subject: Re: How to feed a list of xy pairs into Solve to output xyz triplets > Hi: Let's say that I have a list of xy coordinate pairs: list= {{1,2}},{3,1},{5,4},{6,3},{2,5}}. Now I'd like to find xyz triplets using Solve for the equation 6*x > + 4*y + z == 1. xyz results: {{1,2,-13}},{3,1,-21},{5,4,-45},{6,3,-47},{2,5,-31}}. > (I used Solve 5 times.) > Question: How do I code that into Mathematica for a one shot > output? (Use Solve once.) One approach is to solve for z, then map the solution over the list: Block[{sol=Solve[6*x+4*y+z==1,z][[1]]},Append[#,z/.sol/.{x->#[[1]],y- >#[[2]]}]&/@list] If your equation is linear you can avoid using Solve altogether and just do the matrix arithmetic to get a matrix of z values which you can append to list: Block[{z = Table[1, {Length[list]}] - Flatten[list.{{6}, {4}}]}, ArrayFlatten[{{list, Transpose[{z}]}}]] === Subject: How to feed a list of xy pairs into Solve to output xyz triplets Hi: Let's say that I have a list of xy coordinate pairs: list= {{1,2}},{3,1},{5,4},{6,3},{2,5}}. Now I'd like to find xyz triplets using Solve for the equation 6*x + 4*y + z == 1. xyz results: {{1,2,-13}},{3,1,-21},{5,4,-45},{6,3,-47},{2,5,-31}}. (I used Solve 5 times.) Question: How do I code that into Mathematica for a one shot output? (Use Solve once.) Bill Mathematica 6.0.1 using Win XP on a pc. === Subject: Re: How to feed a list of xy pairs into Solve to output xyz triplets res = Function @@ {{x, y}, z /. Solve[6*x + 4*y + z == 1, z][[1]]}; list = {{1, 2}, {3, 1}, {5, 4}, {6, 3}, {2, 5}}; and res @@@ list Jens > Hi: Let's say that I have a list of xy coordinate pairs: list= {{1,2}},{3,1},{5,4},{6,3},{2,5}}. Now I'd like to find xyz triplets using Solve for the equation 6*x + 4*y + z = 1. xyz results: {{1,2,-13}},{3,1,-21},{5,4,-45},{6,3,-47},{2,5,-31}}. (I used Solve 5 times.) > Question: How do I code that into Mathematica for a one shot output? (Use Solve once.) > Bill > Mathematica 6.0.1 using Win XP on a pc. > === Subject: Re: How to feed a list of xy pairs into Solve to output xyz triplets > Hi: Let's say that I have a list of xy coordinate pairs: list= {{1,2}},{3,1},{5,4},{6,3},{2,5}}. Now I'd like to find xyz triplets using Solve for the equation 6*x + 4*y + z == 1. xyz results: {{1,2,-13}},{3,1,-21},{5,4,-45},{6,3,-47},{2,5,-31}}. (I used Solve 5 times.) Question: How do I code that into Mathematica for a one shot output? (Use Solve once.) > Bill Mathematica 6.0.1 using Win XP on a pc. Solve[6*x + 4*y + z == 1, z] /. {x -> list[[All, 1]], y -> list[[All, 2]]} gets you a one shot list of z. Mapping list onto the structure you want gets you a one shot x,y,z {#[[1]], #[[2]], Solve[6*#[[1]] + 4*#[[2]] + z == 1, z][[1, 1, 2]]} & / @ list Mike === Subject: Startingpoint and Initial region in Nminimize Hi All, I have 2 problems : + I don't know if one can assign ONE Startingpoint when using Nminimize. Example: f[S_, T_] := S^2 + (T - 10)^2; NMinimize[f[S, T], {{S, 2, 2.000001}, {T, 4, 4.00001}}, Method -> {NelderMead, InitialPoints -> {{-2, 30}}}]; As you see, here i have an Initial region: {{S, 2, 2.000001}, {T, 4, 4.00001}}. The InitialPoints serve only as a reference for the final result. Now, i want Nminimize to take Exactly one Starting point (that i give For example {2,4}, not one region). Is it possible??? Sory if the question was already asked. ++ In addition, i observe that the Nminimize's iterations strongly depend on that Initial region. (Not in this simple case but in what i'm doing). Meaning: We can have different result when the Initial region is larger (For example) {{S, 2, 4}, {T, 4, 6}} or smaller {{S, 2, 2.0000001}, {T, 4, 4.000001}}. I do not see why??? because i think that this is just a starting point and the Initial region can not influence the result of the optimization. If someone have experiences about that two questions? Anh. === Subject: Re: Take away the sliders I don't understand the FrameLabel syntax used below. According to the docs, the value for the option, when all 4 boundaries of the frame, etc., are to be labeled, is { {left, right}, {bottom, top} }. For example: Graphics[Disk[],Frame->True, FrameLabel->{{left,right},{bottom,top}}] The preceding puts those labels where their names lead you to expect. On the other hand, the following input... Graphics[Circle[],Frame->True, FrameLabel->{left,right,bottom,top}] puts left on the bottom, right on the left, bottom on the top, and top on the right. The only non-nested list syntax indicated in the More Information at ref/FrameLabel is of the form {bottom, left}. > Manipulate[a + b, > {{a, 0}, ControlType -> InputField}, > {{b, 0}, ControlType -> InputField}, > FrameLabel -> {None, None, a + b, None}] Manipulate[a + b, > {{a, 0}, InputField}, > {{b, 0}, InputField}, > FrameLabel -> {None, None, a + b, None}] ...I just want to use the boxes below the sliders to enter the parameter > values. I dont want to use the sliders or the other functions coming > with Manipulate. Is there another commando i can use than manipulate, > or just a way to remove the sliders? -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: Take away the sliders Specify an InputField, and better yet learn how to make your own custom dynamic displays where you can have complete control of the elements and format. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ Hi I just want to use the boxes below the sliders to enter the parameter values. I dont want to use the sliders or the other functions coming with Manipulate. Is there another commando i can use than manipulate, or just a way to remove the sliders? === Subject: Re: Take away the sliders Hi I just want to use the boxes below the sliders to enter the parameter values. I dont want to use the sliders or the other functions coming with Manipulate. Is there another commando i can use than manipulate, or just a way to remove the sliders? try the InputField. -- Alexei Boulbitch, Dr., habil. Senior Scientist IEE S.A. ZAE Weiergewan 11, rue Edmond Reuter L-5326 Contern Luxembourg Phone: +352 2454 2566 Fax: +352 2454 3566 Website: www.iee.lu === Subject: Re: *slowing down* a Mathematica process (Dynamic/Refresh question) I said this in my earlier post, but perhaps obliquely. The inner call prevents updates which are caused by changes to x. I.e., every time x changes, the Dynamic is immediately invalidated and posted for revalidation (meaning re-evaluation) as soon as the FE needs to draw it again. If it's on-screen, that means right away. Since every attempt to display the Dynamic changes x (because of the increment operator), this is going to cycle very quickly. I think this is much like what's happening in your code. Without having seen it, I can't be for sure, but I suspect that every time you poll, you're changing the value of some variable. That variable then invalidates the Dynamic and forces you into a loop that executes much faster than you want. You have to prevent that dependency from re-triggering the Dynamic, and that's what Refresh[_, None] does. But, having killed the trigger, you need to add a new one. This one will force things to update every second, even though no other trigger has occurred. That's what the outer call to Refresh does. I didn't have to do that part with Refresh. I could have also done it with Clock. E.g., x = 0; Dynamic[Clock[{0, 1, 1}]; Refresh[x++, None]] I see another poster suggested using TrackedSymbols->{}. That's yet another legitimate method (in combination with Refresh or Clock) of accomplishing the same thing. John Fultz jfultz@wolfram.com User Interface Group Wolfram Research, Inc. > John, that's great. One question -- why the nested calls to Refresh[]? Michael > To restate your problem in a way which can be observed without your > code, > I think you're looking for this... > x = 0; Dynamic[Refresh[x++, UpdateInterval -> 1]] > to update at 1 second intervals rather than the minimum of 1 second and > the amount of time it takes to change x (which, in this case, is far > less than 1 second). To do this, you should do something like... > x = 0; Dynamic[Refresh[Refresh[x++, None], UpdateInterval -> 1]] > I.e., you're removing entirely the trigger of the changing value of x > that causes the Dynamic to update, then adding a new trigger which > causes an update every second. > John Fultz > jfultz@wolfram.com > User Interface Group > Wolfram Research, Inc. === Subject: Re: Almost finished - my first calculator! Hi Lobby, nice calculator! Ah, the beauty of compounding! I always feel richer after doing these calculations, don't you? :-) I haven't checked your algo in detail, but if you put Initial dep. 10000 $ Growth 0.05 Years 1 and everything else 0 you get at the end: 10512.7 $ Accumulated amount! Uhm...some people recently got in trouble with this kind of creative accounting. Anyway, could you please wire the virtual 12.7 $ into my virtual Cayman account? :-) I am not sure I understand why inflation should influence your accumulated amount. Inflation will determine the purchasing power of that amount, but not its nominal value. (perhaps you are making some specialized calculation of some specific financial instrument, but if so, this does not transpire from the labels). hth === Subject: Re: Plot with x value in Log f[x_] = Exp[-x/10]; ParametricPlot[ {10*Log[10, x], NIntegrate[f[t], {t, 0, x}]}, {x, 1, 100}, AspectRatio -> 1, PlotRange -> All] Bob Hanlon I need to plot an Integral, that i need to solve numerically. I need to plot 10Log10[x] versus result of integral. If i plot Plot[nIntegrate[],{x,100,1,-1}] is easy, but the plot is wrong. i need to do 10Log10 of x, not only x. But if i plot Breno === Subject: interpolation and to extract between 3D plots Hi All, I have the following data in the form {x,y,z} ; dtvalues= {{0.360374, 183.717, -659.}, {10.1899, 186.526, -659.}, {17.562, 193.898, -659.}, {20.0194, 203.376, -659.}, {17.562, 213.206, -659.}, {10.1899, 220.578, -659.}, {0.360374, 223.386, -659.}, {-9.46912, 220.578, -659.}, {-16.8412, 213.206, -659.}, {-19.2986, 203.376, -659.}, {-16.8412, 193.898, -659.}, {-9.46912, 186.526, -659.}, {0.360374, 183.717, -660.5}, {10.1899, 186.526, -660.5}, {17.562, 193.898, -660.5}, {20.0194, 203.376, -660.5}, {17.562, 213.206, -660.5}, {10.1899, 220.578, -660.5}, {0.360374, 223.386, -660.5}, {-9.46912, 220.578, -660.5}, {-16.8412, 213.206, -660.5}, {-19.2986, 203.376, -660.5}, {-16.8412, 193.898, -660.5}, {-9.46912, 186.526, -660.5}, {0.360374, 183.717, -662.}, {10.1899, 186.526, -662.}, {17.562, 193.898, -662.}, {20.0194, 203.376, -662.}, {17.562, 213.206, -662.}, {10.1899, 220.578, -662.}, {0.360374, 223.386, -662.}, {-9.46912, 220.578, -662.}, {-16.8412, 213.206, -662.}, {-19.2986, 203.376, -662.}, {-16.8412, 193.898, -662.}, {-9.46912, 186.526, -662.}}; Two questions 1.) How to build a 3D volume for visualization for this data. 2.) Is it possible to extract the data at various z values like {z = -659.095, -660, eetc.} === Subject: Re: Wolfram | Alpha: Acres per square mile? (oddities) As for units, you can easily install your own convenience units with the ExtendUnits package. Needs[Units6`ExtendUnits6`] InstallNewUnit[SquareMile -> Mile^2] InstallNewUnit[SquareMeter -> Meter^2] InstallNewUnit[Kilometer -> Kilo Meter] Acre/SquareMile // ToUnit[{Acre/Kilometer^2, Acre/Hectare, Hectare/SquareMile, SquareMeter/Acre, Hectare/Kilometer^2, SquareMile/SquareMeter, 1}] {0.386102 Acre/Kilometer^2, 0.00386102 Acre/Hectare, 0.404686 Hectare/SquareMile, 6.32321 SquareMeter/Acre, 0.15625 Hectare/Kilometer^2, 6.03285*10^-10 SquareMile/SquareMeter, 0.0015625} As for W|A, lately I am more impressed. A couple of days ago I tried to calculate the cooking time for a roast and got 113 arc minutes, which was then converted to radians and grads. But today, when I used 4.53 pounds at 26 minutes per pound I obtained a correct answer. And if I enter where I am. (But just now it gave me a stock chart that didn't even have the same symbol and I had to choose to switch to a calendar unit.) And if you type Sunset it will give you your local time of sunset. I'm more impressed. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ Just out of curiosity (and a current need for info) (and to start learning about W|A), typed: Acres per square mile into Wolfram | Alpha. Results came back (had to do a little hand editing of the following): Assuming U.S. acres for acres Use international acres commercial acres Irish acres Hungarian acres instead Input interpretation: acres/mi^2 Unit conversions: 0.3861 acres per square kilometer 6.323 square meters per acre 0.1563 hectares per square kilometer 0.4047 hectares per square mile 0.003861 acres per hectare Don't see 640 there anywhere! -- and something seriously wrong with that first unit conversion? (not to mention all the others) -- or at least the way it's phrased -- more like 250 acres per square kilometer? Went to M7, tried Needs[Units`] Convert[Acre, Mile^2] Mile^2/640 Went to Units Tutorial: Seems odd to see Centimeter, Meter, Micron, Mile, and a bunch of arcane units listed there -- but NOT Kilometer??? (Gram and Kilogram are in there). === Subject: Wolfram | Alpha: Acres per square mile? (oddities) Just out of curiosity (and a current need for info) (and to start learning about W|A), typed: Ê Acres per square mile into Wolfram | Alpha. Results came back (had to do a little hand editing of the following): Assuming U.S. acres for acres Use international acres commercial acres Irish acres Hungarian acres instead Input interpretation: acres/mi^2 Unit conversions: 0.3861 acres per square kilometer Ê 6.323 square meters per acre Ê 0.1563 hectares per square kilometer Ê 0.4047 hectares per square mile Ê 0.003861 acres per hectare Don't see 640 there anywhere! -- and something seriously wrong with that first unit conversion? (not to mention all the others) -- or at least the way it's phrased -- more like 250 acres per square kilometer? Went to M7, tried Needs[Units`] Convert[Acre, Mile^2] Mile^2/640 Went to Units Tutorial: Seems odd to see Centimeter, Meter, Micron, Mile, and a bunch of arcane units listed there -- but NOT Kilometer??? (Gram and Kilogram are in there). === Subject: Re: Wolfram | Alpha: Acres per square mile? (oddities) Try acre mile^2 This query returned the requisite 640 you are looking for. Mr Weisstein put some work into the Unit part. Hans > Just out of curiosity (and a current need for info) (and to start > learning about W|A), typed: Acres per square mile into Wolfram | Alpha. Results came back (had to do a little hand editing > of the following): Assuming U.S. acres for acres > Use > international acres > commercial acres > Irish acres > Hungarian acres > instead Input interpretation: acres/mi^2 Unit conversions: 0.3861 acres per square kilometer 6.323 square meters per acre 0.1563 hectares per square kilometer 0.4047 hectares per square mile 0.003861 acres per hectare Don't see 640 there anywhere! -- and something seriously wrong with > that first unit conversion? (not to mention all the others) -- or at > least the way it's phrased -- more like 250 acres per square kilometer? Went to M7, tried Needs[Units`] > Convert[Acre, Mile^2] Mile^2/640 Went to Units Tutorial: Seems odd to see Centimeter, Meter, > Micron, Mile, and a bunch of arcane units listed there -- but NOT > Kilometer??? (Gram and Kilogram are in there). > === Subject: Re: Wolfram | Alpha: Acres per square mile? (oddities) > Just out of curiosity (and a current need for info) (and to start > learning about W|A), typed: Acres per square mile into Wolfram | Alpha. Results came back (had to do a little hand editing > of the following): Assuming U.S. acres for acres > Use > international acres > commercial acres > Irish acres > Hungarian acres > instead Input interpretation: acres/mi^2 Unit conversions: 0.3861 acres per square kilometer 6.323 square meters per acre 0.1563 hectares per square kilometer 0.4047 hectares per square mile 0.003861 acres per hectare Don't see 640 there anywhere! -- and something seriously wrong with > that first unit conversion? (not to mention all the others) -- or at > least the way it's phrased -- more like 250 acres per square kilometer? Went to M7, tried Needs[Units`] > Convert[Acre, Mile^2] Mile^2/640 Went to Units Tutorial: Seems odd to see Centimeter, Meter, > Micron, Mile, and a bunch of arcane units listed there -- but NOT > Kilometer??? (Gram and Kilogram are in there). W|A is interpreting your input as the dimensionless unit acres/ miles^2, which isn't terribly helpful. To get the value of the ratio the following seem to work: convert one square mile to acres 1 square mile / 1 acre P.S. You may have already done so, but you can/should submit this kind of comment/suggestion in the send us feedback field at the bottom of W|A page. === Subject: Re: Possible bug in Mathematica 7 using ColorFunction > Problem: use of ColorFunction affects spacing of Greek characters in > Frame label. Here is a simple example of the problem: SetOptions[Plot, Frame -> True, FrameLabel -> Wavelength ([Mu]m)] > Plot[y = x, {x, 1, 1000}, > ColorFunction -> (ColorData[VisibleSpectrum][#] &), > ColorFunctionScaling -> False, Filling -> Axis] Notice the space between the Greek character [Mu] and the m, causing the > m to overlap the right parantheses. The space disappears if you remove > the ColorFunction gradient from the plot parameters. Also, if you change > [Mu] to a standard character like m, the formatting looks perfectly > acceptable. To be honest, I don't really understand the reason for the > [#] & following the ColorData tag, but the gradient doesn't seem to work > properly without it. Is my syntax correct? I'm running under Windows and seeing this. My explanation may vary slightly in the details if you're seeing this on another platform, but the essence should be the same. Under Windows, the drawing of VertexColors (the option by which color gradients are implemented) is done using the 3D drawing system. One down side of using the 3D drawing system is that it requires using a completely different method of rendering fonts which is incapable of rendering ClearType. For small font sizes such as those used in FrameLabels by default, antialiasing actually reduces readability, unlike ClearType where it generally enhances readability. So, since Mathematica is unable to use ClearType and standard antialiasing would be less readable at this size, Mathematica turns off font smoothing altogether. But at small sizes, roundoff issues and other limitations can create the effect you're seeing of inappropriate spacing between characters. Even though we only need the 3D drawing system to correctly render one piece of the graphic, that choice affects the entire graphic, including frame labels. The issue won't affect printing, where font smoothing is not needed, and it won't be apparent under magnification, where the larger sizes allow better on-screen rendering of the text. John Fultz jfultz@wolfram.com User Interface Group Wolfram Research, Inc. === Subject: Re: Undocumented functions for working with graphics But how can I understand the real meaning of such variables (?) as Image`ImageDump`cf, Image`ImageDump`list etc.? > Hi there... When I posted the result to MathGroup, I did edit it a bit to remove > the Image`ImageDump` context prefixes so that it would be easier to > read. I simply did a global replace for the string Image`ImageDump` > so that the resulting code fragment would be more readable. These bits of code that are high level Mathematica code often have > these various contexts in them based on how Wolfram research handles > internal not-for-general-consumption Mathematica code. Also some folks may have noticed that one gets a different answer if > one tries to obtain the code in a fresh Mathematica session. This is > because the code in some of these these contexts is not loaded until > one actually tries to first make use fo the function. So, for example, executing something like Image[ {{0, 1, 0}, {1, 0, 1}, {0, 1, 0}}] Will load that code and then subsequently going through the process > that I outlined will create the code that I showed. Best, Davidhttp://scientificarts.com/worklife > times for using it I must launch Mathematica with -cleanStart key > for clearing the dump. But for Image`ToGraphicsRaster I can not get > your clear code. My result contains unknown functions like > Image`ImageDump`list with no attributes: > In[1]:= ClearAttributes[Image`ToGraphicsRaster, {Protected, > ReadProtected}] > ?Image`ToGraphicsRaster > Output: > Image`ToGraphicsRaster[Image`ImageDump`list:{_? > Image`ValidImageQ..}]:=Image`ToGraphicsRaster/@Image`ImageDump`list > Image`ToGraphicsRaster[Image`ImageDump`img_?Image`ValidImageQ]:=Modul= e > [{Image`ImageDump`width,Image`ImageDump`height,Image`ImageDump`range,Im= ag= > e` = > ImageDump`cf,Image`ImageDump`data,Image`ImageDump`interleaving,Image`Im= ag= > eD = > ump`imsize}, > {{Image`ImageDump`width,Image`ImageDump`height},Image`ImageDump`range,I= ma= > ge = > `ImageDump`cf} > =ImageData[Image`ImageDump`img, > {ImageDimensions,DataRange,ColorFunction}]; > {Image`ImageDump`interleaving,Image`ImageDump`imsize}= > {Interleaving,ImageSize}/.Options[Image`ImageDump`img]/.Options > [Image];If rs= > e > [ImageData[Image`ImageDump`img,Interleaving->True]],Image`ImageDump`dat= a= > =Reverse[First > [Image`ImageDump`img]]];Graphics[Raster[Image`ImageDump`data,{{0,0}, > {Image`ImageDump`width,Image`ImageDump`height}},Image`ImageDump`range,C= ol= > or = ic= > || > {Image`ImageDump`width,Image`ImageDump`height},ImageSize->Image`ImageDu= mp= `imsize],PlotRange->{{0,Image`ImageDump`width}, > {0,Image`ImageDump`height}}]] > How did you get your clear code? > > ...just following up on the method for reverse engineering of my > > previous post, here is part of the code for ToGraphicsRaster obtai= ne= > d > > using that approach: > Image`ToGraphicsRaster[img_?Image`ValidImageQ] := > > Module[{width, height, range, cf, data, interleaving, > > imsize}, {{width, height}, range, cf} = > > ImageData[ > > img, {ImageDimensions, DataRange, ColorFunction}]; {interleav= in= > g, > > imsize} = {Interleaving, ImageSize} /. Options[img] /. > > Options[Image]; > > data = Reverse[ImageData[img, Interleaving -> True]], > > data = Reverse[First[img]]]; > > Graphics[ > > Raster[data, {{0, 0}, {width, height}}, range, > > ColorFunction -> cf], > > ImageSize -> {width, height}, ImageSize -> imsize], > > PlotRange -> {{0, width}, {0, height}}]] > > Does anyone know where such functions as Image`ToGraphicsRaster= = > an= > d > > Image`PossibleImageQ are documented. Are there other such built-i= n > > functions? At this moment I even can't imagine from where (except t= hi= > s > > group) I could learn that functions mentioned exist... === Subject: Separating real part and imaginary part from each other suppose I have the expression f(z) = (a*z+b) / (c*z+d) with z=x+I*y I did the calculation by hand and was able to separate real part fom imag. part to obtain something like this: g=f(x+I*y) = Re(g) + I * Im(g) But I don't know how to do this in Mathematica. I tried FullSimplify, Together, Apart, they didn't work. Can you help me? Alexander === Subject: Simple question about named variables. I would like to write a function which clears many variables called: Test1,Test2,... So I write the function: ClearI[i_] := Clear@ToExpression@StringJoin[Test, ToString@i] Test1 = 1; Test2 = 2; ClearI[1] does not work because the expression is evaluated. What mathematica does is Clear@1. How could I ask Mathematica to do Clear@Test1, Clear@Test2, ... automatically? I am sure that the solution is simple... but I could not find it. Pianiel === Subject: The Principle Everything is an expression I think that the underlying principle Everything is an expression in Mathematica is great and is one of the most exciting advantages of the Mathematica system. But it is disappointing that this principle is still fails even on such basic example as representation of a simple Plot. Consider the following: g = Plot[Sin[x], {x, 0.2, 10}] Show[FullGraphics[g], AspectRatio -> 1/GoldenRatio] It is clear that the two generated images are significantly different. This means that the function FullGraphics[] does not gives the true expression-representation of the first plot. Is it true that in really we can not get the true representation of the plot as an expression? And the principle mentioned really fails even on this? Or there is another way to get it? === Subject: Re: Putting an If in my function Set (=) is evaluated immediately, but the condition (/;g == w) can't be evaluated until g and w are known. Bobby I'm also interested in adding a special case to a function. Using > what's written below works fine: myFun[a_, g_, f_, x_, d_, w_] := d + a f x /; g == w But why doesn't the same work when the myFun is defined using = > instead of:=? i.e., myFun[a_, g_, f_, x_, d_, w_] = (d + a f x) /; g == w > ln[5]:=myFun[a, w, f, x, d, w] > Out[5]=d + a f x /; w == w Porscha > Quoting Sjoerd C. de Vries : > Nomen est omen, the old Romans used to say. And they were often > right. > I'm not sure what you are trying to do here, with your function in an > unneccessary, overly complex, pure function notation. Why not write: > myFun[a_, g_, f_, x_, d_, w_] := d (1 + (E^g - E^w)/f)^(f x) + (a (-1 > + (1 + (E^g - E^w)/f)^(f x)) f)/( E^g - E^w) > which is much more readable (at least in Mathematica)? > In[31]:= Limit[myFun[a, g, f, x, d, w], g -> w] > Out[31]= d + a f x > You use the undefined 'n' in d + a n. I guess this must be f x... > You can add a definition for myFun for this special case like this (no > If[ ] necessary): > myFun[a_, g_, f_, x_, d_, w_] := d + a f x /; g == w > In[36]:= myFun[a, w, f, x, d, w] > Out[36]= d + a f x > If you want to use an If in the definition this would be something > like: > f= > x) > + (a (-1 + (1 + (E^g - E^w)/f)^(f x)) f)/( E^g - E^w),d + a f x] > #5 (1 + ((E^#2 - 1) - (E^#6 - > 1))/#3)^(#3*#4) + (#1*((1 + (((E^#2 - 1) - (E^#6 = > - > 1))/#3))^(#3*#4) - > 1))/(((E^#2 - 1) - (E^#6 - 1))/#3) &[a, g, f, x, d, w] > in the case when w==g the denominator equals zero. > in this case i would like to rewrite the formula above to the much > simpler > d+a*n. How is this done? I've tried > If[w == g, % = d + a*n], but this is not working. Another thing is > where to put the If > > -- DrMajorBob@bigfoot.com === Subject: Re: Putting an If in my function It did exactly what you asked it to do (immediately evaluate RHS). Some proper forms are Clear[myFun] myFun[a_, g_, f_, x_, d_, g_] = (d + a f x); myFun[a, w, f, x, d, w] a f x+d Or Clear[myFun] myFun[a_, g_, f_, x_, d_, w_] /; w == g = (d + a f x); myFun[a, w, f, x, d, w] a f x+d Bob Hanlon I'm also interested in adding a special case to a function. Using what's written below works fine: myFun[a_, g_, f_, x_, d_, w_] := d + a f x /; g == w But why doesn't the same work when the myFun is defined using = instead of:=? i.e., myFun[a_, g_, f_, x_, d_, w_] = (d + a f x) /; g == w ln[5]:=myFun[a, w, f, x, d, w] Out[5]=d + a f x /; w == w Porscha Quoting Sjoerd C. de Vries : Nomen est omen, the old Romans used to say. And they were often > right. I'm not sure what you are trying to do here, with your function in an > unneccessary, overly complex, pure function notation. Why not write: myFun[a_, g_, f_, x_, d_, w_] := d (1 + (E^g - E^w)/f)^(f x) + (a (-1 > + (1 + (E^g - E^w)/f)^(f x)) f)/( E^g - E^w) which is much more readable (at least in Mathematica)? In[31]:= Limit[myFun[a, g, f, x, d, w], g -> w] Out[31]= d + a f x You use the undefined 'n' in d + a n. I guess this must be f x... You can add a definition for myFun for this special case like this (no > If[ ] necessary): myFun[a_, g_, f_, x_, d_, w_] := d + a f x /; g == w In[36]:= myFun[a, w, f, x, d, w] Out[36]= d + a f x If you want to use an If in the definition this would be something > like: > f= > x) > + (a (-1 + (1 + (E^g - E^w)/f)^(f x)) f)/( E^g - E^w),d + a f x] > #5 (1 + ((E^#2 - 1) - (E^#6 - > 1))/#3)^(#3*#4) + (#1*((1 + (((E^#2 - 1) - (E^#6 = > - > 1))/#3))^(#3*#4) - > 1))/(((E^#2 - 1) - (E^#6 - 1))/#3) &[a, g, f, x, d, w] > in the case when w==g the denominator equals zero. > in this case i would like to rewrite the formula above to the much > simpler > d+a*n. How is this done? I've tried > If[w == g, % = d + a*n], but this is not working. Another thing is > where to put the If > -- Bob Hanlon === Subject: Re: Integrate[], Sort[] and Hold[] of more than two things. I support I could use Min and Max to make a new Sort function, but wondered if there might be a better way. So does anyone have any ideas why Min[] and Max[] behave differently to Sort[]? I wondered if it ws about attributes. Attributes[Sort] = {Protected} Attributes[Min] = {Flat, NumericFunction, OneIdentity, Orderless, Protected} Attributes[Max] = {Flat, NumericFunction, OneIdentity, Orderless, Protected} But setting the attributes of Sort[] to match Min[] or Max[] doesn't change Sort[]'s behaviour in Integrate[]. All comments very welcome. > I was somewhat surprised that the following worked: Integrate[Min[2^a, 3^a], {a, -1, 1}] > % // N > (2 Log[2] + Log[27])/(Log[2] Log[27]) > 2.04952 NIntegrate[Min[2^a, 3^a], {a, -1, 1}] > 2.04952 > David Park > djmpark@comcast.net > http://home.comcast.net/~djmpark/ > I am having trouble integrating a function which contains Sort[]. Here is a > stripped down (if slightly odd) example: In = Integrate[Sort[{2, 3}^a], {a, -1, 1}] > Out = {3/Log[4], 8/Log[27]} Mathematica is evaluating this as follows. First, Sort[{2, 3}^a] is > evaluated as {2^a, 3^a}. Then Integrate[2^a, {a, -1, 1}] gives the first > term 3/Log[4]. Finally Integrate[3^a, {a, -1, 1}] gives the second term > 8/Log[27]. Note here that Sort[] is sorting 2^a and 3^a without knowing the > value of a. That is, sort is sorting the raw symbolic expressions. I would prefer Sort[] to wait until it knows the value of a before sorting. > For example, when a is -1, then 2^a = 1/2 and 3^a = 1/3, so Sort[{2, 3}^a] > would be {1/3, 1/2}. However when a is 1, then 2^a = 2 and 3^a = 3, so > Sort[{2, 3}^a] would be {2, 3}. That is, in the first case the terms are > swapped, but in the second case they are not. So what I'm after is In = Integrate[Sort[{2, 3}^a], {a, -1, 1}] > Out = {2/Log[3] + 1/Log[4], 1/Log[2] + 2/Log[27]} > (* This does not actually happen *) [If you prefer to picture this, Plot[{2^a, 3^a}, {a, -1, 1}] draws two > increasing lines that cross at a = 0. Mathematica is integrating under each > curve. I'm trying to integrate under the line made from the two lower > segments, and under the line made from the two upper segments.] I've tried using Hold[], ReleaseHold[], and Evaluate[] but have got myself > into a terrible mess. Obviously with this trivial example I could just split > the integral up myself, but is there a way to achieve delaying Sort[] until > a is known? I would be very grateful for any comments. === Subject: Re: Using fractions in axis labels === Subject: Eigenvalue bug in Mathematica 7.0.0 I find that Mathematica V7.0.0 finds incorrect eigenvalues and eigenvectors of the 100 x 100 real symmetric matrix listed below. You can easily check the first eigenvector produced is not a true eigenvector. I get incorrect results running under I consider this a very serious error. Here is the 100 x 100 matrix: H = {{-31.071666228176326`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3.2937773840081404`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.7008993272504218`, 0, 0, 0, 0, 0, -1.3887784852022385`, 0, 0, 0, 0, 1.3887784852022385`, 0, 0, 0, 0, 0, -1.7008993272504218`}, {0, -37.28599947381161`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4.166335455606716`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5669664424168073`, -1.7008993272504218`, 0, 0, 0, 0.9820146844524842`, -1.4730220266787264`, 0, 0, 0}, {0, 0, -43.50033271944689`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4.4190660800361785`, 0, 0, 0, 0, -2.9460440533574532`, 0, 0, 0, 0.5669664424168073`, -0.5669664424168073`, 0}, {0, 0, 0, -49.714665965082176`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4.166335455606716`, -4.166335455606716`, 0, 0, 0}, {0, 0, 0, 0, -55.92899921071746`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5.378715944759434`, 0, 0}, {0, 0, 0, 0, 0, -31.071666228176326`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.417416106042018`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1.417416106042018`}, {0, 0, 0, 0, 0, 0, -37.28599947381161`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -4.252248318126054`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.7929053149198115`, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, -43.50033271944689`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5.378715944759434`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.9016632593078016`, -1.3446789861898585`}, {0, 0, 0, 0, 0, 0, 0, 0, -49.714665965082176`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33.17864844467907`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.8121363742166812`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.726241085992804`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.8121363742166812`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29.726241085992804`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.8121363742166812`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0,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, 0, 0, 0, 0, 20.848622163656685`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.5627478372868366`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20.848622163656685`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.5627478372868366`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.862220061174895`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.5627478372868366`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.862220061174895`, 0, 0, 0, 0, 0, 0, 0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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 125.66702840179346`, 0, 0, 0, 0, 0, 0, 0}, {1.3887784852022385`, 0, -2.9460440533574532`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118.76221368442091`, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118.76221368442091`, 0, 0, 0, 0, 0}, {0, 0.9820146844524842`, 0, -4.166335455606716`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111.85739896704837`, 0, 0, 0, 0}, {0, -1.4730220266787264`, 0, -4.166335455606716`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111.85739896704837`, 0, 0, 0}, {0, 0, 0.5669664424168073`, 0, -5.378715944759434`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104.95258424967585`, 0, 0}, {0, 0, -0.5669664424168073`, 0, 0, 0, 0, -1.9016632593078016`, 0, -5.378715944759434`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104.95258424967585`, 0}, {-1.7008993272504218`, 0, 0, 0, 0, 1.417416106042018`, 0, -1.3446789861898585`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 121.2282189406254`}}; === Subject: Re: TeX output via TeXForm: variable name translation had: eo /: MakeBoxes[eo, fmt_: StandardForm] := SuperscriptBox[ [Epsilon], (o)] In[438]:= eo // TeXForm Out[438]//TeXForm= epsilon ^{text{(o)}} How do I get rid of the text tag?.. On Jun 21, 7:04 am, Jens-Peer Kuska set up the boxes for you symbol in a proper way and Mathematica > does the rest, i.e. e1 /:MakeBoxes[e1, fmt_: StandardForm] := > SubscriptBox[[Epsilon], 1] and TeXForm[e1] gives epsilon _1 Jens > I am trying to find a good way to interoperate between Mathematica and > LaTeX (or LyX). > Typically, I am workign with multi-character variable names, which > TeXForm interprets as text: > In[65]:= TeXForm[e1] > Out[65]//TeXForm= > text{e1} > To get around this, I am trying to create a translation table of > sorts: e.g. > TranslationTable1 = {{e1, epsilon_1}, {e0, epsilon_0}, {kz0t, > tilde{k^{(0)}_z}}, {kz1t, tilde{k^{(1)}_z}}}; > I would like, if possible, to perform those replacements in > Mathematica, without writing and invoking external scripts. The firs= t > thing I tried was this: > TeXReplacements := (Rule[#[[1]], ToExpression[#[[2]], TeXForm, > HoldForm]] & /@ TranslationTable1) > In[67]:= (e1*kz0t) /. TeXReplacements // TeXForm > Out[67]//TeXForm= > epsilon _1 tilde{k_z^0} > (This simply does the following: > In[69]:= (e1*kz0t) /. {e1 -> ToExpression[epsilon_1, TeXForm, > HoldForm], > kz0t -> ToExpression[tilde{k^{(0)}_z}, TeXForm, HoldForm]} /= / > TeXForm > Out[69]//TeXForm= > epsilon _1 tilde{k_z^0} > ) > Notice how this doesn't work: Take a look at the translation table > above and notice parentheses around in k_z^{(0)}. Mathematica > discards these parentheses. > So the question to the group is: (1) is it possible to preserve the > formatting exactly how I specified it in the translation table before > converting to TeXForm or (2) is it possible to do a replacement usin= g > my translation table after I had converted to TeXForm or (3) is there > a better solution altogether? > - Show quoted text - === Subject: Re: How to feed a list of xy pairs into Solve to output xyz triplets >Let's say that I have a list of xy coordinate pairs: >list= {{1,2}},{3,1},{5,4},{6,3},{2,5}}. >Now I'd like to find xyz triplets using Solve for the equation 6*x + >4*y + z == 1. >xyz results: {{1,2,-13}},{3,1,-21},{5,4,-45},{6,3,-47},{2,5,-31}}. >(I used Solve 5 times.) >Question: How do I code that into Mathematica for a one shot >output? (Use Solve once.) Use Map to map Solve to each of the xy coordinate pairs. This is done as follows: In[2]:= ({x, y, z} /. Solve[{x == First@#, y == Last@#, 6*x + 4*y + z == 1}, {x, y, z}]) & /@ list Out[2]= {{{1, 2, -13}}, {{3, 1, -21}}, {{5, 4, -45}}, {{6, 3, -47}}, {{2, 5, -31}}} Here, I set up a pure function with Solve (the {x, y, z}/.Solve[{x == First@#, y == Last@#, 6*x + 4*y + z == 1}, {x, y, z}])& part) and mapped it to the elements of list (the /@ part). If you are unfamiliar with this technique you should read the documentation on pure functions and Map === Subject: Re: Plot with x value in Log >I need to plot an Integral, that i need to solve numerically. I need >to plot 10Log10[x] versus result of integral. If i plot >Plot[nIntegrate[],{x,100,1,-1}] >is easy, but the plot is wrong. i need to do 10Log10 of x, not only >x. But if i plot >LogLinearPlot[nIntegrate[],{x,100,1,-1}] the >plot is a Log in x, but the values that appear isn't in >help, in anywhere...What i'm doing wrong? You simply aren't using the best built-in function for the task at hand. Use ParametricPlot. The syntax would be: ParametricPlot[{10 Log[10,x],f[x]},{x,xmin,xmax}] Note, unlike most plot functions the default aspect ratio for ParametericPlot is 1. If the range for f[x] is significantly different than the range for 10 Log[10, xmin] to 10 Log[10, xmax] your plot likely not be what you want. To get the more typical aspect ratio you will need to override the default by specifying ApectRatio->1/GoldenRatio === Subject: Re: Plot with x value in Log I need to plot an Integral, that i need to solve numerically. I need to plot 10Log10[x] versus result of integral. If i plot Plot[nIntegrate[],{x,100,1,-1}] is easy, but the plot is wrong. i need to do 10Log10 of x, not only x. But if i plot Breno it is quite unclear what do you want and what is your problem. If you need to plot an indefinite integral, let us see. Assume that you need to integrate a Gaussian curve (e.g. Exp[-x^2]. The result is known, it is 1/2 Sqrt[[Pi]] Erf[x]): Evaluate these operators: g[x_] := Integrate[Exp[-x^2], x] Plot[Evaluate@g[x], {x, 1, 100}] LogLogPlot[Evaluate@g[x], {x, 1, 100}] LogPlot[Evaluate@g[x], {x, 1, 100}] Is its what you need? === Subject: Re: how to make .nbp? ... and first read the documentation on how to read the documentation. 2009/6/25 Sjoerd C. de Vries : > You seem to have the habit of not reading any documentation at all. Perhaps a video is something for you? See howto/ > DeployANotebookForPlayer in the Documentation Centre or > http://www.wolfram.com/broadcast/screencasts/howtodeployanotebookforplayer/= > ?w=800&h=600 > Hi > I want to make my .nb to a .nbp so that people that dont have > mathematica can download mathematica player and use it. How to do it? > -- Peter Lindsay === Subject: Re: how to make .nbp? You seem to have the habit of not reading any documentation at all. Perhaps a video is something for you? See howto/ DeployANotebookForPlayer in the Documentation Centre or http://www.wolfram.com/broadcast/screencasts/howtodeployanotebookforplayer/= ?w=800&h=600 > Hi > I want to make my .nb to a .nbp so that people that dont have > mathematica can download mathematica player and use it. How to do it? === Subject: Re: how to make .nbp? Upload the .nb here and the .nbp will be emailed to you: http://www.wolfram.com/solutions/interactivedeployment/publish/ Porscha Quoting Lobotomy : > Hi > I want to make my .nb to a .nbp so that people that dont have > mathematica can download mathematica player and use it. How to do it? === Subject: Calculate n in binomial distribution Suppose I have the following distribution: cf[n_,p_,k_]=CDF[BinomialDistribution[n,p],k] Now I want to calculate n so that the biggest n such that e.g. cf[n,0.2,7]<0.3 I made a ListPlot ListPlot[Abs[cf[#,0.2,7]-0.3]&/@Range[60]], where I see, that a value of about n=46 gives an approximation nearest to 0.3 To get this value of n I tried Minimize[{Abs[cf[n,0.2,7]-0.3],n>7},n,Integers] Out: {0.699765, {n->11}} which is obviously wrong. Why? Is it, because Abs isn't differentiable at the peak? I tried other ways too, like Reduce NMinimize, FindMinimum, but no success. -- _________________________________________________________________ Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de === Subject: Re: How to feed a list of xy pairs into Solve to output list = {{1, 2}, {3, 1}, {5, 4}, {6, 3}, {2, 5}}; {#[[1]], #[[2]], z /. Solve[6*#[[1]] + 4*#[[2]] + z == 1, z][[1]]} & /@ list {{1, 2, -13}, {3, 1, -21}, {5, 4, -45}, {6, 3, -47}, {2, 5, -31}} Flatten[{##, z /. Solve[{6, 4}.## + z == 1, z][[1]]}] & /@ list {{1, 2, -13}, {3, 1, -21}, {5, 4, -45}, {6, 3, -47}, {2, 5, -31}} {x, y, z} /. {Reduce[{6 x + 4 y + z == 1, 0 < x < 7, 0 < y < 6}, z, Integers] // ToRules} {{1, 1, -9}, {1, 2, -13}, {1, 3, -17}, {1, 4, -21}, {1, 5, -25}, {2, 1, -15}, {2, 2, -19}, {2, 3, -23}, {2, 4, -27}, {2, 5, -31}, {3, 1, -21}, {3, 2, -25}, {3, 3, -29}, {3, 4, -33}, {3, 5, -37}, {4, 1, -27}, {4, 2, -31}, {4, 3, -35}, {4, 4, -39}, {4, 5, -43}, {5, 1, -33}, {5, 2, -37}, {5, 3, -41}, {5, 4, -45}, {5, 5, -49}, {6, 1, -39}, {6, 2, -43}, {6, 3, -47}, {6, 4, -51}, {6, 5, -55}} Bob Hanlon Hi: Let's say that I have a list of xy coordinate pairs: list= {{1,2}},{3,1},{5,4},{6,3},{2,5}}. Now I'd like to find xyz triplets using Solve for the equation 6*x + 4*y + z == 1. xyz results: {{1,2,-13}},{3,1,-21},{5,4,-45},{6,3,-47},{2,5,-31}}. (I used Solve 5 times.) Question: How do I code that into Mathematica for a one shot output? (Use Solve once.) Bill Mathematica 6.0.1 using Win XP on a pc. === Subject: Re: Is Orange translucent? - What Methods exist? Fair enough. We'd know nothing about Presentations OR MathGL 3D, however, if the OP's sentiment prevailed. Bobby > Nor do I. With or without Presentations, Mr. Park knows more about > Mathematica graphics -- and informative graphics in general -- than > the > lot of us. I think one should avoid such generalizations when they concern people > other than the person making this sort of statement. I personally do > not claim to know much about graphics, but I have in the past used > J.P. Kuska's MathGL 3D I would say he does know an awful lot about > Mathematica graphics (and graphics in general). Jens' knowledge may be > of a different kind from David Parks's knowledge but I can see no > grounds at all for dismissing it in such a causal way. Andrzej Kozlowski -- DrMajorBob@bigfoot.com === Subject: Re: Is Orange translucent? - What Methods exist? And more than once I have referred people to Jens-Peer because he does indeed have a deep knowledge of underlying graphics algorithms and formats - things that I know little about. And more than that, I am always learning things from the many people who participate in MathGroup - from both old-timer gurus and from those posting simple questions. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ > Nor do I. With or without Presentations, Mr. Park knows more about > Mathematica graphics -- and informative graphics in general -- than > the > lot of us. I think one should avoid such generalizations when they concern people other than the person making this sort of statement. I personally do not claim to know much about graphics, but I have in the past used J.P. Kuska's MathGL 3D I would say he does know an awful lot about Mathematica graphics (and graphics in general). Jens' knowledge may be of a different kind from David Parks's knowledge but I can see no grounds at all for dismissing it in such a causal way. Andrzej Kozlowski === Subject: Re: Is Orange translucent? - What Methods exist? Mr. Park's approach to deal with graphics is not a commodity to advertise, at all. I think it is a potential ease to use different paradigm to (Mathematica) graphics instead. Easier by far. It goes far beyond plotting lines and patching colors. It saves a lot of time. On the other hand, if someone posts a question anyone is free to deliver what she/he thinks is a suitable response. In my opinion that is all. E. Martin-Serrano -----Original Message----- === Subject: Re: Is Orange translucent? - What Methods exist? > The AxesInFront and GridLinesInFront options should be documented= in > Graphics. But should they be documented in every 2D plot type? That's > probably a lot of work. It's one of the disadvantages of organizing t= he > graphics around set-piece plot types. > David Park > Do you have to turn every one of your posts into an advertisment? :/ > -- m Just for the record, I don't share the sentiment voiced in this post. > I would also like to echo AES's comment. David Park brings a lot of value-added content (especially Graphics related) to this newsgroup. I, for one, value his postings. ......T.L. Harter, PhD === Subject: Re: Union slowdown when Apparently, Tally doesn't slow down for custom SameTest functions, in the way that Union does. I suppose that's because Union wants an ordering, while Tally needs only a test for equivalence. Bobby > (although this is probably irrelevant now), and also I think is a bit > more > pedagogical since it deals explicitly with the same problem that Tally > handles > internally and showcases the power of Dispatch. But for production, > certainly yours is better. Leonid > Here's a faster and (arguably) simpler method, using unsortedUnion > (Tally): > unsortedUnion[x_List] := Tally[x][[All, 1]] > unsortedUnion[x_List, SameTest -> test : (_Symbol | _Function)] := > Tally[x, test][[All, 1]] > unsortedUnion[x_List, test : (_Symbol | _Function)] := > Tally[x, test][[All, 1]] > test = RandomInteger[{1, 100}, {500, 2}]; > Timing[one = > Union[test, SameTest -> (Subtract @@ #1 == Subtract @@ #2 &)];] > {0.087628, Null} > Timing[two = unionBy[test, Subtract @@ # &];] > {0.002282, Null} > Timing[three = > unsortedUnion[Sort@test, (Subtract @@ #1 == Subtract @@ #2 &)];] > {0.00181, Null} > one == two == three > True > largetest = RandomInteger[{1, 100}, {1000, 2, 12}]; > Timing[one = Union[largetest, SameTest -> (First@#1 == First@#2 &)];] > {0.990508, Null} > Timing[two = unionBy[largetest, First];] > {0.006182, Null} > Timing[three = > unsortedUnion[Sort@largetest, (First@#1 == First@#2 &)];] > {0.003405, Null} > one == two == three > True > Bobby > This problem has been noticed and discussed before. > http://www.verbeia.com/mathematica/tips/HTMLLinks/Tricks_Misc_11.html, > probably also on this group. I also discussed it in my book: > http://www.mathprogramming-intro.org/book/node290.html > This is how I understand this issue (I may be wrong): > in the case of Union, the main reason for the huge performance > difference > is as follows: having a sameness function is a weaker requirement than > having a comparison function. For native sameness function SameQ, > there > exists a corresponding comparison function OrderedQ (or its internal > equivalent), therefore O(NlogN) algorithm can be used. For a generic > comparison function, if one wants to stay completely general, all one > can > do > is to compare elements pairwise, which leads to O(N^2) complexity. > On top of this, there is another factor (perhaps, less important in the > case of Union): when SameTest is not specified, the code of Union (or > Sort > etc) is entirely internal, written in C and very fast. When we specify > SameTest, the Union code has to constantly interface with the high - > level > Mathematica code (to call SameTest comparison function), and that > slows it > down a lot. This is a general situation with Mathematica - there is on > the > average an order of magnitude or so gap between built - in and > best-written > user-defined functions in Mathematica, if the functionality is not too > close to built-ins so that several of them can be glued together > with a > minimal performance hit. One reason for this is that built-ins are > written > in a much lower-level compiled language, another (related) is that they > avoid the main evaluation loop and symbolic rewritings involved in > general > Mathematica computations.This shows up to a various degree in many > problems. > Returning to Union, I think it would be nice if Union had an option to > provide a comparison function if it exists, and then use the O(NlogN) > algorithm. The function below represents an attempt in this direction: > Clear[unionBy]; > unionBy[list_List, hashF : (_Symbol | _Function)] := > unionBy[list, hashF /@ list]; > unionBy[list_List, hashlist_List] /; > Length[list] == Length[hashlist] := > With[{ord = Ordering[list]}, > With[{sorted = list[[ord]], sortedHashlist = hashlist[[ord]]}, > Extract[sorted, > Sort[Union[sortedHashlist] /. > Dispatch[MapIndexed[Rule, sortedHashlist]]]]]]; > As it follows from its name, this will work if there exists some kind > of > hash > function that maps your data to another list on which we can use the > native > sort/union. The implementation hinges on Sort / Union algorithms being > stable (that means, they don't displace elements which are already > equal). > Initial sorting of a list and list of hash values is needed so that the > produced > result is exactly the same as for standard Union - here we also use the > fact > that Sort, Ordering and Union used without SameTest use the same > underlying > sorting algorithm with the same native (canonical) sorting function. > If, > instead of the hash-function, you already have a list of hashcodes, > then will be even faster. > Examples: > 1. Union of integer intervals, sametest - their length: > In[1] = > test = RandomInteger[{1, 100}, {500, 2}]; > In[2] = Union[test, SameTest -> (Subtract @@ #1 == Subtract @@ #2 &)] > // > Short // Timing > Out[2] = > {0.551,{{1,1},{1,30},{1,57},{1,71},{1,72},<<156>,{96,8},{98,21},{98,30},{98, 36}}} > In[3] = unionBy[test, Subtract @@ # &] // Short // Timing > Out[3] = > {0.01,{{1,1},{1,30},{1,57},{1,71},{1,72},<<156>,{96,8},{98,21},{98,30},{98,3 6}}} > Union[test, SameTest -> (Subtract @@ #1 == Subtract @@ #2 &)] > Out[4] = True > 2. Your example (smaller sample): > In[5] = > largetest = RandomInteger[{1, 100}, {1000, 2, 12}]; > In[6] = Union[largetest, SameTest -> (First@#1 == First@#2 &)] // > Short // Timing > Out[6] = > {6.7,{{{1,2,30,69,19,67,70,65,56,79,77,72},{37,50,4,73,<<4>,83,47,73,31}},<< 999>}} > In[7] =unionBy[largetest, First] // Short // Timing > Out[7] = > {0.05,{{{1,2,30,69,19,67,70,65,56,79,77,72},{37,50,4,73,<<4>,83,47,73,31}},< <999>}} > In[8] = unionBy[largetest, largetest[[All, 1]]] // Short // Timing > Out[8] = > {0.04,{{{1,2,30,69,19,67,70,65,56,79,77,72},{37,50,4,73,<<4>,83,47,73,31}},< <999>}} > unionBy[largetest, First] > Out[9] = True > The main idea behind unionBy is described in my book at: > http://www.mathprogramming-intro.org/book/node466.html > where the code is analyzed line by line. > Hope this helps. > Leonid > Hello group! I was a little surprised and puzzled by the following: > In[1]:= $Version > Out[1]= 7.0 for Mac OS X PowerPC (32-bit) (November 10, 2008) > In[2]:= data = RandomInteger[{1, 10}, {5000, 2, 12}]; > Timing[Union[data];] > Out[3]= {0.008138, Null} > So far so good; so far so speedy. But why does this happen: > In[4]:= Timing[Union[data, SameTest -> Equal];] > Out[4]= {15.313, Null} > Or more egregiously, > In[5]:= Timing[Union[data, SameTest -> (First@#1 == First@#2 &)];] > Out[5]= {86.293, Null} > There's nothing special about the form of the data here, just it > happens to be similar in form to the data I was working on when I > experienced terrible slowdown with the SameTest that I've shown in the > third example - which doesn't seem like a demanding comparison. So > can anyone explain the orders-of-magnitude change in times here? Much > appreciated! > -- > DrMajorBob@bigfoot.com > > -- DrMajorBob@bigfoot.com === Subject: Re: 3D plot with orthographic projection Have a look at the very poor documentation for ViewMatrix. In the example shown, replace {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, -1, 0}, {0, 0, 0, 1}} with TransformationMatrix[ReflectionTransform[{0, 0, 1}]] giving Graphics3D[Sphere[], Boxed -> False, ViewMatrix -> {TransformationMatrix[ RescalingTransform[{{-1, 1}, {-1, 1}, {-1, 1}}]], TransformationMatrix[ReflectionTransform[{0, 0, 1}]]}] The reason for having two matrices has to do with lighting. For a somewhat more meaningful example try the following: Manipulate[ Graphics3D[{PointSize[0.05], Sphere[{-1, -1, -1}, 0.05] , Arrowheads[{0.05}], Red, Arrow[Tube[{{0, 0, 0}, {1, 0, 0}}, 0.02]], Text[Style[X, Section], {1, 0, 0}], Green, Arrow[Tube[{{0, 0, 0}, {0, 1, 0}}, 0.02]], Text[Style[Y, Section], {0, 1, 0}], Blue, Arrow[Tube[{{0, 0, 0}, {0, 0, 1}}, 0.02]], Text[Style[Z, Section], {0, 0, 1}]}, ViewCenter -> {{1/2, 1/2, 1/2}, ImageScaled[{1, 1}]}, ViewMatrix -> {TransformationMatrix[ScalingTransform[{1, 1, 1} s]], TransformationMatrix[ ReflectionTransform[ Append[Normalize[pt - {1/2, 1/2}], -1 + 2 SquaredEuclideanDistance @@ (pt - {1/2, 1/2})]]]}], {{s, 0.27, Scale}, 0.1, 0.5}, {pt, {{0.777, 0.292}}, Locator}] Move the locator about to get different views. Hope this helps... Alexander I would like to create a 3D Plot in Mathematica 7 using an > orthographic projection instead of the default stereographic mode. So > far, I have found that it is possible to give something like > ViewPoint->{0,0,Infinity} as an option in order to view at the plot > from the top plane, using orthographic projection. But the ViewPoint > option seems to accept only +/-Infinity for *one* of the directions, > keeping all other zero. However, I would like to look at an > orthographic plot from any viewpoint, just as in the default 3d plots > (that I can rotate with the moue). > Does anybody know how that is possible? Markus === Subject: Re: Collect exponents only Collect[expr,x] seems to work on my Mac using Version 7.? Jack Quoting Bob Hanlon : expr = A Exp[I (x + y) - I x] + A^2 Exp[I (x + y) - I y]; expr /. Exp[z_] :> Exp[Simplify[z]] A^2*E^(I*x) + A*E^(I*y) Map[Simplify, expr, {2}] A^2*E^(I*x) + A*E^(I*y) > Bob Hanlon I was wondering if there's anyway to ask the command Simplify (or > maybe some other command) to only collect terms in the exponents of a > long expression (which contains complex exponentials by the way) and > not perform any other kind of simplification. For example I have an expression like this: A Exp[ I (x+y) - I x] + A^2 Exp[ I (x+y) - I y] ( I is the > the imaginary unit ) Mathematica does two simplications here: it simplifies the terms in > the exponents and factors out the A giving: A (Exp[ I y] + Exp[I x]) whereas I would like to obtain only the exponents simplification, > i.e. A^2 Exp[ I y] + A Exp[ I x] Anybody knows how to do this? > Francisco === Subject: Is it possible with Mathematica? Hi mathematica community, when a=>b then a&&b=a and a||b=b Based on this information 1)I need to know how to use mathematica in order to simplify this logical expression (z == zP && x*y == xP*yP) || (z + x*y == zP + xP*yP) into z + x*y == zP + xP*yP? this means that mathematica should detect the implication between the two expressions and should do the appropriate simplification. 2)Does anyone know of an existing functions or packages that can do this logical simplification? 3) Is there a mechanism in mathematica that is able to recognize automatically the implication between two expressions? 4)If this kind of simplifications is not possible with mathematica, is there a tool that I can use to do logical simplifications? === Subject: including specific values in parametric plots I am modeling mechanical components in Mathematica and there are places, (particularly where these must fit together), where the geometry of a piece must change. Can I, (or how would I), instruct Mathematica's ParametricPlot and ParametricPlot3D symbols to include specific values within the parameter set, (to be located at the geometric boundaries)? (e.g.) If X is a parameter being swept between -1 and 1, how would i instruct Mathematica to include the fixed values 0.522 and 0.824? Further, if the precise location of a boundary is only known after parameter X is given; is there a way (based on that information) to instruct ParametricPlot3D to include a specific value within the range of the second parameter, Y? Michael Young === Subject: Re: How to feed a list of xy pairs into Solve to output xyz Hi: Bill PS. Sorry about the extra closing curly braces. === Subject: Re: Undocumented functions for working with graphics Wolfram uses various internal contexts to organize their work. So the real meaning is just just as if you were organizeing your work in private contexts as when you create a Mathematica package using BegnPackage[mycontext`] and Begin[`Private`]. If you looked at your code using ?? once such a package is loaded then you will see the internal, Private`, context variables with the explicit mycontext`Private` contexts explicitly shown. How Wolfram actually organizes their various internal development contexts is something that I don't know about (I could probably find out, but I have not ever developed anything on that level for Wolfram). My guess is that those contexts date back to Mathematica version 1.0. Best, David > But how can I understand the real meaning of such variables (?) as > Image`ImageDump`cf, Image`ImageDump`list etc.? > Hi there... > When I posted the result to MathGroup, I did edit it a bit to remove > the Image`ImageDump` context prefixes so that it would be easier to > read. I simply did a global replace for the string Image`ImageDump` > so that the resulting code fragment would be more readable. > These bits of code that are high level Mathematica code often have > these various contexts in them based on how Wolfram research handles > internal not-for-general-consumption Mathematica code. > Also some folks may have noticed that one gets a different answer if > one tries to obtain the code in a fresh Mathematica session. This is > because the code in some of these these contexts is not loaded until > one actually tries to first make use fo the function. > So, for example, executing something like > Image[ {{0, 1, 0}, {1, 0, 1}, {0, 1, 0}}] > Will load that code and then subsequently going through the process > that I outlined will create the code that I showed. > Best, > Davidhttp://scientificarts.com/worklife > > times for using it I must launch Mathematica with -cleanStart key > > for clearing the dump. But for Image`ToGraphicsRaster I can not get > > your clear code. My result contains unknown functions like > > Image`ImageDump`list with no attributes: > In[1]:= ClearAttributes[Image`ToGraphicsRaster, {Protected, > > ReadProtected}] > > ?Image`ToGraphicsRaster > Output: > Image`ToGraphicsRaster[Image`ImageDump`list:{_? > > Image`ValidImageQ..}]:=Image`ToGraphicsRaster/@Image`ImageDump`list > Image`ToGraphicsRaster[Image`ImageDump`img_?Image`ValidImageQ]:=Mod= ul= > e > > [{Image`ImageDump`width,Image`ImageDump`height,Image`ImageDump`range,= Im= > ag= > e` = > > ImageDump`cf,Image`ImageDump`data,Image`ImageDump`interleaving,Image`= Im= > ag= > eD = > > ump`imsize}, > > {{Image`ImageDump`width,Image`ImageDump`height},Image`ImageDump`range= ,I= > ma= > ge = > > `ImageDump`cf} > > =ImageData[Image`ImageDump`img, > > {ImageDimensions,DataRange,ColorFunction}]; > > {Image`ImageDump`interleaving,Image`ImageDump`imsize}= > > {Interleaving,ImageSize}/.Options[Image`ImageDump`img]/.Options > > [Image];If ve= > rs= > e > > [ImageData[Image`ImageDump`img,Interleaving->True]],Image`ImageDump`d= at= > a= > =Reverse[First > [Image`ImageDump`img]]];Graphics[Raster[Image`ImageDump`data,{{0,0}, > > {Image`ImageDump`width,Image`ImageDump`height}},Image`ImageDump`range= ,C= > ol= > or = at= > ic= > || > {Image`ImageDump`width,Image`ImageDump`height},ImageSize->Image`Image= Du= > mp= > `imsize],PlotRange->{{0,Image`ImageDump`width}, > {0,Image`ImageDump`height}}]] > How did you get your clear code? > > ...just following up on the method for reverse engineering of my > > previous post, here is part of the code for ToGraphicsRaster obt= ai= > ne= > d > > using that approach: > > Image`ToGraphicsRaster[img_?Image`ValidImageQ] := > > Module[{width, height, range, cf, data, interleaving, > > imsize}, {{width, height}, range, cf} = > > ImageData[ > > img, {ImageDimensions, DataRange, ColorFunction}]; {interle= av= > in= > g, > > imsize} = {Interleaving, ImageSize} /. Options[img] /. > > Options[Image]; > > data = Reverse[ImageData[img, Interleaving -> True]], > > data = Reverse[First[img]]]; > > Graphics[ > > Raster[data, {{0, 0}, {width, height}}, range, > > ColorFunction -> cf], > > ImageSize -> {width, height}, ImageSize -> imsize], > > PlotRange -> {{0, width}, {0, height}}]] > > Does anyone know where such functions as Image`ToGraphicsRast= er= > = > an= > > d > > > Image`PossibleImageQ are documented. Are there other such built= -i= > n > > > functions? At this moment I even can't imagine from where (except= t= > hi= > s > > > group) I could learn that functions mentioned exist... === Subject: Re: Wolfram | Alpha: Acres per square mile? (oddities) I'd add to all of this the observation that the Wolfram|Alpha parser is something that is evolving. I also would have expected it to return the result you were expecting. So, whenever one comes across something like this it is helpful to the W|A team to add a quick comment in the W|A comments field. --David > Try acre mile^2 This query returned the requisite 640 you are looking for. Mr Weisstein put some work into the Unit part. Hans > Just out of curiosity (and a current need for info) (and to start > learning about W|A), typed: > Acres per square mile > into Wolfram | Alpha. Results came back (had to do a little hand editin= g > of the following): > Assuming U.S. acres for acres > Use > international acres > commercial acres > Irish acres > Hungarian acres > instead > Input interpretation: > acres/mi^2 > Unit conversions: > 0.3861 acres per square kilometer > 6.323 square meters per acre > 0.1563 hectares per square kilometer > 0.4047 hectares per square mile > 0.003861 acres per hectare > Don't see 640 there anywhere! -- and something seriously wrong with > that first unit conversion? (not to mention all the others) -- or at > least the way it's phrased -- more like 250 acres per square kilometer? > Went to M7, tried > Needs[Units`] > Convert[Acre, Mile^2] > Mile^2/640 > Went to Units Tutorial: Seems odd to see Centimeter, Meter, > Micron, Mile, and a bunch of arcane units listed there -- but NOT > Kilometer??? (Gram and Kilogram are in there). === Subject: Re: Wolfram | Alpha: Acres per square mile? (oddities) > Just out of curiosity (and a current need for info) (and to start > learning about W|A), typed: > Acres per square mile > > into Wolfram | Alpha. Results came back (had to do a little hand editing > of the following): > > 0.3861 acres per square kilometer > > Don't see 640 there anywhere! -- and something seriously wrong with > that first answer? -- more like 250 acres per square kilometer? > W|A is interpreting your input as the dimensionless unit acres/ > miles^2, which isn't terribly helpful. To get the value of the ratio > the following seem to work: convert one square mile to acres 1 square mile / 1 acre doesn't mean what many (most?) of us would think, and doesn't give you any information at all about how many acres there are in a square km; but is instead the conversion factor between two units. > P.S. You may have already done so, but you can/should submit this kind > of comment/suggestion in the send us feedback field at the bottom of > W|A page. Sorry, I don't agree. I scan this newsgroup daily, every morning. Doesn't WIA, with all its resources, have someone on staff whose responsibility it is to do the same; make informed judgments on which if any posts seem useful and important enough for WIA to consider further; and then slapshot-forward those posts to the right people within WIA? If WIA doesn't do that on its own initiative, well, I'm not going to go out of my way to do what you suggest -- especially knowing my own limited knowledge and understanding as to what contributions might be important or of interest to them. === Subject: Re: display of graphics primitives > On Jun 25, 7:09 am, Sjoerd C. de Vries Why should the grass be green, why do I have to press 'send' when > sending mail and why can't I leave my microwave oven door open while > it's doing its job? And why, just why don't I ever win the lottery? LOL! But I think you forgot the classic, Why is the sky blue? we got an answer for that one :) http://www.wolframalpha.com/input/?i=Why+is+the+sky+blue > the thinking (principles) behind Mathematica's language design. > Count your blessings. Before V6, you had to enclose Graphics with Show > to actually generate visible graphics. Show... now there's another command I don't really understand the > point of! For another day, perhaps. > === Subject: Re: display of graphics primitives Let me try another, less metaphorical, approach. In Mathematica, everything is an expression, and an expression always has a head. In order to display as a (2D) graphic, an expression must have the head Graphics. For example: Head[ Plot[x^2,{x,0,1}] ] Graphics On the one hand, Head[ Graphics[Circle[]] ] Graphics ...so that the result of Graphics[Circle[]] is a displayed circle. On the other hand, Head[ Circle[] ] Circle ... so that the result of Circle[] is NOT a displayed graphic image. The head of such an object is Circle, and a Circle is one of the built-in primitive graphic-like (let me call them) objects. So your original question should perhaps be not, essentially, Why must you wrap Circle[] with Graphics?, but rather Why do you NOT need to wrap a Plot expression with Graphics?. (By the way, there's nothing wrong with Graphics[Plot[x^2,{x,0,1}], it's just redundant.) Well, another such primitive graphic-like object is Line. And if you evaluate, say, FullForm[Plot[x^2, {x, 0, 1}]] then you'll get as result a rather complicated expression, having Head Graphics, that includes among other things a whole bunch of Line expressions. So if a graphic-like object such as Line or Circle immediately displayed graphically, in other words, had head Graphics, then how would you expect to combine such things into a more complicated object such as the result of Plot? My point is that this distinction seems a necessary part of the underlying design of the Mathematica language. At least this is my own understanding of the issue. Perhaps an insider can correct my understanding. (But my point does NOT negate the fact that this distinction can then force the user to resort to annoying circumlocutions, such as to have to add directives inside a plot to specify color, etc., or to include a Prolog or Epilog. David Park's marvelous Presentations package allows you to avoid many such circumlocutions and to treat primitive graphic-like objects and try Graphics objects as if they were all of the same kind.) > On Jun 25, 7:09 am, Sjoerd C. de Vries Why should the grass be green, why do I have to press 'send' when > sending mail and why can't I leave my microwave oven door open while > it's doing its job? And why, just why don't I ever win the lottery? LOL! But I think you forgot the classic, Why is the sky blue? > the thinking (principles) behind Mathematica's language design. > Count your blessings. Before V6, you had to enclose Graphics with Show > to actually generate visible graphics. Show... now there's another command I don't really understand the > point of! For another day, perhaps. -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: laptop recommendation to run mathematica fast? > Most people wouldn't consider the Eee PC a laptop. Wikipedia lists it as a > subnotebook/netbook. If you were looking for speed first and portability > second, you're at the wrong end of the hardware scale. The design of netbooks > factors portability and battery life as strong primary and secondary goals, withperformance as a distant tertiary goal. . . . i begin to think that those most people are right! before all this started i had just assumed that these little netbooks were just little laptops you could lift with one hand, ran for ages and fit inside a handbag. (so, ok, i admit it, i have a fondness for large tapestry handbags, with fringes, does this necessarily make me a frivolous person? -- no, do not answer that!) but in one of the emails people most kindly sent on this matter was a pointer to http://www.cpubenchmark.net/ , a website that collates lots of cpu's benchmarks and shows that the little intel atom N270 in my asus eee pc scores just 305 compared to typical numbers of 2000 and higher for those core 2 duo things, so with the benefit of the hindsight it is unsurprising perhaps the rather poor showing of 0.32 in the internal Mathematica v7.0 benchmark the asus gets. . . . and yet, and yet . . . the now ancient 2.4 GHz pentium 4 scores only 231 in those same cpubenchmark tests, slower than the atom, but yet still has a Mathematica benchmark of 1.0, or 3 times more speedy! comparisons are odious to be sure, but for me at least this performance still is most puzzling and makes the choosing of a real laptop that much harder, so if anyone else would care to post their laptop Mathematica benchmark here i think that could be most helpful but, never mind! may i extend a big hug to everyone who has posted here or emailed to me on this subject? it was most kind of you all to expend time and effort on this matter. a big thankyou f.c. P.S as a complete aside i should perhaps add that by using that OMP_NUM_THREADS = %NUMBER_OF_PROCESSORS% environmental variables trick mentioned in this group many moons ago, i can tweak the eee pc benchmark for Mathematica v5.2 up to 0.44 and use both threads for the matrix multiplication process etc. with cpu usage maxing at 100%. for Mathematica v7.0 however this trick has no effect and benchmark stubbornly remains fixed at 0.32 with maximum cpu usage 50%. === Subject: Removing unused nodes in GraphPlot I'm using GraphPlot to graph a large matrix of 1s and 0s. The matrix is square and I was wondering if there was anyway to get rid of nodes that are not connected to anything in the graph. For example, I have the matirx {{0,1,0}, {1,0,0}, {0,0,0}}. 1->2 and 2->1 are displayed, but 3 is hanging out by itself. Is there a way to turn off showing unused nodes, or should I try and delete the entry before hand? === Subject: Re: Calculate n in binomial distribution > Is it, because Abs isn't differentiable at the peak? > Nope, (cf[n, 0.2, 7] - 0.3)^2 which has its maximum at the same point doesn't work either. > I tried other ways too, like Reduce NMinimize, FindMinimum, but no success. > NMinimize[{Abs[cf[n, 0.2, 7] - 0.3], n > 7}, n] works (if you don't mind n being real). > -- > _________________________________________________________________ > Peter Breitfeld, Bad Saulgau, Germany --http://www.pBreitfeld.de === Subject: Re: Take away the sliders Earlier versions used {bottom, left, top, right}, i.e., clockwise starting at the bottom. This was the logical continuation of the {bottom, left}. This older form still works and is simpler to enter, so I don't often use the new form. Bob Hanlon I don't understand the FrameLabel syntax used below. According to the docs, the value for the option, when all 4 boundaries of the frame, etc., are to be labeled, is { {left, right}, {bottom, top} }. For example: Graphics[Disk[],Frame->True, FrameLabel->{{left,right},{bottom,top}}] The preceding puts those labels where their names lead you to expect. On the other hand, the following input... Graphics[Circle[],Frame->True, FrameLabel->{left,right,bottom,top}] puts left on the bottom, right on the left, bottom on the top, and top on the right. The only non-nested list syntax indicated in the More Information at ref/FrameLabel is of the form {bottom, left}. > Manipulate[a + b, > {{a, 0}, ControlType -> InputField}, > {{b, 0}, ControlType -> InputField}, > FrameLabel -> {None, None, a + b, None}] Manipulate[a + b, > {{a, 0}, InputField}, > {{b, 0}, InputField}, > FrameLabel -> {None, None, a + b, None}] ...I just want to use the boxes below the sliders to enter the parameter > values. I dont want to use the sliders or the other functions coming > with Manipulate. Is there another commando i can use than manipulate, > or just a way to remove the sliders? -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: The Principle Everything is an expression ImportString[ExportString[g, PDF], PDF] looks good .. Jens I think that the underlying principle Everything is an expression in > Mathematica is great and is one of the most exciting advantages of the > Mathematica system. But it is disappointing that this principle is still fails even on > such basic example as representation of a simple Plot. Consider the > following: g = Plot[Sin[x], {x, 0.2, 10}] > Show[FullGraphics[g], AspectRatio -> 1/GoldenRatio] It is clear that the two generated images are significantly different. > This means that the function FullGraphics[] does not gives the true > expression-representation of the first plot. Is it true that in really > we can not get the true representation of the plot as an expression? > And the principle mentioned really fails even on this? Or there is > another way to get it? === Subject: Re: The Principle Everything is an expression I think that the underlying principle Everything is an expression in > Mathematica is great and is one of the most exciting advantages of the > Mathematica system. But it is disappointing that this principle is still fails even on > such basic example as representation of a simple Plot. Consider the > following: g = Plot[Sin[x], {x, 0.2, 10}] > Show[FullGraphics[g], AspectRatio -> 1/GoldenRatio] It is clear that the two generated images are significantly different. > This means that the function FullGraphics[] does not gives the true > expression-representation of the first plot. Is it true that in really > we can not get the true representation of the plot as an expression? > And the principle mentioned really fails even on this? Or there is > another way to get it? > Not sure I follow you. FullGraphics definition in the documentation says: takes a graphics object, and generates a *new* one in which objects specified by graphics options are given as explicit lists of graphics primitives. So it is a different (under the hood) representation. I'm guessing what you really want is FullForm[g]??? This gives you the expression- representation of the first plot. g, i.e. your Plot, is an expression ...you can do stuff with it: g /. Hue[_, _, _] -> RGBColor[1, 0, 0] Mike === Subject: Re: The Principle Everything is an expression This example does not violate the principle. FullGraphics is acting on the graphics expression to generate a new expression. Both are valid expressions and both will render as, visually, entities that are perceived as the same. But their structures may differ. FullGraphics is acting on an expression to yield an expression. Both are expressions and so in this example Everything is an expression . --David I think that the underlying principle Everything is an expression in > Mathematica is great and is one of the most exciting advantages of the > Mathematica system. But it is disappointing that this principle is still fails even on > such basic example as representation of a simple Plot. Consider the > following: g = Plot[Sin[x], {x, 0.2, 10}] > Show[FullGraphics[g], AspectRatio -> 1/GoldenRatio] It is clear that the two generated images are significantly different. > This means that the function FullGraphics[] does not gives the true > expression-representation of the first plot. Is it true that in really > we can not get the true representation of the plot as an expression? > And the principle mentioned really fails even on this? Or there is > another way to get it? > === Subject: Re: The Principle Everything is an expression Alexey, I'm not quite certain of the objective of your question, but I suspect it relates to difficulty in using the WRI graphics paradigm. And that is because their paradigm is unintuitive and constantly points users in the wrong direction if they want anything but one of the standard plots. Old-timers know how to construct their graphics, but even they often stay away from overly complex custom graphics just because of the complexity. The principal problem is that WRI initially built their graphics around set-piece plot types. If your graphic fits closely into one of these, everything is fine. Otherwise you have to figure how to screw it around to get what you want. In regular Mathematica, the standard method for making custom graphics is to use the Epilog statement to add primitives, and to use Show to combine various plots. But there are a lot of problems and users still become confused or discouraged. The problem with Show is that you can be forced into a lot of graphics level jumping if you want to combine primitives with plots. Another problem is that you have to be careful how options are picked up in the Show statement. The problem with Epilog is that it can become the tail that wags the dog. Another step in the wrong direction are the drawing tools introduced in Version 6. At first sight, these seem nice but the problem is that one does not end with a complete single basic textual specification for the graphic. If one wants to change some parameter in the set-piece portion of the plot, then one has to redo all the (unspecified) hand changes with the drawing tools. Another confusion for users is the difference between graphics options that affect the individual items drawn (such as MaxRecursion or Mesh) and options that affect the overall look of the graphic (such as AspectRatio or ImageSize). All of this discourages or confuses many users as can be seen by many questions on MathGroup over the years. Everything is an expression is nice, but a supplemental principle for graphics should be: Everything is a graphics primitive. It is that principle that I implemented as a base part of the Presentations package. All of the set-piece plot types are replaced by corresponding Draw statements that can be used directly as graphics primitives and mixed with other primitives such as Circle or Text, and also with graphic Directives. There are Draw statements for just about every plot type, and there is provision for using third party plots. With this paradigm one just draws one thing after another. It is much more intuitive and users appreciate it and find it easy. The usage of each of the Draw statements is like the underlying plot type statement, but its options are only those that affect the production of the primitives. For example, the options for ParametricPlot are: Options[ParametricPlot] {AlignmentPoint -> Center, AspectRatio -> Automatic, Axes -> True, AxesLabel -> None, AxesOrigin -> Automatic, AxesStyle -> {}, Background -> None, BaselinePosition -> Automatic, BaseStyle -> {}, BoundaryStyle -> Automatic, ColorFunction -> Automatic, ColorFunctionScaling -> True, ColorOutput -> Automatic, ContentSelectable -> Automatic, CoordinatesToolOptions -> Automatic, DisplayFunction :> $DisplayFunction, Epilog -> {}, Evaluated -> Automatic, EvaluationMonitor -> None, Exclusions -> Automatic, ExclusionsStyle -> None, FormatType :> TraditionalForm, Frame -> Automatic, FrameLabel -> None, FrameStyle -> {}, FrameTicks -> Automatic, FrameTicksStyle -> {}, GridLines -> None, GridLinesStyle -> {}, ImageMargins -> 0., ImagePadding -> All, ImageSize -> Automatic, ImageSizeRaw -> Automatic, LabelStyle -> {}, MaxRecursion -> Automatic, Mesh -> Automatic, MeshFunctions -> Automatic, MeshShading -> None, MeshStyle -> Automatic, Method -> Automatic, PerformanceGoal :> $PerformanceGoal, PlotLabel -> None, PlotPoints -> Automatic, PlotRange -> Automatic, PlotRangeClipping -> True, PlotRangePadding -> Automatic, PlotRegion -> Automatic, PlotStyle -> Automatic, PreserveImageOptions -> Automatic, Prolog -> {}, RegionFunction -> (True &), RotateLabel -> True, Ticks -> Automatic, TicksStyle -> {}, WorkingPrecision -> MachinePrecision} But the option list for ParametricDraw is much shorter: Options[ParametricDraw] {AxesOrigin -> Automatic, BoundaryStyle -> Automatic, ColorFunction -> Automatic, ColorFunctionScaling -> True, Evaluated -> Automatic, EvaluationMonitor -> None, Exclusions -> Automatic, ExclusionsStyle -> None, MaxRecursion -> Automatic, Mesh -> Automatic, MeshFunctions -> Automatic, MeshShading -> None, MeshStyle -> Automatic, Method -> Automatic, PlotPoints -> Automatic, PlotRange -> Automatic, PlotStyle -> Automatic, RegionFunction -> (True &), WorkingPrecision -> MachinePrecision, PerformanceGoal :> $PerformanceGoal} The custom drawing statement is also much simpler: Draw2D[ {draw one thing, draw a second thing, directive, draw a third thing, etc...}, options that affect the overall look] Another advantage of dealing directly with the primitives is that they are immediately available for manipulation. It is also possible to generate some of the primitives in advance and just insert them into the Draw2D statement. Analogous considerations apply to the Manipulate statement. It is THE set-piece dynamic presentation and again it is very nice if what you want fits neatly into it. But, flexible as it is, most custom dynamic presentations won't and it is much easier to write your own custom dynamic presentations. In the PlaneGeometry section of Presentations I show a simple method for doing this applied to dynamic geometric diagrams. In a Draw2D statement it is easy to apply Dynamic to just the specific items that are changing. I've posted a few examples of this on MathGroup in the past. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ I think that the underlying principle Everything is an expression in Mathematica is great and is one of the most exciting advantages of the Mathematica system. But it is disappointing that this principle is still fails even on such basic example as representation of a simple Plot. Consider the following: g = Plot[Sin[x], {x, 0.2, 10}] Show[FullGraphics[g], AspectRatio -> 1/GoldenRatio] It is clear that the two generated images are significantly different. This means that the function FullGraphics[] does not gives the true expression-representation of the first plot. Is it true that in really we can not get the true representation of the plot as an expression? And the principle mentioned really fails even on this? Or there is another way to get it? === Subject: Re: Separating real part and imaginary part from each other f[z_] := (a*z + b)/(c*z + d) f[x + I*y] // {Re[#], Im[#]} & // ComplexExpand ? Jens suppose I have the expression f(z) = (a*z+b) / (c*z+d) with z=x+I*y I did the calculation by hand and was able to separate real part fom > imag. part to obtain something like this: g=f(x+I*y) = Re(g) + I * Im(g) But I don't know how to do this in Mathematica. I tried FullSimplify, > Together, Apart, they didn't work. Can you help me? Alexander > === Subject: Re: Separating real part and imaginary part from each other In[28]:= f[z_] = (a*z + b)/(c*z + d) Out[28]= (b + a z)/(d + c z) In[29]:= g = f[x + I*y] Out[29]= (b + a (x + I y))/(d + c (x + I y)) In[31]:= ComplexExpand[Re[g] + I*Im[g]] Out[31]= (b d)/((d + c x)^2 + c^2 y^2) + ( b c x)/((d + c x)^2 + c^2 y^2) + (a d x)/((d + c x)^2 + c^2 y^2) + ( a c x^2)/((d + c x)^2 + c^2 y^2) + ( a c y^2)/((d + c x)^2 + c^2 y^2) + I (-((b c y)/((d + c x)^2 + c^2 y^2)) + ( a d y)/((d + c x)^2 + c^2 y^2)) Then Together[] on the real and imaginary parts and you get: (b d + b c x + a d x + a c x^2 + a c y^2)/( d^2 + 2 c d x + c^2 x^2 + c^2 y^2) + I ((-b c y + a d y)/(d^2 + 2 c d x + c^2 x^2 + c^2 y^2)) suppose I have the expression f(z) = (a*z+b) / (c*z+d) with z=x+I*y I did the calculation by hand and was able to separate real part fom > imag. part to obtain something like this: g=f(x+I*y) = Re(g) + I * Im(g) But I don't know how to do this in Mathematica. I tried FullSimplify, > Together, Apart, they didn't work. Can you help me? Alexander === Subject: Re: interpolation and to extract between 3D plots hwat do you mean with 3D volume the data lie all in a plane an it will never be a volume. Or do you mean ListPlot3D[dtvalues] ? Jens > Hi All, I have the following data in the form {x,y,z} ; dtvalues= {{0.360374, 183.717, -659.}, {10.1899, 186.526, -659.}, > {17.562, 193.898, -659.}, {20.0194, 203.376, -659.}, {17.562, 213.206, > -659.}, {10.1899, 220.578, -659.}, {0.360374, 223.386, -659.}, > {-9.46912, 220.578, -659.}, {-16.8412, 213.206, -659.}, {-19.2986, > 203.376, -659.}, {-16.8412, 193.898, -659.}, {-9.46912, 186.526, > -659.}, {0.360374, 183.717, -660.5}, {10.1899, 186.526, -660.5}, > {17.562, 193.898, -660.5}, {20.0194, 203.376, -660.5}, {17.562, > 213.206, -660.5}, {10.1899, 220.578, -660.5}, {0.360374, 223.386, > -660.5}, {-9.46912, 220.578, -660.5}, {-16.8412, 213.206, -660.5}, > {-19.2986, 203.376, -660.5}, {-16.8412, 193.898, -660.5}, {-9.46912, > 186.526, -660.5}, {0.360374, 183.717, -662.}, {10.1899, 186.526, > -662.}, {17.562, 193.898, -662.}, {20.0194, 203.376, -662.}, {17.562, > 213.206, -662.}, {10.1899, 220.578, -662.}, {0.360374, 223.386, > -662.}, {-9.46912, 220.578, -662.}, {-16.8412, 213.206, -662.}, > {-19.2986, 203.376, -662.}, {-16.8412, 193.898, -662.}, {-9.46912, > 186.526, -662.}}; Two questions > 1.) How to build a 3D volume for visualization for this data. > 2.) Is it possible to extract the data at various z values like {z = > -659.095, -660, eetc.} > === Subject: Re: interpolation and to extract between 3D plots dtvalues = {{0.360374, 183.717, -659.}, {10.1899, 186.526, -659.}, {17.562, 193.898, -659.}, {20.0194, 203.376, -659.}, {17.562, 213.206, -659.}, {10.1899, 220.578, -659.}, {0.360374, 223.386, -659.}, {-9.46912, 220.578, -659.}, {-16.8412, 213.206, -659.}, {-19.2986, 203.376, -659.}, {-16.8412, 193.898, -659.}, {-9.46912, 186.526, -659.}, {0.360374, 183.717, -660.5}, {10.1899, 186.526, -660.5}, {17.562, 193.898, -660.5}, {20.0194, 203.376, -660.5}, {17.562, 213.206, -660.5}, {10.1899, 220.578, -660.5}, {0.360374, 223.386, -660.5}, {-9.46912, 220.578, -660.5}, {-16.8412, 213.206, -660.5}, {-19.2986, 203.376, -660.5}, {-16.8412, 193.898, -660.5}, {-9.46912, 186.526, -660.5}, {0.360374, 183.717, -662.}, {10.1899, 186.526, -662.}, {17.562, 193.898, -662.}, {20.0194, 203.376, -662.}, {17.562, 213.206, -662.}, {10.1899, 220.578, -662.}, {0.360374, 223.386, -662.}, {-9.46912, 220.578, -662.}, {-16.8412, 213.206, -662.}, {-19.2986, 203.376, -662.}, {-16.8412, 193.898, -662.}, {-9.46912, 186.526, -662.}}; To separate by z-values sbz = SplitBy[dtvalues, #[[3]] &]; allZ = Union[dtvalues[[All, 3]]]; Reverse[sbz] == (Cases[dtvalues, {__, #}] & /@ allZ) True Graphics3D[Line /@ sbz, Axes -> True, BoxRatios -> {1, 1, .5}] To close each of the rings Graphics3D[Line /@ (Append[#, First[#]] & /@ sbz), Axes -> True, BoxRatios -> {1, 1, .5}] To add additional rings pts = Append[pts = Cases[dtvalues, {x_, y_, dtvalues[[1, 3]]} :> {x, y, z}], First[pts]]; multiRing = Table[pts, {z, Min[allZ], Max[allZ], (Max[allZ] - Min[allZ])/20}]; Graphics3D[Line /@ multiRing, Axes -> True, BoxRatios -> {1, 1, .5}] Bob Hanlon Hi All, I have the following data in the form {x,y,z} ; dtvalues= {{0.360374, 183.717, -659.}, {10.1899, 186.526, -659.}, {17.562, 193.898, -659.}, {20.0194, 203.376, -659.}, {17.562, 213.206, -659.}, {10.1899, 220.578, -659.}, {0.360374, 223.386, -659.}, {-9.46912, 220.578, -659.}, {-16.8412, 213.206, -659.}, {-19.2986, 203.376, -659.}, {-16.8412, 193.898, -659.}, {-9.46912, 186.526, -659.}, {0.360374, 183.717, -660.5}, {10.1899, 186.526, -660.5}, {17.562, 193.898, -660.5}, {20.0194, 203.376, -660.5}, {17.562, 213.206, -660.5}, {10.1899, 220.578, -660.5}, {0.360374, 223.386, -660.5}, {-9.46912, 220.578, -660.5}, {-16.8412, 213.206, -660.5}, {-19.2986, 203.376, -660.5}, {-16.8412, 193.898, -660.5}, {-9.46912, 186.526, -660.5}, {0.360374, 183.717, -662.}, {10.1899, 186.526, -662.}, {17.562, 193.898, -662.}, {20.0194, 203.376, -662.}, {17.562, 213.206, -662.}, {10.1899, 220.578, -662.}, {0.360374, 223.386, -662.}, {-9.46912, 220.578, -662.}, {-16.8412, 213.206, -662.}, {-19.2986, 203.376, -662.}, {-16.8412, 193.898, -662.}, {-9.46912, 186.526, -662.}}; Two questions 1.) How to build a 3D volume for visualization for this data. 2.) Is it possible to extract the data at various z values like {z = -659.095, -660, eetc.} === Subject: Re: Calculate n in binomial distribution cf[n_, p_, k_] = CDF[BinomialDistribution[n, p], k]; You mean the smallest n such that cf[n, 0.2, 7] < 0.3 or the largest n such that cf[n, 0.2, 7] > 0.3 For largest n such that cf[n, 0.2, 7] > 0.3 Floor[n /. FindRoot[cf[n, 0.2, 7] == 0.3, {n, 40}]] 44 For smallest n such that cf[n, 0.2, 7] < 0.3 Ceiling[n /. FindRoot[cf[n, 0.2, 7] == 0.3, {n, 40}]] 45 cf[#, 0.2, 7] & /@ {44, 45} {0.322925,0.297457} Bob Hanlon Suppose I have the following distribution: cf[n_,p_,k_]=CDF[BinomialDistribution[n,p],k] Now I want to calculate n so that the biggest n such that e.g. cf[n,0.2,7]<0.3 I made a ListPlot ListPlot[Abs[cf[#,0.2,7]-0.3]&/@Range[60]], where I see, that a value of about n=46 gives an approximation nearest to 0.3 To get this value of n I tried Minimize[{Abs[cf[n,0.2,7]-0.3],n>7},n,Integers] Out: {0.699765, {n->11}} which is obviously wrong. Why? Is it, because Abs isn't differentiable at the peak? I tried other ways too, like Reduce NMinimize, FindMinimum, but no success. -- _________________________________________________________________ Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de === Subject: Re: ListLinePlot Marker Location > I believe that the markers in ListLinePlot are not centered on the > actual points. Please see the following example: s1 = {0, 0, 0, 0, 0, 0, 1, 0, 0, 0}; > ListLinePlot[s1, PlotRange -> All, PlotMarkers -> Automatic, > Prolog -> {AbsolutePointSize[10], Red, Point[{7, 1}]}] Any ideas? > Kevin You are right. It is a very disappointing bug. The only relief is that this bug does not affect PDF export (in the only case when export is made by selecting the graphics and using File::Save Selection As...::). Unfortunately, Export[] function produces PDF of much less quality. === Subject: Re: Ansatz? > Also, ansatz might relate etymologically to ersatz, which means > cheap substitute. No it doesn't. Ersatz can be translated in many ways. But it doesn't inherently > involve any assessment, > or quality statement. Some common translations are: > replacement > alternative > compensation > reimbursement > reparation > substitute > Markus Markus, Sounds good. I'll take your word for it. Though I did push the point further in my reply to Roland. Vince === Subject: Re: Ansatz? > Wolfram MathWorld says: > An ansatz is an assumed form for a mathematical statement > that is not based on any underlying theory or principle. > SEE ALSO: Conjecture, Hypothesis, Principle, Proposition > Somewhere I've picked up the idea that ansatz can also be used to > indicate the form or the approach -- more specifically, something > like the choice of coordinates and variables and equations -- the > geometry and notation so to speak -- in which one sets up a problem = or > a calculation. > The underlying theory or principles in my interpretation can be > perfectly clear, and no Conjectures or Hypotheses need be involved= . > One is simply setting up the calculation using this ansatz, in order t= o > calculate certain consequences or numerical results (a calculation whi= ch > one, of course, carries out using Mathematica). > Is my interpretation of this term off the mark? (Wikipedia's > explanation of the term seems to me considerably closer to my > understanding than to Wolfram's definition.) > Also, ansatz might relate etymologically to ersatz, which means > cheap substitute. Ansatz in German etymologically refers to put a tool in working > position, eg the scalpell by the doctor or the pencil of a painter. One uses it in cocking and chemistry, where you put some ingredients in > a pot, make fire and look what is boiling out. And finally one makes an Ansatz in order to speak a sentence or to proof > a theorem (both words mean Satz in German) -- but you fail because you > forgot to switch on your brain. Always the Ansatz is meant as crucial for the outcome. The Ansatz generally means a bundle of methods and ideas applied to > solve a given problem. In mathematics it is used for a setting of special class of solutions > with some free parameters, if one is able to solve the complexity > reduced problem in the parameter space. Standard examples are reductions of linear differential equations to > algebraic equations by a Fourier ansatz with a system of functions > fitting the boundary conditions or the solution of nonlinear ones > fitting the symmetries with a Bethe ansatz. -- Roland Franzius Roland, Understood. Your post prompted me to Google 'define:satz'. 'Satz' appears to mean 'sentence' in German. To my unGermanic eyes, ersatz and ansatz are conjugations of this. I'd be able to distinguish the two words better if I knew how 'er-' and 'an-' could modify the meaning of 'sentence' (a useful collection of 'grammatical' parts in some domain). This isn't too far afield Mathematica's (is it?) principle of 'everything is an expression', which is a lot like communicating by diagramming /sentences/. (Incidentally, every compiler's core abstract- syntax-tree machinery relies on this principle.) Vince Virgilio === Subject: publicon product - a LaTeX file to submit. Although I rather like LyX (http://www.lyx.org), since I use Mathematica so much I was interested in seeing how well it performs in LaTeX production. Publicon, but I have a couple of caveats - hope you can help me: 1) from an old post, mathematica people recently stated (February 2008, post by Steve Luttrell ) that: ...we're still working on publicon. We all got sidetracked trying to finish M6, but now we're starting up again. We are actively coding a 1.1 release, and after that we will be integrating it into Mathematica as a paclet to exploit v6 features, and also as a stand-alone app, Publicon v2. any fresher news? 2) most important, plain LaTeX export is useless without support for document classes. Does Publicon supports them? I'm mostly looking for RevTex4, and IEEEtran. Moreover, it would be useless without the possibility to add new classes on the fly: often conferences ask you to download their class package... thank you for any help... alessandro === Subject: Re: soap films Dimitry, you can certainly simulate everything that can be expressed in terms of mathematical equations. And most probably, Mathematica will be able to realize your simulation. Now, concerning equations of the foam theory. I worked several years in a very close field, the membrane physics. For this reason I am pretty good aware also of results in the area of fluid films. It was pioneered by lord Kelvin already, and since that time practically every problem that can be somehow solved analytically has been solved analytically, while others simulated. There is a huge amount of literature on the problem including good books, reviews and original papers. So, mathematics of such a film is well-known, and you can find it in literature for any statement of problem. There are basically two possibilities: 1. Your problem, Dimitry, is already solved, and all you need is to find this result in literature. This is the most probable case. In some cases you may even find a corresponding Mathematica notebook. 2. Your problem has some peculiarities, and is not solved yet. In this case the peculiarities of your problem are most probable in boundary conditions, rather than in equations. Then what you need is to understand (also on the basis of literature), what equations and boundary conditions correctly describe your case. Here no one of us can help you. It is your personal task, since it is you who is the one who knows the problem in details best of all people. After all, it is your job. Then we may think together, how to simulate it, if you will still need help. There is however, a third possibility, when it is easier to simulate then to make a literature search, then have fun! (Comment for the moderator: sorry, it is again mainly about mathematics, rather than about Mathematica. My answer however, is adequate to the question, as I believe). I don't know how we are to see the example you give below. Is that a web address? I'm certain it is possible to represent soap film surfaces with Mathematica. Here is an example of a minimal surface parametrization (Enneper's minimal surface) and a plot of it: enneper[u_, v_] := {u - u^3/3 + u v^2, -v + v^3/3 - v u^2, u^2 - v^2} ParametricPlot3D[enneper[u, v], {u, -3, 3}, {v, -3, 3}] This is from an excellent book: Alfred Gray, Modern Differential Geometry of Curves and Surfaces with Mathematica, Second Edition, 1998, CRC Press. Specifically with: Chapter 30. Minimal Surfaces Chapter 31. Minimal Surfaces and Complex Variables David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ Hi All, I'm an architect and I trying to apply complex geometry for buildings. Now I'm engaged in simulating of soap films, and my question is how it's possible to simulate soap films(see the picture)/Users/dimitrydemin/Pictures/iPhoto Library/Originals/2009/ stadel/Picture 10.png with mathematica? Dimitry -- Alexei Boulbitch, Dr., habil. Senior Scientist IEE S.A. ZAE Weiergewan 11, rue Edmond Reuter L-5326 Contern Luxembourg Phone: +352 2454 2566 Fax: +352 2454 3566 Website: www.iee.lu === Subject: Re: Separating real part and imaginary part from each ComplexExpand is your friend in such situations. (For reasons I don't know, it seems unknown to too many users.) And of course you must use correct Mathematica syntax (but no reason for those explicit * signs): f[z_] := (a z + b)/(c z + d) ComplexExpand[ f[x + I y] ] suppose I have the expression f(z) = (a*z+b) / (c*z+d) with z=x+I*y I did the calculation by hand and was able to separate real part fom > imag. part to obtain something like this: g=f(x+I*y) = Re(g) + I * Im(g) But I don't know how to do this in Mathematica. I tried FullSimplify, > Together, Apart, they didn't work. Can you help me? Alexander > -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: Separating real part and imaginary part from each Hi Alexander, ComplexExpand is what you need. Porscha Quoting Alexander : suppose I have the expression f(z) = (a*z+b) / (c*z+d) with z=x+I*y I did the calculation by hand and was able to separate real part fom > imag. part to obtain something like this: g=f(x+I*y) = Re(g) + I * Im(g) But I don't know how to do this in Mathematica. I tried FullSimplify, > Together, Apart, they didn't work. Can you help me? Alexander === Subject: Re: Separating real part and imaginary part from each f[z_] = (a*z + b)/(c*z + d); g = f[x + I*y]; g // ComplexExpand // FullSimplify (a*x + I*a*y + b)/(c*x + I*c*y + d) FullSimplify[ComplexExpand[#]] & /@ (Re[g] + I*Im[g]) ((a*x + b)*(c*x + d) + a*c*y^2)/ (c^2*y^2 + (c*x + d)^2) + (I*(a*d*y - b*c*y))/(c^2*y^2 + (c*x + d)^2) % == %% // Simplify True Bob Hanlon suppose I have the expression f(z) = (a*z+b) / (c*z+d) with z=x+I*y I did the calculation by hand and was able to separate real part fom imag. part to obtain something like this: g=f(x+I*y) = Re(g) + I * Im(g) But I don't know how to do this in Mathematica. I tried FullSimplify, Together, Apart, they didn't work. Can you help me? Alexander === Subject: Re: The Principle Everything is an expression I'm not sure why you think this is a case where everything is an expression fails. If you evaluate... FullForm[g] ... then you will indeed get an expression in the Mathematica sense. Likewise for: FullForm[FullGraphics[g]] I think that the underlying principle Everything is an expression in > Mathematica is great and is one of the most exciting advantages of the > Mathematica system. But it is disappointing that this principle is still fails even on > such basic example as representation of a simple Plot. Consider the > following: g = Plot[Sin[x], {x, 0.2, 10}] > Show[FullGraphics[g], AspectRatio -> 1/GoldenRatio] It is clear that the two generated images are significantly different. > This means that the function FullGraphics[] does not gives the true > expression-representation of the first plot. Is it true that in really > we can not get the true representation of the plot as an expression? > And the principle mentioned really fails even on this? Or there is > another way to get it? -- Murray Eisenberg murray@math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305 === Subject: Re: The Principle Everything is an expression g = Plot[Sin[x], {x, 0.2, 10}] Show[g] Bob Hanlon I think that the underlying principle Everything is an expression in Mathematica is great and is one of the most exciting advantages of the Mathematica system. But it is disappointing that this principle is still fails even on such basic example as representation of a simple Plot. Consider the following: g = Plot[Sin[x], {x, 0.2, 10}] Show[FullGraphics[g], AspectRatio -> 1/GoldenRatio] It is clear that the two generated images are significantly different. This means that the function FullGraphics[] does not gives the true expression-representation of the first plot. Is it true that in really we can not get the true representation of the plot as an expression? And the principle mentioned really fails even on this? Or there is another way to get it? === Subject: Help with NMaximize I was trying to minimize a function with one variable. I used NMaximize with various methods but none gave the correct answer. I can plot the objective function in In[3] and the maximum is located at around x=8.6. It appears that the variable x in the objective function is not evaluated in the function Count during the numerical optimization. In[1]:=SeedRandom[1] In[2]:=z = RandomReal[{5, 20}, 10] Out[2]:={17.2608, 6.67129, 16.8429, 7.81705, 8.62041, 5.98608, 13.1337, 8.46732, 10.9401, 15.5071} In[3]:=NMaximize[Count[z, _?(# < x &)]/x + Count[z, _?(# >= x &)]/Max [z], x, Method -> SimulatedAnnealing] Out[3]:={0., {x -> 2.71773}} I would appreciate any help to find the maximum point. K. Zhang === Subject: Re: Eigenvalue bug in Mathematica 7.0.0 I received a message from Wolfram that This issue has been fixed in vista 64 bit for Mathematica version 7.0.1. -MS === Subject: Re: Eigenvalue bug in Mathematica 7.0.0 I tried your example with Mathematica 7.0.1 and cannot find any mistake. Mathematica returns the Eigenvalues {138.983, 138.983, 134.545, 134.545, 132.139, 132.139, 130.106, 130.106, 127.7, 127.7, 125.685, 125.667, 125.306, 125.236, 123.261, 123.261, 121.271, 120.907, 120.797, 118.89, 118.822, 118.385, 118.269, 116.492, 116.359, 114.048, 113.83, 112.135, 111.94, 109.619, 109.391, 105.158, 105.134, -62.1433, -56.109, -56.1087, -49.9294, -49.9193, -43.7204, -43.679, 42.6088, 42.6088, 39.1564, 39.1564, 37.4483, 37.4483, -37.4396, -37.4207, 33.9956, 33.9956, 32.3605, 32.3605, 32.2878, 32.2878, -31.2147, -31.0896, 28.9063, 28.9062, 28.8348, 28.8347, 27.1637, 27.1637, 27.1274, 27.1274, 23.7099, 23.7098, 23.6741, 23.674, 21.967, 21.9669, 21.9669, 21.9669, 18.5135, 18.5134, 18.5134, 18.5132, 16.8509, 16.8509, 16.7702, 16.7702, 13.3985, 13.3985, 13.3171, 13.3169, 11.6985, 11.6985, 11.5893, 11.5893, 8.24605, 8.24605, 8.13687, 8.13687, 6.38447, 6.38447, 2.93206, 2.93206, -2.27249, -2.27249, 1.17992, 1.17992} As you can see, all the eigenvalues occur twice, which indicates, that you have some symmetry in your equations, which you didn't use to reduce the size of the system. Also the Jordan matrix, which you obtain by {ev, em} = Eigensystem[H]; eb=Transpose[em]; jor=Inverse[eb].H.eb; looks reasonable. The numeric errors are quite small. Since the computation of eigenvalues is quite standard and has bin in Mathematica for decades, I doubt, that the program does something wrong. Good luck Alois === Subject: Re: Eigenvalue bug in Mathematica 7.0.0 and you have not spend a idea to upgrade to version 7.0.1 ?? Jens > I find that Mathematica V7.0.0 finds incorrect eigenvalues and eigenvectors of the 100 x 100 real symmetric matrix listed below. You can easily check the first eigenvector produced is not a true eigenvector. I get incorrect results running under I consider this a very serious error. Here is the > 100 x 100 matrix: SNIP > === Subject: Re: Eigenvalue bug in Mathematica 7.0.0 Mark, with version 7.0 for Microsoft Windows (32-bit) (February 18, 2009), I get this: {eivals, eivecs} = Eigensystem[H]; In[]:= And @@ Table[ Chop[Norm[H.eivecs[[i]] - eivals[[i]] eivecs[[i]]]] == 0, {i, Length[eivals]} ] Out[]= True So I think the result is correct. ADL > I find that Mathematica V7.0.0 finds incorrect eigenvalues and eigenvecto= rs of the 100 x 100 real symmetric matrix listed below. You can easily chec= k the first eigenvector produced is not a true eigenvector. I get incorrect results running under bit. I get correct results running under Windows Vista 32 bit. All of the a= bove systems produce correct results if I evaluate with Mathematica V6.0.1.= 0. I consider this a very serious error. Here is the > 100 x 100 matrix: > .... === Subject: Re: Eigenvalue bug in Mathematica 7.0.0 No problems on my system: 7.01 for Microsoft Windows (32-bit), WinXP > I find that Mathematica V7.0.0 finds incorrect eigenvalues and eigenvecto= rs of the 100 x 100 real symmetric matrix listed below. You can easily chec= k the first eigenvector produced is not a true eigenvector. I get incorrect results running under bit. I get correct results running under Windows Vista 32 bit. All of the a= bove systems produce correct results if I evaluate with Mathematica V6.0.1.= 0. I consider this a very serious error. Here is the > 100 x 100 matrix: H = {{-31.071666228176326`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3.2937773840081404`, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 1.7008993272504218`, 0, 0, 0, 0, > 0, -1.3887784852022385`, 0, 0, 0, 0, 1.3887784852022385`, 0, 0, 0= , > 0, 0, -1.7008993272504218`}, {0, -37.28599947381161`, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, -4.166335455606716`, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0.5669664424168073`, -1.7008993272504218`, 0, 0, 0, > 0.9820146844524842`, -1.4730220266787264`, 0, 0, 0}, {0, > 0, -43.50033271944689`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, -4.4190660800361785`, 0, 0, 0, > 0, -2.9460440533574532`, 0, 0, 0, > 0.5669664424168073`, -0.5669664424168073`, 0}, {0, 0, > 0, -49.714665965082176`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -4.166335455606716`, -4.166335455606716`, 0, 0, 0}, {0, 0, 0, > 0, -55.92899921071746`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5.378715944759434`, 0, > 0}, {0, 0, 0, 0, 0, -31.071666228176326`, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, -1.417416106042018`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 1.417416106042018`}, {0, 0, 0, 0, 0, > 0, -37.28599947381161`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, -4.252248318126054`, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.7929053149198115`, 0, 0, 0, 0, 0, 0= , > 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, -43.50033271944689`, 0, 0, 0, = 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, -5.378715944759434`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, -1.9016632593078016`, -1.3446789861898585`}, {0, 0, 0= , > 0, 0, 0, 0, 0, -49.714665965082176`, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, -5.704989777923406`, 0, 0, 0, 0, 0, 0, 0, 0, > 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, -55.92899921071746`, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -5.378715944759434`, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -62.14333245635274`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 33.17864844467907`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1.8121363742166812`, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33.17864844467907`, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -1.8121363742166812`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, = 0, > 0, 0, 0, 0, 0, 0, 0, 29.726241085992804`, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -1.8121363742166812`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, = 0, > 0, 0, 0, 0, 0, 0, 0, 29.726241085992804`, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -1.8121363742166812`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, = 0, > 0, 0, 0, 0, 0, 0, 0, 28.739838983511014`, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -2.339457999465966`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, = 0, > 0, 0, 0, 28.739838983511014`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.339457999465966`, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, = 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25.287431624824748`, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, -2.339457999465966`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, = 0, > 0, 0, 0, 25.287431624824748`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.339457999465966`, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, = 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24.30102952234295`, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, -2.5627478372868366`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 24.30102952234295`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.5627478372868366`, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20.848622163656685`, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, -2.5627478372868366`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 20.848622163656685`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.5627478372868366`, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19.862220061174895`, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, -2.5627478372868366`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0}, = {0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 19.862220061174895`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.5627478372868366`, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -2.4412206547453974`, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 16.40981270248863`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.5627478372868366`, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -2.4412206547453974`, 0, 0, 0, 0}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, > 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 127.63983260675704`, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, = 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127.63983260675704`, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, = 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453974`= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 120.7350178893845`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0}, {0, -4.166335455606716`, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, -2.4412206547453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0, 0, 0, 0, 0, 0, 0, 0, 125.66702840179346`, 0, 0, 0, 0, > 0, 0, 0}, {1.3887784852022385`, 0, -2.9460440533574532`, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118.76221368442091`, 0, 0, 0,= 0, > 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, = 0, > 0, 0, 0, 0, 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 118.7622136844209= 1`, > 0, 0, 0, 0, 0}, {0, 0.9820146844524842`, 0, -4.166335455606716= `, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111.85739896704837`, 0, 0, 0, > 0}, {0, -1.4730220266787264`, 0, -4.166335455606716`, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, -2.4412206547453974`, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111.85739896704837`, 0, 0, > 0}, {0, 0, 0.5669664424168073`, 0, -5.378715944759434`, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 104.95258424967585`, 0, 0}, {0, 0, -0.5669664424168073`, 0, 0, > 0, 0, -1.9016632593078016`, 0, -5.378715944759434`, 0, 0, 0, 0, 0= , > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,= 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 104.95258424967585`, 0}, {-1.7008993272504218`, 0, 0, 0, 0, > 1.417416106042018`, 0, -1.3446789861898585`, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 121.2282189406254`}}; === Subject: Re: Simple question about named variables. the best is to avoid Test1, Test2 and use test[1] and test[2] instead but ClearI[i_] := Clear @@ ToExpression[StringJoin[Test, ToString[i]], InputForm, Hold] will work too. Jens I would like to write a function which clears many variables called: Test1,Test2,... So I write the function: ClearI[i_] := Clear@ToExpression@StringJoin[Test, ToString@i] Test1 = 1; > Test2 = 2; > ClearI[1] does not work because the expression is evaluated. What > mathematica does is Clear@1. How could I ask Mathematica to do > Clear@Test1, Clear@Test2, ... automatically? I am sure that the solution is simple... but I could not find it. > Pianiel > === Subject: Re: Simple question about named variables. Perhaps I'm missing your intention, but the following very simple interaction appears to achieve your goal: In[1]:= x = 5 Out[1]= 5 In[2]:= ClearI[y_] := Clear[x] In[3]:= ClearI[x] In[4]:= x Out[4]= x -----Original Message----- === Subject: Simple question about named variables. I would like to write a function which clears many variables called: Test1,Test2,... So I write the function: ClearI[i_] := Clear@ToExpression@StringJoin[Test, ToString@i] Test1 = 1; Test2 = 2; ClearI[1] does not work because the expression is evaluated. What mathematica does is Clear@1. How could I ask Mathematica to do Clear@Test1, Clear@Test2, ... automatically? I am sure that the solution is simple... but I could not find it. Pianiel === Subject: Re: Fast calculation of pair correlation function The code you've posted doesn't set any histogr elements or give any output (nor do anything else), so it's not entirely clear what you meant to do. (One can only hope that the equivalent C code isn't likewise doing nothing, at higher speed.) I'm guessing this is close to your need: delta = 1; data = RandomReal[{0, 10}, {1000, 3}]; Timing[histogr = Flatten@Table[ Ceiling[Norm[data[[i]] - data[[j]]]/delta], {i, 1, Length[data] - 1}, {j, i + 1, Length[data]}];] Histogram@histogr {4.57758, Null} or (no divide by delta gives a nicer density function) Timing[histogr = Flatten@Table[ Norm[data[[i]] - data[[j]]], {i, 1, Length@data - 1}, {j, i + 1, Length@data}];] Histogram@histogr {3.93137, Null} Drawing the histogram is slower than computing the distances, and I've left that out of the Timing. Bobby I have a quite large list (length ~ 10,000) of coordinates (positions > {x2,y2,z2},...}, and I am looking for fast way to calculate the pair > correlation or radial distribution function, which tells me, for > epsilon). > Usually, this can be calculated by something like: Do[Do[histogr[[ Ceiling[Norm[ data[[i]]-data[[j]] ] / delta] ]], {j, i > +1, Length[data]}], {i, 1, Length[data]-1}] where histogr is just a list whose index corresponds to the distance > r. Unfortunately I have found that for lists of length >1,000, this way > of calculating is very slow (it can take ~minutes), compared to the > equivalent C code, which proceeds in a few seconds. I have also tried > to Compile the function, but the speed does not increase... Does anybody know some fast way of calculating the pair distribution > function in Mathematica? > -- DrMajorBob@bigfoot.com === Subject: Re: Fast calculation of pair correlation function > indeed, there was an error in my first post: it should be histogr > [[ ... ]]++ (see my latest post). > Anyway, I found that Mathematica is too slow for this type of > calculations, at least if the array has more than 10000 entries. > I'm using now a C program, which I call from Mathematica, for that. If I understand correctly what you are trying to do, here's a Mathematica version that takes less than 8 seconds for a 10^4 list (on a 64-bit Vista machine). I use a delta of .001: Needs[HierarchicalClustering`] data = RandomReal[1, {10^4, 3}]; In[7]:= res = Sort@Tally@ Ceiling[(Flatten@ Sqrt@DistanceMatrix[data])/.001]; // AbsoluteTiming Out[7]= {7.4340000, Null} In[8]:= res[[;; 10]] Out[8]= {{0, 10000}, {2, 2}, {3, 4}, {4, 14}, {5, 12}, {6, 42}, {7, 44}, {8, 62}, {9, 76}, {10, 116}} Carl Woll Wolfram Research === Subject: Re: Fast calculation of pair correlation function indeed, there was an error in my first post: it should be histogr [[ ... ]]++ (see my latest post). Anyway, I found that Mathematica is too slow for this type of calculations, at least if the array has more than 10000 entries. I'm using now a C program, which I call from Mathematica, for that. === Subject: Re: LogLinearPlot strange features David Park a =E9crit : > You essentially found the answer. The separately plotted Points have to be > converted to the underlying log plot coordinates. (And these are not the > same as the labeled values.) > It'd be nice to have all the graphics primitives in the same coordinate, > wouldn't it? Yes. Here is one way to work from the same basic data, in fact the same > basic plot primitives, for all four plot types. I'm using the Presentations > package DrawingTransform to transform a set of pre-computed graphics > primitives to the various log plot types. The one down side of this method > is that we have to use CustomTicks and CustomGridLines to specify the proper > ticks and grids. However, especially with the Grids, the Mathematica choice > is quite poor anyway. Besides a poor choice of values, they make the Grid > lines way too dark. Grid lines should be barely visible so they don't stomp > all over the data. (The following plots don't generate any out of domain > messages, but you could just use Quiet on your plots anyway. If Mathematica > can normally ignore non-real plot points, why can't they also ignore points > outside an InterpolatingFunction domain?) > <> I also keep getting that message: > InterpolatingFunction::dmval: Input value {-0.634829} lies outside the > range of data in the interpolating function. Extrapolation will be used. > which I guess is plain wrong since > Exp[-0.6348286996935327`] = 0.5300262742047284` > My point about the out of domain message is that it seems to be a bug, because the values given back by mathematica *are* in the interpolating function domain. Sure I can Quiet it (and this is what I do). -- Fred. === Subject: Re: Collect exponents only great start to know that you guys are so willing to help. Best to all -Francisco > Hi Francisco, one way is to use pattern-matching to simplify only specific expresions: In[1]:= > A Exp[I (x+y)-I x]+A^2 Exp[I (x+y)-I y]/.x:Power[E,_]:> Simplify[x] Out[1] = A^2*E^(I*x) + A*E^(I*y) Leonid > I was wondering if there's anyway to ask the command Simplify (or > maybe some other command) to only collect terms in the exponents of a > long expression (which contains complex exponentials by the way) and > not perform any other kind of simplification. > For example I have an expression like this: > A Exp[ I (x+y) - I x] + A^2 Exp[ I (x+y) - I y] ( I is the > the imaginary unit ) > Mathematica does two simplications here: it simplifies the terms in > the exponents and factors out the A giving: > A (Exp[ I y] + Exp[I x]) > whereas I would like to obtain only the exponents simplification, > i.e. A^2 Exp[ I y] + A Exp[ I x] > Anybody knows how to do this? > Francisco > === Subject: Re: Is it possible with Mathematica? > Hi mathematica community, > when a=>b then a&&b=a and a||b=b > Based on this information > 1)I need to know how to use mathematica in order to simplify this > logical expression > (z == zP && x*y == xP*yP) || (z + x*y == zP + xP*yP) into > z + x*y == zP + xP*yP? this means that mathematica should detect the implication between the > two expressions and should do the appropriate simplification. 2)Does anyone know of an existing functions or packages that can do > this logical simplification? 3) Is there a mechanism in mathematica that is able to recognize > automatically the implication between two expressions? 4)If this kind of simplifications is not possible with mathematica, is > there a tool that I can use to do logical simplifications? If you are willing to use the assumption that all your expressions are real, then Reduce[(z == zP && x*y == xP*yP) || z + x*y == zP + xP*yP, Reals] z == -(x*y) + xP*yP + zP Andrzej Kozlowski === Subject: Re: Is Orange translucent? - What I'd like to chip in with an unsolicited testimonial of my own:David Parks' Presentations package gives an extraordinary boost to the graphical capabilities of Mathematica. A small subset of examples using the Presentations package are shown at http://blackbook.mcs.st-and.ac.uk/~Peter/djmpark/html/, and more info about it is found at David's own pages: http://home.comcast.net/~djmpark/DrawGraphicsPage.html I should also add that I am constantly amazed by the patience and generosity of people like David and Jens-Peer [ and many others ] in answering newbie questions from people like myself. We should also be thankful to the regular contributors from members of Wolfram who clearly keep an eye on developments in this group. Peter 2009/7/6 E. Martin-Serrano at all. I think it is a potential ease to use different paradigm to > (Mathematica) graphics instead. Easier by far. It goes far beyond plotting > lines and patching colors. It saves a lot of time. On the other hand, if > someone posts a question anyone is free to deliver what she/he thinks is a > suitable response. In my opinion that is all. > E. Martin-Serrano -----Original Message----- === > Subject: Re: Is Orange translucent? - What Methods > exist? > The AxesInFront and GridLinesInFront options should be documented= > in > Graphics. But should they be documented in every 2D plot type? That's > probably a lot of work. It's one of the disadvantages of organizing t= > he > graphics around set-piece plot types. > > David Park > Do you have to turn every one of your posts into an advertisment? :/ > > -- m > > Just for the record, I don't share the sentiment voiced in this post. I would also like to echo AES's comment. David Park brings a lot of > value-added content (especially Graphics related) to this newsgroup. I, > for one, value his postings. ......T.L. Harter, PhD > === Subject: Re: eyeofra_ifs.gif (GIF Image, 1044x1044 pixels) - Scaled (87%) John, VertexColors and Multi-Primitives certainly come in handy and offer new effective approaches to complex visualization. But... it is quite vexing that the old-fashioned code is rendered so much slower (whatever the reasons). Many users are not aware of the new approach for larger primitive sets, and it is not very handy to have to re-write old code to get it to run adequately fast. In my case, I often postprocess the old output into multi-primitives (plus VertexColors) and then render them. But this is not always trivial, and might put new users off (or have them complain about bad performance, never a nice thing). Since the rendering can be slowed down (or accelerated, depending on where you stand) significantly, perhaps it would be nice if Mathematica took care of that optimization internally and save the user the hassle. Is there any intent at WRI to get over this issue (e.g. by transparently preprocessing the output before rendering without changing the structure of the graphics expression in the notebook) or will we have to get used to this split approach and code accordingly? Yves > http://www.geocities.com/rlbagulatftn/eyeofra_ifs.gif > The Eye of Ra fractal > by doing an affine inside the > kiss ellipse with reduced the number of transforms in > Mathematica: > Clear[f, dlst, pt, cr, ptlst, x, y] > RandomSeed[]; > dlst = Table[ Random[Integer, {1, 2}], {n, 100000}]; > f[1, {x_, y_}] := N[ {2*x*y/(x^2 + y^2) , (y^2 - x^2)/(y^2 + x^2)}]; > f[2, {x_, y_}] := N[ {(2*((x - y)/ > Sqrt[2]) - (x + y)/Sqrt[2])/( > 2.83), (2*((x - y)/Sqrt[2]) + (x + y)/Sqrt[2])/(2.83)}]; > pt = {0.5, 0.75}; > cr[n_] := If[n - 2 == 0, RGBColor[ > 0, 0, 1], If[n - 3 == 0, RGBColor[0, > 1, 0], If[n - 1 == 0, RGBColor[1, 0, 0], RGBColor[0, 0, 0]]]] > ptlst = Table[{cr[dlst[[j]]], Point[pt = f[dlst[[j]], Sequence[pt]]]}, > {j, Length[dlst]}]; > Show[Graphics[Join[{PointSize[.001]}, ptlst]], > AspectRatio -> Automatic, PlotRange -> All] New to version 7, when doing lists of multi-color points, it's much better to > use a multi-Point primitive with the VertexColors option. Here's an example of > your code refactored (also used FoldList rather than your history-remembering > global variable, which also adds a small speedup). I think you'll find this > rendering significantly faster. Clear[f, dlst, pt, cr, ptlst, x, y]; > RandomSeed[]; > dlst = Table[Random[Integer, {1, 2}], {n, 100000}]; > f[{x_, y_}, 1] := N[{2*x*y/(x^2 + y^2), (y^2 - x^2)/(y^2 + x^2)}]; > f[{x_, y_}, 2] := > N[{(2*((x - y)/Sqrt[2]) - (x + y)/ > Sqrt[2])/(2.83), (2*((x - y)/Sqrt[2]) + (x + y)/ > Sqrt[2])/(2.83)}]; > cr[n_] := > If[n - 2 == 0, RGBColor[0, 0, 1], > If[n - 3 == 0, RGBColor[0, 1, 0], > If[n - 1 == 0, RGBColor[1, 0, 0], RGBColor[0, 0, 0]]]]; > ptlst = {PointSize[.001], > Point[Rest[FoldList[f, {.5, .75}, dlst]], > VertexColors -> cr /@ dlst]}; > Show[Graphics[Join[{PointSize[.001]}, ptlst]], > AspectRatio -> Automatic, PlotRange -> All] > John Fultz > jfultz@wolfram.com > User Interface Group > Wolfram Research, Inc. > === Subject: Re: Install problem of Mathematica kernel I installed Mathematica Player 7.0.1 and it was working fine for a while until a few weeks ago. Now I get this error message everytime I start Mathematica Player Mathematica could not establish a connection to the kernel. Kernel: Local. Low-level MathLink error: Unknown internal error. I'm runnin Windows XP Home Edition Service Pak 3, 32-bit platform. I'm very interested in getting a solution for this problem, too, since I use Mathematica demonstration notebooks to illustrate my classes. === Subject: Pattern matching / subsequence matching, question on example in On pp 154-156 of the book, the example to search a sequence of digits for a given subsequence is shown as FindSubsequence[lis_List, subseq_List] := Module[{p}, p = Partition[lis, Length[subseq], 1]; Position[p, Flatten[{___,subseq, ___}]]] I'm puzzled at the use of Flatten[{___,subseq, ___}] for the pattern, instead of just subseq, and can't seem to see what, if anything, it adds to the functionality of the example. Can someone thaw my brain freeze? Rob === Subject: Re: Using Lists with Mapping Besides the question you're asking, I don't think you're constructing your a and b lists quite the way you want. Try this: a = RealDigits[Pi, 7, 32][[1]]; b = RealDigits[E, 3, 32][[1]]; rule1 = {1 -> 2, 2 -> 4, 3 -> 5, 4 -> 7, 5 -> 9, 6 -> 11} rule2 = {0 -> 1/4, 1 -> 1/8, 2 -> 1/16} a = a /. rule1; b = b /. rule2; Sound[Thread[SoundNote[a, b]], {0, 8}] js (* Given: *) a = RealDigits[Pi,7,32]; b = RealDigits[E,3,32]; rule1 = {1 -> 2, 2 -> 4, 3 -> 5, 4 -> 7, 5 -> 9, > 6 -> 11} (* apply C Major scale to the chromatic scale *) rule2 = {0->1/4,1->1/8,2->1/16} (* apply 3 duration values *) a /. rule1; > b /. rule2; (* How can the below function(s) be modified to allow another list (b) > to by mapped for substitution for the 1/8 duration parameter of the > function? *) Sound[SoundNote[#,1/8] & /@ a, {0,8}] Any help would be greatly apprecated. Benjamin Tubb > brtubb@pdmusic.org > Mathematica 7 Home Edition User !SIG:4a5312f5280391812871034! === Subject: Using Lists with Mapping (* Given: *) a = RealDigits[Pi,7,32]; b = RealDigits[E,3,32]; rule1 = {1 -> 2, 2 -> 4, 3 -> 5, 4 -> 7, 5 -> 9, 6 -> 11} (* apply C Major scale to the chromatic scale *) rule2 = {0->1/4,1->1/8,2->1/16} (* apply 3 duration values *) a /. rule1; b /. rule2; (* How can the below function(s) be modified to allow another list (b) to by mapped for substitution for the 1/8 duration parameter of the function? *) Sound[SoundNote[#,1/8] & /@ a, {0,8}] Any help would be greatly apprecated. Benjamin Tubb brtubb@pdmusic.org Mathematica 7 Home Edition User === Subject: put some elements to zero I have a matrix with only two columns and many rows. For instance {xi,yi}. For those xi {xi, 0} or table /. {xi_, yi_} :> {xi, 0} /; xi < 0.5 Some people who are not used to the programming-with-punctuation style may prefer the partially spelled-out version: ReplaceAll[table, {xi_, yi_} :> Condition[{xi, 0}, xi < 0.5]] Look up tutorial/PuttingConstraintsOnPatterns in the Documentation Center. === Subject: Re: 3D plot with orthographic projection thank you, Alexander, this is what I was looking for, although it is a bit too complicated for my taste. I hope that in the next version of Mathematica there will be some simple option for Graphics3D to enable orthographic projection === Subject: Re: AbsoluteOptions for BarChart Try BarChart[{{16, 8}, {5, 6}}] // First and you can pick off the colors - but not the rectangles. Or try BarChart[{{16, 8}, {5, 6}}] // First // InputForm David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ When I use BarChart[{{16, 8}, {5, 6}}] I get two colors for each group of data, a blue and a green. I am trying to find the RGB values of the blue that is being used in the bar chart. AbsoluteOptions[BarChart[{{16, 8}, {5, 6}}]] // TableForm gives for the value of the ColorOutput option the value Automatic Is there anyway to know what the actual RGB values are that are being used? I thought AbsoluteOptions was the right function to get this information, but it's not === Subject: AbsoluteOptions for BarChart When I use BarChart[{{16, 8}, {5, 6}}] I get two colors for each group of data, a blue and a green. I am trying to find the RGB values of the blue that is being used in the bar chart. AbsoluteOptions[BarChart[{{16, 8}, {5, 6}}]] // TableForm gives for the value of the ColorOutput option the value Automatic Is there anyway to know what the actual RGB values are that are being used? I thought AbsoluteOptions was the right function to get this information, but it's not === Subject: Re: including specific values in To include specific points you can exclude them ParametricPlot[{Sin[u], Sin[2 u]}, {u, 0, 2 Pi}, Exclusions -> {0.522, 0.824}, ExclusionsStyle -> {AbsolutePointSize[1], Red}] ParametricPlot3D[{Sin[2 u], Cos[2 u], u/5}, {u, 0, 5}, Exclusions -> {0.522, 0.824}, ExclusionsStyle -> {AbsolutePointSize[1], Red}] Bob Hanlon It would be nice if you could give a specific example that illustrated a particular case of the problem. You can use options such as MaxRecursion and PlotPoints to refine a plot. It is possible to have the second iterator depend on the value of the first iterator. (Version 6+) RegionFunction can be used to tailor the boundary of a plotted region. It's possible to piece together a larger region from subregions. I don't think it is possible to specify that special points be hit, but I might learn otherwise. If members of this group saw a more specific example I think it is likely there would be some solution. David Park djmpark@comcast.net http://home.comcast.net/~djmpark/ I am modeling mechanical components in Mathematica and there are places, (particularly where these must fit together), where the geometry of a piece must change. Can I, (or how would I), instruct Mathematica's ParametricPlot and ParametricPlot3D symbols to include specific values within the parameter set, (to be located at the geometric boundaries)? (e.g.) If X is a parameter being swept between -1 and 1, how would i instruct Mathematica to include the fixed values 0.522 and 0.824? Further, if the precise location of a boundary is only known after parameter X is given; is there a way (based on that information) to instruct ParametricPlot3D to include a specific value within the range of the second parameter, Y? Michael Young === Subject: Re: Looping- Programming Hi Osman, I packed your procedure in a module and use NestList for looping. Daniel step[poc_] := Module[{new,t}, new = If[RandomReal[] <= 0.1 , t = Round[RandomReal[] #]; {t, # - t} , # ] & /@ poc; new = Flatten[new]; Round[ new RandomReal[{1, 2}, Length[new]] ] ] NestList[step, {1000, 300, 7000, 60, 550}, 20] > We want to make a demonstration about population and cities. Firstly we chose an initial condition, let's say we have 5 cities with population {1000,300,7000,60,550} respectively. After that we give a decision population growth rate with selection random number. After we find new population of cities we decide whether a city divide or not, and how they will divide. We again give a random number to these cities population, > and if this random number 0.0<=x<=0.1 it will divide, if 0.1 cwbd: cities will be divided, > cwNbd: cities will NOT be divided, > pocwbd: population of cwbd > pocwNbd:population of cwNbd, > pocadF+pocadS:pocwbd *) > poc[0] = {1000,300,7000,60,550}; s= Table[Random[], {Count[poc[0], _Integer]}]; p = Partition[Riffle[s, poc[0]], 2]; cwbd = Cases[p, {x_, y_} /; 0.0 <= x <= 0.1]; cwNbd = Cases[p, {x_, y_} /; 0.1 < x <= 1.0]; pocwbd = Cases[cwbd, {x_, y_} -> y]; pocwNbd = Cases[cwNbd, {x_, y_} -> y]; pocadF = IntegerPart[Cases[cwbd, {x_, y_} -> y]* Table[Random[], {Count[pocwbd, _Integer]}]]; pocadS = pocwbd - pocadF; poc[1]= Join[pocwNbd, pocadF, pocadS]; poc[2]=poc[1]+poc[1]*IntegerPart [Table[Random[],{Count[poc[1],_Integer]}]]; s= Table[Random[], {Count[poc[2], _Integer]}]; p = Partition[Riffle[s, poc[2]], 2]; cwbd = Cases[p, {x_, y_} /; 0.0 <= x <= 0.1]; cwNbd = Cases[p, {x_, y_} /; 0.1 < x <= 1.0]; pocwbd = Cases[cwbd, {x_, y_} -> y]; pocwNbd = Cases[cwNbd, {x_, y_} -> y]; pocadF = IntegerPart[Cases[cwbd, {x_, y_} -> y]* Table[Random[], {Count[pocwbd, _Integer]}]]; pocadS = pocwbd - pocadF; poc[3]= Join[pocwNbd, pocadF, pocadS]; poc[Y]=poc[Y-1]+IntegerPart[poc[Y-1]*Table[Random[],{Count[poc[Y-1],_Integer] }]]; s= Table[Random[], {Count[poc[Y], _Integer]}]; p = Partition[Riffle[s, poc[Y]], 2]; cwbd = Cases[p, {x_, y_} /; 0.0 <= x <= 0.1]; cwNbd = Cases[p, {x_, y_} /; 0.1 < x <= 1.0]; pocwbd = Cases[cwbd, {x_, y_} -> y]; pocwNbd = Cases[cwNbd, {x_, y_} -> y]; pocadF = IntegerPart[Cases[cwbd, {x_, y_} -> y]* Table[Random[], {Count[pocwbd, _Integer]}]]; pocadS = pocwbd - pocadF; poc[Y+1]= Join[pocwNbd, pocadF, pocadS] Y's initial value is 4, how can we repeat this loop until 20th step. I want to find poc[5],poc[7],poc[9] etc... Osman Tuna > === Subject: Re: Polynomial rewriting question > Hi Andrew, One simple way is to substitute x= t+y and then call Simplify: In[1] = > Clear[p1,p2,p3,x,y,z,w,p,h]; > p1 = x*z - y*z; > p2 = x^2*w - 2*x*y*w + y^2 w + p; > p3 = 2*s + h + x - y; In[2] = Simplify[# /. x -> t + y] & /@ {p1, p2, p3} Out[2] = {t z,p+t^2 w,h+2 s+t} Whether or not this will be useful in your setting I don't know - > depends on how complex is the real problem. For polynomials this > should > work. Leonid > Consider the following polynomials: Here x,y,z,w,h are variables; rest are constants. > (1) x*z-y*z, (2) x^2*w -2*x*y*w +y^2w + p, (3) 2*s+h+x-y > When we look closely at these, we notice that everywhere x and y occur, they occur as x-y. Suppose we let t= x-y, then we can rewrite the above polynomials as (1) tz (2) t^2*w (3) 2*s+h+t. > How can do this in Mathematica? i.e., given the above 3 polynomials and the set of variables as input, I should get output of x-y and the 3 rewritten polynomials tz, t^2*w, 2*s+h+t. > Note that the above is an example. When I apply the program to any arbitrary and large number of polynomials, in place of x-y above, I would like to get the largest polynomial (maximum number of monomial terms) with as many variables in it as possible. > Andrew. > I somehow missed the original post (and cannot seem to locate it via the MathGroup archives or Google groups, which might just be ineptness on my part). Anyway, automating this process is hit-or-miss at best. Can be attempted using FullSimplify and Experimental`OptimizeExpression, as below. In[11]:= InputForm[Experimental`OptimizeExpression[ FullSimplify[{x*z-y*z, x^2*w -2*x*y*w +y^2w + p, 2*s+h+x-y}], OptimizationLevel->2]] Out[11]//InputForm= Experimental`OptimizedExpression[Block[{Compile`$1, Compile`$2, Compile`$4}, Compile`$1 = -y; Compile`$2 = x + Compile`$1; Compile`$4 = Compile`$2^2; {Compile`$2*z, p + w*Compile`$4, h + 2*s + x + Compile`$1}]] FullSimplify will (sometimes) manage to get its teeth into nature of the optimization might use this in common subexpression elimination. Daniel Lichtblau Wolfram Research === Subject: Re: Polynomial rewriting question Hi Andrew, One simple way is to substitute x= t+y and then call Simplify: In[1] = Clear[p1,p2,p3,x,y,z,w,p,h]; p1 = x*z - y*z; p2 = x^2*w - 2*x*y*w + y^2 w + p; p3 = 2*s + h + x - y; In[2] = Simplify[# /. x -> t + y] & /@ {p1, p2, p3} Out[2] = {t z,p+t^2 w,h+2 s+t} Whether or not this will be useful in your setting I don't know - depends on how complex is the real problem. For polynomials this should work. Leonid > Consider the following polynomials: Here x,y,z,w,h are variables; rest are constants. > (1) x*z-y*z, (2) x^2*w -2*x*y*w +y^2w + p, (3) 2*s+h+x-y When we look closely at these, we notice that everywhere x and y occur, they occur as x-y. Suppose we let t= x-y, then we can rewrite the above polynomials as (1) tz (2) t^2*w (3) 2*s+h+t. How can do this in Mathematica? i.e., given the above 3 polynomials and the set of variables as input, I should get output of x-y and the 3 rewritten polynomials tz, t^2*w, 2*s+h+t. Note that the above is an example. When I apply the program to any arbitrary and large number of polynomials, in place of x-y above, I would like to get the largest polynomial (maximum number of monomial terms) with as many variables in it as possible. Andrew. === Subject: Manipulate not working Manipulate[f[z_] := z^2 - 4*z + k; rpts = Graphics3D[{PointSize[0.02], Red, Point @@ {({Re[#1], Im[#1], 0} & ) /@ (z /. Solve[f[z] == 0, z])}}]; p1 = ParametricPlot3D[{Re[z], Im[z], Re[f[z]]} /. z -> x, {x, 0, 4}, PlotStyle -> {Thickness[0.008], Yellow}]; p2 = Plot3D[Re[f[z]] /. z -> x + I*y, {x, 0, 4}, {y, -4, 4}, PlotRange -> {{0, 4}, {-2, 2}, {-5, 5}}, PlotStyle -> {LightPurple}]; cp1 = ContourPlot[Re[f[x + I*y]] == 0, {x, 0, 4}, {y, -2, 2}]; lns = Cases[Normal[First[cp1]], Line[pts_] :> ({#1[[1]], #1[[2]], 0} & ) /@ pts, {0, Infinity}]; realcontour = Show[Graphics3D[{Thickness[0.008], Purple, Line @@ {lns}}], PlotRange -> {{0, 4}, {-2, 2}, {-5, 5}}]; cp2 = ContourPlot[Im[f[x + I*y]] == 0, {x, 0, 4}, {y, -2, 2}]; lns = Cases[Normal[First[cp2]], Line[pts_] :> ({#1[[1]], #1[[2]], 0} & ) /@ pts, {0, Infinity}]; imagcontour = Show[Graphics3D[{Thickness[0.008], Green, Line @@ {lns}}], PlotRange -> {{0, 4}, {-2, 2}, {-5, 5}}]; realdiagram = Show[{p2, p1, realcontour, imagcontour, rpts}, PlotRange -> {{0, 4}, {-2, 2}, {-5, 5}}, Lighting -> Neutral, BoxRatios -> {1, 1, 1}, AxesLabel -> {Style[x, 20], Style[y, 20], Style[Re, 20]}, AxesEdge -> {{-1, -1}, {1, -1}, {1, 1}}, ImageSize -> {500, 500}], {k, -5, 5, 1}] === Subject: Re: piechart with percent... This changes the Tooltip outputs to percents: Clear@pctPieChart3D pctPieChart3D[nums_List] := PieChart3D@nums /. Style[x_?NumericQ, y_] :> Style[100. x/Total@nums %, y] pctPieChart3D@{1000, 5000, 4000} Bobby > Hi I have a piechart consisting of 3 functions. > PieChart3D[{[Alpha]*[Zeta]*[Psi], [Lambda], f - [Alpha]*[Zeta]* > [Psi] - [Lambda]}] the output from the functions are real numbers.. for instance it could > be 1000, 5000, 4000. > I want to show the procental distribution between these somehow. in > the above example the different functions would have 10% 50% and 40% > written beside them... > -- DrMajorBob@bigfoot.com === Subject: Re: piechart with percent... v = {1000, 5000, 4000}; PieChart3D[v, ChartLabels -> Placed[Style[ToString[100 #/Total[v]] <> %, {Bold, 16}] & /@ v, RadialOutside]] PieChart3D[v, ChartLabels -> Placed[Style[ToString[100 #/Total[v]] <> %, {Bold, 16}] & /@ v, RadialOuter]] Bob Hanlon Hi I have a piechart consisting of 3 functions. PieChart3D[{[Alpha]*[Zeta]*[Psi], [Lambda], f - [Alpha]*[Zeta]* [Psi] - [Lambda]}] the output from the functions are real numbers.. for instance it could be 1000, 5000, 4000. I want to show the procental distribution between these somehow. in the above example the different functions would have 10% 50% and 40% written beside them... === Subject: Re: Simplifying with KroneckerDelta That helps, but maybe I should have been more specfic because I actually have long and more involved expressions. What would be really useful for me in this case would be a replacement rule like this: krule = f[b_] KroneckerDelta[a_, b_] -> f[a] KroneckerDelta[a, b] where f[ ] is any function. For example, if I had an expression like: Exp[a-b] KroneckerDelta[a,b] I would like Mathematica to give me Exp[0] KroneckerDelta[a,b] which after simplifying of course it's just KroneckerDelta[a,b] Is there anyway I can do this? I tried some ways but they didn't work (maybe writing f[b_] is not the right way?) -Francsico > Why not use a rule? krule = b_ KroneckerDelta[a_, b_] -> a KroneckerDelta[a, b] (m + n) KroneckerDelta[k, m + n] /. Krule > k KroneckerDelta[k, m + n] But the real work might be if you have a sum before the KroneckerDelta that > only includes m + n as sub-terms. You could write a routine that collected > on the KroneckerDelta forms, then wrapped Hold around the m+n sub-terms > (both places), then applied the rule and released the Hold. > David Park > djmpark@comcast.net > http://home.comcast.net/~djmpark/ Does anybody know how to tell mathematica to use the KroneckerDelta in > order > to simplify expressions? For example, it would be great if it could receive > something like this: (m+n) KroneckerDelta[k,m+n] and give k KroneckerDelta[k,m+n] Of course this is simple example, but I have an expression which is about > 200 terms long, so if it could use the delta to simplify things by itself, > that would be great. Francisco > -- > View this message in context: http://www.nabble.com/Simplifying-with-KroneckerDelta-tp24362541p24362541.ht > ml