MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: FindRoot can NOT handle mixed real and complex variables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79982] Re: FindRoot can NOT handle mixed real and complex variables
  • From: AES <siegman at stanford.edu>
  • Date: Fri, 10 Aug 2007 01:44:27 -0400 (EDT)
  • Organization: Stanford University
  • References: <200708080853.EAA05884@smc.vnet.net> <f9emsc$lts$1@smc.vnet.net>

In article <f9emsc$lts$1 at smc.vnet.net>,
 Curtis Osterhoudt <cfo at lanl.gov> wrote:

> I may be misunderstanding what you want. At least with 
> 
>       $Version
> 
>       "6.0 for Linux x86 (32-bit) (June 19, 2007)"
> 
> the following works, though it homes in on the same roots for every (tested)  
> starting value of "DN" between -10^6 and +10^6:
> 
> solns = ({#1, FindRoot[{u*BesselJ[1, u]*BesselK[0, w] == 
>                 w*BesselK[1, w]*BesselJ[0, u], u^2 + w^2 == g, 
>        Re[g] == input\[Breve]value, 
>               
>        Re[w] == 0}, {{u, -2.39 + 0.17*I}, {w, 
>         14.34*I}, {g, -200 + 0.8*I}, 
>               {input\[Breve]value, #1}}]} & ) /@ 
>   Range[-10^6, 10^6, 10^4]
> 
> 
> Perhaps things will converge to different root values for radically different 
> starting values, but this seems to handle the system adequately. 

I believe that Curtis and I now agree that this solution does not work 
because the "input\[Breve]value" quantity that he introduced is treated 
by FindRoot, not as a *fixed* parameter or constraint as desired in the 
problem, but as just another variable to be solved for by FindRoot.

So, when you run this code, Re[g] wanders off to new values as FindRoot 
goes thru its paces, instead of being held fixed at a specified value as 
desired.  It only wanders a little ways in the above example, because 
the other initial values I supplied are close to the real root.  

But, change the initial value 14.34 to 16.0 in the above, and Re[g] 
wanders away from -200 by a substantially larger amount.

I received one or two other proposed solutions by email having this same 
problem.

I'm beginning to think that FindRoot _really_ can't handle mixed real 
and complex quantities -- all the variables that appear in the "vars" 
list and that you solve for must either be purely real, or _all_ of them 
will be treated as complex????

And if any explicit "I"'s appear in the equations, they're all complex???

And you can put explicit Re[] or Im[] constraints in the equations???

But it will take someone above my pay grade to give authoritative 
answers on this.  [Meanwhile, I'm getting the numerical answers I need 
by other methods.]


  • Prev by Date: Re: FindRoot can NOT handle mixed real and complex variables
  • Next by Date: Re: Beta function, Integral
  • Previous by thread: Re: FindRoot can NOT handle mixed real and complex variables
  • Next by thread: Block vs. ReplaceAll