Scot Gould

Scot Gould

1039 Reputation

15 Badges

12 years, 216 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

@Glowing I concur if that is one’s intent. However, when I do use evalf with n, the precision of the calculation, it is never for small number of digits in the precision. Rather it for those occasions I require far more Digits in that calculation than is required for the rest of the worksheet. And there is no point in running the entire worksheet with such a high number of digits.

In concusion, I'm in agreement with Carl Love. The function was designed as intented and that if any modification of the function is highly likely to break previous code. The hope is that a new function is created.

As an addendum, here is my low budget version of "sigfig". I'm hoping that those with far more Maple experience than I will shame me properly by writing a more robust version. (I tend to write code in Maple only for personal use.)  This also allows me to highjack the discussion to complain about some commands in Maple. The command "whattype" returns "float" or "integer" or others. But the command "convert" does not accept "interger". Rather, it must be "int".  Hence the clumsy type checking to make sure the proper type is returned. 


 

restart

p1 := 1007; p2 := 1014; p3 := 1014.1

"sigfig(x, n):=convert((trunc(x*10^(n)))/(10^(n)), if(whattype(x)=float, float, int)):"

sigfig(p2-p1, 2)

7

(1)

sigfig(p3-p1, 2)

7.100000000

(2)

``


 

Download sigfig_example.mw

 

@Stretto Check out this thread: https://www.mapleprimes.com/questions/227789-Plotting-With-Mod

Also, with your function is a floating point evaluation. Hence:

 f(n):=evalf(n*fmod(n,4))

 

@Glowing I understand your views. The Maple function "evalf" is a function with a task of "performing a calculation, i.e., an evaluation, as a floating point using the following precision". What you are asking for that is found in Mathematica's 'N' function is a type of "sigfig" function that "reports the answer to a calculation using the number of significant figures that one desires".

There are a number of Maple commands which I do find non-intuitive, but this one I do not. Maybe there is already a "report" type function in Maple already. Maybe the Maplesoft folks can add one. 

@Carl Love Learn something new everyday,and it seems consistent to me. Not a bug.

Maybe Glowing's request is for a different command, something like "sigfig". This function returns the number with the number of significant figures so that sigfig(p3-p1,2) returns the 7.1 .

The term evalf actually makes sense.  It evaluates the calculation using the precision required. 

@Carl Love 

p1:=1007.0:
p2:=1014.0:
evalf(p2-p1,2); evalf(p3-p1,2);  

both return 0. which is consistent with your statement.

And yet his first "assumed to be correct answer" solution works only with whole numbers. They appear to be substituted in first before the operation occurs. 

I have not had this experience, but what I have experienced is Maple freezing while typing text in a document. And it is always text, not a mathematical equation. I don’t know if the system is trying to connect to a server and it can’t.  Fortunately, I have been able to end the task, re-open Maple and Restore Backup without losing much text.

Windows 10, Maple 2019.2.1 on several computers. It started with Maple 2019.1

@Rouben Rostamian  Thanks for the first suggestion.  I actually find the "simplify(v)" more intuitative than adding some other character in the eval expression. eval, or something like that, would be the most intuitive. 

Not sure what people are experiencing, but I'm a big fan of 2019.2 as upgrade of 2019 and 2019.1. I write much of my work in Maple. The logic of text and non-executable math input found in 2018 has returned. 

In working with new users, Maple on a Mac generates far more problems. 

@nm You might find 2D input unsatisfactory for your work, but based on my experience with students who are just starting, it is 2D that sells.  New users see Maple 2d math as real math.  Students I work with say they return to Maple because 2D is more readable - regardless of their experience with C++, Python, Mathematica, etc.

As for your examples, I wonder what is going on since I don't see any periods or multiplication symbols in a derivative expression. 

It is my view that 2D has really come around so that the problems we experenced in the past are virtually gone. As someone who is constantly correcting the Maple code of others, 2D misrepresentating a command has essentially disappeared. This is good because it means that most of my time consists of looking for typos, e.g., misspelling a variable name, changing the case of a variable, misspelling a command, etc.

I dislike all of them, but don't see any way around them. As Rouben says, "This doesn't make much sense." 

@acer  I have a sense of what is going on here and now know how to advise the students in the future. Frankly, I would prefer both groups to be of the same type, either a mutable structor or not, rather than different types since it is easier to educate others without explaining this difference. 

@Tegewaldt 

1) Since you are getting started, allow me to recommend "Worksheet" over "Document" mode. In teaching Maple to students and colleague at a college for many years, "Document" mode is fabulous if you are skilled in Maple code. Otherwise, it is more of a hassle in spacing, execution, etc. Worksheet is what you want. To make sure you always use worksheet, in Windows, select tools -> options -> the interface tab -> and then change default format to Worksheet. (On a Mac, under Maple 2019, select preferences -> interface tab -> change default format.)

2.) You don't have to use the notation g := x-> function.   You can write g(x) = function.  And yet, if you look at the Maple output, the format tells you what you are actually doing. g is a entitity which takes the value in x and puts it into the function. Here it is not needly complicated. That said.

3.) I do agree with you that "g" "colon" "equal" "x" "dash" "is greater than" your function is NOT intuitive and has been a reason some of my colleagues simply won't adopt the program since they simply don't use it enough to remember to code it this way. Hats off to Maplesoft for allowing us to use the mathematics the way we learned it in early school. Maple should be solving math, not about learning a new coding system.  Here the only new coding you have to learn is the difference between "assign" and "equivalent". Personally, I find this more intuitive that how Python /C++ does it where "=" means assign, and "==" means equivalent. Shouldn't "=" mean "equals"?

4.) In having Maple answer one's math problem, the "D" operator (or is it a function? Or both?) makes no sense to me or others who have seen it. If it differentiates, then with respect to what? I don't use, I don't teach it.

5.) However, what Maple wrote out when I said g(x1) := f '(x1) is not complicated - it is precise. In your mind you are differentiating with respect to x, but then using a different x to evaluate the outcome. 

And the evaluation symbol of a vertical bar with x = x1 is about as standards as I have every seen regardless of where you learned mathematicsl in the globe. Think of how you write to say you are going to evaluate the endpoints of an integral.

If I were the instructor, this would be a good moment to have students think about what is the sequence for solving such a problem. Hence I would walk through this question so that the most readable and accurate outcome is:

g(x, y):=eval(  diff( f(x1), x1) , x= x1)*y

differentiate with respect to a variable, then evaluate with the value stored in another variable.

 

This long post concludes with encouragement. I agree that there is a level of added complexity to using Maple when people are not 100% familiar with the math they are trying to work with. But on the other hand, it does an abosolutely amazing job considering other mathematical systems out there. 

Download Example.mw

@Doug Meade The poster asks a reasonable question that I would assign as part of a homework assignment for a coding class testing the students ability to append to a data file. However, in this situation, I sense the person asking is of limited ability and so I was tyring to determine a solution which requires the least amount of new function or logic memorization. 

If you run the worksheet and the outcome is some result, you can add a line at the bottom of the worksheet assign to a variable that outcome. Otherwise, you are going to have to be more specific. 

There is a "hacked" version of it out there. Your results are consistant with what others are reporting. 

First 25 26 27 28 29 30 31 Page 27 of 31