A46 == Try in this manner, I think that it is right:In[1]:= matr = {{0, 1, 2}, {1, 2, 3}}In[2]:= f = x m + pOk?***********************************************Stefano FricanoDip. di Scienze Fisiche ed AstronomicheUniversit.88 degli StudiVia Archirafi, 36Palermo 90123********************************************* ==== Dear Narasimham,Try in this manner, I think that it is right:In[1]:= matr = {{0, 1, 2}, {1, 2, 3}}In[2]:= f = x m + pOk?***********************************************Stefano FricanoDip. di Scienze Fisiche ed AstronomicheUniversit.88 degli StudiVia Archirafi, 36Palermo 90123********************************************* ==== Johannes,I took a brief look at your problem, and I have a couple comments. I agreethat there is no reason that FindRoot should be slower in Mathematica thanin any other program, as the functionality of FindRoot is not complex.First, I couldn't get your function Probit to work with your data set. Ihave not tried to figure out the problem here.Second, and more importantly, your Probit function uses the nongradient formof FindRoot, since it provides two starting points for each variable insteadof just one. With two starting points for each variable, FindRoot will nottry to evaluate the gradient, and will instead use a root finding techniquewhich does not rely on gradient information. Of course, using FindRootwithout gradient information is much slower than using FindRoot withgradient information, and I believe this is the root of your problem.I'm guessing that you used the two starting point, nongradient form ofFindRoot because Mathematica is unable to find the gradient of your functionby itself, and so Mathematica returned an error when you tried usingFindRoot with only one starting point. However, when using the two startingpoint, nongradient form of FindRoot, gradient information is not needed, sosupplying a gradient to FindRoot does nothing. Try supplying a gradientwhile using only one starting point for each variable.Carl WollPhysics DeptU of Washington ==== please check syntax for upper limit I did not use it before this way.st1 = Solve[((Integrate[#1, {t, 0, cannot be followed by [Tau]}] & ) /@ . ==== fix this with an option.]This forces Export to use a different version of the W3C Universal style default because we have seen problems with this stylesheet on some browsers.-Dale ==== [...]Let's first define your special product:In[34]:= comp[a_, b_] := Thread[Unevaluated[a*b], List, -1]In[35]:= comp[{1, 2, 3}, {4, 5, 6}]Out[35]= {{4, 8, 12}, {5, 10, 15}, {6, 12, 18}}To decompose, my suggestion is:In[36]:=decomp[m_] := Module[{a, b = GCD @@@ m, d}, d = m/b; a = First[d]; Catch[ b = If[And @@ SameQ @@@ #, #[[All, 1]], Throw[$Failed]] &[a/# & /@ d]* b; {a, b}]]Catch and Throw here only is to get a decent error. If you can assert thedecomposability you may dispense with that. Let's try:In[37]:= decomp[{{-4, -8, 12}, {5, 10, -15}, {6, 12, -18}}]Out[37]= {{-1, -2, 3}, {4, -5, -6}}verify:In[38]:= comp @@ %Out[38]= {{-4, -8, 12}, {5, 10, -15}, {6, 12, -18}}In[39]:= decomp[{{-4, -8, 12}, {5, 10, 15}, {6, 12, -18}}]Out[39]= $FailedThis one was not decomposable.You might like to take the steps:In[40]:= m = {{-4, -8, 12}, {5, 10, -15}, {6, 12, -18}};In[41]:= b = GCD @@@ mOut[41]= {4, 5, 6}Not quite the second factor, but we get the missing signs if we divideIn[42]:= d = m/bOut[42]= {{-1, -2, 3}, {1, 2, -3}, {1, 2, -3}}All elements of this list should be the same except for a sign ±1. We arbitrarily take the first element as the first factor (this gives theother solution of your example).In[43]:= a = First[d]Out[43]= {-1, -2, 3}We want to get the signs:In[44]:= a/# & /@ dOut[44]= {{1, 1, 1}, {-1, -1, -1}, {-1, -1, -1}}In each element there should be all 1 or all -1. (This was tested above.)In[45]:= %[[All, 1]]Out[45]= {1, -1, -1}In[46]:= %*bOut[46]= {4, -5, -6}This is now the second factor of your special product.--Hartmut Wolf ==== I want to give notice, that I made available an new version of my oo systemfor Mathematica on my web site:www.schmitther.de.The following features were added to the system:- the possibility to store objects on external media(serialization/deserialization).- the possibility to create classes in the programs.- additional functions, which make available information about classes andobjects.Hermann Schmitt ==== Yves,There are some cases where responders might wish to respond privately or askfor more information and it is very slow doing this day by day through thenewsgroup.The regular Convert routine will simplify your expression.Needs[Miscellaneous`Units`]Needs[Miscellaneous` PhysicalConstants`]Sqrt[x*Meter^2]Convert[%, Meter] gives...Sqrt[Meter^2*x]Meter*Sqrt[x]To use prefixes, you must leave a space between the prefix and the unit.Convert[1500. Milli Meter, Yard]1.64042 YardUnfortunately, when one goes the other way, Mathematica sorts the symbols togive an unnatural order.Convert[0.05Yard, Milli Meter]45.72 Meter MilliIn using units, I think that it is often best to never put the units in theequations. Put the units in the data. Then you can manipulate and solve yourequations symbolically without units ever showing, and substitute the dataWITH the units at the end. Here is a very simple example. What height will astone reach in 20 seconds if dropped from 2 miles.Without introducing units...v[t_] = Integrate[-g, {t, 0, t}]-g tx[t_] = x0 + Integrate[v[t], {t, 0, t}]-((g*t^2)/2) + x0Now we can introduce our data WITH the units attached to obtain the answer.x[t] /. dataConvert[%, Mile] giving-1961.33 Meter + 2 Mile0.781286 MileThere are two packages at my web site below, V4ExtendUnits andV4ReducedUnits, that extend the Units package. Its ToUnit function is alittle more convenient to use than Convert. One can also format the outputat the same time as converting it and there is a new output form calledPrefixForm. It automatically picks a proper prefix and puts the output in aHoldForm to maintain the customary order. So in the example above...Needs[Miscellaneous`V4ExtendUnits`]45.7200 Milli MeterThere are many other useful features. With the regular Units package youcan't convert ßoating point quantities to Degrees because Mathematica madethe mistake of making Degrees both a constant and a unit. With ExtendUnitsyou can convert to degrees. There is a BaseSI command that convertseverything to base SI units. The SI command does not convert everything tocommon units. You can convert to multiple units at the same time, and alsoparse a quantity into descending compatible units (for example, Day, Hour,Minute, Second). It will handle units in DiracDeltas, UnitStep and ArcTan.To do numerical work or plotting it is necessary to remove units one way oranother. The package has a Deunitize function that will deunitize tostandard unit systems. There is also a more controlled function that allowsone to specify the implied input and output units.The package also allows you to install your own units, (GeV for GigaElectronVolt, or mps for Meter/Second, say). The ReducedUnits package allowsthe introduction of unit systems where certain physical constants are takenas 1. These would include such systems as geometrized units or atomic units.David Parkdjmp@earthlink.nethttp://home.earthlink.net/~djmp/Am I missing something? Is there a way to get the units properlysimplified?2) There is Meter and Centimeter predefined. Where have the Millimetersgone? I did not succeed in prepending any of the SI unit prefixes. Could I simply use MilliMeter? Did not really work for me...Yves ==== First of all, thanks to David and Bill!David Park schrieb:I agree. My yk@despammed.com is totally functional, though. Really nice spam filtering service there (Until they havenÇt stopped this weekend, IÇll check this... no, works just fine).Again, agreed:-) I tried to do so anyway, but got annoyed by unsimplified units in the results.Again, thanks! I will check out your packages...Yves ==== Narasimham,Here is one method...Needs[Graphics`Colors`]Here is an array of slopes and y-axis intercepts.mc = {{0, 0.2, 0.4, 0.6}, {-0.1, 0.1, 0.2, 0.3}};The following statement generates a table of functions for the lines.functions = MapThread[#1 x + #2 &, mc]{-0.1, 0.1 + 0.2*x, 0.2 + 0.4*x, 0.3 + 0.6*x}Plot[functions // Evaluate, {x, -1, 1},David Parkdjmp@earthlink.nethttp://home.earthlink.net/~djmp/ Sender: steve@smc.vnet.net ==== Hi all,Does anyone why f@a_=2 a gives a proper answer for f[1]and not in the case of Prefix[s[a_]]= 2 a eventhough that Prefix[s[a_]]=f@a_???In[1]:=f@a_=2 af[1]Out[1]=2 aOut[2]=2In[3]:=Prefix[s[a_]]Prefix[s[a_]]=2 as[1]Out[3]=s@a_Set::write: Tag Prefix in s@a_ is Protected.Out[4]=2 aOut[5]=s[1]Reply-To: kuska@informatik.uni-leipzig.de ==== Hi, becausePrefix[] *print* the function f[expr] in the form f @ expr.And printing an expression is quite the oposite of parsing/reading a expression. Jens ==== In a fit of inspiration/boredom, I just made a palette that some of you might like. The buttons on it are as follows:Clear All -- executes ClearAll[Global`*]Remove All -- executes Remove[Global`*]Quiet Spell Warnings -- executes Off[General::spell, General::spell1] (By the way, why the heck are there two kinds of spell messages?)Conserve Memory -- executes $HistoryLength=10 and Share[]Unshadow -- executes a version of Ulrich Jentschura's unshadowing functionLoad Graphics Packages -- executes <