pchin

Dr. Paulina Chin

1406 Reputation

12 Badges

19 years, 338 days
Maplesoft
Senior Architect
Waterloo, Ontario, Canada

MaplePrimes Activity


These are answers submitted by pchin

If you'd like to get a good introduction to the plotting facilities in Maple, try looking at Chapter 5 of the User's Manual. You can view the User's Manual in Maple by going to the Help menu and choosing "Manuals, Dictionaries and more". There is much more available for plotting than is contained in this chapter, but it's not a bad way to get started. You can then look at specific help pages or continue to ask questions in this forum. Some brief answers to the questions you'd asked: - To set the view, you can use the 'view' option with any of the plot commands, or choose Axes->Properties from the context menu for the plot. - In 2-D math input mode, you can use the Common Symbols palette to insert square-root or infinity symbols. - To generate multiple curves, use a list as the first argument to the plot command. (This is described on the plot help page.) Alternatively, you can create several plots and combine them with the plots[display] command. Paulina Chin Maplesoft
Andrew writes:
In other words, is it possible to give an implicit finction of three variables, and have it plot two of the variables on two axes and some function of the third variable on the third axis. For the simple sphere case, imagine giving the equation x^2+y^2+z^2-1=0 and asking it to plot not (x,y,z) but rather (x,y,f(z)) where f is some function of z you specify. Does anybody know how to do this?
You can use plots[implicitplot3d] to generate a plot p of the (x,y,z) values satisfying your equation. Then, use the plottools[transform] command to transform the points to (x,y,f(z)): plottools[transform]((x,y,z)->[x,y,f(z)])(p) Paulina Chin Maplesoft
You can create a Matrix (see the Matrix help page for information on how to construct one) that holds all the data you are using for the plots. Then, use the ExcelTools[Export] command to export all the data to a single Excel file. Paulina Chin Maplesoft
Andrew writes:
I tried to plot the circle where a cylinder cuts through a sphere. Unfortunately, using plot(eq1, eq2) command it plots both surfaces (cylinder and sphere), not just the intersection. So, do any of you know a way to give maple two equations and have it plot the points which satisfy both equations?
Try using the new plots[intersectplot] command, introduced in Maple 11. This can be used to plot the intersection of two surfaces. Paulina Chin Maplesoft
The easiest way to get a postscript file, if you are using the Standard Worksheet interface, is to right-click on the plot and choose Export, followed by Encapsulated Postscript, from the context menu. As Jacques states, there are other ways to do this if you're not working from the Standard Worksheet. These are described on the plot/device help page. Paulina Chin Maplesoft
Robert writes:
2) I'm using a step of 20 rather than 10, because 21 legends don't fit very well. Actually even 11 legends, though it works in Classic, doesn't seem to work in Standard: only 6 legends are shown although there is room for more (e.g. if you use legendstyle=[location=left]) 3) By default there are only 8 different colours for the curves, though you could get around this by specifying the colour option as a list.
We are aware of the legend problem and plan to have it resolved in a future release. Regarding the curve colours, Robert's suggestion of using a list works well, but I thought I'd use this opportunity to mention a new command in Maple 11, plots[setcolors]. This command lets you set the sequence of default colors assigned to multiple curves generated by the plot command. You can specify any number of colours and the plot command will cycle through them in order. Paulina Chin Maplesoft
If you don't want to bother with zip and seq, there are several nice routines in the Statistics package for plotting data sets. See the Statistics/Visualization help page for more information. For example, after doing with(Statistics), try PointPlot([x1, x2], xcoords=y, orientation=horizontal, color=[red, blue]). This command plots y-coordinates x1 and x2 against x-coordinates y, and the orientation option is used to flip the axes. If this seems unnatural to you, you can use plots[display] to combine PointPlot(y, xcoords=x1, color=red) and PointPlot(y, xcoords=x2, color=blue). Paulina Chin Maplesoft
Another option is to use polygonplot from the plots package: > plots[polygonplot]([[-2,-4],[1,3],[2,-2]], color=red, thickness=2); Paulina Chin Maplesoft
Take a look at the ?examples/Optimization help page. The last section, "Curve Fitting with Least Squares", shows how LSSolve can be used to fit a curve to data and it also shows the commands to plot the original data and the curve. If you have Maple 10, you can also try the commands listed on the ?Statistics/Regression help page. These commands use the same underlying algorithms as Optimization[LSSolve] but the user-interface is more natural for linear and nonlinear fitting applications. Paulina Chin Maplesoft
You can use the Fortran command from the CodeGeneration package to translate expressions or procedures into Fortran 77 source code. The ?CodeGeneration/Fortran help page gives instructions on using this command and includes examples. You will probably find the ?examples/CodeGeneration and ?CodeGeneration/TranslationDetails help pages useful as well. Paulina Chin Maplesoft
To create an animation with the implicitplot command, use the plots[animate] command with the implicitplot command as the first argument. For example, > with(plots): > animate(implicitplot, [x^2+y^2=t, x=-1..1, y=-1..1], t=0.1 .. 1); Paulina Chin Maplesoft
The Statistics package currently solves unconstrained problems only. That is, you can fit a model function that's linear or nonlinear in the parameters, but you can't impose constraints on those parameters. The only exception is that the NonlinearFit command allows simple bounds on the parameters to be specified through the parameterranges option. However, you can use the Optimization[LSSolve] command to set up the constrained optimization problem directly. You'll have to provide the residuals explicitly, but then you can add the boundary conditions as part of the constraint set. You may find the ?examples/Optimization help page useful for getting started with the Optimization package. Paulina Chin Maplesoft
To assign different colours with implicitplot3d, first put the expressions in a list (not a set) and then provide a list of colours: >implicitplot3d( [x+y+z=100, x+y>=50,x+z>=50,y+z>=50], x=0..120, y=0..110, z=0..115, axes=normal, color=[yellow, blue, red, green]); As for your second question, the easiest approach would be to substitute z=100-x-y into the constraints and then use the 2-D plots[inequal] command. Paulina Chin Maplesoft
Maple does not have a 3-D version of plots[inequal], but perhaps using plots[implicitplot3d] to visualize the surface defined by the equality would be helpful. Paulina Chin Maplesoft
When the first argument to GlobalSolve is a procedure, the bounds are specified as ranges (not as equations of the form name=range). The order of the bounds should follow the order of parameters in the procedure. So try changing "a=0..5, b=0..5" to simply "0..5, 0..5". Paulina Chin Maplesoft
First 7 8 9 10 Page 9 of 10