Yannick
Yannick

Reputation: 862

Maple strange results while solving for complex equation

I'm trying to make Maple solve a complex equation, but it produces an incorrect result.

The following images tells it all : enter image description here

enter image description here At (3) I would expect to get something close to 1 (as (2) shows), yet it gives me something that doesn't make any sense. Is it that the || (to express the complex number modulus) operator has another significance in the solve() function?

Upvotes: 1

Views: 859

Answers (2)

Therkel
Therkel

Reputation: 1438

Restrict the values of L in the solve command with the assuming command.

Example 1:

G:= (w,L) -> (50+I*L*2*Pi*w)/(150+I*L*2*Pi*w);
result := evalf(5*abs(G(10,1)));

solve({5*abs(G(10,L)) = result},L) assuming L::real;
{L = 1.000000000}, {L = -1.000000000}

Example 2:

G:=(f,L) -> (256.4+I*2*Pi*L*f)/(256.4+9845+I*2*Pi*L*f);
result := 5*abs(G(20000,0.03602197444));

solve({5*abs(G(20000,L)) = result},L) assuming L::real;
{L = 0.03602197445}, {L = -0.03602197445}

Upvotes: 0

zhk
zhk

Reputation: 331

The more appropriate function here is fsolve.

Example 1

restart:
G:=(w,L)->(5+I*L*2*Pi*w)/(150+I*L*2*Pi*w);
evalf(5*abs(G(10,1)));
fsolve(5*abs(G(10,L))=%,L=0..10)

Example 2

As above, you need to specify the interval L=0..1 where the solution might be.

G:=(f,L)->(256.4+I*L*2*Pi*f)/(256.4+9845+I*L*2*Pi*f);
evalf(5*abs(G(20000,0.03602197444)));
fsolve(5*abs(G(20000,L))=%,L=0..1);

If you are facing difficulties to specify the interval then you should plot it first, it will give you an idea about it?

plot(5*abs(G(20000,L)),L=0..1)

Upvotes: 1

Related Questions