A41 === For those that can't read attachments:I want to find the kernel of this 80 by 96 matrix where the aijk areunspecified. (I already know that the vector v7:= (1, 0, 0, 0, 0, 1, 0,0, 0, 0,1, 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1,-1,0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0,0,0, 0, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0,0,-1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1) is in the kernelbut are there any others?) My computerjust sits there rumbling. Is it too big for my computer or should I notusethe ÔNullSpace' function? (a1111, a1121, a1112, a1122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,a1111, a1211, a1121, a1221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (a2111, a2121, a2112, a2122, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, a2111, a2211, a2121, a2221, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), (a1211, a1221,a1212,a1222, 0, 0, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0,a1121, a1221, a1122, a1222, 0, 0, 0, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, a2111, a2121, a2112, a2122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, a2121, a2221, a2122, a2222, 0, 0, 0, 0), (0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, a1211, a1221, a1212, a1222, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, a1121, a1221,a1122,a1222), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, a2211, a2221, a2212, a2222,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0,a2121, a2221, a2122, a2222)----------------------NS Jones, MathematicsN.S.Jones@bristol.ac.ukReply-To: kuska@informatik.uni-leipzig.de ==== myfunc[a : {__Integer}] /; And @@ ((# >= 0 && # <= 9) & /@ a) := blubmyfunc[_] := Print[incorrect input] Jens> I was wondering if there is an easy way to do this.> I want to input a list of nine numbers. I would like to test each element in> the list prior to acting upon it.> This ends up being a sort of error check on the list prior to manipulating> it, if it is wrong, produce an error message or do nothing with the module.> So, I would like to test each element to be a. an integer, b. >= 0, c. <= 9.> Is there a way to test this list at the input prior to acting upon it?> ==== >-----Original Message----->Sent: Friday, November 08, 2002 8:16 AM>To: mathgroup@smc.vnet.net>>I was wondering if there is an easy way to do this.>>I want to input a list of nine numbers. I would like to test >each element in>the list prior to acting upon it.>>This ends up being a sort of error check on the list prior to >manipulating>it, if it is wrong, produce an error message or do nothing >with the module.>>So, I would like to test each element to be a. an integer, b. >>= 0, c. <= 9.>>Is there a way to test this list at the input prior to acting upon it?>>I don't understand your use of input, and so this might be of no help. But we have pattern matching and Condition for checking arguments, e.g.In[9]:= Remove[f]In[10]:=f[a:{__Integer}] /; And @@ Thread[0 <= a <= 9] := a^2 In[11]:= f[Range[0, 9]]Out[11]= {0, 1, 4, 9, 16, 25, 36, 49, 64, 81}In[12]:= f[{-1, 5}]Out[12]= f[{-1, 5}]In[13]:= f[{9, 10}]Out[13]= f[{9, 10}]In[14]:= f[3]Out[14]= f[3]In[15]:= f[{3, {3}}]Out[15]= f[{3, {3}}]You may separate function and testing completely if you like: In[24]:= Remove[f, test]In[25]:= f[a_] /; test[a] := a^2In[26]:= test[a_List /; VectorQ[a, Head[#] == Integer &]] := And @@ Thread[0<= a <= 9]Such you may vary the tests whenever you like.--Hartmut Wolf ==== 1. Step by StepYour demand is a very frequent one; computer algebra does, however, *not*act like a teacher demonstrating simplification and final solution ofequations on the blackboard. Hence, looking over computer algebra's shoulderis of no benefit for the purpose of learning and cannot be done inMATHEMATICA.2. Nice OutputConvert your input/output to TraditionalForm:Cell -> Convert To -> TraditionalForm.Matthias BodeSal. Oppenheim jr. & Cie. KGaAKoenigsberger Strasse 29D-60487 Frankfurt am MainGERMANYMobile: +49(0)172 6 74 95 77Internet: http://www.oppenheim.de-----Ursprí.b9ngliche Nachricht-----Gesendet: Freitag, 8. November 2002 08:16An: mathgroup@smc.vnet.netBetreff: problemHow do i get mathematica 4 to show me step-by-step how it solved my input?iwant to see the whole process and can't find any option to enable this. the other question is how can i make it show me the solution but in a morenicer form. i mean, to be written like i would write it for my homework.example: i would never write 5^3 but i would write it like 5 and a small 3in the upper right corner of the number 5. i think you all know what i mean.thanks a lot,Teo ==== I have a module which allows a user to definea matrix.This matrix may, of course, have an inverse or not have an inverse.As an example,In[15]:=c = {{5, 17}, {4, 15}};In[16]:=cinv = Inverse[c, Modulus -> 26]Out[16]={{17, 5}, {18, 23}}In[17]:=c = {{5, 5}, {5, 5}};In[18]:=cinv = Inverse[c, Modulus -> 26]Inverse::sing: Matrix !({(({5, 5})), (({5, 5}))}) issingular.Out[18]=Inverse[{{5, 5}, {5, 5}}, Modulus -> 26]How can I have my module fail in the case where an inverse does not exist?I want to end the module and give the user an error message stating to use anew matrix: this one does not have an inverse modulo 26.How can we in general take advantage of error messages or error returnvalues in order to do this? ==== Flip,Here is an example that you may be able to modify for your own use:It would be better to use the option Modulus for inserting the modulus touse - since this is the way that it is done in several built-in functions.Clear[`*]RIM::usage= RIM[s,r,m],for positive integers, s, r and non-negative integerm, constructs an s by s square matrix of integers between -r and r and teststo see if it is invertible modulo m. If it is not invertable it announcesthis in a message and invites the user to try againRIM[n___] :=Module[{s, r, m, thr, mat}, mat /; Which[ Length[{n}] != 3, Message[RIM::argrx, RIM, Length[{n}], 3]; False, !MatchQ[{n}, {(i__Integer)?Positive, _Integer?NonNegative}], Message[RIM::npos]; False, {s, r, m} = {n}; mat = Table[Random[Integer, {-r, r}], {s}, {s}]; Det[mat, Modulus -> m] == 0, Message[RIM::sing, mat, m]; False, True, True ] ];DEFINE MESSAGESI also use the built-in message argrx which is described in the Help Browser[ Other Information]RIM::npos= The first two arguments of RIM must be positive integers, the last onemust be a non-negative integer.;RIM::sing= the matrix `1` created by RIM was not invertible Modulo `2`, please tryagain.;TESTSRIM[3,5,-2,3] RIM::argrx: RIM called with 4 arguments; 3 arguments are expected. RIM[3,5,-2,3]RIM[3,5,-2] RIM::npos: The first two arguments of RIM must be positive integers, thelast one must be a non-negative integer. RIM[3,5,-2]RIM[3,5,0] {{4,-5,1},{0,3,0},{5,-3,2}}RIM[3,5,5] {{1,-2,4},{4,5,4},{-4,2,1}}RIM[3,5,5] RIM::sing: the matrix {{-4,-4,-1},{2,5,-1},{-3,-1,2}} created by RIM wasnot invertible Modulo 5, please try again. RIM[3,5,5]--Allan---------------------Allan HayesMathematica Training and ConsultingLeicester UKwww.haystack.demon.co.ukhay@haystack.demon.co.ukVoice: +44 (0)116 271 4198>> I have a module which allows a user to definea matrix.>> This matrix may, of course, have an inverse or not have an inverse.>> As an example,>> In[15]:=> c = {{5, 17}, {4, 15}};>> In[16]:=> cinv = Inverse[c, Modulus -> 26]>> Out[16]=> {{17, 5}, {18, 23}}>> In[17]:=> c = {{5, 5}, {5, 5}};>> In[18]:=> cinv = Inverse[c, Modulus -> 26]>> Inverse::sing: Matrix !({(({5, 5})), (({5, 5}))}) is> singular.>> Out[18]=> Inverse[{{5, 5}, {5, 5}}, Modulus -> 26]>> How can I have my module fail in the case where an inverse does not exist?> I want to end the module and give the user an error message stating to usea> new matrix: this one does not have an inverse modulo 26.>> How can we in general take advantage of error messages or error return> values in order to do this?> ==== Adam,You just need Select with a pure function.data = {{0.39501, 10}, {1.65689, 20}, {2.40239, 30}, {3.27252, 40}, {4.41738, 50}};Select[data, 2.0 <= First[#] < 4 &]{{2.40239, 30}, {3.27252, 40}}David Parkdjmp@earthlink.nethttp://home.earthlink.net/~djmp/ the final result would be{{2.40239, 30}, {3.27252, 40}}In reality the list is several hundred pairs.Adam ==== >-----Original Message----->Sent: Friday, November 08, 2002 8:14 AM>To: mathgroup@smc.vnet.net>Seemingly simple gridbox question>I think you're saying Sequence[] is always an acceptable replacement for>an argument that otherwise would be missing, while Null would not always>be acceptable.>>If so, that's very useful information.>>Bobby>---snipped--Bobby,that's not quite what I wanted to express: this was not related to argumentsin general, but to the treatment of options.Almost ever, options are passed by a BlankNullSequence pattern variable.(And almost ever there exists a default for them.)Let's first just look at the passing of parameters in general:In[249]:= Remove[g]In[250]:=g[a_, b_:0, c___] := Print[arg 1 = , ToString[a], ; arg 2 = , ToString[b], ; arglist 3 = , ToString[{c}]]In[251]:= g[1]In[252]:= g[1, 2]In[253]:= g[1, 2, 3]In[254]:= g[1, 2, 3, 4]In[255]:= g[, , ,]In[256]:= g[1, Sequence[], 3, 4]In[257]:= g[1, 2, Sequence[]]In[258]:= g[1, 2, Sequence[], 4]What I told, applies for cases In[257] and In[258] but not for In[256] whichwould shift a parameter (3) into a wrong slot (2). Of course you would nevertype such things, but when we calculate options conditionally (as I did), wehave to deal with the case that no option results. For that Sequence[] isan appropriate value, Null normally not. Case In[255] (or any Null at the place of an option) is not acceptablebecause it will early or late run into this problem:In[284]:= expr /. {a -> 1, Null}ReplaceAll::reps: {{a -> 1, Null} is neither a list of replacement rulesnor a valid dispatch table, and so cannot be used for replacing.Out[284]=expr /.{a -> 1, Null}If you program defensively, you always should protect your options parameterby the function OptionQ:In[278]:= Remove [f]In[279]:= f[opts___?OptionQ] := Print[{opts}]In[280]:= f[a -> 1, b :> 2]In[281]:= f[]In[282]:= f[{}]In[283]:= f[, a -> 1]Out[283]= f[Null, a -> 1]Furthermore you should adapt your coding to OptionQ, as also this...In[285]:= f[a -> 1, {{b :> 2, {{{c -> 3}, {}}}}, d -> 4}]{a -> 1, {{b :> 2, {{{c -> 3}, {}}}}, d -> 4}}...passed. This is done exactly because options may accumulate throughnested calls, and also {} can now be understood as no option specified atany place. This may be done e.g. as in Graphics`Graphics`:ScaledPlot[funcs_List,{x_Symbol,xmin_,xmax _},opts___?OptionQ] := Module[{scale, ..., ao, ...}, {scale, ao} = {ScaleFunction, AxesOrigin} /. Flatten[{opts, Options[ScaledPlot]}]; ... ]i.e. Flatten[{opts}] and combine with default Options[...] appropriately.But, alas, not all functions treat their option parameters in such a cleanway; so the wary programmer moves sequence-objects to option slots,Sequence[] is the choice for no option specified.--Hartmut Wolf ==== I would be grateful if you answered with some concrete arguments onthe fundamental functional character of the Mathematica language.not very helpful. This is a technical issue, after all.Orestis Vantzos > Mathematica allow many programming concepts. > Because it should be used by as many persons > as possible and all these persons should pay for> a Mathematica license. > It is not a good idea for a commercial product to> force the customers to learn functional/logic> programming if these cutsomers have 10--20> years of programming experience with FORTRAN 77> (as the most physicist have).> Deep in it's internal structure Mathematica> is a functional/logic language and a functional> logic language uses functions, patterns and> transformation rules *and* it is optimzed> to do this. > If someone like it, he can use Do[], For[] and> Goto[] as in a FORTRAN program. This> will not make Mathematica to a imperativ/procedural> language.> OOP is developed for simulations and > graphical user interfaces where the objects> *must* have its own life like a window on screen> or a car in a traffic simulation.> This concept is very clear realized in Objective C> or Eiffel.> Every programming languagage has its own taste> and ßavor. The taste and ßavor of Mathematica> is functional/logic and if someone can't exist> without the object oriented ßavor he should> stay away from Mathematica.> I don't like to to see that my beloved> programming language is raped by OOP-idiots.> Jens> > [I know what you're thinking; this guy is nuts!]> Anyway, Jens keeps attacking the whole OOP-Mathematica idea based on> the single premise that ÔThis is a Functional Language'. He even does> it in a rather abrupt manner, which I do not appreciate.> Well guess what; Mathematica is NOT a functional language. It can> definitely be used like one.But...> a) Wolfram in the Mathematica Book seems to suggest that Mathematica> is primarily a rules-based language...in A new kind of Science this> assumption is even stronger.> b) Symbols and rules are the fundamentals of Mathematica.> Symbols have UpValues and DownValues (and OwnValues,etc. but let's> keep it simple).> > It is true that an evaluation of the expression s_Symbol[args___] can> be thought of as Ôthe function s is applied to the subexpression> Sequence[args]'.> This is ONLY a metaphor!!!> What really happens is that the symbol s is called upon to apply its> transformation rules stored under DownValues on the expression. This> is the ONLY objective description of the process. Everything else is> an assumption on part of the programmer.> Moreover, UpValues completely throw the functional metaphor out the> window:> in this case s_Symbol[x_Symbol,rest___] is transformed not according> to the Ôfunction' s but according to the UpValues of Ôargument' x !!> So Jens, LISP is a functional language, since its fundamental> structures are function-based. Mathematica is just a darn good> simulation of a functional language. So good, that we have learned to> ignore that it is only a facade.> People like me are trying to build a different interpretation of what> all these symbols and rules are doing (or can be persuaded to do)> inside Mathematica. You look at symbols and see functions; I look and see> objects. An OOP package will only be a Ôsimulation', since Mathematica> is not inherently OO, but I repeat that all the talk about functional> programming in Mathematica is no better in any way.> Rules and symbols are real; the rest is a mindgame.> Orestis Vantzos ==== I'm trying to solve a system of nonlinear algebraic equations.I was hoping to use the FindRoot. However, someof the variables for which I'm solving must satisfy someinequalities. Is there an easy way to impose these constraintsin the solution?George(KthielK@us.ibm.com) ==== George,You might find the new, in Mathematica 4.2, standard packageNumericalMath`NMinimize useful: << NumericalMath`NMinimize` conds = {(Sin[x] - 3/4)^2, 2*Pi < x < 3*Pi}; NMinimize[conds, {x}] NMinimize::strong:Strong inequality has been changed to a weakinequality. {1.232595164407831*^-32, {x -> 7.131247386161068}}Check that the conditions are satisfied conds /. %[[2]] {1.232595164407831*^-32, True}--Allan---------------------Allan HayesMathematica Training and ConsultingLeicester UKwww.haystack.demon.co.ukhay@haystack.demon.co.ukVoice: +44 (0)116 271 4198> I'm trying to solve a system of nonlinear algebraic equations.> I was hoping to use the FindRoot. However, some> of the variables for which I'm solving must satisfy some> inequalities. Is there an easy way to impose these constraints> in the solution?>> George> (KthielK@us.ibm.com)>In-reply-To: <200211080716.CAA07416@smc.vnet.net> ==== KS> How do I go about plotting equations of the form:KS> 1. |z-2i| = 6Plot[Abs[z - 2I] - 6, {z, -3, 3}]By the way, enjoy with a remarkable shape of Plot[Abs[z - 2I] - 6, {z, -100, 100}]Can you explain it?KS> 2. (2z-Conjugate(z))^2 = -6(z + Conjugate(z)Plot[(2z - Conjugate[z])^2 + 6(z + Conjugate[z]), {z, -3, 3}]Plot[(2z - Conjugate[z])^2 + 6(z + Conjugate[z]), {z, -30, 30}]Plot[(2z - Conjugate[z])^2 + 6(z + Conjugate[z]), {z, -300, 300}]KS> In addition, how can you solve the following in terms of exponentials?KS> z^6 = 6 + 3iDo you mean this?Rationalize[N[Abs[6 + 3 I]Exp[I Arg[6 + 3 I]]]]6 + 3 ISolve[z^6 == Abs[6 + 3 I]Exp[I Arg[6 + 3 I]], z]{{z -> -(3^(1/6)*5^(1/12)*E^((I/6)*ArcTan[1/2]))},{{z -> {z -> 3^(1/6)*5^(1/12)*E^((I/6)*ArcTan[1/2])},{z -> -((-1)^(1/3)*3^(1/6)*5^(1/12)*E^((I/6)*ArcTan[1/2]))},{z -> {z -> (-1)^(1/3)*3^(1/6)*5^(1/12)*E^((I/6)*ArcTan[1/2])},{z -> -((-1)^(2/3)*3^(1/6)*5^(1/12)*E^((I/6)*ArcTan[1/2]))},{z -> {z -> (-1)^(2/3)*3^(1/6)*5^(1/12)*E^((I/6)*ArcTan[1/2])}}Or something else?Best wishes,Vladimir BondarenkoWeb : http://www.CAS-testing.org/ (under development, 95% ready) http://maple.bug-list.org/ (under development, 20% ready) ==== 1)In[1]:=<< Algebra`ReIm`In[2]:=x /: Im[x] = 0; y /: Im[y] = 0; z = x + I*y;In[7]:=<< Graphics`ImplicitPlot`In[11]:=ImplicitPlot[ComplexExpand[ Abs[z - 2*I], TargetFunctions -> {Re, Im}] == 6, {x, -7, 7}];2)Could be done in the same way, but is not interesting.In fact,In[16]:=ComplexExpand[(2*z - Conjugate[z])^2, TargetFunctions -> {Re, Im}]Out[16]=x^2 + 6*I*x*y - 9*y^2In[17]:=ComplexExpand[-6*(z + Conjugate[z]), TargetFunctions -> {Re, Im}]Out[17]=-12*xSo x*y = 0 and x^2-9y^2=12*x. The only point is (0;0) !3)The best is to do it by hand :Table[Print[solution , i, : z = , Abs[6 + 3*I]^(1/6), Simplify[ E^((Arg[6 + 3*I]/6)*I + i*2*(Pi/6))]], {i, 0, 5}];Meilleures salutationsFlorian Jaccard-----Message d'origine-----Envoy.8e : ven., 8. novembre 2002 08:16è : mathgroup@smc.vnet.netObjet : Complex Numbers: Plotting EquationsHow do I go about plotting equations of the form:1. |z-2i| = 62. (2z-Conjugate(z))^2 = -6(z + Conjugate(z)In addition, how can you solve the following in terms of exponentials?z^6 = 6 + 3iKev ==== I would like to have a latex output for function SixJSymbolwhich in standard physics notation should look like thisSixJSymbol[{a,b,c}, {d,e,f}] ->{ a b c }{ }{ d e f }Notice curly brackets (should be single big { and } ).To be more accurate, here is the piece of latex codeleft{begin{array}[c]{ccc} a & b & c d & e & f end{array}right}I am trying to do the following Format[SixJSymbol[{j1_, j2_, j3_}, {l1_, l2_, l3_}], TeXForm] := SequenceForm[left{ begin{array}[c]{ccc}, j1, & , j2, & , j3, , l1, & , l2, & , l3, end{array} right}]The problem with this implementation: I get & (instead of simply &) in the latex output.Is there any way to protect & or any other solution to the problem?I am using mmka 4.1AndreiReply-To: kuska@informatik.uni-leipzig.de ==== SixJSymbol[{j, 2, 3}, {i, l, m}] // TraditionalForm // TeXFormdoes already what you want. Jens> I would like to have a latex output for function SixJSymbol> which in standard physics notation should look like this> SixJSymbol[{a,b,c}, {d,e,f}] ->> { a b c }> { }> { d e f }> Notice curly brackets (should be single big { and } ).> To be more accurate, here is the piece of latex code> left{> begin{array}[c]{ccc}> a & b & c > d & e & f> end{array}> right}> I am trying to do the following> Format[SixJSymbol[{j1_, j2_, j3_}, {l1_, l2_, l3_}], TeXForm] :=> SequenceForm[left{ begin{array}[c]{ccc},> j1, & , j2, & , j3, ,> l1, & , l2, & , l3,> end{array} right}> ]> The problem with this implementation:> I get & (instead of simply &) in the latex output.> Is there any way to protect & or any other solution to the problem?> I am using mmka 4.1> Andrei ==== Doris,The problem is not at your end, it is at his end. I suspect that he is still using OS 9, where this was a constant aggravation. Notebooks arriving as attachments are not recognized. (The same file inserted on a windows formatted ßoppy will be recognized.) I wound up writing an applescript to change the creator ßag on such files but discarded it when I moved to OS 10--where it is easy to set the OS to recognize the .nb extension.Begin forwarded message:> To: mathgroup@smc.vnet.net> computers> I have the following problem:>> I created notebooks with Mathematica 4 on a Windows PC. I stored it> attachment to a Professor of mine. He is using a Macintosh> (Mathematica 4 / 4.1). When he saves the attachment on his hard disk> (as Name.nb) Mathematica doesn«t recognize this file and doesn«t open> it. Changing the name of the stored file to Name.txt and then again to> Name.nb solves this problem, the notebook can be opened.>> How do I have to save the notebook or send the attachment that the> notebook can be opened at once without renaming the extension?> I appreciate any help!> TIA>> Doris S.>>Garry HelzerDepartment of MathematicsUniversity of Maryland1303 Math BldgCollege Park, MD 20742-4015 ==== > Aaaargh.> What is with Mathematica (4.2 here) and infinite sums?! (The> following has annoyed me for years. I'm finally indignant enough to> pose this query.)> A nominally infinite sum for which only a finite number of terms> contribute FAILS to evaluate for an uppper index limit of Infinity,> but evaluates PROPERLY for an (arbitrary) finite upper index limit.> Example:> cn = If[n == 0, 1, 0] - 1/2 If[n == 1, 1, 0];> Sum[x^(n-1) cn,{n,0,Infinity}]> gives> If[n == 0, 1, 0] - 1/2 If[n == 1, 1, 0]/((1 - x) x)> while> Sum[x^(n-1) cn,{n,0,731}]> gives> -1/2 + 1/x> (which is, of course, what I want). I've Google-searched to no avail,> nested Evaluate every which way, but only a finite upper limit works> properly--inconvenient for formal results.> Can anybody explain what's going on, or how to coerce Mathematica into not> choking on an infinite number of non-contributing terms?> David M. Wood, Department of Physics, Colorado School of Mines,> http://www.mines.edu/Academic/physics/people/pages/wood.html> > --> David M. Wood, Dept. of Physics, Colorado School of Mines, Golden, CO 80401You get the desired result for concrete upper bounds because the sum isevaluated procedurally, that is, it is explicitly summed. I shouldmention that this is a bit of a design controversy in that proceduraland functional summation are not separated.You do not get a sum using a symbolic or infinite upper bound becausethe symbolic summation code is not able to handle If. You can get whatyou want if you rewrite your function in terms of, say, KroneckerDelta.For example:In[1]:= cn[r_] := KroneckerDelta[r] + KroneckerDelta[r-1]/2In[2]:= InputForm[Sum[x^(n-1) cn[n],{n,0,Infinity}]]Out[2]//InputForm= 1/2 + x^(-1)In[3]:= InputForm[Sum[x^(n-1)*cn[n],{n,0,t}]]Out[3]//InputForm= UnitStep[-1 + t]/2 + UnitStep[t]/xDaniel LichtblauWolfram Research ==== Here is one way that works:In[3]:=cn = KroneckerDelta[n, 0] - (1/2)*KroneckerDelta[n, 1];Sum[Evaluate[x^(n - 1)*cn], {n, 0, Infinity}]Out[4]=-(1/2) + 1/xHowever, I really do think you ought to use;In[5]:=c[n_] := KroneckerDelta[n, 0] - (1/2)*KroneckerDelta[n, 1]In[6]:=Sum[x^(n - 1)*c[n], {n, 0, Infinity}]Out[6]=-(1/2) + 1/xNote that this way you do not even need Evaluate.And, by the way, the reason why your approach does not work is simply that Mathematica does not expect having to deal with an If[...] in an infinite sum. After all, in the case of infinite sums (unlike in the finite one) no actual summation takes place: Mathematica has to work out the answer by means of various transofrmation and the rules it knows about. In the finite case it just counts ...Andrzej KozlowskiYokohama, Japanhttp://www.mimuw.edu.pl/~akoz/http:// platon.c.u-tokyo.ac.jp/andrzej/> Aaaargh.>> What is with Mathematica (4.2 here) and infinite sums?! (The> following has annoyed me for years. I'm finally indignant enough to> pose this query.)>> A nominally infinite sum for which only a finite number of terms> contribute FAILS to evaluate for an uppper index limit of Infinity,> but evaluates PROPERLY for an (arbitrary) finite upper index limit.>> Example:>> cn = If[n == 0, 1, 0] - 1/2 If[n == 1, 1, 0];> Sum[x^(n-1) cn,{n,0,Infinity}]>> gives>> If[n == 0, 1, 0] - 1/2 If[n == 1, 1, 0]/((1 - x) x)>> while>> Sum[x^(n-1) cn,{n,0,731}]>> gives>> -1/2 + 1/x>> (which is, of course, what I want). I've Google-searched to no avail,> nested Evaluate every which way, but only a finite upper limit works> properly--inconvenient for formal results.>> Can anybody explain what's going on, or how to coerce Mathematica into > not> choking on an infinite number of non-contributing terms?> David M. Wood, Department of Physics, Colorado School of Mines,> http://www.mines.edu/Academic/physics/people/pages/wood.html> > -- > David M. Wood, Dept. of Physics, Colorado School of Mines, Golden, CO > 80401> ==== > A nominally infinite sum for which only a finite number of terms> contribute FAILS to evaluate for an uppper index limit of Infinity,> but evaluates PROPERLY for an (arbitrary) finite upper index limit.> Example:> cn = If[n == 0, 1, 0] - 1/2 If[n == 1, 1, 0];> Sum[x^(n-1) cn,{n,0,Infinity}]> gives> If[n == 0, 1, 0] - 1/2 If[n == 1, 1, 0]/((1 - x) x)> while> Sum[x^(n-1) cn,{n,0,731}]> gives> -1/2 + 1/xBoth Andrzej Kozlowski and Daniel Lichtblau were kind enough to respond but maps my original query into a new one:How can I persuade Mathematica to convert its conditionals (which weregenerated by RSolve from a set of recursion relations) into KronckerDeltaswithout carefuly human intervention?-- David M. Wood, Dept. of Physics, Colorado School of Mines, Golden, CO 80401Reply-To: kuska@informatik.uni-leipzig.de ==== in a finite sum the index is replaced by the numericalvalue and all results of the evaluation of the sum-argumentwith arg /. n->i are added.In a infinite sum the index is handled symbolical andso Sum[] can not find out that some of your If[] testswould give True because mathematica can't insert a infinitenumber of n's in a finite time to find all cases where a If[Mod[n,2]==0,__] would give True. Jens> Aaaargh.> What is with Mathematica (4.2 here) and infinite sums?! (The> following has annoyed me for years. I'm finally indignant enough to> pose this query.)> A nominally infinite sum for which only a finite number of terms> contribute FAILS to evaluate for an uppper index limit of Infinity,> but evaluates PROPERLY for an (arbitrary) finite upper index limit.> Example:> cn = If[n == 0, 1, 0] - 1/2 If[n == 1, 1, 0];> Sum[x^(n-1) cn,{n,0,Infinity}]> gives> If[n == 0, 1, 0] - 1/2 If[n == 1, 1, 0]/((1 - x) x)> while> > Sum[x^(n-1) cn,{n,0,731}]> gives> -1/2 + 1/x> (which is, of course, what I want). I've Google-searched to no avail,> nested Evaluate every which way, but only a finite upper limit works> properly--inconvenient for formal results.> Can anybody explain what's going on, or how to coerce Mathematica into not> choking on an infinite number of non-contributing terms?> David M. Wood, Department of Physics, Colorado School of Mines,> http://www.mines.edu/Academic/physics/people/pages/wood.html> > --> David M. Wood, Dept. of Physics, Colorado School of Mines, Golden, CO 80401 ==== Teo,One of the features of Mathematica is that it does a lot of elementaryevaluation and doesn't show you the steps. In some cases it uses internalmethods and you wouldn't even what to see the steps.Still, it is possible to do calculations in a more controlled manner. Thereare a couple of notebooks and a package at my web site that may help you.The StepByStepEquations notebook shows how to solve equations step by stepusing pure functions and map. The ExpressionManipulation package and theaccompanying EvaluationTutorial notebook has routines for evaluatingexpressions in a controlled manner. There are many examples from addition offractions to integration by parts.David Parkdjmp@earthlink.nethttp://home.earthlink.net/~djmp/ ==== Daniel,There are a number of ways.1) Use ImplicitPlotNeeds[Graphics`ImplicitPlot`]ImplicitPlot[x^2 + (y - 1)^2 == 1, {x, -1, 1}];2) Parametrize the circle and use ParametricPlotcirclecurve[center : {_, _}][t_] := {Cos[t], Sin[t]} + centerParametricPlot[Evaluate[circlecurve[{0, 1}][t]], {t, 0, 2Pi}, AspectRatio -> Automatic];3) Use the Circle graphics primitiveShow[Graphics[{Circle[{0, 1}, 1]}], Axes -> True, AspectRatio -> Automatic];David Parkdjmp@earthlink.nethttp://home.earthlink.net/~djmp/ Sender: steve@smc.vnet.netApproved: Steven M. Christensen , Moderator ==== This is an elementary problem. You'd do well to get acquainted with the verybasics of Mathematica, which requires little more than a couple of weeksreading The Book or some textbook on the subject. Anyway, I propose thefirst three approaches which come to my mind, to deal with a list of 10,000pairs. In[1]:=data = Transpose[{Table[Random[Real, {0, 5}], {10000}], Range[10000]}];In[2]:=Timing[Select[data, 2<= #[[1]]< 4 & ]; ]Out[2]={0.047Second,Null}In[3]:=Timing[Cases[data, {x_, y_} /; 2<= x< 4]; ]Out[3]={0.062 Second,Null}In[4]:=Timing[data[[Flatten[Position[Transpose[ data][[1]], x_ /; 2<= x< 4]]]]; ]Out[4]={0.063 Second,Null}Tomas GarzaMexico City----- Original Message -----> {{0.39501, 10}, {1.65689, 20}, {2.40239, 30}, {3.27252, 40}, {4.41738,> 50}}>> I want to select only the pairs for which the first element of each> pair is greater than or equal to 2.0 and less than 4.0 In this case> the final result would be>> {{2.40239, 30}, {3.27252, 40}}>> In reality the list is several hundred pairs.> Adam>> ==== Use this:Cases[data, {_?(# >= 2 && # <= 4 &), _}]Steve Luttrell> I know that this has been covered before, but I could not find it.>> I have a list of data and I want to select a subset based on a> condition.>> A simple example:>> data => {{0.39501, 10}, {1.65689, 20}, {2.40239, 30}, {3.27252, 40}, {4.41738,> 50}}>> I want to select only the pairs for which the first element of each> pair is greater than or equal to 2.0 and less than 4.0 In this case> the final result would be>> {{2.40239, 30}, {3.27252, 40}}>> In reality the list is several hundred pairs.> Adam>Reply-To: kuska@informatik.uni-leipzig.de ==== Select[data, First[#] >= 2 && First[#] <= 4 &] Jens> I know that this has been covered before, but I could not find it.> I have a list of data and I want to select a subset based on a> condition.> A simple example:> data => {{0.39501, 10}, {1.65689, 20}, {2.40239, 30}, {3.27252, 40}, {4.41738,> 50}}> I want to select only the pairs for which the first element of each> pair is greater than or equal to 2.0 and less than 4.0 In this case> the final result would be> {{2.40239, 30}, {3.27252, 40}}> In reality the list is several hundred pairs.> Adam ==== Try these:In[1]:=data={1,3.23,-12,9.5,8.9,2,5,8,-4};In[2]:=If[ Union[IntegerQ /@ data] != {True}, Print[ouch!]]ouch!In[3]:=If[Union[(#1 >= 0 & ) /@ data] != {True}, Print[ouch!]]ouch!In[4]:=If[Union[(#1 <= 9 & ) /@ data] != {True}, Print[ouch!]]ouch!Tomas GarzaMexico City----- Original Message -----> This ends up being a sort of error check on the list prior to manipulating> it, if it is wrong, produce an error message or do nothing with themodule.>> So, I would like to test each element to be a. an integer, b. >= 0, c. <=9.>> Is there a way to test this list at the input prior to acting upon it?> ==== Flip,Something like this.ßiptest = Head[#] === Integer && 0 <= # <= 9 &;list1 = {1.0, 3, 7, 14, 2.5};list2 = {2, 7, 3, 6, 5};ßiptest /@ list1And @@ %{False, True, True, False, False}FalseAnd @@ ßiptest /@ list2TrueDavid Parkdjmp@earthlink.nethttp://home.earthlink.net/~djmp/ ==== Try this:In[1]:=< Dan> ==== Dan,To obtain the graph you have several alternatives. Two of them are:1) Use parametric equations and the Mathematica function ParametricPlot:ParametricPlot[{Cos[t], Sin[t]}, {t, 0, 2*Pi}, AspectRatio -> Automatic];2) Load the standard add-on package Graphics`ImplicitPlot ` and use thefunction ImplicitPlot:< Dan>>Reply-To: kuska@informatik.uni-leipzig.de ==== Needs[Graphics` ImplicitPlot`]ImplicitPlot[x^2 + (y - 1)^2 == 1, {x, -2, 2}] Jens> I want to plot the function x^2 + (y-1)^2 == 1> How do I do this.> DanIn-reply-To: <200211080715.CAA07383@smc.vnet.net> ==== DS> I want to plot the function x^2 + (y-1)^2 == 1DS> How do I do this.<< Graphics`ImplicitPlot`ImplicitPlot[x^2 + (y - 1)^2 == 1, {x, -1, 1}]Reading Help might add your life by way of ornament ;-)Why don't come and try, at the cursor at Ôplot', hitting F1?The total Bible's sweep considered, the biggest thrill available,enjoy :)Best wishes,Vladimir BondarenkoMathematical and Production DirectorSymbolic Testing GroupWeb : http://www.CAS-testing.org/ (under development, 95% ready) http://maple.bug-list.org/ (under development, 20% ready)Mail : 76 Zalesskaya Str, Simferopol, Crimea, Ukraine ==== In[1]:=<{x,y}];Meilleures salutationsFlorian Jaccard-----Message d'origine-----Envoy.8e : ven., 8. novembre 2002 08:16è : mathgroup@smc.vnet.netObjet : Plotting a circle...I want to plot the function x^2 + (y-1)^2 == 1How do I do this.Dan ==== Teo,Steps:We would have to set up some code to go through the kind of steps that wewould use steps and show them because the methods that Mathematica uses willoften not be the ones a person would use.FormatOutput:You can get the output to look like traditional math by selecting the outputcell and using the menu item Cell>Convert To > Traditional Form.(or you can make all output appear in this form by using Cell>Default OutputFormat Type>Traditional FormInput:You can convert your input into traditional math form by selecting the celland and using the menu item Cell>Convert To > Traditional Form.Or you might like to learn to type such forms in directly or by usingpalettes. Help may be found at Help>Help Browser>Other Information >2DExpression Input--Allan---------------------Allan HayesMathematica Training and ConsultingLeicester UKwww.haystack.demon.co.ukhay@haystack.demon.co.ukVoice: +44 (0)116 271 4198> How do i get mathematica 4 to show me step-by-step how it solved myinput?i> want to see the whole process and can't find any option to enable this.> the other question is how can i make it show me the solution but in amore> nicer form. i mean, to be written like i would write it for my homework.> example: i would never write 5^3 but i would write it like 5 and a small 3> in the upper right corner of the number 5. i think you all know what imean.> thanks a lot,> Teo> ==== Teo,For built-in functions, you are out of luck. If you program an algorithmand use that in mathematica, then do Trace[fcn[inputs],_=_], and you willsee most of what is going on. For your last question, set the defaultoutput to TraditionalForm.Matt Herman> How do i get mathematica 4 to show me step-by-step how it solved my input?i> want to see the whole process and can't find any option to enable this.> the other question is how can i make it show me the solution but in a more> nicer form. i mean, to be written like i would write it for my homework.> example: i would never write 5^3 but i would write it like 5 and a small 3> in the upper right corner of the number 5. i think you all know what i mean.> thanks a lot,> Teo>>In-reply-To: <200211080716.CAA07443@smc.vnet.net> ==== T> How do i get mathematica 4 to show me step-by-step how it solved my input?iT> want to see the whole process and can't find any option to enable this.What you are asking for is an age-long dream of many lazy-bonesincluding me and you ;-)Actually, the algorithms and heuristics behind the scene of symboliccomputations yield human unreadable intermediate data roughly equivalentthe omnibus edition of Balzac... or even far much bulkier! There is evena special tech term, intermediate expression swell, to denote this biggestproblem in Computer Algebra.Usually, even for many seemingly innocuous inputs there should be doneformidable, massive, large scale calculations... which are hidden so notto confuse us the users.To see the whole process? The pot of gold at the end of the rainbow?Sure not. However, to produce such the expert system you want wouldrequire a quite sizable investment... That will run to a pretty penny,and up to now, AFAIK, the entrepreneurs seems to be reluctant enoughto tread this thorny path...However, not all is so pitch-dark!Below comes a quotation from the Calculus Derivative and Integral siteat http://www.calc101.com/ Day or night, from anywhere, you can get calculus problems solved in seconds, automatically. You get all the steps including the final answer. Each step is explained in plain English, just like the examples in your textbook. You see it all in standard math notation, just like your teacher at the blackboard.But I am prepared to admit I find it difficult to name the second URLof that ilk 8-(T> the other question is how can i make it show me the solution but in a moreT> nicer form. i mean, to be written like i would write it for my homework.T> example: i would never write 5^3 but i would write it like 5 and a small 3T> in the upper right corner of the number 5. i think you all know what i mean.Use TraditionalForm.{5^3, D[f[z], z], Integrate[f[z], z]} // TraditionalFormBest wishes,Vladimir BondarenkoWeb : http://www.CAS-testing.org/ (under development, 95% ready) http://maple.bug-list.org/ (under development, 20% ready) ==== I am looking for Mathematica code computing representation of _large_ suitableintegers as sums of three squares. I would like to try the approach of EmilGrosswald in chapter 4 of his book `Representation of integers as sums ofsquares', Û1 to 7. ==== >> I am looking for Mathematica code computing representation of _large_ > suitable> integers as sums of three squares. I would like to try the approach > of Emil> Grosswald in chapter 4 of his book `Representation of integers as sums > of> squares', ¤1 to 7.>>How large? If not too large the following will do:In[1]:=< SumOfSquaresRepresentationsSorry, ways off what I need. I already have faster routines for such toyexamples. Perhaps should I have written `really large' instead of `_large_'. ==== You may be able to, but it will require some though and a trial an error, for there is no built in option or anything like that to do this. But the basic idea is simple. L t me illustrate it on a toy problem. Suppose I want to find the solutions of Sin[x]==3/4 lying somewhere between 2Pi and 3Pi. Of course the obvious way would be to use FindRoot with a starting value 2Pi, but I want to start at 0. I simply define a suitable function as follows:In[1]:=g[x_] := (Sin[x] - 3/4)^2 + If[2*Pi < x < 3*Pi, 0, 1]and then use FindRoot in the usual way:In[2]:=FindRoot[Evaluate[g[x] == 0], {x, 0}, WorkingPrecision -> 50, MaxIterations -> 100]Out[2]={x -> 7.1312473861610674849663965707576817827292718868836790 013303355880347`50}There are of course lots of different variants of this approach and some will work better than others. In some cases it may be better to use only smooth functions (created by means of Interpolation) but usually its not needed.Andrzej KozlowskiToyama International UniversityJAPANhttp://sigma.tuins.ac.jp/~andrzej/> I'm trying to solve a system of nonlinear algebraic equations.> I was hoping to use the FindRoot. However, some> of the variables for which I'm solving must satisfy some> inequalities. Is there an easy way to impose these constraints> in the solution?>> George> (KthielK@us.ibm.com)> ==== One possibility:inv[M_, p_] := Block[{$Messages = {}}, Check[Inverse[M, Modulus -> p], Your matrix has no inverse modulo <> ToString[p] <> . Use another one.]]In[2]:=a = {{5, 17}, {4, 15}};In[3]:=b= {{5, 5}, {5, 5}};In[4]:=inv[a, 26]Out[4]={{17,5},{18,23}}In[5]:=inv[b,26]Out[5]=Your matrix has no inverse modulo 26. Use another one.Andrzej KozlowskiYokohama, Japanhttp://www.mimuw.edu.pl/~akoz/http:// platon.c.u-tokyo.ac.jp/andrzej/>> I have a module which allows a user to definea matrix.>> This matrix may, of course, have an inverse or not have an inverse.>> As an example,>> In[15]:=> c = {{5, 17}, {4, 15}};>> In[16]:=> cinv = Inverse[c, Modulus -> 26]>> Out[16]=> {{17, 5}, {18, 23}}>> In[17]:=> c = {{5, 5}, {5, 5}};>> In[18]:=> cinv = Inverse[c, Modulus -> 26]>> Inverse::sing: Matrix !({(({5, 5})), (({5, 5}))}) is> singular.>> Out[18]=> Inverse[{{5, 5}, {5, 5}}, Modulus -> 26]>> How can I have my module fail in the case where an inverse does not > exist?> I want to end the module and give the user an error message stating to > use a> new matrix: this one does not have an inverse modulo 26.>> How can we in general take advantage of error messages or error return> values in order to do this?> ==== >One possibility:>>inv[M_, p_] := Block[{$Messages = {}}, Check[Inverse[M, Modulus -> p], >Your> matrix has no inverse modulo <> ToString[p] <> . Use another >one.]]Hmmm...This Check function does not halt the computation...In[]:=Check[ Inverse[{{5, 5}, {5, 5}}, Modulus -> 26]; Print[123], $Failed]-->Inverse::modp: Value of option Modulus -> 26 should be a prime number.123Out[]=$FailedSome more test:Unprotect[Message];Message[Inverse::modp,__]:=Throw[$ Failed];Protect[Message];Catch[ Inverse[{{5, 5}, {5, 5}}, Modulus -> 26]; 123]--> 123So Throw doesn't work either.Likewise for Return as well.DH ==== Excuse me, that I state some simple thoughts, being in contrast to the thorough insight of Orestis:If you look at the statements of Jens-Peer in a general way, you may state,Jens Peer proposes subroutines as the way to structure programs. That thesubroutines are called functions in this case is rather irrelevant.This leads to the conclusion:Oh what revelation: This is always the starting point of OOP, because theOOP fans think that using objects leads to better programs than usingsubroutines. Hermann Schmitt> ----- Original Message -----> To: > Sent: Saturday, November 09, 2002 6:29 AM>> I would be grateful if you answered with some concrete arguments on> the fundamental functional character of the Mathematica language.> not very helpful. This is a technical issue, after all.> Orestis Vantzos>> >> Mathematica allow many programming concepts.> Because it should be used by as many persons> as possible and all these persons should pay for> a Mathematica license.>> It is not a good idea for a commercial product to> force the customers to learn functional/logic> programming if these cutsomers have 10--20> years of programming experience with FORTRAN 77> > (as the most physicist have).>> Deep in it's internal structure Mathematica> is a functional/logic language and a functional> logic language uses functions, patterns and> transformation rules *and* it is optimzed> > to do this.>> If someone like it, he can use Do[], For[] and> Goto[] as in a FORTRAN program. This> will not make Mathematica to a imperativ/procedural> language.> >> OOP is developed for simulations and> graphical user interfaces where the objects> *must* have its own life like a window on screen> or a car in a traffic simulation.> This concept is very clear realized in Objective C> or Eiffel.>> Every programming languagage has its own taste> and ßavor. The taste and ßavor of Mathematica> is functional/logic and if someone can't exist> without the object oriented ßavor he should> > stay away from Mathematica.> Jens> > [I know what you're thinking; this guy is nuts!]> Anyway, Jens keeps attacking the whole OOP-Mathematica idea based on> the single premise that ÔThis is a Functional Language'. He evendoes> it in a rather abrupt manner, which I do not appreciate.>> > Well guess what; Mathematica is NOT a functional language. It can> definitely be used like one.But...>> a) Wolfram in the Mathematica Book seems to suggest that Mathematica> is primarily a rules-based language...in A new kind of Science this> assumption is even stronger.>> b) Symbols and rules are the fundamentals of Mathematica.> Symbols have UpValues and DownValues (and OwnValues,etc. but let's> keep it simple).> It is true that an evaluation of the expression s_Symbol[args___]can> be thought of as Ôthe function s is applied to the subexpression> Sequence[args]'.>> This is ONLY a metaphor!!!> >> What really happens is that the symbol s is called upon to apply its> transformation rules stored under DownValues on the expression. This> is the ONLY objective description of the process. Everything else is> > an assumption on part of the programmer.>> Moreover, UpValues completely throw the functional metaphor out the> window:> in this case s_Symbol[x_Symbol,rest___] is transformed not according> > to the Ôfunction' s but according to the UpValues of Ôargument' x !!>> So Jens, LISP is a functional language, since its fundamental> structures are function-based. Mathematica is just a darn good> simulation of a functional language. So good, that we have learnedto> ignore that it is only a facade.>> > People like me are trying to build a different interpretation ofwhat> all these symbols and rules are doing (or can be persuaded to do)> inside Mathematica. You look at symbols and see functions; I lookand> see> objects. An OOP package will only be a Ôsimulation', sinceMathematica> is not inherently OO, but I repeat that all the talk aboutfunctional> programming in Mathematica is no better in any way.>> Rules and symbols are real; the rest is a mindgame.>> Orestis Vantzos>> ==== I am using Mathematica 4.0. It might not support Import function, since the expression you proposed to me cannot work. In[2]:=Import[data.csv]Import::guess: Could not guess format from channel data.csv.Out[2]=Import[data.csv]In[3]:=Import[data.csv, CSV]Import::format: CSV is not a recognized Import format.Out[3]=Import[data.csv, CSV]Fortunately, Sseziwa's method works fine to me.{ToExpression[#[[1]]],#[[2]],Sequence@@Table[ToExpression[ #[[i]]],{i,3,8 }]}&/ @ReadList[strm,Word,WordSeparators[Rule]{,},RecordLists [Rule]True]Wen-Feng Hsiao----------> Import[data.css, CSV]> ??> Jens> ==== I am trying to help a friend at a University create some plots of his data. I have a trial version of Mathematica and it looks like it will do the job, but I need help with a simple problem.I have written some code to massage the data and put it in forms for reading into Mathematica.I will be doing a surface plot and want to provide can provide my own triangulation data.I will have data of the form n n n n n n n n n n n n n n n n nI can read this into lists and end up with {n,n,n,n},{n,n,n,n,n,n},{n,n,n,n,n},{n,n}I need to turn this into {n,{n,n,n}},{n,{n,n,n,n,n}},{n,{n,n,n,n}},{n,{n}}to use as the triangulation data.Can some kind soul provide me with some Mathematica code to transfrom my data into the proper format. There are so many features, there must be some simple transformation code.-- Terrell MitchellReply-To: kuska@informatik.uni-leipzig.de ==== {First[#], Rest[#]} & /@ {{n, n, n, n}, {n, n, n, n, n, n}, {n, n, n, n, n}, {n, n}} Jens> I am trying to help a friend at a University create some plots of his> data. I have a trial version of Mathematica and it looks like it will> do the job, but I need help with a simple problem.> I have written some code to massage the data and put it in forms for> reading into Mathematica.> I will be doing a surface plot and want to provide can provide my own> triangulation data.> I will have data of the form> n n n n> n n n n n n> n n n n n> n n> I can read this into lists and end up with> {n,n,n,n},{n,n,n,n,n,n},{n,n,n,n,n},{n,n}> I need to turn this into> {n,{n,n,n}},{n,{n,n,n,n,n}},{n,{n,n,n,n}},{n,{n}}> to use as the triangulation data.> Can some kind soul provide me with some Mathematica code to transfrom my> data into the proper format. There are so many features, there must be> some simple transformation code.> --> Terrell Mitchell ==== > I can read this into lists and end up with> {n,n,n,n},{n,n,n,n,n,n},{n,n,n,n,n},{n,n}> I need to turn this into> {n,{n,n,n}},{n,{n,n,n,n,n}},{n,{n,n,n,n}},{n,{n}}> to use as the triangulation data.How about...In[1]:= tmp = {{n,n,n,n},{n,n,n,n,n,n},{n,n,n,n,n},{n,n}};In[2]:= Map[{First[#], Rest[#]}&, tmp]Out[2]= {{n, {n, n, n}}, {n, {n, n, n, n, n}}, {n, {n, n, n, n}}, {n, {n}}}--Bhuvanesh,Wolfram Research. ==== Here's one approach. Define f[{x_, y___}] := {x, {y}}Then map f through a list containing your lists:In: f /@ {{n, n, n, n}, {n, n, n, n, n, n}, {n, n, n, n, n}}Out: {{n, {n,n,n}}, {n, {n, n, n , n, n}}, {n, {n, n, n, n}}}----Selwyn Hollis> I am trying to help a friend at a University create some plots of his > data. I have a trial version of Mathematica and it looks like it will > do the job, but I need help with a simple problem.> I have written some code to massage the data and put it in forms for > reading into Mathematica.> I will be doing a surface plot and want to provide can provide my own > triangulation data.> > I will have data of the form> n n n n > n n n n n n> n n n n n> n n> I can read this into lists and end up with> {n,n,n,n},{n,n,n,n,n,n},{n,n,n,n,n},{n,n}> I need to turn this into> {n,{n,n,n}},{n,{n,n,n,n,n}},{n,{n,n,n,n}},{n,{n}}> to use as the triangulation data.> Can some kind soul provide me with some Mathematica code to transfrom my > data into the proper format. There are so many features, there must be > some simple transformation code.> ==== Terrell, dat={{n,n,n,n},{n,n,n,n,n,n},{n,n,n,n,n},{n,n}}; {First[#],Rest[#]}&/@dat {{n,{n,n,n}},{n,{n,n,n,n,n}},{n,{n,n,n,n}},{n,{n}}}--Allan--- ------------------Allan HayesMathematica Training and ConsultingLeicester UKwww.haystack.demon.co.ukhay@haystack.demon.co.ukVoice: +44 (0)116 271 4198>> I am trying to help a friend at a University create some plots of his> data. I have a trial version of Mathematica and it looks like it will> do the job, but I need help with a simple problem.>> I have written some code to massage the data and put it in forms for> reading into Mathematica.>> I will be doing a surface plot and want to provide can provide my own> triangulation data.>> I will have data of the form> n n n n> n n n n n n> n n n n n> n n> I can read this into lists and end up with> {n,n,n,n},{n,n,n,n,n,n},{n,n,n,n,n},{n,n}> I need to turn this into> {n,{n,n,n}},{n,{n,n,n,n,n}},{n,{n,n,n,n}},{n,{n}}> to use as the triangulation data.>> Can some kind soul provide me with some Mathematica code to transfrom my> data into the proper format. There are so many features, there must be> some simple transformation code.>> -->> Terrell Mitchell> ==== please excuse my basic Mathematica coding skills as I am only a casual user and wishI could write thing like Stan Wagon, David Wagner or Roam Maeder (maybe someday).Anyway, I have the following snippet from some RSA code I have and waswondering if it could be made cleaner. Sometimes, an e cannot be foundfor the p and q, but I just rerun it. Maybe this should be automatic also,but I am concerned that it may run forever.Any hints as to how to make this more efficient are appreciated. The nrepresents the number of digits in n = pq. I like all of the printouts asthis code is meant to help teach the method (RSA).(*RSA Code Snippet Follows *)Needs[NumberTheory`NumberTheoryFunctions`]RandomPrime[d_] := NextPrime[Random[Integer, {10^(d - 1), 10^d}]]findE[p_, q_] := Module[{res, n = p q, phi = EulerPhi[n]}, res = Random[Integer, {p, n}]; While[GCD[res, phi] != 1, res = Random[Integer, {p, n}]]; res]PubPrivKey[nDigits_] := Module[{l, p, q, n, d, e, publicKey, privateKey}, Clear[l, p, q, n, d, e, publicKey, privateKey]; l = Floor[N[nDigits/2]]; p = RandomPrime[l]; Print[p = , p]; q = RandomPrime[l]; Print[q = , q]; n = p q; Print[n = pq = , n]; phi = EulerPhi[n]; Print[phi = , phi]; e = findE[p, q]; Print[Coprime to phi = e = , e]; d = PowerMod[e, -1, phi]; Print[Modular inverse d = , d]; publicKey = {d, n}; Print[Public Key = {d,n} = , {d, n}]; privateKey = {e, n}; Print[Private Key = {e,n} = , {e, n}]; {publicKey, privateKey}]{$PublicKey, $PrivateKey} = PubPrivKey[10] ==== hi!Has anybody found a final solution to this problem?> If you follow this link, you will see what I have found out about this:> http://forums.wolfram.com/student-support/topics/5709> Brian> Deleting the browserindex.nb does not correct the online help e.g the> online mathematica book is not fully accessable etc.Why are some of> the *.nb files corrupted in the first place?It seems to occur only on> win2k.> >Try deleting ...> >Mathematica4.2DocumentationEnglishMainBook BrowserIndex.nb>> ==== you write below, that you have never written a function with more tha ca. 30statements and a function has typical 5-10 statements.But in the next section you write about packages. That is, there issomething to be designed beyond the single function!You do not see the forest because of the many trees!Hermann Schmitt----- Original Message ----->> It seems that larger packages work perfectly right> without any object oriented extension -- how can this> happen ?>> And yes I mean functional programming when I say> functional programming. Every> real functional/logic programming language> has an assigment. The assigment is not needed> but it save some computation time. Mathematica> has also functions like While[] only for> efficiency.>> Jens> you must differentiate between instructions and the structuring ofprograms.> If you write a small program the structure of the program is no issue.But I> think, that Mathematica is one of the best programming languages, youcan> also program larger programs/applications with Mathematica. Then the> structuring of the program/the applications is an issue. You ignore the> problems of structuring.> Additionally, your usage of the notion functional programming iswrong. If> you read in the literature, you will see, that functional programming is> programming only with functions and expressions and without variablesand> without the assignement of values to variables. I think, you canprogram in> this way in Mathematica, but I do not think, that you mean this.> Hermann> ==== As you write below:Mathematica contains all that is necessary to program in an OO style, butperhaps lacks tools to make such an endeavor easy.Therefore I created an OO system for Mathematica as a package. I think, thatit contains all the features, which are considered necessary for an OOsystem.You may find a small example program for my system in my contribution ofNov. 4, 10.38.I shall make my package available, soon, on my web site:www.schmitther.deHermann Schmitt----- Original Message ----->> (unfortunately due to the change in subject lines this thread seems to>> have split into 4 separate ones) you can inherit structure and methods>> etc. I know Orestis used downvalues but I think upvalues would be>> more>> efficient. I'd also change his method to use a symbol without a>> definition rather than overloading Dot. If you are using Mathematica>> you already have to condition yourself to use Map, Fold et al. rather>> than Do, For, While etc. What's wrong with using pattern matching for>> structures instead of tuples?>> The whole idea is going beyond a simple Ôrecord', all the way to a> full ßedged object, complete with methods. I used DownValues, because> I think that the message passing mechanism is best pictured in> Mathematica as obj@method[args] rather than as method[obj,args]. What> I mean to say is that the object obj receives the message method[args]> rather than method is applied on {obj,args}, which would be more> functional in style.> There is a major implementation issue related with my use of> DownValues, instead of UpValues. Although the identity of the object> is obvious, the identity of the method is not, given that inheritance> and polymorphism can identify several pieces of code with the same> Ômethod'. It is therefore wise to enclose the Ôunstable' part of the> expression (method[args]) with the definite one (obj), incase some> form of processing is needed before the message is actualy evaluated> (in which case you would SetAttributes[onj,HoldAll] ).> The UpValues versus DownValues issue is a matter of taste as you seem> to agree (as is the use of Dot). I was just suggesting the my personal> preference is to use the UpValues. The post to which you are replying> was a response to a question about porting code which used C struct> types to Mathematica, OO issues were not mentioned. I was merely> suggesting that if you wanted to mechanically port (by which I mean> substituting a roughly equivalent Mathematica expression for each line> of C code) C code containing structs then changing the structs to> expressions with heads sorted by type may be a better idea than> maintaining them as lists.>> That said, I have never had occasion to do this myself and am merely> it seems you have had experience in just such a project and I will> defer to your wisdom on the subject.>> Finally to make my own position perfectly clear. I believe that> Mathematica contains all that is necessary to program in an OO style> but perhaps lacks tools to make such an endeavor easy. I'm not even> sure what those tools should be since they would almost necessarily> enforce some sort of OO policy decisions (ie. delegates as Orestis uses> or the more static hierarchy using lists of rules presented earlier)> which would make someone unhappy. In fact it seems that similarly to> the way X Windows allows the creation of a GUI without specifying the> rules of the GUI (focus follows mouse, menubar on window or desktop> etc.) Mathematica allows OO without making decisions about the specific> form either. To use OO in Mathematica then it would probably be better> to understand the more general object model of a system such as CLOS> than a more rigid model such as Java or C++. Anyway, I've already said> more than I ever intended to on this subject. It seems the best way to> make any productive contributions to this subject is for people to> actually implement projects using OO techniques in Mathematica and> present them. If there is any interest then I'm sure Mathematica users> will be able to generalize whatever features are necessary to make OO> programming easy in Mathematica and maybe even get them included as a> standard package.> Ssezi>> ==== > I will have data of the form> n n n n > n n n n n n> n n n n n> n n> I can read this into lists and end up with> {n,n,n,n},{n,n,n,n,n,n},{n,n,n,n,n},{n,n}> I need to turn this into> {n,{n,n,n}},{n,{n,n,n,n,n}},{n,{n,n,n,n}},{n,{n}}Lett = {{a, b, c, d, e}, {f, g, h}, {i, j}, {k}};Then a suitable transformation isr = {(a_)?AtomQ, b__} :> {a, {b}}so thatt /. rgives you what you want. If you choose to process the members of list t oneat a time (or if you give t some Head other than List), then the simplerpattern {a_, b__} will do. The more complicated pattern avoids a match withthe entire list as a unit (i.e., at level 0).Tom Burton ==== Terrell,If you start withdata = {{n, n, n, n}, {n, n, n, n, n, n}, {n, n, n, n, n}, {n, n}};Map the following pure function onto the data items{First[#], Rest[#]} & /@ data{{n, {n, n, n}}, {n, {n, n, n, n, n}}, {n, {n, n, n, n}}, {n, {n}}}/@ is the shortcut for Map and everything through & is the pure function.David Parkdjmp@earthlink.nethttp://home.earthlink.net/~djmp/ n n n n n n n n n n n n nI can read this into lists and end up with {n,n,n,n},{n,n,n,n,n,n},{n,n,n,n,n},{n,n}I need to turn this into {n,{n,n,n}},{n,{n,n,n,n,n}},{n,{n,n,n,n}},{n,{n}}to use as the triangulation data.Can some kind soul provide me with some Mathematica code to transfrom my data into the proper format. There are so many features, there must be some simple transformation code.-- Terrell Mitchell ==== I have, what I believe, a system of two linear, first-order, inhomogeneous differential equations describing a real biological system. When I tried to solve this system for a numerical solution by NDSolve, it gave a solution that was different from that of the symbolic solution (in which I used the same boundary conditions).NDSolve[{y1'[t] == a y1[t] + b y2[t], y2'[t] == d + c y1[t] - b y2[t], y1[0] == 0.0018, y2[0] == 0.03}, {y1[t], y2[t]}, {t, 0, 18000}, MaxSteps -> 1000000, AccuracyGoal -> 10, PrecisionGoal -> 10, WorkingPrecision -> 20]DSolve[{y1'[t] == a y1[t] + b y2[t] , y2'[t] == d + c y1[t] - b y2[t] }, {y1[t], y2[t]}, t]I am puzzled by these results, and would very much like to arrive at an analytical solution. I would very much appreciate ideas and suggestions to help me get there.Many thanks in advance.Loling SongCornell UniversityDepartment of Physics,117 Clark Hall,Ithaca, NY 14853 ==== Is there any standard, immediately available way in the Mathematica front end to obtain an Outline type of behavior, in which one can close and/or then re-open cells in a Mathematica notebook level by level, globally, preferably using a keyboard shortcut, in a hierarchical fashion which follows the numbered Styles in the Format menu?I' m sure there's some complex way to do this, but is there anything immediately built in?)-----Power tends to corrupt. Absolute power corrupts absolutely. Lord Acton (1834-1902) (slightly modified)Dependence on advertising tends to corrupt. Total dependence on advertising corrupts totally. -- Modern equivalent. ==== I'm quite new in operating with Mathematica. Solving a problem concerningnetwork reliability I have to implement an algorithm which uses idempotence(e.g.: a*a=a, a^2*b^3=ab).As a result of this fact, the following lists should be the same:list1={b+a c-a b c,c,1}list2={2 b+2 a c-a b c-a c (b+a c-a b c)-b (b+2 a c-a b c-a c (b+a c-a bc)),c,1}The result of list1===list2 should be true.Does anybody have a hint or an idea how to solve it with Mathematica? Icouldn't find anything about it even on Wolfram's webpage.Tilo. ==== Just a remark:Writing package code with a simple text editor can give you more control, fewer headaches, and cleaner code faster.---Selwyn Hollis ==== > I can write a simple package with a single line of code written in> StandardForm, so the 1/10 term is written 1 on top of 10...> test := Module[(x = 1/10, (* now is the time *) y = 2}, x]> Using StandardForm and 2D mathematical typesetting, it works fine in> the notebook. Save it as a package and load it in, and I get a slew of> error messages...> !(InputForm`Syntax::sntxb :> Expression cannot begin with etc....> This is KILLING me!Same goes for highlighting changes with color, font changes, etc. A seriousnuisance! Problems may lie dormant until you port to another platform. Arelated issue is that when you process the code through the kernel (e.g.,menu Cell, Convert To, StandardForm), this local formatting is strippedaway. This loss cannot be undone.Wolfram Support has discouraged me from using all such fragileconstructions. Comments are the least of it really, because alternatives arebetter for other reasons: (1) Divide code into small chunks interspersedwith explanatory material. (2) Use longer, self-descriptive names forsymbols.The related issue above suggests a cure: Process the code through thekernel, stripping out all local formatting, on the way to the m-file. Thischange would kill folks who still look at m files. Still, if thecorrection were that easy, WRI would have done by now :-) Perhaps theinstability is in the notebook. That would present a more difficult problem. Tom Burton ==== Mike,I set your code (in 2D form)and put it into a .m file (1) by copying andp[asting into a the file (2) by making the containing cell initializing andusing Edit>Copy Selection As>Package Format.I then loaded the file using <<.In both cases test evaluated with no problem.Maybe I am missing something/I am using Mathematica m.2--Allan---------------------Allan HayesMathematica Training and ConsultingLeicester UKwww.haystack.demon.co.ukhay@haystack.demon.co.ukVoice: +44 (0)116 271 4198> I can write a simple package with a single line of code written in> StandardForm, so the 1/10 term is written 1 on top of 10...>> test := Module[(x = 1/10, (* now is the time *) y = 2}, x]>> Using StandardForm and 2D mathematical typesetting, it works fine in> the notebook. Save it as a package and load it in, and I get a slew of> error messages...>> !(InputForm`Syntax::sntxb :> Expression cannot begin with etc....>> This is KILLING me! If the Front End has a bug in it, then make> to) use text, mathematical typesetting, and comments to provide a best> product to my customer. While text is great, there is certainly a time> and a place for comments within the code.>> Does anyone have some sort of add-in such that the autopackage> function converts all cells to input form first? Or reconverts to> StandardForm? I don't need to carry any of the comments or formatting> into the *.m file, and prefer that none of it did. Wolfram, do you> guys have anything like this?>> Why hasn't this been fixed?>> Mike> ==== I've been bitten by problems with comments, (legal) white space, andMathematica's autoformatting in the past. I gave up using all of them and theneventually gave up using Mathematica for large coding projects. Luckily Imostly do numerical work so other solutions will work for me. Sadly,Mathematica remains a difficult environment to code and debug in. Sorry, Ihave no solution for you only my own story.-- Lou Pecora - My views are my own. ==== zeno:Look at the code and you'll see 9 instances where the author uses Round[thing + .5]. Replace each of those with Ceiling[thing]. That fixed it for me.---Selwyn Hollis> The Menger Sponge code in the mathsource archives does not work in> version 3 or 4. The notebook is called fractals.nb> It is claimed to be for version 3 however...but does not work right in> version 3...> It gives an output that is the opposite of what it should be...(where> there are holes in the menger sponge there are blocks and vice-versa).> Also, under iteration of 0 it works, but with iterations of 1 and 2 it> gives a postscrip error..> I ahd tech Support run the notebook in version 4 and it came out the> same..> is there code for version 3 or 4 that makes a correct Menger Sponge?> ==== The Menger Sponge code in the mathsource archives does not work inversion 3 or 4. The notebook is called fractals.nbIt is claimed to be for version 3 however...but does not work right inversion 3...It gives an output that is the opposite of what it should be...(wherethere are holes in the menger sponge there are blocks and vice-versa).Also, under iteration of 0 it works, but with iterations of 1 and 2 itgives a postscrip error..I ahd tech Support run the notebook in version 4 and it came out thesame..is there code for version 3 or 4 that makes a correct Menger Sponge? ==== How can one solve multiple linear and quadratic inequalities (in my case, atmost 3) in multiple variables (in my case, at most 3)?I am using Mathematica 4.0.Matt Herman ==== If you have Mathematica 4.2 and time constraints are not too severe (i.e. the system contains not too many equations and variables), simply reformulate the root finding problem as a maximization problem and use NMinimize. The reformulation is simple: just minimize the constant function 1 subject to your equality and inequality constraints. Johannes> I'm trying to solve a system of nonlinear algebraic equations.> I was hoping to use the FindRoot. However, some> of the variables for which I'm solving must satisfy some> inequalities. Is there an easy way to impose these constraints> in the solution?> George> (KthielK@us.ibm.com)> <><><><><><><><><><><><><><><><><><>Johannes LudsteckInstitut fuer VolkswirtschaftslehreLehrstuhl Prof. Dr. MoellerUniversitaet RegensburgUniversitaetsstrasse 3193053 Regensburg ==== I have to find many complex roots of complex function likef[z]=0 where z is complex.I try first the graphical approch:ImplicitPlot[{Re[f[a+ Ib]]==0,Im[f[a+I b]]==0},{a,amin,amax},{b,bmin,bmax}]or somethink else, and it works good and I visualize the solution in thespecificated region.Now I'd like to compute the finding automaticaly.I' seen other posts which illustrates how find many roots of real functionof real varible but I'm unable to genaralize in 2D case.Some one can help me?P.S. sorry for my english ==== The use of n is a handy way to get line breaks in text strings, as in Epilog->{Text[purengainnguiding, {4, 5}, {-1,-1}]to get pure gain guidingIs there a way to change the alignment of the text box from Left justify to Center or Right justify?-----Power tends to corrupt. Absolute power corrupts absolutely. Lord Acton (1834-1902) (slightly modified)Dependence on advertising tends to corrupt. Total dependence on advertising corrupts totally. -- Modern equivalent.