Scot Gould

## 732 Reputation

11 years, 150 days
Claremont McKenna, Pitzer, Scripps College
Professor of Physics
Upland, California, United States
Dr. Scot Gould is a professor of physics in the W.M. Keck Science Department of Claremont McKenna, Pitzer, and Scripps Colleges - members of The Claremont Colleges in California. He was involved in the early development of the atomic force microscope. His research has included numerous studies and experiments using scanning probe microscopes, particularly those involving natural fibers such as spider silk. More recently, he was involved in developing and sustaining AISS. This full-year multi-unit, non-traditional, interdisciplinary undergraduate science education course integrated topics from biology, chemistry, physics, mathematics, and computer science. His current interest is integrating computational topics into the physics curriculum. He teaches the use of Maple's computer algebraic and numerical systems to assist students in modeling and visualizing physical and biological systems. His Dirac-notation-based quantum mechanics course is taught solely through Maple.

## Thanks to all, and some observations...

@acer@Ronan ​​​​​​​, @nm ​​​​​​​, @sursumCorda ​​​​​​​, @Carl Love ​​​​​​​

Thank you, everyone, for contributing. The discussion led me down a rabbit hole, so I wrote some simple code to compare the efficiencies of the techniques.

As predicted, using a listlist conversion is the least efficient technique, requiring 50 times longer to execute than the most efficient. That's okay; the process taught me something.

The next least efficient technique, by nearly an order of magnitude to the most, is seq(Column(M, i), i=1..N), which is understandable given the number of times Column is called for a large matrix.

I like the techniques of using a single call to Column, i.e., in my preferred notation, [Column(M, [1..-1])]. It is highly efficient. However, it would be slicker if one didn't have to include the 1 and -1. This one was new to me.

Equally efficient is the call to convert the matrix into a list. I have seen this one before and very much like this approach. It is highly readable by most folks, which is important to me since I often have to show my work to non-Maple users.

The most efficient method uses no calls to a named procedure, (i->M[.., i])~(\$N). Yes, there is still a call to obtain the dimension of the matrix, but it is about seven times quicker than the convert call. It either receives high marks or demerits for being the least readable and the only form that cannot be implemented using 2D input.

In the end, while I truly learned more about Maple coding from the experience, it is likely I will continue to use the seq(M[.., i], i=1..N) expression. It is readable, but it does rely upon a reader's understanding of indexing matrices. It is the most efficient technique that can be implemented using 2D input. (Though not by much.) However, I am likely to include the convert-to-list technique because of its sweet spot of being both highly efficient and readable.

## Yes, that works...

@Ronan But I was thinking of trying to employ an elementwise-of-a-procedure approach. I should have stated that in the question.

## Thanks......

@acer Those are the techniques I have used. I was just wondering if there could be an elementwise application of a procedure to break up the matrix. I should have included that desire in my question.

## Yes, it does solve this intregral...

Maple can certainly do the integral you show as long as it knows something about

the constants . Hence, the assuming modifier is added

 >

For example, what is  if ?

 >
 (1)

What is if ?

 >
 (2)

But what I don't understand is what your goal is in your worksheet. Are you trying to calculate something or

present an argument? Are you aware that your  is an "atomic variable"? That is,

it is no different than a name such as  or . Is each p supposed

to be an indexed value, i.e.,  and ?

## Thank you...

@sand15 I appreciate passing the word. The series was generated out of necessity. I wanted to help the students during lockdown. In addition, I knew I couldn't replace Robert Lopez's great webinars. Rather, it is designed to complement his work. The videos are pretty dry, and I sound stilted, but they are only 12 minutes each.

I'm constantly updating the series. There are many more videos to generate and reshoot. More content will appear when I have the time.

## Is it necessary?...

@jganding

If you find a situation where prefix notation is useful, great, but my sense is that Maplesoft continues to work to make it unnecessary. Several years ago, I took a programming class with a lead developer. (He may have been the head of development at Maplesoft.) He apologized for using prefix notation in the example code, calling it "ugly. He said that it should be changed so that the use of a prefix notation could be avoided.

That said, what examples do you find useful?

## Learning Maple...

May I suggest the website gould.prof/learning-maple? Through videos and accompanying documents, it covers the basics of Maple and most undergraduate mathematics appropriate for a physics or engineering major. The problem you state is one found in the "Troubleshooting" section of the document on Calculus - Integration.

## Yes, it still fails in Windows (sometime...

The workaround is to print the file as a PDF.

Edit: To be fair, the problem does not occur in every Windows environment.

## Another answer and a suggesion...

@acer correctly identified the problem - dsolve format for  a numeric solution, assuming you want a list of procedures, is:

dsolve( { sequence of equations }, numeric, output = listprocedure )

where the sequence of equations is the odes and the conditions.

But, allow me one other suggestion. I you are going to use subscripts, do NOT use indexed variables. Instead, use atomic variables. For example, instead of

R[V] := 0.72 * AU;

write:

R__V := 0.72 * AU

The reason for not using atomic units is that should V be assigned an expression or number, then the variable is no longer R[V] but R[what ever V is defined]. For example;

Indexed variable approach

 >
 (1)
 >
 (2)
 >
 (3)

Subscript approach

 > R__V := 0.72*AU
 (4)
 > 'R__V' = R__V
 (5)

In 2d-input, 'R_ _ V' appears as

 >
 (6)
 >

## Noticeable improvement in speed...

Does the notification flag work for you? I click on it, and the circling star image never shows anything useful anymore. It just keeps saying "Loading."  Maybe it is just me.

(I like the flag idea. I used to work.)

## no kidding...

@Scot Gould that post required nearly a minute to be uploaded.

## yes...

Sometimes it requires multiple temps to load a page. I'm glad to find out that I'm not the only person who is observing this behavior.

## It is 2023.2 into 2024......

@acer Apparently, the ability to control the position of a graph in the Array is not a high priority. At least this post was relatively easy to locate in MaplePrimes. Thanks for the recommendation.

 4 5 6 7 8 9 10 Last Page 6 of 23
﻿