Explore - Maple Help

Explore

explore mathematical expressions, plots, or images that depend upon parameters

 Calling Sequence Explore(expr) Explore(expr, pars ) Explore(expr, opts ) Explore(expr, pars, opts )

Parameters

 expr - anything; the expression or function call to explore. pars - (optional) seq(name={range,list}); one or more parameter's values' specifications. Use the parameters keyword option instead for specifying the controller and other qualities for a particular parameter. opts - one or more keyword options, as described in the Options section.

Options

 • animate = {truefalse,identical(never)}
 Sets a default for animation check boxes alongside each parameter controller. If set to true then by default animation check boxes are initially selected (checked). If set to false then by default animation check boxes are present but initially unselected (unchecked). If set to never then by default animation check boxes are absent. If this option is omitted, and if any individual parameter specification enables its own animation, then animation check boxes are present for all sliding controllers which do not have an override.
 • autorecord = truefalse
 Toggle on recording of plots automatically, if the recordto option has been supplied. The default value is false.
 • autorun = truefalse
 Play the animation automatically, upon embedding into the current worksheet. When set to true the animate option is implied as true even if the animate option is not set. This has no effect when using the newsheet option.
 • componentbackground = {string,name,list}
 This option specifies the background color of the Plot Component or Math Component. The default value is "White".
 • componentborders = truefalse
 This option specifies whether the borders of the Plot Component or Math Component are shown. By default the borders of the Plot Component are shown, and those of the Math Component are not shown.
 • documentproperties = list(string=string)
 A list of equations for each of which the left-hand side string specifies a Document Property key and the right-hand side string specifies the corresponding value. This option is only valid when accompanied by the options newsheet=true or insert=false, and the Document Properties are set on the new document.
 • echoexpression = truefalse
 This option specifies whether the unevaluated expression appears on the left-hand side of a equation displayed in the embedded Math Component. The default value is true. This option has no effect in the case of an explored plot or image.
 • fillcolor = {string,name,list}
 This option specifies the fill (background) color for all Table cells and controllers, unless overridden for a controller in the parameters option. The default value is White.
 • fontcolor = {string,name,list}
 This option specifies the font (foreground) color for all Table cells and controllers, unless overridden for a controller in the parameters option. The default value is "Black".
 • initialvalues = list(name=realcons)
 A list of equations specifying parameter values used in the initial evaluation of expr and as the initial values for the sliding controllers.
 By default the left endpoints of the slider ranges are used for all parameters whose initial values are not specified by this option. If expr fails to evaluate without error then the right endpoints of the slider ranges are used for all parameters whose initial values are not specified by this option.
 • insert = truefalse
 Insert the assembly of embedded components. The default value is true. This option can be used in conjunction with the returnxml option to construct worksheet source of interactive applications when the Standard GUI is not the currently running user interface.
 • loop = {truefalse,identical(never)}
 Enable looping when animating. When set to true a check box for enabling looping is embedded and initially selected (checked), in the case of an animation. When set to true the animate option is implied as true even if the animate option is not set. When set to false a check box for enabling looping is embedded and initially unselected (unchecked), in the case of an animation. When set to never a check box for enabling looping is absent. The default value is never.
 • markers = list({list({name,realcons,identical(symbolsize,symbol,color)=anything}),identical(symbolsize,symbol,color)=anything})
 A list of lists of pairs of parameter names or fixed numeric value, or point modifiers, for the case of exploring a 2-D plot. For a marker [p1,p2] a symbol is included in the plot at position [v1,v2] using the current values v1 and v2 respectively of the sliding controllers of parameters p1 and p2. Each marker symbol on the plot can be dragged interactively with the pointer device (eg. mouse), as a click and drag action.
 By default the sliding controllers associated with parameters used as markers are not shown. This can be overridden by using the showmarkercontrols option or by qualifying a controller as shown within the parameters option.
 While dragging a marker the pair of associated sliding controllers will be updated with new values. While interactively changing either of the associated sliding controllers the plot will be updated with the new marker positions. The markers can only be dragged to positions which fall within the ranges specified for the associated parameters.
 In the case of just a single marker being present then clicking on a point in the plot will move the marker to that position and its sliding controllers will be updated accordingly. This single-click move will only occur if the coordinates of the clicked position fall within the ranges specified for the associated parameters.
 In addition to the name or value pair, each inner list may also contain keyword options as modifiers to specify the color, symbolsize, or symbol for the corresponding marker. These conform to the point options for 2D plots.
 The outer list may also contain those same keyword options, in order to qualify the symbols for all markers. These are overridden by any such qualifier appearing within the inner list specifying a marker.
 • newsheet = truefalse
 Launch the exploration in a new Document, rather than embed into the current worksheet. By default the exploration assembly is embedded in the current worksheet at a position below the output of the current execution point.
 • numeric = truefalse
 This option specifies whether evalf is applied around each individual evaluation of expr. This behavior is distinct from whether the parameters take on floating-point values.
 • numframes = posint
 The number of frames for an animation. The default value is 50.
 • orientation = identical(vertical,horizontal)
 This option specifies the orientation of any parameter's Slider controller as either horizontal or vertical. The default is horizontal.
 • overview = string
 A string inserted as a plaintext description of the embedded interactive application. The description appears as text in a top row of the Table. By default no description appears.
 • parameters = list({name={range,list},list})
 A list specifying the parameters that can be varied. Each entry of this list corresponds to one parameter. An entry can have three forms:
 – An entry of the form name = range specifies that the parameter with the given name can assume values in the given range. It can be controlled interactively with a sliding component.
 If both endpoints of a parameter's range are integers then the associated slider will take on only integer values.  If either endpoint of a parameter's range is entered as a non-integer value (such as 2.6, Pi, 4/7, or sqrt(2)) then evalf is applied to both endpoints of that range and the associated parameter will take on floating-point values.
 – An entry of the form name = list specifies that the parameter with the given name can assume values from the given list. It can be controlled with a ComboBox or a CheckBox if the list has only two values true and false.
 – An entry that is a list must contain exactly one element which is either a name or an equation whose left-hand side is not one of the qualifying option names listed below. If this element is an equation then it is processed in the same way as the name = range and name = list forms above. If this element is a name then it is processed similarly to name = [true,false] and by default is controlled as a CheckBox. The other valid entries of the list are qualifying option names and/or equations that apply to this parameter only.
 Whenever an option is not specified in this list, it takes its default value from the options specified as top level options that are part of the Explore call, or the global default if no such option is given. For example, if a parameter has a Slider as its controller and it is specified in a list with the equation placement = right, then its controller will be placed on the right of the component displaying results. If it is specified with a list containing no placement option (or specified as name = range), and the call to Explore contains the option placement = left, it will be placed to the left. If it is specified with a list containing no placement option (or specified as name = range), and there is also no placement option in the top level call to Explore, then it will get the default placement for parameters with a Slider as controller: at the bottom.
 Special qualifying options are described below. Any additional options are passed to the individual controller constructors.
 • controller = {name,string}
 This overrides the component type used to control this parameter's value. Valid choices are slider, volumegauge, dial, meter, rotarygauge, checkbox, combobox, listbox and textarea. The value for this option can be a name or a string, spelled in any mix of upper and lower case. See EmbeddedComponents for more details about these interactive components.
 • label = {name,string}
 This overrides the label displayed beside the controller for this parameter. The default label is the name of the parameter itself.
 • shown = truefalse
 This specifies whether the controls for the parameter are visible. The default for marker controllers is false, while the default for non-marker controllers is true. This overrides the value of the showmarkercontrols option, for the given parameter.
 • placement = identical(left,bottom,right,top)
 This overrides the value of the placement option, for the given parameter.
 • animate = {truefalse,identical(never)}
 This overrides the value of the animate option, for the given parameter. Like for the top level animate option, you can shorten animate = true to the equivalent animate.
 • orientation = identical(horizontal,vertical)
 This overrides the value of the orientation option, for the given parameter.
 If the parameters option is not supplied then a dialog box appears which allows customized creation of the exploration application.
 • placement = identical(left,bottom,right,top)
 Sets a new default for placement of parameter controllers, with respect to the component that displays the explored plot, expression, or image. If unset then sliding components are placed at bottom by default, and ComboBox controllers for nonnumeric discrete valued parameters are placed left. This new default may be overridden in the specification of any individual parameter.
 • recordto = name
 A global name to which generated plots are assigned to as indexed entries whenever the embedded record button is toggle on (solid red). The entries are indexed in the order in which they are assigned, starting from 1. This named table can be subsequently used outside of the exploration. See also the autorecord option.
 • returnxml = truefalse
 Return a string containing XML worksheet source for the exploration application. The default behavior is that the return value is NULL.
 • showbanner = truefalse
 This option controls whether the graphic banner image appears in the case that the exploration application is launched in a new Document. By default the banner will appear at the top of a newly launched Document. No banner is included for the default case of the exploration interface embedded into the current worksheet.
 • showhiddenborders = identical(always,never,worksheet)
 This option specifies whether hidden borders are displayed upon mouse pointer rollover. The values of always or never override the hidden Table borders property of the Document or Worksheet. If the newsheet option is supplied as true then the value of showhiddenborders defaults to worksheet. If the newsheet option is false or not supplied then the value of showhiddenborders defaults to never.
 • showmarkercontrols = truefalse
 Include sliding controllers for parameters listed in the markers option. The default value is false. This can be overridden in the parameters' individual specification provided in the parameters option.
 • size = list({posint,identical(default)})
 A list of two positive integers which sets the size (width and height) in pixels of the component displaying results.
 The Math Expression Component inserted by Explore has its auto-fit property enabled by default. Following execution of the Explore command the autofit property can be disabled by right-clicking on the Math Expression Component, and unselecting auto-fit in its properties. If the size option to Explore is used, its effect won't be seen unless the auto-fit property is unselected.
 With respect to resizing plots, the default behavior for the Explore command is to set the size of the Plot Component to the size of the plot.  Supplying the size option to the Explore command will set the size of the Plot Component irrespective of any size options on the plot.
 In the case of images, by default the width and height properties of the inserted Label Component are given the width and height of the initially computed image.  Supplying the size option to the Explore option sets the width and height of the Label.
 Following insertion, the size of the display component can be changed by selecting it and changing its properties in the Context Panel.
 • startupdefinitions = list({name,name=anything})
 A list of names or equations with names on the left-hand side. This option is only valid when accompanied by the options newsheet=true or insert=false. For each name an assignment statement will be placed in the Startup Code Region of the newly opened document, assigning to that name either its current value under 2-level evaluation or the right-hand side of the equation.
 • tablealignment = identical(left,right,center)
 This option specifies how the Table containing the exploration is aligned horizontally in the Worksheet or Document. By default it is aligned to the center.
 • tableborders = truefalse
 The option specifies whether external borders of the Table containing the exploration are shown. They are shown by default.
 • title = string
 A string used as a title for the embedded worksheet Table. By default no title will appear.
 • width = And(realcons,nonnegative)
 The width of the Table which encloses the entire exploration. If the option widthmode has value pixels then the width value specifies the number of pixels under 100% magnification. If the option widthmode has value percentage then the width value specifies the percentage of the worksheet's width that is occupied by the exploration. The default width in the case widthmode=pixels is determined automatically by the components and controls in the exploration. The default width in the case widthmode=percentage is 100% of the worksheet.
 • widthmode = identical(percentage,pixels)
 This option specifies whether the value of the width option is taken as a percentage of the worksheet or the width in pixels of the exploration under 100% magnification.

Description

 • The Explore command takes an arbitrary Maple expression or function call and displays an interactive application to explore its evaluation at varying values of unassigned, dependent parameters. The interactive application for exploration is comprised of various embedded components within a Standard GUI Table.
 Embedded components act as controllers which allow the values of the parameters to be changed. The result of evaluating the expression or function call at the values specified by the controllers is displayed either as an expression in a Math Component, a plot in a Plot Component, or as an image on a Label Component.
 • A plotting command to be explored can be a function call to plot, plot3d, a command in the plots package, or a command or user-defined procedure which returns a two- or three-dimensional plot structure or an Array of such plot structures.
 In the case of a Math Component, if the explored expression evaluates to an expression sequence then the expression is wrapped within a list before being placed within the Math Component.
 • Parameter values are used by re-evaluating the original expression or function call. The parameter names are not assigned values in this process. In consequence instances of the unassigned parameter names within a procedure body will not be evaluated. In order to use the values within a procedure the parameter name should occur in an argument to an explored function call.
 • The resulting exploration application is not the return value of the Explore command. The default return value is NULL.
 • This command inserts the assembly of Tables and Embedded Components into the worksheet using the InsertContent facility. The inserted content is placed after any usual output of the Execution Group in which this command is called. Each Execution Group allows for only one inserted result to exist at any given time. Multiple calls to commands which utilize the InsertContent facility made within the same Execution Group will result in each successive inserted assembly replacing any assembly inserted earlier for that Execution Group.
 The newsheet option allows for the exploration assembly to appear in a new Document tab instead of being inserted into the current worksheet.
 • The Explore command can also be applied using the Context Panel.
 Note: This feature only works in the Maple Standard Worksheet interface.

Examples

See Explore Examples for additional examples and discussion of the various command options.

 > $\mathrm{Explore}\left(\mathrm{plot}\left(\mathrm{sin}\left(ax\right){x}^{2},x=-2\mathrm{\pi }..2\mathrm{\pi },\mathrm{view}=-30..30\right),a=1.0..5.0\right)$

$\mathbf{a}$

 > $\mathrm{Explore}\left(\mathrm{factor}\left({x}^{a}-1\right),\mathrm{parameters}=\left[a=2..9\right],\mathrm{initialvalues}=\left[a=4\right]\right)$

$\mathbf{a}$

 > $\mathrm{Explore}\left(\mathrm{plot}\left(\frac{\left(b+0.7\right)\mathrm{sin}\left(\frac{x}{a+1}\right)}{x}+b,x=-4\mathrm{\pi }..4\mathrm{\pi },\mathrm{view}=-2..6\right),a=-2.0..1.0,b=0...3.0\right)$

$\mathbf{a}$

$\mathbf{b}$

 > $\mathrm{Explore}\left(\mathrm{plot3d}\left(\mathrm{sin}\left(ax\right)by,x=-\mathrm{\pi }..\mathrm{\pi },y=1..\mathrm{sqrt}\left(5\right),\mathrm{view}=-5..5\right),\mathrm{orientation}=\mathrm{vertical},\mathrm{parameters}=\left[\left[a=1..4.0,\mathrm{placement}=\mathrm{left}\right],\left[b=1.0..\mathrm{sqrt}\left(5\right),\mathrm{placement}=\mathrm{right}\right]\right]\right)$

$\mathbf{a}$

$\mathbf{b}$

The fill and font colors can be customized.

 > $\mathrm{Explore}\left(\mathrm{plot3d}\left(\mathrm{sin}\left(ax\right){y}^{2},x=-\mathrm{\pi }..\mathrm{\pi },y=-1..1,\mathrm{axis}=\left[\mathrm{color}=\mathrm{cyan}\right],\mathrm{view}=-1..1\right),a=1..5.0,\mathrm{componentbackground}="Black",\mathrm{fillcolor}="LightBlue",\mathrm{fontcolor}="DarkBlue"\right)$

${\mathbf{a}}$

Parameters taking discrete values can be controlled with ComboBox or ListBox components.

 > $\mathrm{Explore}\left(\mathrm{plots}:-\mathrm{display}\left(\mathrm{ColorTools}:-\mathrm{SpatterPlot3d}\left(\left[\mathrm{ColorTools}:-\mathrm{GetPalette}\left(p\right)\left[\right]\right],\mathrm{space}=c,\mathrm{symbol}="box"\right),\mathrm{orientation}=\mathrm{piecewise}\left(c="Lab"\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{or}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}c="Luv",\left[-172,12,-145\right],\left[55,75,0\right]\right),\mathrm{view}=\mathrm{piecewise}\left(c="RGB"\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{or}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}c="HSV",\left[0..1,0..1,0..1\right],c="xyY",\left[0...0.7,0...0.7,0...1.0\right],\left[\mathrm{default},\mathrm{default},\mathrm{default}\right]\right),\mathrm{projection}=0.78\right),\mathrm{parameters}=\left[\left[p=\left["X11","HTML","Resene","Generic","CSS","Niagara","MapleV","OldPlots","Mono"\right],\mathrm{label}=\mathrm{Palette}\right],\left[c=\left["RGB","HSV","Lab","Luv","xyY"\right],\mathrm{label}=\mathrm{Color Space}\right]\right],\mathrm{size}=\left[500,500\right],\mathrm{placement}=\mathrm{bottom},\mathrm{orientation}=\mathrm{vertical},\mathrm{fillcolor}="#BCBCBC",\mathrm{componentbackground}="#777777",\mathrm{title}="Color Palette SpatterPlots"\right)$

 X11HTMLReseneGenericCSSNiagaraMapleVOldPlotsMono RGBHSVLabLuvxyY

In the next example the red marker controls parameters a and b while the green marker controls only parameter c. The markers can be moved with the mouse cursor. This example uses no custom user-authored procedures and will function after restart, without the need to re-execute code.

 > $\mathrm{Explore}\left(\mathrm{plots}:-\mathrm{display}\left(\mathrm{plottools}:-\mathrm{polygon}\left(\left[\left[0,1\right],\left[a,b\right],\left[a,c\right],\left[0,1\right]\right],\mathrm{color}="Orange"\right),\mathrm{view}=\left[0..5,0..5\right]\right),a=1.0..4.0,b=1.0..4.0,c=1.0..4.0,\mathrm{initialvalues}=\left[a=3,b=2\right],\mathrm{markers}=\left[\left[a,b,\mathrm{symbol}=\mathrm{circle},\mathrm{symbolsize}=35,\mathrm{color}="Red"\right],\left[0,c,\mathrm{symbol}=\mathrm{solidbox},\mathrm{symbolsize}=20,\mathrm{color}="Green"\right]\right],\mathrm{tableborders}=\mathrm{false},\mathrm{componentborders}=\mathrm{false}\right)$

In the next example the parameters freq and A are controlled by TextArea components. Note the supplied numeric initial values for these parameters, without which the initial values used would be simply the unassigned global parameter names. To update the plot with a new value for one of these parameters edit the value in its TextArea controller and press the Enter key.

 > $\mathrm{Explore}\left(\mathrm{plot}\left(A\mathrm{sin}\left(\mathrm{freq}x\right),x=0..2\mathrm{\pi },\mathrm{view}=-A..A\right),\mathrm{parameters}=\left[\left[\mathrm{freq},\mathrm{controller}=\mathrm{textarea},\mathrm{label}="Frequency"\right],\left[A,\mathrm{controller}=\mathrm{textarea},\mathrm{label}="Amplitude"\right]\right],\mathrm{initialvalues}=\left[\mathrm{freq}=3.0,A=2.5\right]\right)$

A 2D or 3D plot exploration can be automatically run with the frames automatically assigned as indexed entries of a named table.

 > $\mathrm{Explore}\left(\mathrm{plot}\left(\mathrm{sin}\left(ax\right),x=-\mathrm{\pi }..\mathrm{\pi },\mathrm{size}=\left[400,200\right]\right),a=1.0..5.0,\mathrm{recordto}='\mathrm{myanimation}',\mathrm{autorecord},\mathrm{autorun},\mathrm{numframes}=10\right)$

$\mathbf{a}$

The entries of the table can be subsequently used as an animation. For example, once displayed the animation can be run using the animation toolbar.

 > $\mathrm{plots}:-\mathrm{display}\left(\mathrm{op}\left(\mathrm{convert}\left(\mathrm{myanimation},\mathrm{list}\right)\right),\mathrm{insequence},\mathrm{size}=\left[400,200\right]\right)$
 > 

Compatibility

 • The echoexpression, initialvalues, newsheet, numeric, overview, parameters, returnxml, showbanner and title options were introduced in Maple 17.