Scot Gould

Scot Gould

1039 Reputation

15 Badges

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

Are you using the ExcelTools version of Import, i.e., ExcelTools:-Import, or the generic version of Import? Either way, I was not able to reproduce your error. 

Not sure what is going on in your worksheet since it appears to be correct. You might upload it for others to examine. Also, you I don't see which version you are using.  Regardless, it works for me.  Maybe try starting with the attached worksheet. My version is 2020, but I believe it works for several previous versions

restart; with(VectorCalculus)

v := VectorField(`<,>`(y, -x, 0), 'cartesian'[x, y, z])

Vector(3, {(1) = y, (2) = -x, (3) = 0})

(1)

SetCoordinates('cartesian'[x, y, z])

cartesian[x, y, z]

(2)

F := VectorField(`<,>`(y, -x, 0))

Vector(3, {(1) = y, (2) = -x, (3) = 0})

(3)

Curl(F)

Vector(3, {(1) = 0, (2) = 0, (3) = -2})

(4)

``


 

Download VectorField.mw

I just want to say that I hope folks didn't read my intro as an attack on the work of @Samir Khan, but rather an opportunity to correct a common mistake in his app and introduce the modern mechanics approach, i.e., educate. (Hey, that is what educators do!). After working through the example, it became apparent that this problem has many positive qualities. Hopefully folks can use this example in advocating for the much needed paradigm shift in the pedagogy of disciplines which use applied mathematics - infusing computational algebraic and numercial systems into the educational process. 

@rameen hamood Upload a screenshot and then maybe someone could help you.

@rlopez I appreciate you taking the time to respond. Yes, this could discussion could lead to an endless morass. However, your experiences as an educator are valuable. Your comments have positively impacted my thinking. Given the goals of the students you worked with, the Context Panel appears to be a major plus.  Historically, my students have tended to work on complex problems for which I believe goes beyond the capabilities of the Context Panel. But very, very few require the type of coding capabilities that are often discussed on MaplePrimes. 

Moral of story: I agree, adopt the usage that best serves solving the types problems one faces. However, with the several types of approaches, the questions now appear to be, when and how to transition from one approach to another. And as educators, how do help others to answer these questions?    

@tomleslie  I believe I understand what you are saying, and I'm with you. His mode of Maple usage is not the one that I use or teach. Thus, I have gently suggested Paul consider other paradigms when working with Maple. I want him to enjoy the experience, and I want him to be able to solve more than a handful of one-line algebraic problems. If all he needs are answer to one line problems, he can move to Wolfram Alpha.

However, I can highly sympathize with Paul. The approach he is taking is presented by Maplesoft as the approach new users should employ. Look at the Maple Portal, which Maplesoft states as "the starting place for any Maple user." (My bolding.) The tutorials use the Context Panel, which partially produces the "pretty output" mode that you appear to question. 

While I agree Context Panel is great for the occasional user or the user who needs an operation, but can’t remember the command, in my view, relying solely on it limits the possibilities and adds difficulties to the process of working with more complex problems.  Maybe it is the best way to start. But how does one transition to a more robust approach to using Maple?

I suspect this discussion is probably best for another post. And I would be interested in any current or past thoughts by @rlopez  on these questions and approaches.

@Carl Love Given the number of topics covered, it is not surprising that my view has been lost in the process.

1) First and foremost, I am a physicist with lots of CS exposure, not a CS researcher/educator. I use, and we teach, top down thinking in physics. (It is also how I approach all research questions.) All applications of physics must be based upon physical principles. Start with the principle and then add a level of details and keep adding details until you have reached the bottom. 

2) And thus, I truly appreciate Maple’s ability to allow me to model through the top-down approach. It is my experience that once the undergraduates reach an understanding, and mode of thinking, using Maple's capabilities, they learn physics more quickly and have a richer understanding of the principles.  As a consequence, when we must move to Python and/or MATLAB, the undergraduates often become frustrated with Python's and MATLAB's bottom-up approach and the one-level evaluation limitations. Yes, it is true they could load some symbolic libraries, but, compared to working with Maple, the usage process ain't pretty.  Many undergraduates return from REUs (research-experience-for-undergraduate programs) telling me how they don't understand why their research group battles with MATLAB when the problem is more easily solved in Maple. 

3) However, since this full level evaluation does not occur in procedure, the pedagogical advantage of Maple is lost when problem solving within procedures. I understand why this is the policy – improved efficiency. And fortunately, now that I know this property of the Maple system,  before I return any of my work using a top-down approach, which is yes, less efficient, I need fully evaluate. It is not a hardship, but I wish I had been aware of this difference years ago because in the vast majority of my work with Maple, I’m expecting, and usually receiving, full evaluation with every statement. Knowing the one-level evaluation would have saved many moments of misunderstanding the reason for the outcome of my procedures. That is on me. And now I know.

4) You wrote, "I think that you've misconstrued the comment about other programming languages. In a language without symbolic variables, it's impossible for there to be any distinction between full and one-level evaluation."  What I meant was, my complaint about the lack of full evaluation capabilities in procedures is unwarranted given that virtually every other language I have used, assembly, FORTRAN (66, 77, 90), Pascal, BASIC, C, C++, Python, MATLAB (I'm sure I'm missing some), possesses only one-level evaluation.  However, it is possible to use a one-level evaluation programming language to construct a full level evaluation language which only produces numerical outcomes.  

I hope this lengthy reply provides you with some contextual understanding about a person whose experiences and approaches mimic a larger percentage of North America’s physical scientists and educators.  I certainly would not have made the effort if I didn’t value your knowledge, experience and efforts to help others here on MaplePrimes

 

@Carl Love If the original function includes the positive square root, then x=-3 is not a root since eq4a(-3) = 2. Yes?  Since he said there are 2 roots and he included line 1.4, I took it that he meant there originally was a square and he had square rooted it to begin his quest for 2 roots. 

@Carl Love  Happy to provide an example.

The following is an example of the approach for nearly every physics problem, from first semester classical mechanics to grad school quantum mechanics:  Atwood’s machine  (not my favorite, but you probably know it).  A diagram can be found here

Two masses attached by a string for which the string is hooked over a pully. One mass is greater than the other. Hence the question is – what is the acceleration of the system?

Pedagogical approach – always start with a first principle, in this case the momentum principle -  that the acceleration of a body is due to the net force on the body divide by the mass of the body.  Next, we note the net force on the body is due to the sum of the forces on it.

Now we apply the principle to each of the two bodies. The net force on each is the combination of the tension of the rope, the other by the gravitational pull of the Earth, i.e., weight.  The weight is a combination of the body’s mass times the near Earth gravitational constant, g.  With this system, we note there are two constraints – the tension in the rope is assume to be the same on both bodies (not true, close enough for this example), and that as one accelerates up, the other accelerates down with the same magnitude.

Solve symbolically.

Evaluate the symbolic result and ask oneself – do the extreme points makes sense (say m2 = 0, etc.)

Then, if provided, evaluate with specific values.
 

restart; peq1 := a1 = F1/m1; peq2 := a2 = F2/m2; F1 := T1-W1; W1 := m1*g; F2 := T2-W2; W2 := m2*g; peq1; peq2

a1 = (-g*m1+T1)/m1

 

a2 = (-g*m2+T2)/m2

(1)

constrainteq1 := abs(T1) = abs(T2); constrainteq2 := a1 = -a2

sol := `assuming`([solve({peq1, peq2, constrainteq1, constrainteq2}, {T1, T2, a1, a2})], [positive])

{T1 = 2*g*m1*m2/(m1+m2), T2 = 2*g*m1*m2/(m1+m2), a1 = -g*(m1-m2)/(m1+m2), a2 = g*(m1-m2)/(m1+m2)}

(2)

eval(sol, {g = 9.8, m1 = 1.1, m2 = 1.2})

{T1 = 11.24869565, T2 = 11.24869565, a1 = .4260869565, a2 = -.4260869565}

(3)


 

Download topdown.mw

As I said – this is the most common approach in thinking about working with a physical system, that it is an example of set of applied physical principles, and what I define as a top-down approach. (Bottom up would be to define all the variables first, then calculate the weight, the tension, the net force, and finally the momentum principle equations.)

 

Now – you do raise a point I recognize – the power of the symbolic approach. However, could not one devise a system, for which space is allocated, but all evaluation is performed numerically at the last step? And if I do misunderstand the statement in Maple, can you provide an example of a language they are referring to?

 

 

@acer Much appreciated with the numerous suggested references. Your comment has motivated me stop being so lazy and  get serious about reading and working with the programming manual beyond the first couple chapters. (I was looking in section 1.4 under evaluation.)  For example, now I truly understand the value of the left apostrophe (`) vs. the right apostrophe (‘).

 

@Carl Love Sadly, my question formulation skillset for Maple has not matched the Help structure. Often I end up with what appear to be random suggestions for pages to look through. (Currently I have 7 help pages open from the web.) 

However, in reading the programming manual and help pages that  @acer provided, I came across a great nugget: the one level evaluation within procedures is how other programming languages work. Of course - this is why after spending time with Maple at the main/global level,  I (and students) find MATLAB and Python quite frustrating. (And hence my frustration as begin to write more complex procedures in Maple.)

IMO, Maple is a wonderful educational tool in the physical sciences, because at the main/global level with its default full evaluation property, it emulates the  top-down thinking process one uses in the physical sciences: principle first, then general properties of example, followed by specificity of the general properties.  

@Carl Love You are correct on the info - one level down at the procedural level. This type of info I assumed was somewhere in the Maple help. However, I thought it would be in the programming manual, but I was unable to find it. (Have you memorized all of Help?) 

I built a procedure which required 6 levels of evaluation necessary, (or so I believe). I timed it with random numbers, and you are correct, there is a bit of an efficiency hit. But it isn't significant - 10%?.  How often does one needs to reach 6 levels down? 

eval_procedures.mw

The process which produced a far greater improvement in performance was to write the code bottom up, rather than top down. I.e., define a before using it with b, rather than define b, then a, and then evaluating b. 

I appreciate any suggestions and corrections. 

@acer  "Why you would expect 20 for the second example's return value?"   Actually, I expected an error, and not what I saw. Why?

In the example below, when I ask for "c", the full expression is evaluated.  But just because "a" and "b" are in the procedure, "b" is not returned evaluated unless I ask for it to be. Is there some sort of advantage to what appears to be an inconsistancy?  


 

restart

c := d+10; d := 20; c

30

(1)

f := proc () local a, b; b := a+10; a := 20; return b, eval(b) end proc

f()

a+10, 30

(2)

 

Radaar's example:

 

a := 10; f2 := proc () b := a+10; a := b; return b, eval(b) end proc

Warning, `b` is implicitly declared local to procedure `f2`

 

Warning, `a` is implicitly declared local to procedure `f2`

 

f2()

Error, (in f2) too many levels of recursion

 

``


 

Download expect.mw

 

 

 

@acer Thank you. Went through the list of "what's new" items for Maple 2020, since I had never seen this issue crop up until this release. Nothing was there.  Apparently I wasn't smart enough to view other options. Frankly, because some information that I wanted was missing in my smartview altered plots, I didn't find smartview particularly helpful. It does a nice job for plots from 0 to infinity. 

First 22 23 24 25 26 27 28 Page 24 of 31