plotting modulus of complex function



On Fri, May 4, 2012 at 1:07 AM, Bart Vandewoestyne <
Bart.Vandewoestyne at telenet.be> wrote:

> On 05/03/2012 03:26 PM, Jaime Villate wrote:
>
>>
>> Hi,
>> the function used to obtain the modulus of a complex number is cabs()
>> and not abs(). However, in the command plot2d(float(abs(Ge(s))), [s,
>> 1e-1, 1e3]) cabs would give you a very long expression in terms of s
>> which might get your system stuck. I suggest that you first compute the
>> floating-point value for a given s,
>> then compute cabs and only then pass the result. Also, the notation
>> epsilon[0] might look cute in Wxmaxima,
>> but it means defining an array which you really don't need and will add
>> to the computational complexity.
>> You might want to try something such as:
>>
> >
> > [... snip code ...]
>
>
>> Your functions have several steep spikes, so you might have to view
>> separate
>> parts of the frequency domain in separate plots, in order to see the
>> separate spikes.
>>
> > [...]
>
> Hello Jaime (and list),
>
> Thanks for the hints.  Actually, the main problem for me not being able to
> plot, appeared to be a problem with my gnuplot install.
>
> The real reason why I wanted to look at the Ge(s) function is that I want
> to understand its behavior for s->0.  If I plot its modulus, i see a quite
> smooth behavior between 1e-7 and 1e-1, but for values lower than 1e-7 the
> abs(Ge(s)) function seems to go up again???
>
> So I'm in doubt... is lim_{s->0} Ge(s) = constant or infinity?  Is the
> 'weird behavior' below 1e-8 just a result of rounding error, or could it
> really be that lim_{s->0} Ge(s) = infinity?  My educated guess is that it's
> rounding error and that the limit should indeed give me a constant value.
>

Since, as you said, limit isn't working very well, let's try a taylor
expansion around 0:

result:rectform(float(taylor(Ge(s),s,0,1)))$
realpart(result)
-> 4.495690568998906e-23/s-1.1606583177590578e-8*s
imagpart(result);
-> 1.1535859169661196e-7*s+3.833768849248987e-24/s

So, it looks like Ge(s) is approximately (4.5e-23+%i*3.8e-24)/s.  However,
there may be numerical inaccuracies in this result since you used
floating-point numbers in the original equations.  But this kind of matches
what you see where Ge(s) increases as s gets closer to 0.

Ray