Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6313

Re: Plotting discontinuities using Exclusions

From DrMajorBob <btreat1@austin.rr.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Plotting discontinuities using Exclusions
Date 2011-11-10 11:53 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j9gdvv$om6$1@smc.vnet.net> (permalink)
References <201111091125.GAA11166@smc.vnet.net>

Show all headers | View raw


f = (x^2 - 2 x)/(x - 2);
label = ToString@Factor@Numerator@f/ToString@Denominator@f;
Plot[f, {x, 0, 4}, PlotLabel -> label,
  Exclusions -> Reduce[Denominator[f] == 0, x]]

Bobby

On Wed, 09 Nov 2011 05:25:48 -0600, John Accardi <johnaccardi@comcast.net>  
wrote:

> Goal: Display the definition of a rational function in factored form
> to better see points of discontinuities, like holes and then plot
> the function showing the hole.
>
> Example 1:
>
> The following does the graph correctly, showing a gap at x = 2 but
> requires an undesirable function definition (I want to specify
> the numerator factored).
>
> f = (x^2 - 2 x)/(x - 2)
>
> (-2 x + x^2)/(-2 + x)
>
> Plot[f, {x, 0, 4}, Exclusions -> Reduce[Denominator[f] == 0, x]]
>
>
> Example 2:
>
> More desirable is to show the function with numerator factored so
> students can see the zero of the bottom being the same as the zero
> in the top for the hole.  For example, the following shows the function
> definition
> as desired but the graph then does not show the gap for the hole:
>
> f = x (x - 2)/(x - 2)
>
> x
>
> Plot[f, {x, 0, 4}, Exclusions -> Reduce[Denominator[f] == 0, x]]
>
> I suspect that Mathematica does the cancellation (outputting x) and
> therefore
> loses sight of the discontinuity for the plot.
>
> Question:
>
> How can I use the function definition of Example 2 and the plot output
> of Example 1 in one sequence?  (I want to prevent the simplification
> Mathematica does when processing the function definition.)
>
> Thanks for any insights.
>


-- 
DrMajorBob@yahoo.com

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Plotting discontinuities using Exclusions DrMajorBob <btreat1@austin.rr.com> - 2011-11-10 11:53 +0000

csiph-web