Scot Gould

Prof. Scot Gould

287 Reputation

12 Badges

7 years, 75 days
Dr. Scot Gould is a professor of physics in the W.M. Keck Science Department of Claremont McKenna, Pitzer, 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 applications of scanning problem microscopes, particularly those which involved natural and synthetic fibers such as spider silk. He has more than 60 papers and his publications have been sited more than four thousand times. He has more recently been involved in developing and sustaining non-traditional interdisciplinary undergraduate science educational programs that involve biology, chemistry, physics, mathematical and computer science. He teaches the use of Maple to assist students to model and visual biochemical systems from a physical approach.

MaplePrimes Activity

These are replies submitted by Scot Gould

@tomleslie Thanks for the advice. I've edited the question to include an example. Unfortunately, HTML input/output is not what I want, but the command did educate me on unicodes. 


What tends to work for me is to write out one line a time and see if there are errors in the line before moving on. Notice all the lines in your calculation are in one execution group (>). 

For what you post, the error occurs in the 3rd line of the big execution goup  where you write something with "z". As @gkokovidis points out, there appears to be a missing "mutiplication" sign between the "z" and the "x". While I don't think you need to convert to Maple input mode, (I use 2D input all the time), I do agree it should say "z * x(t)" 

The rest suggests you have copied from some other source. My experience is that it is best to understand each line well before moving on to the next.  There are some incredibly smart and gifted folks here who are likely to help you out before I have a chance to look at the rest.  

(P.S. Thank you for the complement.) 



Online help is your best source for such information:

Search for Fit, which is the command to perform regression and the 2nd listing is this one:

We discover that :

restart; with(Statistics); Y := Vector([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 8, 12, 12, 22, 30, 40, 44, 51, 65, 70, 97, 111, 131, 135, 174, 184, 210, 214, 232, 238, 254, 276, 285, 305, 318, 323, 343, 373, 407, 442, 493, 542, 627, 665, 782, 873, 981, 1095, 1182, 1273, 1337, 1532, 1728, 1932, 2170, 2388, 2558, 2802, 2950, 3145, 3526, 3912, 4151, 4399, 4641, 4787, 4971, 5162, 5445, 5621, 5959, 6175, 6401, 6677, 7016, 7261, 7526, 7839, 8068, 8344, 8733, 8915, 9302, 9855, 10162, 10819, 11166, 11516, 11844, 12233, 12486, 12801, 13464, 13873, 14554, 15181, 15682, 16085, 16658, 17148, 17735])

Build the X vector with the number of elements (upperbound works too) for the size.

N := numelems(Y); X := Vector([seq(1 .. N)])



The next is to identify a equation to plot. Again, lots to try, but what sort of works well is a power fit of the format:    


Let's try it and plot to see how it looks:

cfit := A*x^r; ScatterPlot(X, Y, labels = ["X", "Y"], tickmarks = [6, 10], symbolsize = 15, symbol = circle, fit = [cfit, x], color = ["DarkRed", "DodgerBlue"], legend = "data")




To see the values of a basic curve that fits the data, use Fit in the Statistics package.  Let Maple figure out which type of fit command to call. It will output the equation

fiteq := Fit(cfit, X, Y, x)



Now let's extract the residuals. Same command, but asking for a different output

Yres := Fit(cfit, X, Y, x, output = residuals)

Now you want to plot just the residuals?

Typesetting:-mrow(Typesetting:-mi("ScatterPlot", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("X", italic = "true", mathvariant = "italic"), Typesetting:-mo(",", mathvariant = "normal", fence = "false", separator = "true", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.3333333em"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mi("Yres", italic = "true", mathvariant = "italic"), Typesetting:-mo(",", mathvariant = "normal", fence = "false", separator = "true", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.3333333em"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mi("title", italic = "true", mathvariant = "italic"), Typesetting:-mo("=", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-ms("Residual/error for each point"), Typesetting:-mi("")), mathvariant = "normal"))





@nm You are asking for something like the old teletype printer as if the screen were a roll of paper. That might be a potentially useful option because you are correct, that is not how it works currently. For those situations, may I suggest continuously holding down the page-down button?  Using the page-down technique might  be an even more useful than a continuous-scrolling system, since the page-down technique will allow you to stop scrolling when you see a line or set of lines that are particularly interesting. 

Maple 2020.1 in Windows 10 - worksheet mode. 

I tried to reproduce your situation. I wrote a do loop to print out 10,000 lines of numbers.  Yes, the scrollbar did shrink, but it never reached the microscopic size you are describing. The scrollbar was still manageable. 

For me, when the Maple output is beyond a 100 lines, I find it so extensive that it is incomprehensible.   I’m pleased how quickly ‘ctrl-d’ cleans up the mess.


@acer I understand your explaination and your example. I wonder how the numbers are represented in 2D-Input so that the simplification process never occurs.

Regardless, it appear that this happens, and it is an unexpected outcome. (So much for my attempt understand Carl's discussion about evalf.) Much thanks.

@Rouben Rostamian  At my institution, multiple students were suspended for a semester for receiving answers to questions like these on Chegg.   (Interestingly, it was the students who had turned in nonsensical solutions who were caught.)   

evalf[30](3^(6/5)) in Maple Input does produce all 30 digits. 

However, I may have found a possible answer from a post by @Carl Love from 5 years ago regarding the output of evalf. That is, the output of evalf is not accurate to n digits, rather that all subcomputations are performed using approximately n digits. I recongize there is a limit, but I thought 15 digits is attainable and the output shown would be to at least 15 digits, regardless of the type style of input used. Certainly, I have seen many Maple examples by Maplesoft imply evalf does produce the output of "give me the value to n digits." 

@tomleslie I noticed the units in your output are enclosed by double brackets. According to help, the double brakets were shown prior to Maple 2015. Is this the case for you because 2019, 2020, do not show double brackets? I would like them to be displayed and I can't figure out how to show them. 

Since you do have access to Maple 2020, I encourage you to look at the Maple Portal.  It has lots of great help, and is organized to assume that the person using Maple has no experience with it. I encourage you to spend time watching the very short introductory videos and clicking the numerous useful links under "How do I..." 

I assure you - it is worth the effort. (I'm guessing you are a student. My students feel sorry for the students in other could who don't spend time becoming able to implement the power of Maple.) 

@acer Yes, this clarrifies why StringBuffer is not defined as an object or Object. even though the wording in the help does tend to mix terms:



The StringBuffer constructor returns a string buffer object.

The StringBuffer object returned by the constructor is a module with six methods: clear, append, appendf, newline, space, and value.

The first line in help is basically is the same wording in the Today command, without mentioning the word module. Hence the source of confusion. 

Anyway, I'm working toward chapter 9 of the programming manual, and currently view modules as "static classes" while objects are "dynamics classes".  Your example below matches my interpretation of these ideas in an OOL. 


@nm I'll second your proposal of calling a method using the :- operator. It appears to be the form of some of Maple's objects (which I interprete as classes) such as StringBuffer:

s:=StringBuffer();  # Constructor
s:-append("Hello, world!");


But what one may view as methods of other objects, such as data, or time, don't follow this style. :

d := Today();  # Constructor
d:-IsWeekend(); # fails


Is d:-IsWeekend() not a reasonable method?

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})


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

cartesian[x, y, z]


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

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



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





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. 

1 2 3 4 5 6 7 Page 1 of 8