Skip to main content
4-Participant
March 18, 2017
Solved

How to remove the straight line coming in x-axis at the point -0.3

  • March 18, 2017
  • 2 replies
  • 7334 views

Dear all,

I want to remove the straight line coming in the x-axis at the point -0.3

in my attached plot.

Please go through the attached plot.

Thanks.

Best answer by -MFra-

Hi vetri veeran,

are you Looking for something like this?

vetri veeran 1.jpg

Regards

FM

2 replies

-MFra-21-Topaz IIAnswer
21-Topaz II
March 18, 2017

Hi vetri veeran,

are you Looking for something like this?

vetri veeran 1.jpg

Regards

FM

vveeran4-ParticipantAuthor
4-Participant
March 18, 2017

Thank you for your reply.

Yes, That is what I need.

What is the reason for the straight line at that point ?

Could you please tell me ?

21-Topaz II
March 18, 2017

The function in that range, jumps from minus infinity to plus infinity. These jumps occur, in the case of rational functions, in correspondence of the poles of the function. This is what happens to your function. We should analytically determine the values of x that make the function infinite. In other words a method could be this: what are the value of x  which make the first derivative of f(x) equal to π / 2.

25-Diamond I
March 19, 2017

BTW, here is another way to avoid the vertical line without having to split the plot in two plots (which in my opinion is something undesirable):

5-Regular Member
December 29, 2018

Hello,

 

I tried to use your method in my Mathcad 15 for vertical asymptotes but unfortunatelly, it does not work (file attached)

Could you help me ?

Thank you.

 

Richard

25-Diamond I
December 30, 2018

You have basically 2 errors:

 

1) The definition of h.plot is wrong in the first line. The wrong version cannot be distinguished from the correct one with the naked eye. In the left placeholder of the "on error" statement there is only "NaN". Then the whole "on error" statement must be assigned to F. You made the assigment "F <- NaN" in the left placehoder of the "on error" statement.

I tried to make it more clear by highlighting it in yellow and setting parenthesis in the picture below

 

2) The second problem is the range variable used for plotting. You defined a range from -3 to 2 with a step width of 1. Thats far to coarse. My stepwidth 0.001 may be a bit too fine and you may try -3,-2.99 .. 2.

BTW, you don't have to use a range variable for plotting at all. Delete the definition of x.plot and see how mathcad choses its own range for plotting. This feature is called "quick plot". Most the time it works fine but I nevertheless often find it better to use a range as it gives me the control over start and stop value and stepwidth.

I try to avoid to name that variable which is just used for plotting "x" as I usually want x to be a "free" variable without any value. Thats the reason for naming it "x.plot". Often I name it just "x." because when the focus is outside of the plot this variable looks like "x".

 B.png

 

BTW, your function h(x) plot quite fine without any vertical artefact if you use a simple quickplot. No need for any tricks 😉

B2.png