On Sun, Jul 28, 2013 at 11:23 AM, Stefan Krastanov
<
krastano...@gmail.com> wrote:
> Below I try to answer the question (basically there is no way for the
> moment), but could you tell us how you actually expected this figure to look
> like?
>
> There does not seem to be a satisfactory way to do it. After all DiracDelta
> is zero at all points besides x=0, so simple sampling will miss this point.
> If x=0 is actually sampled, it returns infinity which either will cause the
> code to crash or it will mask the point as a NaN so it will be invisible.
>
> A step forward to solving this would be to have some kind of asymptote
> detector that changes the scale of the plot accordingly.
>
> Another way to solve this would be to provide an appropriate api for
> functions to tell the plotting module that they have such degenerate points.
This would be the ideal solution, so that we could print some kind of
vertical line, like at
http://en.wikipedia.org/wiki/Dirac_delta. It
would also allow plotting things like 1/x with dashed lines at that
asymptote, and even non-vertical asymptotes. I like the idea of the
API, so that we could have this be both automatic based on solve() and
extensible. This would be useful outside of plotting as well.
For now, probably the easiest way to do this would be to find some
suitable fn(x) such that fn(x) -> DiracDelta(x) as n -> oo and plot
fn(x) for n pretty large. Stefan will have to comment on what kind of
fn will be best suited for the plotting module.
Aaron Meurer