Search code examples
maple

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?


Solution

  • 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}