cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

SOLVED
Highlighted
Participant

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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

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

Hi vetri veeran,

are you Looking for something like this?

Regards

FM

19 REPLIES 19
Highlighted

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

Hi vetri veeran,

are you Looking for something like this?

Regards

FM

Highlighted

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

Yes, That is what I need.

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

Could you please tell me ?

Highlighted

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

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.

Highlighted

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

Dear FM,

Could you please tell me in detail from the above program, how to determine for which

value of x, the function becomes infinite which will be very much helpful to me ?

Because, in mathcad, for x ranging from -3 to 3, if I enter f(x), it just shows an error as "divide by zero" it is difficult to find

for which values of x, the function becomes infinite ?

Highlighted

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

> Because, in mathcad, for x ranging from -3 to 3, if I enter f(x), it just shows an error as "divide by zero" it is difficult to find for which values of x, the function becomes infinite ?

What do YOU think happens here, if x equals zero?

Check:

Solving for the other denominator gives you the position of the vertical asymptote, the pole:

The exact value is

Highlighted

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

Dear @W.E,

Thank you very much.

Highlighted

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

I had not saved the file to keep it.

Do you experience any difficulties in typing in the two or three expressions?

Highlighted

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

Dear @W.E,

I can't type fnew(x) = NaN on error f(x).

Also, when I type 1+beta.G(x).Vm^2 solve,x -->

I am getting error as bad solve variable.

Thats why could you please attach the code.

Thanks.

Highlighted

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

> I can't type fnew(x) = NaN on error f(x).

You can't simply type this, you have to use the symbolic palette to insert the "on error" statement

> Also, when I type 1+beta.G(x).Vm^2 solve,x -->

>I am getting error as bad solve variable.

Probably because you have already assigned x a value or range.

type x:=x before the symbolic solve - this clears the variable (but only for symbolic operations).

BTW - what do you see as my name when you are logged in? You should see WE when you are mot logged in, but after you logged in you should see my full name. Do you see it?

Highlighted

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

Dear Wener Exinger,

I can see you name Werner Exinger after I logged in.

Since, F.M used your name in the previous comment as W.E so I followed that.

Highlighted

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

> Since, F.M used your name in the previous comment as W.E so I followed that.

No problem. He seems to like initials as he is using intials as his "real" name, too.

I just wondered if anything with the settings was broken but am glad to hear that all works as it should.

Highlighted

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

Hi vetri veeran,

it follows my reworking, also thanks to the instructions of W. E .:

Highlighted

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

Dear @F.M,

Thank you so much.

Highlighted

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

HI vetri veeran

I'm sorry, I would have to attach it first.

Greetings

F.M.

Highlighted

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

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):

Highlighted

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

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

Highlighted

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

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".

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

Highlighted

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

Thank you very much for your help.

I wish you a Happy New Year from Belgium.

Richard

Highlighted

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

@ptc-4127093 wrote:

Thank you very much for your help.

I wish you a Happy New Year from Belgium.

Richard

You are welcome!

Happy New Year to you, too, from Austria!

Werner

Announcements