How do I veryfy an equation exists

Hello,

I have to build a simple procedure that will plot the graph and its tangent, however, i wanna go further and plot the x= (asymptot) if the function does not allow a derivative at a point. For instance, Tan(x) doesn't allow any derivative at Pi/2. I can't use the Showtangent command.

gkokovidis's picture

How do I veryfy an equation exists

I don't know if this will "verify" that an equation exists, but it is the function that is used to trigger error messages, similar to what you get when you try to take the tangent of Pi/2.  Look at the help pages for "NumericEvent" and see if you can integrate it into you procedure.  

>? NumericEvent

The above command is used many times in the "tan" function call.  To view the code that the tan function uses, type the following:

>showstat(tan);

You can use showstat to display the Maple code for most of the functions that Maple uses internally.  Hope this helps.

 

Regards,
Georgios Kokovidis
Dräger Medical


I've played a bit with

I've played a bit with NumericEvent and I have managed not to get an error when I run the proc however I sitll have the wrong operation to check wheter the derivative exists or not and to plot and X=t where t is the x coord where the derivative would not exist (Pi/2 for tan)

gkokovidis's picture

Type Checking

You can implement type checking, and if the limit at a value approaches infinity, you can ignore it in your plot.

>p:=x->tan(x);

>q:=D(p);

>r:=limit(q(x),x=Pi/2);

>type(r,infinity);

 

Don't forget that you are only checking the above at one particular value.  tan(x) has an infinite number of asymptotes, in intervals of Pi.  x = -1/2*Pi, x = 1/2*Pi, x = 3/2*Pi...

 

Regards,
Georgios Kokovidis
Dräger Medical


Type checking worked thanks

Type checking worked thanks alot, now How do I plot an equation like x=2 or x=Pi/2??

gkokovidis's picture

Lines

See examples below.  Run the lines to see what happens.

 

>restart:with(plots): 

>plot([Pi/2,y,y=-10..10]);

>plot([2,y,y=-10..10],color=blue);

>p1:=plot([Pi/2,y,y=-10..10]):

>p2:=plot([2,y,y=-10..10],color=blue):

>display(p1,p2);
 

Regards,
Georgios Kokovidis
Dräger Medical


Worked, thanks

Worked, thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}