## 2900 Reputation

18 years, 110 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.

## sin(x)/cos(x) -> tan(x)...

But suppose the OP meant to write sin(x)/cos(x) not becoming tan(x) under "simplify." That was the case with all Maple up to and including 2022. That's fixed in Maple 2023. Just guessing.

## More syntax-free computing...

Make the functionalities of all the Student packages available via the Context Panel.

Load the Student VectorCalculus package and define the vector q:=Vector(<1,0,0>).

Change to spherical coordinates:

MapToBasis(q,spherical) => (1)*e[r]+(Pi/2)*e[phi]+(0)*e[theta]

So, the Physics convention has been imposed, as it has been since at least Map;le 2016 (thee earliest version I can access). To reverse the meaning of the names phi and theta, do MapToBasis(q,spherical[r,theta,phi]) =>(1)*e[r]+(Pi/2)*e[theta]+(0)*e[phi]. Note that it's the position of the angle names in the triple of coordinate names that determines the meaning of these angle names.

However, MapToBasis(q,spherical_math) leads to an error (spherical_math is not one of the 5 coordinate systems supported by the Student package). Therefor try

VectorCalculus:-MapToBasis(q,spherical_math) => (1)*e[r]+(Pi/2)*e[theta]+(0)*e[phi], which is the same as if "spherical_math" were just "spherical."

The reason for this: the "changecoords" command applies only to scalars. To change coordinates in a vector in one of the VC packages, the MapToBasis command is essential. Otherwise, the basis vectors will not be subjected to the change.

Also, note again that in the VC packages, it's not the names of the spherical angles that matter. Perhaps for display purposes, yes. But the function (i.e., meaning) of the angles, no matter what their names, it's the position of the angles in the triple [name1, name2, name3]. The middle name in that triple is always the angle down from the z-axis; the third name always refers to the angle around the z-axis.

Perhaps the help page at ?coords could have mentioned these two issues - (1) the changecoords command is a top-level command, and has nothing to do with what happens in the VC packages. In those packages, the MapToBasis command is much more important but has been left ignorant of the option spherical_math; and (2) the meaning of the names used in spherical coordinates is determined by the position in the triple of coordinate names, not by the names themselves.

## Drawing a figure...

It's easy enough to sketch a drawing with pencil and paper. Would that suffice, or do you want to see the Maple code that would draw such a figure? (I don't find it particularly easy to use Maple as a drawing tool.)

## Dot Product operator is commutative...

In the LinearAlgebra package, the noncommutative multiplication operator is the period. I don't know if you used the period and it displayed like a centered bold black dot. I think you will have to figure out a proper entry for z1. If it continues to contain a mixture of ordinary multiplication and noncommutative products, I'm not sure how you can simplify and collect on lambda.

## confusion with multiplication operator...

Why is the LinearAlgebra package installed? Is it because you are taking dot products (see your bold black dots where the asterisk for ordinary multiplication is expected) between scalars? I see nothing to indicate that any of the quantities in z1 are vectors, so why the dot product symbol?

Inspect the result of lprint(z1) and you will see that there are some ordinary multipications (*) and some dot prodcts. That use of the dot product operator is why z1 is not simplifying, and why the coeff command utterly fails. Change all the dot product operators to ordinary multiplications and z1 simplifies and coeff will work.

## See my webinar on Projection...

https://youtu.be/_8nhHBEHEw0

Projection

Let me climb up on my soapbox and pontificate: (The 81-year-old lecturer in me can't resist, even if he can't be forgiven.)

There are times when one wants an efficiently obtained answer, and there are times when one wants Maple to implement  the computational steps that provide that answer. The efficient solution provided by the MultivariateCalculus package's Lines&Planes tools allow one to think conceptually. "What is the line onto which the projection is to take place, what is the projected point, and how far apart are the points?" According to this mode of thinking, the details of how one obtains the line, etc., are not as important as is the thought process "how is the answer to the question logically obtained?" Once the logical, i.e., conceptual framework is determined, and can be shown to lead to the solution, then the mundane details of the computation that implements the conceptualization can be pursued.

I added my solution to this discussion simply to remind readers that there are other tools in Maple that are worth knowing about. I do indeed appreciate the kind words you attached to my solution.

I am not familiar with the syntax of Mathcad. If you would state clearly what mathematics your Mathcad formula is supposed to encapsulate, perhaps we could tell you the equivalent in Maple. The common language between us should be standard mathematical notation. Then we could determine the Maple syntax that reproduces that mathematics.

I suspect Axel Vogt is right in opining that Mathcad is performing elementwise multiplications between vectors. If that is so, could you then detail what the resulting mathematical expressions would be?

## Error message again points to a difficul...

In the Multiple_input worksheet, near the end you define a function f(p), but it contains vectors multiplied by vectors. I think you need to examine just what mathematical objects you are manipulating in that definition.

## Works fine in Maple 2022.2...

As far as I can tell, it works fine in Maple 2022.2 running in Windows10 on a 64-bit machine.

I no longer have access to Maple 2022, so couldn't tell if that version exhibits a bug.

## Is this what you really want?...

RJL Maplesoft

I just checked: acer's code will cause f(cos(t),sin(t),z) to echo with the name "f" carrying the superscript cos(t) sin(t). (If the first two arguments to f are large expressions, the echo could be really difficult to read.) Is that what you really want?

## Github issue...

@ I can but pass this along to Maplesoft, as I have just done.

## LinearAlgebra works over the complex fie...

By design, LineaAlgebra works over the complex number field. Hence, variables are assumed to be complex, and hence the conjugation mentioned by Carl Love. Within this package, some commands allow for an option to treat the field as real.

The Student LinearAlgebra package works over the real number field and the need for constantly dealing with complex conjugates disappears. Make the choice that's best for your needs.

If you are working in the Student package and find you need something that's only in the LinearAlgebra package itself, use the long name for the command, as in LinearAlgebra:-DotProduct.

## Avoiding package conflicts...

I often use commands from the Vector Calculus and Multivariate Calculus packages where there are name clashes. I've gotten around this problem by aliasing a short name to the long name of one of the packages and not loading that package. For example,

alias(VC = Student:-VectorCalculus):

Then (for example) VC:-PlotVector(...)

Equivalent constructs appear in a number of my Maplesoft webinars. However, I've developed no worksheets in which both VectorCalculus and Physics:-Vectors are used, so I have no actual experience in using both these two packages simultaneously.

## Study Guides in the Help system...

The help systems in either Maple 2021 or 2022 contain the Calculus Study Guide and the Multivariate Calculus Study Guide. These are ebooks that demonstrate how to solve more than 1200 exercises in the calculus using the tools of Maple. Are you aware of these resouces?

 1 2 3 4 5 6 7 Last Page 1 of 20
﻿