Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: complicated equation including bessel functions
Replies: 22   Last Post: May 8, 2013 2:43 PM

 Messages: [ Previous | Next ]
 Steven Lord Posts: 17,945 Registered: 12/7/04
Re: complicated equation including bessel functions
Posted: May 8, 2013 11:47 AM

"ghasem " <shaban_sadeghi@yahoo.com> wrote in message
news:kmdp0d\$59q\$1@newscl01ah.mathworks.com...
> "Bruno Luong" <b.luong@fogale.findmycountry> wrote in message
> <kmdol4\$4bt\$1@newscl01ah.mathworks.com>...

>> "ghasem " <shaban_sadeghi@yahoo.com> wrote in message
>> <kmdo2e\$28g\$1@newscl01ah.mathworks.com>...
>>

>> > I know Bruno,But where of this example,is related to my question?
>>
>> It shows you the right way to use FSOLVE with complex equation.
>>
>> Bruno

> ======================
> yes,But complex equation with real argument.in fact,a complex equation
> that you can separate real and imaginary parts.
> but in bessel function,complex numbers are implicity (no explicity).
> ghasem

Yes. Instead of trying to solve for a root of f(z) = besselj(1, z) [for
example] solve for solutions of f([x; y]) = [real(besselj(1, x+1i*y));
imag(besselj(1, x+1i*y))]

function output = mysystem(inputs)
% The inputs are all purely real
realPartOfInput = inputs(1);
imagPartOfInput = inputs(2);

% Build a complex number from the inputs
z = complex(realPartOfInput, imagPartOfInput);

% Now you can work with the complex value z internally
complexOutput = besselj(1, z);

% In order to return a value to FSOLVE, the outputs must be purely real
% Break the output into its parts
output = [real(complexOutput); imag(complexOutput)];

Instead of having a system of one equation in one unknown you have a system
of two equations (the real and imaginary parts of the BESSEL function) in
two unknowns (the real and imaginary parts of z.)

--
Steve Lord
slord@mathworks.com
http://www.mathworks.com

Date Subject Author
5/7/13 ghasem
5/8/13 ghasem
5/8/13 Torsten
5/8/13 Bruno Luong
5/8/13 Torsten
5/8/13 ghasem
5/8/13 Bruno Luong
5/8/13 ghasem
5/8/13 Nasser Abbasi
5/8/13 Bruno Luong
5/8/13 ghasem
5/8/13 Torsten
5/8/13 ghasem
5/8/13 Torsten
5/8/13 Bruno Luong
5/8/13 ghasem
5/8/13 Bruno Luong
5/8/13 ghasem
5/8/13 Steven Lord
5/8/13 ghasem
5/8/13 Steven Lord
5/8/13 ghasem
5/8/13 ghasem