Application Center - Maplesoft

App Preview:

Interval Arithmetic: Complex Disc Arithmetic

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

Learn about Maple
Download Application


 

ComplexDisc.mws

Complex Disc Arithmetic

written by  Grimmer, Markus, Department of Mathematics, University of Wuppertal, Germany, http://www.math.uni-wuppertal.de/wrswt
<? 1999-2002 Scientific Computing/Software Engineering Research Group, University of Wuppertal, Germany>

NOTE: This worksheet demonstrates the use of the Maple package intpakX v1.0  for interval arithmetic.

This document is not the package.  It only shows how to work with the functions and types provided by intpakX v1.0 .  You must create the package in an empty directory before loading the package ( i.e., /usr/maple/intpakX/lib)  Once created, load the package as follows:

>    restart;
libname:="C:/mylib/interval", libname;
with(intpakX);

libname :=

Warning, the name changecoords has been redefined

Warning, the assigned name midpoint now has a global binding

Warning, the protected names ilog10, max and min have been redefined and unprotected

[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...
[`&*`, `&**`, `&+`, `&-`, `&/`, `&Convex_Hull`, `&arccos`, `&arcsin`, `&arctan`, `&cabs`, `&cadd`, `&cdiv`, `&cdiv_opt`, `&cmult`, `&cmult_opt`, `&cos`, `&cosh`, `&csub`, `&exp`, `&intersect`, `&intpow...

Complex Disc Arithmetic

In addition to real intervals, there are also types and procedures for complex interval arithmetic.

Data Types and basic operations


Data Types: type/complex_disc and type/complex_interval
A complex disc is given by a complex number (center of the disc) and a value for the radius. It is defined as a list of three entries, [z_re,z_im,r].
A complex interval is given by two real intervals specifying a rectangular area.

>    A1:=[1,0,1];
type(A1,complex_disc);

A1 := [1, 0, 1]

true

>    B1:=[1.,2.];
B2:=[3.,4.];
B3:=[B1,B2];
type(B3,complex_interval);

B1 := [1., 2.]

B2 := [3., 4.]

B3 := [[1., 2.], [3., 4.]]

true


Display complex disc intervals:

>    complex_disc_plot(A1);

[Maple Plot]


Arithmetical Operations:
&cadd, &csub, &cmult, &cdiv
As for real intervals, you can also do the basic arithmetics with disc intervals.


Area optimal multiplication and division:
You can also use area optimal multiplication and division instead of their centered counterparts (where you get the new center i.e. by  
multiplying the centers of the discs to be multiplied).

>    A2:=[-1,1,1];
A3:=A1 &cmult A2;
A4:=A1 &cmult_opt A2;

A2 := [-1, 1, 1]

A3 := [-1.000000000, 1.000000000, 3.414213579]

A4 := [-1.390388204, 1.390388204, 2.969562256]

Range Enclosure for Complex Polynomials

Define and display complex polynomials:

>    p1:=(0.1+0.1*I)*z^5+0.2*I*z^4-0.1*I*z^3+(-0.2-0.1*I)*z+2.0+1.0*I;
Z:=[-0.2,0.4,1];
type(Z,complex_disc);
type(p1,polynom);

p1 := (.1+.1*I)*z^5+.2*I*z^4-.1*I*z^3-(.2+.1*I)*z+2.0+1.0*I

Z := [-.2, .4, 1]

true

true

>    complex_polynom_plot(p1,Z);

[Maple Plot]


There are three methods for enclosing the range of a complex polynomial, two based on a Horner-like evaluation with centered or area optimal multiplication, the third based on centered forms (similar to the mean value form for real numbers). Study the example for the differences:

>    pH:=horner_eval_cent(p1,Z);
pO:=horner_eval_opt(p1,Z);
pC:=centred_form_eval(p1,Z);

pH := [2.070624000, .9264320000, 2.045124573]

pO := [2.015564848, .6058466116, 1.733919747]

pC := [2.070624000, .9264320000, 1.850902850]

>    c1:=complex_disc_plot(pH,color=blue,thickness=2,linestyle=4):
c2:=complex_disc_plot(pO,color=green,thickness=2,linestyle=3):
c3:=complex_disc_plot(pC,color=red,thickness=2,linestyle=2):
c4:=complexplot(subs(z=Z[1]+I*Z[2]+Z[3]*(cos(t)+I*sin(t)),p1),t=0..2*Pi,color=black,thickness=2):

>    display([c1,c2,c3,c4],scaling=constrained);

[Maple Plot]


The display command can be found in the Maple plots package. For the options cf. the plot command options.

The Complex Exponential Function


Finally, there's the exponential function for complex discs:

>    cexp(Z);

[.7541009612, .3188287726, 1.406810183]

>   

Disclaimer:  While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material.