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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

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

vveeran
4-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.

ACCEPTED SOLUTION

Accepted Solutions
-MFra-
21-Topaz II
(To:vveeran)

Hi vetri veeran,

are you Looking for something like this?

vetri veeran 1.jpg

Regards

FM

View solution in original post

19 REPLIES 19
-MFra-
21-Topaz II
(To:vveeran)

Hi vetri veeran,

are you Looking for something like this?

vetri veeran 1.jpg

Regards

FM

vveeran
4-Participant
(To:-MFra-)

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 ?

-MFra-
21-Topaz II
(To:vveeran)

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.

vveeran
4-Participant
(To:-MFra-)

Dear FM,

Thank you so much for your reply.

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 ?

Werner_E
25-Diamond I
(To:vveeran)

> 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

vveeran
4-Participant
(To:Werner_E)

Dear @W.E,

Thank you very much.

Could you please attach your mathcad code.

Werner_E
25-Diamond I
(To:vveeran)

I had not saved the file to keep it.

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

vveeran
4-Participant
(To:Werner_E)

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.

Werner_E
25-Diamond I
(To:vveeran)

> 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?

vveeran
4-Participant
(To:Werner_E)

Dear Wener Exinger,

Thank you very much for your comments.

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.

Werner_E
25-Diamond I
(To:vveeran)

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

-MFra-
21-Topaz II
(To:vveeran)

Hi vetri veeran,

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

vetri veeran 2.jpg

vveeran
4-Participant
(To:-MFra-)

Dear @F.M,

Thank you so much.

Could you please attach you mathcad code.

-MFra-
21-Topaz II
(To:vveeran)

HI vetri veeran

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

Greetings

F.M.

Werner_E
25-Diamond I
(To:vveeran)

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

ptc-4127093
4-Participant
(To:Werner_E)

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

Werner_E
25-Diamond I
(To:ptc-4127093)

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

ptc-4127093
4-Participant
(To:Werner_E)

Thank you very much for your help.

Your "trick" works fine !

 

I wish you a Happy New Year from Belgium.

 

Richard

Werner_E
25-Diamond I
(To:ptc-4127093)


@ptc-4127093 wrote:

Thank you very much for your help.

Your "trick" works fine !

 

I wish you a Happy New Year from Belgium.

 

Richard


You are welcome!

 

Happy New Year to you, too, from Austria!

Werner

Announcements

Top Tags