Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Taking the Log causing Mathematica kernel crash.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57061] Re: [mg57057] Re: Taking the Log causing Mathematica kernel crash.
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Sat, 14 May 2005 04:57:58 -0400 (EDT)
  • References: <d615dg$nn1$1@smc.vnet.net> <200505130518.BAA26930@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

You need to Evaluate the function before plotting:

Plot[Evaluate[20*Log[10, Abs[c[w]]]], {w, -5, 5}, PlotRange -> All]

works fine.

Andrzej Kozlowski



On 13 May 2005, at 14:18, Nasser Abbasi wrote:

>
> Hi;
>
> I think in my earlier post I did not convert the cell to INPUT FORM 
> before posting it.
>
> The code I posted seems magled up a little. Trying again.
>
> Is this one is supposed to post Mathematica code? convert to INPUT 
> FORM first?
>
> Clear["Global`*"]
> f[t_] := Sin[3.5*t] + 2*Cos[2*t];
> g[t_] := Piecewise[{{0, t < -2*Pi}, {f[t], t >= -2*Pi && t <= 2*Pi},
> {0, t > 2*Pi}}];
> c[w_] := Integrate[g[t]*Exp[(-I)*w*t], {t, -Infinity, Infinity}];
> Plot[20*Log[10, Abs[c[w]]], {w, -5, 5}, PlotRange -> All]
>
> thanks,
>
> Nasser
>
> "me" <nma at 12000.org> wrote in message news:d615dg$nn1$1 at smc.vnet.net...
>> Mathematica 5.1 on Windows.
>>
>> Clear["Global`*"]
>> f[t_] := Sin[3.5 t] + 2 Cos[2 t];
>> g[t_] := Piecewise[{{0, t < -2Pi}, { f[t], t = -2Pi && t = 2Pi}, {0, 
>> t >
>> 2Pi}}];
>> c[w_] := Integrate[ g[t] Exp[-I w t], {t, -Infinity, Infinity}] ;
>> Plot[20 Log[10, Abs[c[w]]], {w, -5, 5}, PlotRange -> All]
>>
>> The above code causes Mathemtica kernel crash.
>>
>> Change the last line above to remove the Log, then it is OK:
>>
>> Plot[20 Abs[c[w]], {w, -5, 5}, PlotRange -> All]
>>
>> Nasser
>>
>>
>


  • Prev by Date: Re: InterpolatingFunctionAnatomy.m
  • Next by Date: Numerical Eigenvalues for a 11x11 matrix
  • Previous by thread: Re: Taking the Log causing Mathematica kernel crash.
  • Next by thread: Re: Taking the Log causing Mathematica kernel crash.