Re: solution of equation

*To*: mathgroup at smc.vnet.net*Subject*: [mg116399] Re: solution of equation*From*: Bob Hanlon <hanlonr at cox.net>*Date*: Sun, 13 Feb 2011 03:07:18 -0500 (EST)*Reply-to*: hanlonr at cox.net

FindRoot will only find one root for each starting value. To find multiple roots you would map FindRoot onto a list of starting values. However, FindRoot may locate a root that is away from the starting value. To constrain the root to be near a value, it is easier to use NMinimize since it accepts explicit constraints. So Map NMinimize with varying constraints. L = 100; h = 1; NMinimize[{n Tan[n L] - h, 0.99 # < n < 1.01 #}, n][[2]] & /@ (Range[1, 11, 2] Pi/(2 L)) // Quiet {{n -> 0.015708}, {n -> 0.0471239}, {n -> 0.0785398}, {n -> 0.109956}, {n -> 0.141372}, {n -> 0.172788}} Plot[{n Tan[n L], h}, {n, 0, 0.2}, PlotRange -> {0.95, 1.05}, Exclusions -> (Range[1, 11, 2] Pi/(2 L))] Bob Hanlon ---- Piotr Munik <pi.munik at gmail.com> wrote: ============= Dear Math Group, I want to solve equation like this: L := 100; h := 1; n Tan[n L] == h I need roots of this equation in a list form but I have a problem. I try findfoot FindRoot[n Tan[n L] == h, {n, 0.01}] but it's not good I need your help... Piotr