Re: Using InterpolateRoot Function in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg41158] Re: [mg41127] Using InterpolateRoot Function in Mathematica
- From: Bobby Treat <drmajorbob+MathGroup3528 at mailblocks.com>
- Date: Tue, 6 May 2003 05:58:39 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
Needs["NumericalMath`InterpolateRoot`"] z[L_,x_]=-(2*x*(L*beta-3*deltaY))/L^2-(3*x^2*((-L)*beta+2*deltaY))/L^3; deltaY=0.000254;L0=.013;alpha=5; beta=Tan[alpha*(Pi/180)]; f[L_?NumericQ]:=NIntegrate[Sqrt[1+z[L,x]^2],{x,0,L}]-L0 InterpolateRoot[f[L],{L,.01,.02}] {L -> 0.012992620790646777121996501} NIntegrate and NumericQ help avoid the messy symbolic integral. Making z an explicit function isn't essential, but I gave up getting past NIntegrate's HoldAll attribute without it. Bobby -----Original Message----- From: Haritha Yalamanchili <haritha12 at attbi.com> To: mathgroup at smc.vnet.net mathgroup at smc.vnet.net Subject: [mg41158] Re: [mg41127] Using InterpolateRoot Function in Mathematica Hi Bobby, Thank you for the response. I did not enter the exact mathematica format, I only used the symbolic notation to explain the problem (sorry if this caused any confusion). Attached is the mathematica file I was using to solve for the arclength. deltay, beta and L0 are constants. Also L0 can be used as an initial guess for the root (L). I was able to solve this problem in Mathcad, on one of my friends computer, but I would prefer to solve in Mathematica , as I am more comfortable using Mathamatica. Any help that you could provide is greatly appreciated. Thank You Prasad ----- Original Message ----- From: "Bobby Treat" <drmajorbob+MathGroup3528 at mailblocks.com> To: mathgroup at smc.vnet.net Subject: [mg41158] Re: [mg41127] Using InterpolateRoot Function in Mathematica > First, why write > > f(L) = Integrate[sqrt(1+z^2) dx] - L0 (Integration limits are from 0 to > L) > > if you mean > > f[L_]:= Integrate[sqrt(1+z^2),{z,0,L}] - L0 > > ?? > > This leaves me wondering if you entered that, or something else. The > possible errors you MIGHT have made are endless, so it would really > help if you just showed us the statement you entered. > > Secondly, what is L0? Another unknown? A parameter? > > Bobby > > -----Original Message----- > From: Haritha Yalamanchili <haritha12 at attbi.com> To: mathgroup at smc.vnet.net > To: mathgroup at smc.vnet.net > Sent: Sun, 4 May 2003 03:56:52 -0400 (EDT) > Subject: [mg41158] [mg41127] Using InterpolateRoot Function in Mathematica > > Hi, > > I am trying to use Mathematica to find a value of "L" that satisfies the > equation > > Integrate[sqrt(1+z^2) dx] - L0 = 0 (Integration limits are from 0 to L) > > where, > > z= -2 x(L C1 - 3 C2)/L^2 - 3 x^2(-L C1 + 2 C2)/L^3 > > In order to find the value of L that satisfies the above equation, I > have > setup the problem in Mathematica as shown below. Can some one help to > verify > if the problem is setup properly of if Mathematica is capable of > finding a > root for such functions. > > ****** > f(L) = Integrate[sqrt(1+z^2) dx] - L0 (Integration limits are from 0 to > L) > > InterpolateRoot[ f(L),{L,0,L0} ] > ******* > (L0=13, C1=0.12, C2=0.25) > > Value of L is close to L0 and hence, L0 can be used as the initial guess > value. > > Thank You and Best Regards > Prasad