*To*: mathgroup@smc.vnet.net*Subject*: [mg12051] Re: [mg11966] calculation*From*: Sean Ross <seanross@worldnet.att.net>*Date*: Fri, 24 Apr 1998 01:52:21 -0400*References*: <199804170621.CAA29134@smc.vnet.net.>

Saeed Esmaily Rashid wrote: > > Hello! > > My name is Saeed and i'm studying physics. I have a problem which ihope > someone can help me with it. I have an equation > > .001422409738*R^(73/80)*(R^(1/2)-1)^(-13/40) == .04 > > i'm using the Solve function in Mathematica 3.0 to solve it for R, but > it calculats endlessly and takes very long time. the question is that > is there any way to optimize this equation or using another function in > Mathematica 3.0 to make it faster to calculate? > > Regards Your equation looks transcendental, meaning not solveable by algebra. It also appears to be ill conditioned numerically. To see this, try: Plot[.001422409738*R^(73/80)*(R^(1/2)-1)^(-13/40) ,{R,1,3}] You will see that your equation has a vertical asymptote at R==1. To understand the effect this has, set f[R_]:=.001422409738*R^(73/80)*(R^(1/2)-1)^(-13/40) Two test values are: f[1.000001]=0.158803 f[1.0000001]=0.335629 The difference in the argument is very small and the derivatives are huge in the region of interest. There are very few numerical root finders that can handle this kind of equation without modification. The first thing you want to do is make sure that any numerical root finder never tries values less than one since that makes the function complex. To do this, set f[R_]=Abs[.001422409738*R^(73/80)*(R^(1/2)-1)^(-13/40)]. The next thing is to use the correct routine. Solve uses algebra until it gives up and then calls NSolve which uses Gauss factoring. FindRoot uses Newtons Method if you give it one guess (and will attempt to calculate symbolic derivates of your function) or secant method if you give it two guesses. With a big "no mans land" of possible arguments for R less than one, secant method is the best in this case if you give it a very good initial guess as in: N[FindRoot[ Abs[.001422409738*R^(73/80)*(R^(1/2)-1)^(-13/40)] == .04,{R,1.0000010000, 1.00000010000},AccuracyGoal->10],16] which returns: {R-->1.000069590880218} -- Remove the _nospam_ in the return address to respond.

**References**:**calculation***From:*Saeed Esmaily Rashid <saeedr@stud.ntnu.no>