Scot Gould

Scot Gould

1059 Reputation

15 Badges

12 years, 266 days
Claremont McKenna, Pitzer, Scripps College
Professor of Physics
Upland, California, United States
Dr. Scot Gould is a professor of physics at 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.

MaplePrimes Activity


These are replies submitted by Scot Gould

@tomleslie 

Your question, after my poorly worded response, deserves a more detailed answer. Hence, I’ll attempt to explain why 2d-input in Maple is crucial.

2d input, with the ability to use palettes, allows both the new user and the non-user to better read and understand the mathematics that is being performed. By highly reducing the amount of monospaced coding syntax, 2d-input is a catalyst for new users to solve mathematical problems that, historically, have been ignored. This is because such problems have been viewed as either too computational or mathematically difficult or required too much start-up cost to learn the coding necessary to solve.  This reality is reproduced every year in my computational math course for physics and engineering majors where students use both Maple and MATLAB to solve math problems typically found in undergraduate physics or engineering courses.  With 2d-input in Maple, where the “code” looks like mathematical symbols, students spend more time working on translating the mathematical symbols and operations into their personal language/narrative and less time translating that which they do not fully understand, the mathematics, into yet another set of symbols and operations, i.e., the programming code. (I should explain that once we have covered the mathematics using Maple to do the grunt work, I switch to the MATLAB code. MATLAB still is too popular in research environments.)

And like any spoken & written language, if one is not using the language constantly, one forgets it. It my experience that students can leave the coding environment for a semester and relearn 2d-input Maple more quickly than they can relearn the limited MATLAB they know. And this is true even for students who spent an entire semester learning how to code in MATLAB.

Finally, it is my experience 2d-input is so highly readable that people who are not familiar with Maple can quickly comprehend the operations and functions.  Hence my colleagues, who were all raised with Mathematica, MATLAB and/or Python and were initially opposed to the use of Maple in our department, have become accepting of students using Maple. Since they can read Maple 2d-input, it makes their lives easier. They do not have to learn another coding language.

Personally, there are times where I prefer to write a procedure in 1d-input. There are some very cool 1d-input coding features in Maple.  So, I recognize there is value in the Maple programming language and syntax. But for most projects which I must share with newer Maple-users or non-users, 2d-input, with its highly readable format, is the most effective tool I have for solving computational mathematical problems.

I hope this clarifies my unintentionally snarky “I’m not going there” comment.

 

@tomleslie

I misspoke. I should have said, “Given my situation, I am not going to be able to ‘go there’.” I.e., to 1-D input, even though I do write Maple code this way.

However, you ask an excellent question that Maplesoft must be able to answer. And you do it with an important prompt, “Is 2D-input anything more than a pretty display?”

In my view, 2D-input is a major reason why I don’t just follow the rest my colleague and switch 100% to MATLAB and Mathematica – the leaders of mathematical software products in physics and engineering.  Tonight, I don’t have time for a follow up, but I wanted to make sure you are aware I appreciate your reply.

@tomleslie Thanks. I tried this ideas, but didn't think about 1-D. Since I'm not going there, this is not an option.  I like a number of the new features and plan to stick with it regardless of some of the new annoyances. 

 

Thanks for adding the ability to call dsove, numerically, with vectorized functions. Between that, and the improvements in the document mode, I see a significant paradigm shift in how I as a college instructor can use Maple as both document of readable "code" and a way for students to code with a minimal amount of teaching code.  

I quickly coded up a example of being able to write vectors differential equations using "dot notation", solve them numerically, and Explore the output using the parameterized option in dsolve, numeric.  Much of it takes advantage of the fact that: 

           Maple math = real math.

Here is a quick screen shot of some of this "coding while writing" 

This additions continue to move improve an impressive product. 

 


Example_vectorized_dsolve_numeric_problem.mw

@Christopher Tocci 

Yep, I missed it. I suspected it was "too good to be true."

Given that it looks like there is only a numerical solution, here is an alternative numerical approach that you might find useful - Explore. I guessed on some ranges. (S = separation, d = diameter..)  

@mmcdara 

I’m with you. I found the use of “ pf := ‘pf’ ” and the statement, “pf is your table” to be confusing. However, your questions and discussions were highly illuminating. The outcome in my mind is that “pf” is re-assigned as a symbol (in case it had already been assigned or later assigned), which is then interpreted by Maple as a table once indexing occurs.

For a 10 item element, I assume the speed of accessing a table vs. a Array or Vector must be negligable, but becomes significant when the size is large.  Hence, I would still think Vector first, though tables are handy. 

@Kitonum 

Is there any advantage or disadvantage to using the "output = listprocedure" option?

For me, it is cleaner because one doesn't need to worry about premature evaluation in calculations: 

@nm I like your use of the term Explore. My version isn't better, but simply adds some features that, until recently, I wasn't aware of and have found useful - particuarly the loop and autorun options.  (Mine is also not as clean as yours, but it demonstrates the difference between integer and real scales.)


Download Explore_function.mw

The process is identical for Windows as an alternative path of creating a PDF. 

@Carl Love Since the task is to write function A(n) where n will be specified, hence the number of terms will be specified before the integral is performed, isn't mul (like add) more appropriate than product?  Hence, I don't see the advantage. 

That said, just like in the case where sum works, which is more readable than add, it is nice that product does work for a definite set of terms. 


 

This calculation calls product

"restart;     A(n):=(∫)[0]^(infinity)(∏)(h(x/(2*m+1))) ⅆx :  h(x):=(sin(x))/(x):     time(seq(A(n), n=0..8));  "

13.515

(1)

"restart;  A(n) := (∫)[0]^(infinity)mul(h(x/(2*m+1)), m=0..n) ⅆx :  h(x) := (sin(x))/(x):    time( seq(A(n), n=0..8) );"

13.359

(2)

restart; h := proc (x) options operator, arrow; sin(x)/x end proc; J := Int(product(h(x/(2*a+1)), a = 0 .. n), x = 0 .. infinity); time(seq(value(eval(J, n = nn)), nn = 0 .. 8))

13.640

(3)

"restart;  f(n) := (∏)(h(x/(2*m+1))):  h(x):=(sin(x))/(x):  time(seq( f(n), n=0..500));"

10.484

(4)

"restart;  f(n) := mul(h(x/(2*m+1)), m = 0..n):  h(x):=(sin(x))/(x):  time(seq( f(n), n=0..500));"

4.171

(5)

``


 

Download Product_vs_Mul.mw

@mmcdara With a smile on my face, I'll say that from a physicist's stand point, the normal distrbution is the most natural. It allows me to control the width of the distribution curve as well as where it peaks. However, I admit I'm not as familiar with the binomial distribution much beyond counting coin flips or win-losses in sports. Would you be willing to recommend code that would substitute for win_prob as a function of the three variables?

@graleo Mathematica?

@graleo  Are you sure about the equations? If one define qeq as 1.001*P and not 1.001*P^(1/8.758), the solutions can be plotted. 

@Carl Love If the row labels are positive integers, but are clearly not the index numbers, sorting by RowLabels works perfectly.  I wanted to post this "caution" to complete this discussion. 

@Carl Love , @Joe Riel .  Thanks again for your help with the sort within a sort of DataFrames problems I possed. Back in August. In writing up an example, I came across an unexpected outcome, which caused me to question. The 'key' that Carl suggested works, however, if the row labels don't quite match the row number, Maple will get confused in the sort.  Consequenty, sorting by RowLabels does work most of the time, but not aways, but it appears sorting the row numbers always works. 
 

restart; interface(rtablesize = [5, 6]); poll_data := Import("https://www.electoral-vote.com/evp2020/Pres/pres_polls.csv")

_m2111003542336

(1)

First line is a the headers, so it is removed. poll_data is redefined starting at line 2.

poll_data := poll_data[2 .. (), () .. ()]

_m2110993532416

(2)

Sort by row labels fails. In this example, the primary value is the negative of value in the first column (a type of descending sort), and the secondary value is from column 3 (by state names).

poll_data[sort(RowLabels(poll_data), 'key' = (proc (n) options operator, arrow; [-poll_data[n, 1], poll_data[n, 3]] end proc)), () .. ()]

_m2111031661216

(3)

Sort by row numbers works.

poll_data[sort([seq(1 .. upperbound(poll_data, 1))], 'key' = (proc (n) options operator, arrow; [-poll_data[n, 1], poll_data[n, 3]] end proc)), () .. ()]

_m2111033833344

(4)


poll_data rows are re-labeled starting from 1. Now sorting by row labels works.

poll_data := DataFrame(poll_data, 'rows' = [seq(1 .. upperbound(poll_data, 1))]); poll_data[sort(RowLabels(poll_data), 'key' = (proc (n) options operator, arrow; [-poll_data[n, 1], poll_data[n, 3]] end proc)), () .. ()]

_m2111100827264

(5)

``


 

Download Large_data_double_sort_by_row_label_-_row_number.mw

First 18 19 20 21 22 23 24 Last Page 20 of 31