Scot Gould

Scot Gould

517 Reputation

14 Badges

10 years, 154 days
Upland, California, United States
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 studies and experiments making us of scanning probe microscopes, particularly those which involved natural fibers such as spider silk. More recently, he was involved in developing and sustaining AISS, a full-year multi-unit non-traditional interdisciplinary undergraduate science education course which 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 the computer algebraic and numerical system Maple to assist students in modeling and visualizing physical, and biological, systems. His Dirac-notation based quantum mechanics course is taught solely through Maple. An avid baseball fan, during his spare time, Dr. Gould is traveling, particularly to locations where he can bicycle on smooth, traffic-free roads, visit beaches and/or mountains, and enjoy good food and drink.

MaplePrimes Activity


These are questions asked by Scot Gould

I wish to write 2D output strings in various colors. Normally I use printf, though I'm willing to hear other suggestions.

An optimal procedure would one where I pass it the string, and a ColorName color such as "DodgerBlue" or "xkcd blue", but I'm happy if it means passing my own hex code.  Thanks.

In reference to the nice application: https://www.mapleprimes.com/posts/209845-Dataframes--Looking-For-A-New-Flashlight by @Christopher2222 ,  my question is: 

is there a simple way to sort primarily by one column, but if two elements possess identical values, then using a second column to determine the order? For example, what if we wanted to sort the flashlight dataframe primarily by "B-type" but use a subsort by "Minutes". 

I wrote a function which used recursion. It worked fine for small dataframes, but was painfully slow with a multi-thousand element spreadsheet.

 

Even though I was using the thoughtful answer provided by a poster in a previous MaplePrimes question, I was unable to successfully place labels on a column graph.  I have reduced the problem to adding a plots:-setoptions call, of any type, before calling ColumnGraph:
 

restart

with(Statistics)

T := [StringTools[CharacterFrequencies]("antidisestablishmentarianism")]

["a" = 4, "b" = 1, "d" = 1, "e" = 2, "h" = 1, "i" = 5, "l" = 1, "m" = 2, "n" = 3, "r" = 1, "s" = 4, "t" = 3]

(1)

ColumnGraph(T)

 

plots:-setoptions(size = [300, 250])

ColumnGraph(T)

Error, (in Statistics:-ColumnGraph) expecting plot structure but received: ROOT(BOUNDS_X(0), BOUNDS_Y(0), BOUNDS_WIDTH(300), BOUNDS_HEIGHT(250))

 

 


 

Download ColumnGraph_Problem.mw

 

The challenge for me is that for my work, several default plot parameters require changing including the default plot size which is too large. Hence my Maple initialization file includes calls to plots:-setoptions. Is this a bug in the ColumnGraph command and is there a work around that does not include removing the plots:-setoptions from my initialization file? Note: this problem occurs both in Maple 2019 and 2020. 

I have a string which includes characters from the extended ASCII character set. I simply want to print the string. Nothing fancy. Hence my question is: how does one print characters from the extended ASCII character set so that they show up as the characters and not a bunch of empty boxes?  (A technique for UTF-8  character printing would be a bonus.)   

<Edit> For example, in integers, my string could be:

s := [56, 72, 157, 38];

Hence there printing of s as a string should be a 4 character / bytes entity: 

printf("%s", convert(s, bytes));

In preparing to sample problems, I came across this difference in an output depending upon the input type: 2d Input vs. Maple Input. Is there a typo on my part?


 

restart; kernelopts(version); Digits

`Maple 2020.1, X86 64 WINDOWS, Jun 10 2020, Build ID 1474787`

 

10

(1)

Very happy with the output of the following line:

x := evalf[30](3.0^1.2)

3.73719281884655197790004100992

(2)

 

But I'm confused about the output of the next line. Is it a limit to the calculation or a display problem?

a := evalf[30](3.0^(1.2))

3.737192819

(3)

 

and yet this next output looks fine:

b := evalf[30]( exp( 1.2 * ln(3)))

3.73719281884655197790004100989

(4)

 

Fortunately, there appears to be no difference between x and b:

evalf[30](x-b)

0.3e-28

(5)

 

But these next  lines suggest there is an actual limit in the calculation of a.

evalf[30](a-b)

0.15344802209995899011e-9

(6)

evalf[30](a - b);

0.15344802209995899011e-9

(7)

Note - when Digits is set to 30, the calculation difference between x and a disappears.

``


 

Download 2020_evalf_digits.mw

1 2 3 4 5 6 Page 2 of 6