2448 Reputation

11 Badges

14 years, 166 days

Dr. Robert J. Lopez, Emeritus Professor of Mathematics at the Rose-Hulman Institute of Technology in Terre Haute, Indiana, USA, is an award winning educator in mathematics and is the author of several books including Advanced Engineering Mathematics (Addison-Wesley 2001). For over two decades, Dr. Lopez has also been a visionary figure in the introduction of Maplesoft technology into undergraduate education. Dr. Lopez earned his Ph.D. in mathematics from Purdue University, his MS from the University of Missouri - Rolla, and his BA from Marist College. He has held academic appointments at Rose-Hulman (1985-2003), Memorial University of Newfoundland (1973-1985), and the University of Nebraska - Lincoln (1970-1973). His publication and research history includes manuscripts and papers in a variety of pure and applied mathematics topics. He has received numerous awards for outstanding scholarship and teaching.

MaplePrimes Activity

These are answers submitted by rlopez

 If "q" has the value 2, your nested seq commands should produce a sequence of four equations. If "q" is not assigned, you should get an error message to the effect that Maple is unable to execute the seq command.

RJL Maplesoft

 You have two choices: You can either assign the expression to a name, or you can reference the expression via its equation label.

q:=x^2+1 is the way you assign the expression the name "q".

It's not clear what flavor of Maple you're working with, so the issue of equation labels may or may not be relevant. If  you see equation labels on the right edge of  your worksheet, you can use those to reference the item so labeled. Use Ctrl+L (in Windows) to bring up the Equation Label dialog, and here, enter the number of the label (do not type any parentheses).

RJL Maplesoft

 Surprisingly, the Wronskian command is not in LinearAlgebra, but in VectorCalculus. The old linalg package contained a "wronskian" command - perhaps that's the basis for the confusion.

RJL Maplesoft

 The equations of the plane and cylinder define their objects implicitly. Hence, the implicitplot3d command could be used to plot both items at the same time. Unfortunately, the "cylinder" in this question contains two equal signs. If that is what was sent to a plot command in Maple, an error would definitely be generated.

The following syntax would be an example of something that would work in Maple.

plots[implicitplot3d]([2*x+3*y-z = 5,x^2+4*y^2 = 1],x=-3..3,y=-3..3,z=-3..3);

RJL Maplesoft

 Maple does not yet have the ability to "fill" between two arbitrary curves or surfaces. However, there are several tricks that sometimes allow Maple to nearly do this task. The plot command admits the filled=true option that shades between a curve and the horizontal axis. The generalization of this in the plot3d command "fills" to the z=0 plane.

In Maple 14 there are five new task templates for drawing regions of integration. (See in the Task Browser under Calculus, Multivariate, Integration, Visualizing Regions of Integration.) In several of these, "solids" are drawn. These drawings are done surface-by-surface, each of the six possible bounding surfaces being drawn parametrically. Open one of these task templates and view the code through the Context Menu for the Graph buttons.

Without a general all-purpose tool for drawing an arbitrary solid, each example requires tricks and devices specific to the given solid. I wish it were otherwise.

RJL Maplesoft

 Somehow, I have the feeling that if the flight of a baseball is the bottom line here, then a differential equation might just be at stake. If so, why are we re-inventing the wheel? Maple's dsolve/numeric command has enough flexibility to handle these data-storage issues without having to micromanage the data the way this discussion is going.

So, if I'm right, then we should be talking about Maple's dsolve/numeric capability and how to use it efficiently, and not about storing the individually computed data points. Let Maple's internal routines handle that and just use the top-level integrator to set up and solve for the trajectory.

Of course, you could have been assigned the task or re-writing a numeric solver for ODEs. If so, I doubt you will reproduce (in the time the typical assignment takes) the sophistication already built into the existing Maple code.

So, can we step back and see what the underlying issue really is?

RJL Maplesoft

 After seeing that individual components of the sublists (i.e., triples) need to be changed, I decided to ask one of the Maple programmers about the efficiency of this approach. Turns out that changing an element of a list requires Maple to recreate the full list. Not very efficient.

The suggestion was to use an Array or Matrix of size 3x120. Each column would represent one of the triples, and the 120 columns would be the 120 "vectors" you originally asked about. It's much more efficient computationally to change an element in an Array or Matrix. It all has to do with allocation to memory locations, pointers, etc.

If you need the "linear algebra" properties of these 120 vectors, use a Matrix. If the data structure is just a storage for 360 numbers, an Array will suffice.

Create the Array with A:=Array(1..3,1..120);

Assign a value to the location row=2, column=25 with the syntax A(2,25):=x;

Access this value with A(2,25);

If instead, a Matrix is appropriate, use B:=Matrix(3,120);

Assign a value to location row=2, column=25 with the same syntax as in the Array.

A single column can be extracted from the Matrix with the command LinearAlgebra:-Column(B,25);

Of course, if a number of commands from the LinearAlgebra package are to be used, simply load the package via the syntax with(LinearAlgebra) so that calls to commands in the package don't need the prefix LinearAlgebra:-

It would be useful to know what kind of "advanced calculus functions" are to be applied to the columns of the Array or Matrix. Some of these functions might reside in the VectorCalculus package. Recall that I pointed out earlier that a VectorCalculus Vector carries as an attribute its coordinate system. This is not the case for LinearAlgebra Vectors, so a conversion might be necessary. However, if the vector operations are just dot and cross products, it is not necessary to go to the VectorCalculus package. We can give better advice if we know more specifically just what operations you need to inflict on your vectors, or triples, as the case may be.

RJL Maplesoft

 This is a problem encountered in physics, or in the calculus of variations (think variational mechanics). The diff command is modified in the Physics package to do what you want.

For example, to differentiate sin(x) with respect to sin(x), and therefore get the answer 1, you can use


RJL Maplesoft

 The Vector construct at top-level would suffice. These are the same vectors as in the LinearAlgebra package. However, vectors in the VectorCalculus package are not the same - these have the attribute of a coordinate system attached.

You could also use simple lists to keep track of triples of numbers: [1,3,5] is a list of three numbers.

The best book I ever bought for Maple was Andre Heck's Introduction to Maple. I bought the first two editions, but by the time the third edition came out I was either out of money or didn't need another copy of the text.

RJL Maplesoft

RJL Maplesoft

In particular, to remove the "big oh" term from a series S, use


This effects a change in the internal structure of the object. The internal representation of a series does not allow for evaluation or plotting. Simply removing the O-term wouldn't help either. It's the internal representation that has to change, and the convert command does that, as well as remove from the display the O-term.

It's possible to make this conversion interactively through the Context Menu. Select Series->Truncate to polynomial.

This option activates the convert command, although on the screen it will appear that all that has happend is that the expression has been truncated.

RJL Maplesoft

My first suggestion would be to use the animate command. For example, try something like


The animate command (in the plots package) will animate plots created by plotting functions. These functions can be built-in plot commands such as plot or plot3d, or they can be user-defined procedures that result in a plot structure. The command is pretty robust, and has a lot of built-in features that are tedious to reproduce when building an animation with display/insequence=true.

Mixing 2d and 3d plots requires more care. In fact, you can't. You have to "elevate" the 2d plot to a 3d plot. The typical technique I've used for this is via the transform command from the plottools package. One uses this command to define a function whose job is to change each 2d point in the 2d plot structure to an equivalent 3d point. So, suppose you had a 2d plot structure whose name was Q, and which generated the graph of a curve in the plane. If you want this curve to appear in the z=0 plane in a 3d plot called R, execute f := transform((x, y) -> [x, y, 0]):

Then, join the plots of Q and R with display([R, f(Q)])

For the rest, it's not exactly clear what you want to do. I have this vague sense that perhaps you want to animate a series or set of disturbances resembling stones dropped into a lake. Not sure, so perhaps this needs some iteration on your part.

RJL Maplesoft

Specifically coded for such applications, the command convert(expr,phaseamp) is a more powerful (and convenient) alternative.

This is a remarkably smart conversion, as it will find all instances of the desired structure, even if there are multiple pairs of sine/cosine functions in the mix. It's much more powerful than using solve/identity, which fails in many instances: For example, if the trig functions are multiplied by a common exponential, or the coefficients are symbolic, not numeric, etc.


RJL Maplesoft

By design, the VectorCalculus package computes the differential operators Divergence, Curl, Gradient, and Laplacian only in orthogonal coordinates.  It uses scale factors, and that works only with orthogonal systems.  However, Maple's plot package can draw graphs for non-orthogonal systems, so there is this option in VectorCalculus to add a non-orthogonal system for the purpose of graphing, but not for computing.

To obtain the gradient in non-orthogonal systems, you would need the Tensor subpackage of the DifferentialGeometry package. In essence, such a gradient must be computed via the covariant derivative, which is the generalization of the directional derivative. In multivariate calculus, one meets the directional derivative of a scalar. When this derivative exists, it can be computed by taking the dot product of the gradient vector with the direction vector. Well, when you ask for a directional derivative of a vector field, you first need to generalize the gradient vector. This generalization is the "covariant derivative." Dotting the covariant derivative with the direction vector then produces the directional deriavtive of the vector field.

So, what does a covariant derivative look like? In this case it would be a rank-2 tensor. This object can be represented as a matrix - its components can be organized into a matrix format. Then, matrix multiplication with a vector can be used to compute the equivalent of the summation process that's lurking in the tensor calculus.

If you really need to learn this stuff, I suggest you read the Reporter Article "Classroom Tips and Techniques: Tensor Calculus with the Differential Geometry Package" that's now in the Maple Application Center at the end of the following link.


Alternatively, go to the Application Center, and search for articles by Robert Lopez. There are at least 50, but the one I'm suggesting is in the list.


The file 11412_eigenvector.mw does not contain a 3x3 matrix.  I tried writing a matrix of the coefficients of u[1],v[1],w[1] in the vector given in that file, but the eigenvalues of the resulting matrix do not match the -6.908 value in the file.

Essentially, the question is pretty opaque, and should be further clarified by the proposer.

RJL Maplesoft

RJL Maplesoft One advantage of the worksheet is that you can single-step through a sequence of Maple commands, with the cursor moving automatically to the next prompt. This does not happen in Document mode. In fact, after hitting the Enter key to execute a command in document mode, the cursor moves to the next blank document block. Further use of the Enter key just generates new empty document blocks, so if you are in class working through a sequence of calculations, you have to use the mouse to move to the next executable command in Document mode. One blend of the technologies is to use a worksheet, but to capture the commands in 2D math. These commands can either be written in 2D math, or converted to 2D math from 1D. In fact, experienced users of Maple who demonstrate sequential calculations for students can write a worksheet much as they would have done in earlier versions of Maple, then convert the 1D input to 2D input for the mathematical clarity that such input often permits. In my 15 years of using Maple in the classroom, I was in worksheet mode with 1D math. After my retirement, it took a bit of time, but I morphed my style to worksheet with 1D for creation, with converson to 2D for a better view of the mathematics being expressed by the command. A student who wants to see the underlying 1D math input can revert the change via context menu. I haven't yet used the Document mode to write a mathematical paragraph that captures live calculations within the sentences of the paragraph. That's what I see as one of the two basic functionalities of the Document mode. The other is as a workspace for free-form drag-and-drop point-and-click syntax-free calculations. This can be done in a worksheet, too, but it feels more efficient to me done in a Document.
First 19 20 21 22 Page 21 of 22