[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Transcendental equation
From: |
Allen.Windhorn |
Subject: |
RE: Transcendental equation |
Date: |
Wed, 30 Apr 2014 16:27:26 +0000 |
Guido,
> -----Original Message-----
> From: address@hidden
>
> I implemented your solution and it is almost correct. This is the
> result:
>
> a = 0.20276 3.83709 7.01853 10.17550 13.32524
> 16.47188
> 19.61691 22.76099 25.90447 29.04754
>
> The problem is that I can only find the odd roots (the first, the
> third, the fifth, and so on), infact between each couple of values
> saved in the vector /a/ there is another value that it is not
> saved. I tried changing your solution (*i*pi+pi/4*) in something
> more refined like *i*pi/2+pi/4* and this is the result:
>
> a = 0.20276 0.20276 3.83709 3.83710 7.01853
> 7.01853
> 10.17550 10.17551 13.32524 13.32526
>
> I still find the same values than before but this time each one is
> found twice, which clearly is not what I want.
> What am I missing?
Look at the graph of the function. You are finding all the roots.
Between each pair of roots is a singularity which is not being
found, but this is not the same as a root, since the function
"passes through" infinity, not zero. It looks like a root on the
graph, only because the plot function is working on discrete
points and doesn't know about infinity.
Regards,
Allen
> Here is my full code:
>
> D=0.05
> h=100
> k=60.5
> Lc=D/4
> Bi=h*Lc/k
> N=10;
>
> # Function plot in the interval between x=0 and x=20 to have an
> # idea of the roots' values
> x=[0.0001:0.001:20];
> y=x.*(besselj(1,x))./(besselj(0, x)).-Bi;
> # [Define f here, then y = f(x), or f(x, Bi)]
> plot(x, y, '-r')
> axis([0 20 -1 1])
>
> a=[1:N];
> for i=0:(N-1)
> f=@(x)(x*(besselj(1, x))/(besselj(0, x))-Bi);
> # [don't need to define every time, just once]
> a(i+1)=fsolve(f, (i*pi+pi/4));
> end