mm-769 === Subject: Re: How to find expected value? First, your code has a typo error. The lower limit of your integral in the definition of pif should read cn (not c_n). Second, the second argument of the function ExpectedValue should be a distribution: i.e. you should use NormalDistribution[[Micro]c, sc] as your second argument and not your definition (using the PDF). With these changes Mathematica returned (after some seconds) the following expression: !([ExponentialE]^((r ((2 @p ((ch - W + § (((-p) q + q [Micro]c + b Po [Micro]q)))) - @2 b § [Micro]q sc + @p r §^2 ((q - a [Micro]q))^2 sc^2)))/(2 @p))) I hope this is what you want / expect. Norbert Marxer www.mec.li === Subject: Problems with FindRoot I'm trying to find minima of the function V[x, y] = 12.3/x^3 + 12*Sqrt[2]*Exp[-4*Pi*y]*Pi^2*Sqrt[y]/x - 10*Exp[-2*Pi*y]*Pi*y/x^2 using FindRoot. The numerical coefficients are such that there is a minimum for exponentially large x, but Mathematica has trouble finding it - presumably because the derivatives of V are extremely small in that region. I tried playing with MaxAccuracy, WorkingPrecision and PrecisionGoal, but without any success. Now, I know analytically where the minimum is so I look for it near there: soln = FindRoot[{D[V[x, y], x] == 0, D[V[x, y], y] == 0}, {x, 3*10^10}, {y, 4.10}, MaxIterations -> 10000] and Mathematica finds it, {{x -> 4.4553238320849495`*^10, y -> 4.170188563200261`}. Even tiny perturbations about this point result in Mathematica failing to give the solution, though. Also, I need to solve a more complicated problem with three variables, but as soon as I add another one, even trivially, as in g[x, y, z] = 12.3/x^3 + 12*Sqrt[2]*Exp[-4*Pi*y]*Pi^2*Sqrt[y]/x - 10*Exp[-2*Pi*y]*Pi*y/x^2 + z^2 (just added z^2 to V[x,y]), minimisation via soln = FindRoot[{D[g[x, y, z], x] == 0, D[g[x, y, z], y] == 0, D[g[x, y, z], z] == 0}, {x, 3*10^10}, {y, 4.10}, {z, 0.4}, MaxIterations -> 10000] fails! The output is: {x -> 3.`*^10, y -> 4.1`, z -> 0.`} Note that the initial condition used for x and y is the same as in the 2D case. I'm using Mathematica 5. The function FindMinimum didn't seem to improve on the situation. Any advice on how to solve these equations/find minima of V[x,y]/g[x,y,z] reliably would be much appreciated. === Subject: When is x^y = != E^(y*Log[x]) The Mathematica documentation for Power says: For complex numbers (x^y) gives the principal value of ( E^(y*Log[x] ). This is consistent with reference books. I wanted to see where in the extended complex plane this identity applies. Also when it doesn't apply how do we determine (x^y). So consider the following: In[1]:= x=0; y=-3; {x^y, E^(y*Log[x])} Out[3]= {ComplexInfinity, Infinity} The documentation wasn't wrong in the above example because 0, -3 are not complex numbers. However, I have seen books that imply the identity above works for any (x,y). Well I can see the above identity doesn't apply when x=0 and y is negative. The above identity doesn't apply in the following cases either. In[4]:= x=-2; y=(2+I)*Infinity; {x^y, E^(y*Log[x])} Out[6]= {Indeterminate, 0} In[7]:= x=5-6*I; y=-Infinity*I; {x^y, E^(y*Log[x])} Out[9]= {Indeterminate, 0} In[10]:= x=y=Infinity; {x^y, E^(y*Log[x])} Out[11]= {ComplexInfinity, Infinity} Then you might say the above identity doesn't apply when Abs[y]==Infinity, but the above identity does apply in the next example. In[12]:= x=(1+2*I)*Infinity; y=(-1+2*I)*Infinity; {x^y, E^(y*Log[x])} Out[14]= {0, 0} Could somebody provide conditions on (x,y) that are necessary and sufficient for E^(y*Log[x]) to return the same thing as (x^y). ------------- Ted Ersek === Subject: Re: Root's third argument? > The Root function seems to have an undocumented third argument--does > anyone know what it represents? > I ran into it while trying to use some replacement rules to replace > Root objects in an expression, and none of my Root[f_,k_] patterns > were matching, because Root has an invisible third argument that > doesn't show up in output. > I have a workaround, but I'm still curious. > Brad >> Yes, there is indeed a third, hidden argument. I think it represents >> (or at least it used to represent) what is called the isolating >> set of the algebraic number, that is, a subset of the complex plane >> in which the root object is the only root of the minimal polynomial. >> This is necessary in order for the roots of the polynomial to be >> ordered, so that you can speak of the first roots, second root etc. >> Mathematica uses two approaches to root isolation: numerical and >> exact one. Which one is used depends on the value of the option >> ExactRootIsolation of Root. One can check that the invisible third >> argument is different (you can extract it with Part). However, it >> seems to me that the actual form of the third argument was changed >> (without my noticing it until today ;-)) in some version of >> Mathematica between 3 and 5. Mathematica used to return an >> approximate value of the root with the ExactRootIsolation set to >> False and the corners of the isolating rectangle in the complex plane >> with ExactRootIsolation set to True. However, now it seems just to >> return 0 and 1, which I find impossible to interpret. I am sure, >> however, that the same information is still stored somewhere... >> Andrzej Kozlowski > On second thoughts I think that the most likely explanation is this. > Originally the third argument in Root was indeed the information about > the isolating set that I described above. Then, at some point, it was > decided not to include this information any more. However, probably for > the sake of backward compatibility of code, three argument form of Root > was retained, but the third argument was changed to 0 or 1 depending on > whether ExactRootIsolation is set to False or True. This is exactly what it is. The third argument of Root indicates the root isolation method to be used to determine the ordering of roots. Specifying the root ordering is necessary to give a precise meaning to the definition of Root[f, k] as the k-th root of f. In the root ordering chosen in Mathematica the real roots always come first, and they are ordered by the increasing values. Hence, for real roots, the root ordering is well defined without a reference to root isolation methods used, and therefore the value of the third argument of Root is irrelevant. For roots that are not real the situation is different. They always come after the real roots, and the complex conjugates are always adjacent, but the relative ordering of pairs of conjugate roots is determined by sorting the isolating sets of the roots with negative imaginary parts (using Mathematica Sort function). Hence, to make the ordering of non-real roots well defined we need to indicate which method should be used to obtain the isolating sets. In particular, it may happen that Root[f, k, 0] != Root[f, k, 1] (but only if f has less than k real roots). Adam Strzebonski Wolfram Research > I am just guessing, of course, and, as always, take no responsibility > for whatever might happen to your Mathematica code if you believe me > ...;-) > Andrzej Kozlowski > Tokyo, Japan === Subject: Re: Root's third argument? >> The Root function seems to have an undocumented third argument--does >> anyone know what it represents? >> I ran into it while trying to use some replacement rules to replace >> Root objects in an expression, and none of my Root[f_,k_] patterns >> were matching, because Root has an invisible third argument that >> doesn't show up in output. >> I have a workaround, but I'm still curious. >> Brad > Yes, there is indeed a third, hidden argument. I think it > represents (or at least it used to represent) what is called the > isolating set of the algebraic number, that is, a subset of the > complex plane in which the root object is the only root of the > minimal polynomial. This is necessary in order for the roots of the > polynomial to be ordered, so that you can speak of the first > roots, second root etc. > Mathematica uses two approaches to root isolation: numerical and > exact one. Which one is used depends on the value of the option > ExactRootIsolation of Root. One can check that the invisible third > argument is different (you can extract it with Part). However, it > seems to me that the actual form of the third argument was changed > (without my noticing it until today ;-)) in some version of > Mathematica between 3 and 5. Mathematica used to return an > approximate value of the root with the ExactRootIsolation set to > False and the corners of the isolating rectangle in the complex > plane with ExactRootIsolation set to True. However, now it seems > just to return 0 and 1, which I find impossible to interpret. I am > sure, however, that the same information is still stored somewhere... > Andrzej Kozlowski On second thoughts I think that the most likely explanation is this. Originally the third argument in Root was indeed the information about the isolating set that I described above. Then, at some point, it was decided not to include this information any more. However, probably for the sake of backward compatibility of code, three argument form of Root was retained, but the third argument was changed to 0 or 1 depending on whether ExactRootIsolation is set to False or True. I am just guessing, of course, and, as always, take no responsibility for whatever might happen to your Mathematica code if you believe me ...;-) Andrzej Kozlowski Tokyo, Japan === Subject: Re: Root's third argument? > The Root function seems to have an undocumented third argument--does > anyone know what it represents? > I ran into it while trying to use some replacement rules to replace > Root objects in an expression, and none of my Root[f_,k_] patterns > were matching, because Root has an invisible third argument that > doesn't show up in output. > I have a workaround, but I'm still curious. > Brad Yes, there is indeed a third, hidden argument. I think it represents (or at least it used to represent) what is called the isolating set of the algebraic number, that is, a subset of the complex plane in which the root object is the only root of the minimal polynomial. This is necessary in order for the roots of the polynomial to be ordered, so that you can speak of the first roots, second root etc. Mathematica uses two approaches to root isolation: numerical and exact one. Which one is used depends on the value of the option ExactRootIsolation of Root. One can check that the invisible third argument is different (you can extract it with Part). However, it seems to me that the actual form of the third argument was changed (without my noticing it until today ;-)) in some version of Mathematica between 3 and 5. Mathematica used to return an approximate value of the root with the ExactRootIsolation set to False and the corners of the isolating rectangle in the complex plane with ExactRootIsolation set to True. However, now it seems just to return 0 and 1, which I find impossible to interpret. I am sure, however, that the same information is still stored somewhere... Andrzej Kozlowski === Subject: Differentiating Cross Hello! We have a handy default rule for Dot: In[]:= Dt[a . b, t] Out[]= a . Dt[b, t] + Dt[a, t] . b So I'd like to have a similar behavior for Cross, but it looks like chain rule is used instead: In[]:= Dt[Cross[a, b], t] Out[]= Dt[b, t]*Derivative[0, 1][Cross][a, b] + Dt[a, t]*Derivative[1, 0][Cross][a, b] So I defined required transformation: In[]:= Unprotect[Dt]; Dt[Cross[a_, b_], t_] := Cross[a, Dt[b, t]] + Cross[Dt[a, t], b]; which works for just Dt[Cross[a, b], t], but it still doesn't work when Cross is a part of expression like Dt[Cross[a, b] + c, t] etc. What am I doing wrong? -- Vladimir === Subject: Re: Faster Random Walk Simulation ?!? Hi , This is the winner!!! Timing is now .45 sec. I tried to use Compile function before but without sucess. Could you help me (and potential readers) with short explanation of your coude. thank you Mario === Subject: Re: Faster Random Walk Simulation ?!? Hi thank you for the suggestions. Regarding Random[]: I compared the outcome of my simulation to the code done by earlier Fortran version and I can not see big difference. I am designing a stochostic model of human cognitive behaviour with a lot of noise so that may not count. thank you very much, Mario === Subject: Re: Faster Random Walk Simulation ?!? Hi Jean-Marc. This is very helpfull. In fact it does improve calculation time for higer boundary values. For boundaryA=15 this code is 30% faster then my code. Mario === Subject: Re: Faster Random Walk Simulation ?!? Hi Ben, I am aware of the analytic form for the random walk. This is just one smal part of a relatively complex project that inlcudes simulation as a way of assessing a model charactistics. Mario === Subject: Re: Faster Random Walk Simulation ?!? > I am running a simulation with Mathematica 5 that includes random walk > described below. The argument boundaryA is upper and lower boundary for > a random walk. Parameter value is just a constant arbitrarily set to > 0.5. The output of the table function is the 10000 random walks, and > their path to either +5 or -5 boundary value. > While everything works as expected, it takes considerable duration of > time. For example it takes 2.6 seconds to generate the table output, on > a relatively fast computer. > I would very appreciate if any significantly faster solution could be > suggested. > value = .5 > RandomWalk[boundaryA_] := Block[{l = {{0, 0}}, x = 0, > i = 0 }, While[boundaryA > x > -boundaryA, > x += If[Random[] > value, 1, -1]; > l = Append[l, {++i, x}]]; > l] > Timing[Table[RandomWalk[5], {i, 1, 10000}];] > Out[420]= > {2.672 Second, Null} Does not save much time but a bit Step=(2*Random[Integer, {0, 1}] + # - 1) & cd[bound_] := (Transpose[{Range[1, Length[#]], #}] &)[ NestWhileList[Step,0, Abs[ #] < bound &] ] Timing[Table[cd[5], {10000}];] {1.472 Second, Null} Mathematica 5.2 Windows XP Centrino 1.5 MHz running at 500 MHz {1.332 Second, Null} running full speed at 1.5 MHz -- Roland Franzius === Subject: webMathematica-text How can I show Text with Graphics3D in web mathematica? I have program that is working fine in Mathematica and with LiveGraphics3D (i have changed Text StyleForm in LiveGraphics3D) but when I transfer code in html (jsp) for webMathematica everything is shown correctly except Text. How can I write Text in webMathematica in Graphics3D? Matija === Subject: Re: Testing for squares In[1]:= test1 = IntegerQ[Sqrt[#]]&; v = Range[123456]; Timing[a = test1/@v;] Timing[b = test2/@v;] Out[4]= {3.49 Second,Null} Out[5]= {0.34 Second,Null} Out[6]= True > Hi all, > 1) I would like to have an efficient test to decide if an integer is a > square. > test1 = IntegerQ[Sqrt[#]]& > is too slow for my needs. I am using something like > test2 = Positive[#] && JacobiSymbol[#, p] && Sqrt[Round[N[#, > precission]]]^2==# & > where p is a prime (or I may use several primes). However test2 may > return False for very large integers. How large depends on the value of > precission. Do you know of a faster test? > 2) Let MyList be a large list of integers (somewhere between 20.000 and > 50.000 elements) and MyTest a function on the integers returning True > or False (for instance, test2 above). What is an efficient way of > deciding if there is an element in MyList for which MyTest is True? > Right now I use > Select[MyList, MyTest, 1] != {} > but may be some of you can provide a better way. > Juli.87n Aguirre === Subject: Re: Testing for squares >2) Let MyList be a large list of integers (somewhere between 20.000 >and 50.000 elements) and MyTest a function on the integers returning >True or False (for instance, test2 above). What is an efficient way >of deciding if there is an element in MyList for which MyTest is >True? Right now I use >Select[MyList, MyTest, 1] != {} There are a variety of alternatives particularly if your function isn't simply restricted to returning True or False. For example consider trying to determine if a given value occurs in a list of random integers. In[53]:= data = Table[Random[Integer, {1, 10^6}], {10^5}]; then any of the following could be used In[59]:= Timing[Count[data, 100]] Out[59]= {0.053191 Second,0} In[55]:= Timing[Select[data,100==#&]] Out[55]= {0.27063 Second,{}} In[56]:= Timing[Cases[data,100]] Out[56]= {0.053879 Second,{}} In[57]:= Timing[Pick[data,#==100&/@data]] Out[57]= {0.348369 Second,{}} The fastest method I know for this specific problem is: In[58]:= Timing[SparseArray[1 - Abs[Sign[data - 100]]] /. SparseArray[_, _, _, a_] :> Last[a]] Out[58]= {0.014741 Second, {}} Note, the fastest method will likely change with details of the function used as the test function. -- === Subject: Re: How to find expected value? >It seems like you are trying to compute the expected value of a >continuous distribution, while ExpectedValue is only defined for >finite discrete distributions. It is not correct to say ExpectedValue is only defined for discrete distributions. For example, you can compute the mean of say a gamma distribution as follows: In[1]:= <>In[7]:= Position[M[[All, 1]], 34 | 199 | 876] >The OR operator is intuitive and certainly does the trick for a >short list of things to identify. While it maybe convenient to think of this as an Or operator and read it as such it is not. Instead it is Alternatives that is being used, i.e., In[4]:= 12 | 13//FullForm//TraditionalForm Out[4]//FullForm= Alternatives[12,13] Contrast this with In[5]:= 12 || 13//FullForm//TraditionalForm Out[5]//TraditionalForm= Or[12,13] And setting any performance issues aside, this method can be used for lists much longer than convenient to type using Apply with a list, i.e. Position[M[[All,1]], Alternatives@@{34,199,876}] will produces exactly the same result. In particular, In[9]:= Position[Range[40],Alternatives@@Range[23,25]] Out[9]= {{23}, {24}, {25}} produces the expected result but In[10]:= Position[Range[40],Or@@Range[23,25]] Out[10]= {} which would be unexpected if you were expecting this to return the position of of 23, 24 or 25 in the data list. -- === Subject: Determining Linear dependent vectors Am looking for methods to determine linearly dependent vectors out of a given set. Any pointers appreciated. === Subject: Mathematica 4.1 on ThinkPAD T40 - Exception ntdll.dll - any advice on how to fix? I just started working at a chemical company and they gave me a ThinkPad T40 laptop (with loads of security modification, etc - very very anal about 1.5GHz Pentium M, WinXP SP2. I've installed Mathematica 4.1 and I keep getting an error report - to many modules to list. When I run the command line version, the module that seems to have a problem with math.exe is ntdll.dll. Any advice? I'll look for some patches if there are any. This could also be the company's mod's to the OS too. Still, any body have problems running 4.1 on a T40 w/ XP?? Monty === Subject: JLink : JavaNew Failure I am very new to J/Link but I have been fiddling with it for a while but I just don't see what was wrong: folder. Then I tried to call it from Mathematica using: Needs[JLink`]; InstallJava[CommandLine->home/usr/java/bin/java]; AddToClassPath[home/myclasses]; LoadJavaClass[test]; All these go well with the new class path added and JavaClass[test,9] as output to the last line, but when: test1= JavaNew[test]; Mathematica failed to created object because there is no constructor that takes zero arguments even though I put in an explicit constructor that takes no argument. I tried putting in a constructor taking an int as an argument and using test1= JavaNew[test,1]; (after reinstalling Java etc) but now the type of the argument is wrong. I think the class is either not properly loaded or something, but I just dont' know what is wrong!! Please help! cheers, Kay === Subject: Re: NMinimize with numerically evaluated constraints > Hi there! >I'm trying to solve an optimization problem, with constraints g(x)<=0 >(x are decision variables), such that the evaluation of g(x) for a >particular x requires a numerical procedure. So far, I've been able to >use NMinimize with g(x) defined analytically as a function of the symbol >x, while the objective function f(x) can be restricted to a numerical >input x as follows: >fOBJ[x_ /; NumericQ[x]]:=Module[{},...; Return[fOBJval]] >Is it possible to apply this numerical input restriction also to the >Fernando Pedro Martins Bernardo >Department of Chemical Engineering >University of Coimbra >P=F3lo II - Pinhal de Marrocos >3030-290 Coimbra >Portugal >Tele: +351-239-798722 >Fax: +351-239-798703 >bernardo@eq.uc.pt >__________ NOD32 1.1519 (20060504) Information __________ >This message was checked by NOD32 antivirus system. >http://www.eset.com You can try to minimize f(x) with the penalty function. The idea is to multiply the objective function with a penalty function and minimize their product. The penalty function is increased, when in the process of the minimization the constraints are broken. This wil turn the optimization path in the oposite direction. E.g. New objective function is P*f(x), if g(x)<= 0 P=100 else P=1. This is a step like penalty function. You can produce also countinious penalty functions for better convergence of the minimization. Cernivec Gregor. === Subject: Re: Re: Do Mathematica applications EVER get updated? It seems to me you should distinguish products developed in-house by Wolfram Research from those authored and maintained by independent developers (such as Jens) and only sold by WRI. It is very easy to find out who develops The Digital Image Processing package or MathGL3d: for example by writing to this list ... Andrzej Kozlowski >> why not ask the individual developer ?? > I have never heard of a customer having to look for and ask individual > developers inside a company about product updates. > For example, if the next MS word version gets delayed, do you pick > up the > phone and dial 1800 Microsoft and ask to please talk to the > developer of MS > word to ask him/her about the status of the application? > Do you have the phone number of the developer for the VISTA > operating system > because I need to call him/her to ask when it will be released. > Do you have a list of phone numbers I can call to find who is the > developer > to each one of the listed Mathematica packages? > This must be a new method of doing business that I have not heard > of before. >> At least for my package I can tell you that I'm >> working on the next version and it should be >> finished at the end of the year. >> The Digital Image Processing package is also active >> developed and I'm sure the Mariusz Jankowski is >> working on the next version. > How do you know that? how do customers know this? Where is this > listed on > the web site for the DIP product? > http://www.wolfram.com/products/applications/digitalimage/ > I do not see any name of developer there or any email address or > any phone > numbers. > If you know some internal information such as the above, then this > does not > mean the public knows this as well. > This is NOT how software business should work. >> Jens > Is it worth buying more Mathematica applications? > I am asking, because it seems these applications are hardly ever > being > updated. > Look at the structural mechanics application > http://documents.wolfram.com/applications/structural/index.html > It is still version 1, and the copyright shows it was published > in 1999. > This is 7 years ago !! This is like a million years ago in computer > software > time. > The control systems application > http://documents.wolfram.com/applications/control/FrontMatter/ > 0.2.html > without any > single update. > The Signals and Systems application > http://www.wolfram.com/products/applications/signals/ > Still at version 1.2.1 from 1995 (this is 11 years ago). > And I can go on and on. > Another big problem is that it is almost impossible to figure what > version > number these application are at and when was the last version > released. > It > is as if this is intentionally kept hidden. Look at the mechanical > system > package > http://www.wolfram.com/products/applications/mechsystems/ > It says at the top NEW VERSION. but no version number or when > was this > version released. When you scroll to the bottom of the page, it says > mechanical system 2. Then it says 1994-2005. Whatever this is > supposed > to > mean is anyone's guess. > Can any one from the company explain all of this? > I was about to buy the structural mechanics package, but last > minute when > I > checked the date on it, and that it was still version 1 since > 1999, I > closed > the window and did not buy it. It is clear that there are many dead > applications that are not being maintained and are still being > sold to > customers. > Nasser === Subject: Re: Re: Do Mathematica applications EVER get updated? It's actually a VERY nice way to do business, for when a problem arises, you are able to interact with the person who knows the most! No outsourced intermediaries, .... >> why not ask the individual developer ?? > I have never heard of a customer having to look for and ask individual > developers inside a company about product updates. > For example, if the next MS word version gets delayed, do you pick up the > phone and dial 1800 Microsoft and ask to please talk to the developer of MS > word to ask him/her about the status of the application? > Do you have the phone number of the developer for the VISTA operating system > because I need to call him/her to ask when it will be released. > Do you have a list of phone numbers I can call to find who is the developer > to each one of the listed Mathematica packages? > This must be a new method of doing business that I have not heard of before. >> At least for my package I can tell you that I'm >> working on the next version and it should be >> finished at the end of the year. >> The Digital Image Processing package is also active >> developed and I'm sure the Mariusz Jankowski is >> working on the next version. > How do you know that? how do customers know this? Where is this listed on > the web site for the DIP product? > http://www.wolfram.com/products/applications/digitalimage/ > I do not see any name of developer there or any email address or any phone > numbers. > If you know some internal information such as the above, then this does not > mean the public knows this as well. > This is NOT how software business should work. >> Jens > Is it worth buying more Mathematica applications? > I am asking, because it seems these applications are hardly ever being > updated. > Look at the structural mechanics application > http://documents.wolfram.com/applications/structural/index.html > It is still version 1, and the copyright shows it was published in 1999. > This is 7 years ago !! This is like a million years ago in computer > software > time. > The control systems application > http://documents.wolfram.com/applications/control/FrontMatter/0.2.html > single update. > The Signals and Systems application > http://www.wolfram.com/products/applications/signals/ > Still at version 1.2.1 from 1995 (this is 11 years ago). > And I can go on and on. > Another big problem is that it is almost impossible to figure what > version > number these application are at and when was the last version released. > It > is as if this is intentionally kept hidden. Look at the mechanical > system > package > http://www.wolfram.com/products/applications/mechsystems/ > It says at the top NEW VERSION. but no version number or when was this > version released. When you scroll to the bottom of the page, it says > mechanical system 2. Then it says 1994-2005. Whatever this is supposed > to > mean is anyone's guess. > Can any one from the company explain all of this? > I was about to buy the structural mechanics package, but last minute when > I > checked the date on it, and that it was still version 1 since 1999, I > closed > the window and did not buy it. It is clear that there are many dead > applications that are not being maintained and are still being sold to > customers. > Nasser -- 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: Do Mathematica applications EVER get updated? >> why not ask the individual developer ?? > I have never heard of a customer having to look for and ask individual > developers inside a company about product updates. hmm -- my name stand large and bold below MathGL3d and the *.m packages have usual a (* Copyright: *) (* Author: *) entry with the name of the developer or the company > For example, if the next MS word version gets delayed, do you pick up the > phone and dial 1800 Microsoft and ask to please talk to the developer of MS > word to ask him/her about the status of the application? The most Mathematica packages 100-200 kByte of (ASCII) code -- how many developers may have written this ? 100 or 1000 ?? in the most cases one or two developer have produced the package. > Do you have the phone number of the developer for the VISTA operating system > because I need to call him/her to ask when it will be released. > Do you have a list of phone numbers I can call to find who is the developer > to each one of the listed Mathematica packages? Take the (* Author : *) entry form the *.m files and ask Google or ask the Wolfram support for the e-mail ... Jens === Subject: RootSearch package updated Many of you know about my RootSearch package. The package has a function that is very good at finding all roots of an equation between (xmin, xmax). An updated version of the package is posted at http://library.wolfram.com/infocenter/MathSource/4482/ The new version is faster than the last version. I also learned about a problem with loading the previous version using Mac OS. That problem is fixed in the new version. Ted Ersek === Subject: Re: Re: Apparent accuracy error in least squares fit The code shows I tried with both data sets you gave. ?? > Of course, I told you that with this dataset, the program worked. The trouble > appears when the experimental values are lower; for instance: > {300., 2.7933}, {350., 2.7832}, {400., 2.7452}, {450., 2.6898}, > {500., 2.5623}, {550., 2.3616}, {600., 2.0242}, {650., 1.5675}, > {700.,1.0732}, {740., 0.693}} > Using them, the fitting procedure diverges, throwing the message: > FindRoot::lstol: The line search decreased the step size to within > tolerance > specified by AccuracyGoal and PrecisionGoal but was unable to find > a > sufficient decrease in the merit function. You may need more than > MachinePrecision digits of working precision to meet these > tolerances. > El Jueves, 4 de Mayo de 2006 11:20, escribi.97: > Here is what I get. There are no error messages. > In[1]:= > $Version > Out[1]= > 5.2 for Microsoft Windows (June 20, 2005) > In[2]:= > f[T_,Ms_]=Ms-Mo*Coth[(a+b*Ms)/T]+Mo*T/(a+b*Ms) > Out[2]= > !(Ms + (Mo T)/(a + b Ms) - Mo Coth[(a + b Ms)/T]) > In[3]:= > data={{300.,2.7933},{350.,2.7832},{400.,2.7452},{450.,2.6898},{500., > 2.5623},{550.,2.3616},{600.,2.0242},{650.,1.5675},{700.,1.0732},{740., > 0.693}} > Out[3]= > {{300.,2.7933},{350.,2.7832},{400.,2.7452},{450.,2.6898},{500.,2.5623},{550 >., 2.3616},{600.,2.0242},{650.,1.5675},{700.,1.0732},{740.,0.693}} In[4]:= > g=Apply[Plus,Map[Sqrt[f[#[[1]],#[[2]]]^2]&,data]]; > In[5]:= > {sol1,sol2}=NMinimize[{g,00},{a,b,Mo}] > Out[5]= > {3.41302,{a[Rule]17.3187,b[Rule]6.81003,Mo[Rule]91.5214}} > In[6]:= > data={{300.,9.4478},{350.,9.1237},{400.,8.6531},{450.,8.0999},{500., > 7.4426},{550.,6.706},{600.,5.8785},{650.,4.9522},{700.,3.8981},{750., > 2.9685}} > Out[6]= > {{300.,9.4478},{350.,9.1237},{400.,8.6531},{450.,8.0999},{500.,7.4426},{550 >., 6.706},{600.,5.8785},{650.,4.9522},{700.,3.8981},{750.,2.9685}} In[7]:= > g=Apply[Plus,Map[Sqrt[f[#[[1]],#[[2]]]^2]&,data]]; > In[8]:= > {sol1,sol2}=NMinimize[{g,00},{a,b,Mo}] > Out[8]= > {0.479589,{a[Rule]0.00152594,b[Rule]194.249,Mo[Rule]11.3153}} > -- > iel Ortega Ponce -- http://chris.chiasson.name/ === Subject: Re: Re: Apparent accuracy error in least squares fit Of course, I told you that with this dataset, the program worked. The trouble appears when the experimental values are lower; for instance: {300., 2.7933}, {350., 2.7832}, {400., 2.7452}, {450., 2.6898}, {500., 2.5623}, {550., 2.3616}, {600., 2.0242}, {650., 1.5675}, {700.,1.0732}, {740., 0.693}} Using them, the fitting procedure diverges, throwing the message: FindRoot::lstol: The line search decreased the step size to within tolerance specified by AccuracyGoal and PrecisionGoal but was unable to find a sufficient decrease in the merit function. ÊYou may need more than MachinePrecision digits of working precision to meet these tolerances. El Jueves, 4 de Mayo de 2006 11:20, escribi.97: > Here is what I get. There are no error messages. > In[1]:= > $Version > Out[1]= > 5.2 for Microsoft Windows (June 20, 2005) > In[2]:= > f[T_,Ms_]=Ms-Mo*Coth[(a+b*Ms)/T]+Mo*T/(a+b*Ms) > Out[2]= > !(Ms + (Mo T)/(a + b Ms) - Mo Coth[(a + b Ms)/T]) > In[3]:= > data={{300.,2.7933},{350.,2.7832},{400.,2.7452},{450.,2.6898},{500., > 2.5623},{550.,2.3616},{600.,2.0242},{650.,1.5675},{700.,1.0732},{740., > 0.693}} > Out[3]= > {{300.,2.7933},{350.,2.7832},{400.,2.7452},{450.,2.6898},{500.,2.5623},{550 >., 2.3616},{600.,2.0242},{650.,1.5675},{700.,1.0732},{740.,0.693}} In[4]:= > g=Apply[Plus,Map[Sqrt[f[#[[1]],#[[2]]]^2]&,data]]; > In[5]:= > {sol1,sol2}=NMinimize[{g,00},{a,b,Mo}] > Out[5]= > {3.41302,{a[Rule]17.3187,b[Rule]6.81003,Mo[Rule]91.5214}} > In[6]:= > data={{300.,9.4478},{350.,9.1237},{400.,8.6531},{450.,8.0999},{500., > 7.4426},{550.,6.706},{600.,5.8785},{650.,4.9522},{700.,3.8981},{750., > 2.9685}} > Out[6]= > {{300.,9.4478},{350.,9.1237},{400.,8.6531},{450.,8.0999},{500.,7.4426},{550 >., 6.706},{600.,5.8785},{650.,4.9522},{700.,3.8981},{750.,2.9685}} In[7]:= > g=Apply[Plus,Map[Sqrt[f[#[[1]],#[[2]]]^2]&,data]]; > In[8]:= > {sol1,sol2}=NMinimize[{g,00},{a,b,Mo}] > Out[8]= > {0.479589,{a[Rule]0.00152594,b[Rule]194.249,Mo[Rule]11.3153}} -- iel Ortega Ponce === Subject: Re: Evaluating integrals RE: the below commands Given the ouput of the second command, why does the third work? <