Application Center - Maplesoft

App Preview:

Three-dimensional plots of a Function with Discontinuities

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

phaseplot3d.mw

Three-dimensional plots of a Function with Discontinuities

Robert Ipanaqu Chero

National University of Piura, PERU
E-mail: robertchero@hotmail.com

Web page: robertchero.tk

Introduction

The package DiscontinuousFunctions serves to create three-dimensional plots of a function with discontinuities (e.g phase boundaries). The output obtained is consistent with Maple's notation. The performance of the package is discussed by means of several illustrative and interesting examples.

The Package DiscontinuousFunctions: Some Illustrative Examples

Loading the package developed by the author:

> libname := "c:\\mylib\\DiscontinuousFunctions",libname;

> with(DiscontinuousFunctions);

libname :=

[phaseplot3d]

Example of a cylinder:

> phase1:=(x,y)->1:
phase2:=(x,y)->-1:

phase3:=(x,y)->0:


phaseSelection:=(x,y)->piecewise(

x^2+y^2<0.8,1,

(x-2)^2+y^2<0.8,2,3

):

> phaseplot3d(
phaseSelection,[phase1,phase2,phase3],

x=-1..3,y=-1..1);

[Plot]

This would be the same function as a standard three-dimensional plot:

> phaseSelection:=(x,y)->piecewise(
x^2+y^2<0.8,1,

(x-2)^2+y^2<0.8,-1,0

):

> plot3d(
phaseSelection(x,y),

x=-1..3,y=-1..1);

[Plot]

Using the options incorporates in this package:

> phase1:=(x,y)->1:
phase2:=(x,y)->-1:

phase3:=(x,y)->0:


phaseSelection:=(x,y)->piecewise(

x^2+y^2<0.8,1,

(x-2)^2+y^2<0.8,2,3

):

> phaseplot3d(
phaseSelection,[phase1,phase2,phase3],

x=-1..3,y=-1..1,

scaling=constrained,style=patchnogrid,axes=boxed);

[Plot]

Another example:

> phase1:=(x,y)->sqrt(1.001-x^2-y^2):
phase2:=(x,y)->x^2+y:


phaseSelection:=(x,y)->piecewise(

x^2+y^2<1,1,2

):

> phaseplot3d(
phaseSelection,[phase1,phase2],

x=-1.5..1.5,y=-1.5..1.5,axes=boxed);

[Plot]

>

Conclusions

In this worksheet a new Maple package, DiscontinuousFunctions, create three-dimensional plots of a function with discontinuities. The performance of the package has been illustrated by means of several interesting examples. In all the cases, the output obtained is consistent with Maple's notation.

Source

Heiko Feldmann: 3D Plots of Discontinuous Functions. Institute for theoretical physics, University of Wrzburg, Germany. 2000.