Scot Gould

Scot Gould

687 Reputation

14 Badges

11 years, 37 days
Claremont McKenna, Pitzer, Scripps College
Professor of Physics
Upland, California, United States
Dr. Scot Gould is a professor of physics in the W.M. Keck Science Department of 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

Unless I mistyped the problem, even though I declared gamma to be local, the output is too complicated that Maple does not execute. Solving the set of non-linear equations without an output

  T:= solve({f1, f2, f3, f4, f5, f6}, [s, v, e, i, q, r]):

for the unknowns and asking for the expression of s

eval(s, T)

produced and "invalid input." Hence, no solution was returned.

Please, next time use the big green arrow to upload your worksheet.

@sursumCorda In Maple, variables are altered based on when a command is executed. In Flow, variables are altered based on where the command exists in the worksheet. 

Based on my experience teaching new users for a dozen years or so, getting these folks to recognize that if they correct a line in the middle of the calculations, it does not mean the line at the end of the calculation is immediately corrected. The new users will say to me, "My worksheet does not work even though it looks like it should work because the commands are laid out in the correct sequence." I often "fix" their error by going back to the restart command and hitting <Enter><Enter><Enter> several times. (I recommend worksheet mode over document mode for new users.)

In Flow, it is what you see is what you get. If you correct a previous line, all subsequent lines are updated and corrected. This is why when if first attempted to introduce computation into my physics courses, I started with Mathcad. However, I found Maple to be a more robust CAS, so I switched to it.

@dharr A worthy attempt.  But it fails. 

As one Maplesoft employee once characterized Maple Flow, Flow is a form of Maple lite. What works in Maple does not necessarily work in Maple Flow. 

And yet, Maple Flow has one feature that is incredibly powerful, especially for new users. Calculations are performed through input that is applied spatially, not temporally. 

@acer Agreed on the third parameter. 0..0.99999999

While both solutions below work with Maple, neither one works with Maple Flow 2022.  It appears the "||" operator is not recognized. It may work with version 2023. (You do not say which version.)

@acer The first error is bizarre. 

And saying "plot(expr,x) works Ok" is completely unexpected. "expr" has to be assigned somewhere else, yes?

@acer Yes, I know MakeFunction is an alias name for unapply. Since the 2019 Maple Conference, I have been publically pushing for another name or another function to replace the "what the heck does that mean" unapply procedure. 

So, a big thumbs up to Maplesoft for adding the MakeFunction name. (I just wish the addition had been included in the "What's New" notes. I lucked out in finding out about it from a Maplesoft employee.)  And because I am so pleased about the MakeFunction procedure name, I want to ensure folks know about it. 

Unfortunately, for this post, my attempt at hyperbole-based humor was misunderstood. Maybe I should have changed the font. 

@acer What if I want to display multiple variables, each in a separate line using technique 3?  For example:

y1 = x + 1
y2 = x + 2

Currently, they come out as :

  y1 = x + 1, y2 = x + 2

@acer LOL! Just after I posted the question, I realized the 3rd way might work. The first two are not simple for me. 

I'm glad I'm not the only person who can be frustrated by Explore. It is highly useful, but occasionally it confuses me. 

@acer Lots of useful ideas here. But for my version of 2023.1, factor(expr) is sufficient. The combine procedure does nothing. 

But this post leads to the next question: why doesn't the simplify procedure work? Shouldn't it try a number of options, settling on the simplest? (Of course, how does one define "simplest.")

@dharr I can still recommend to my colleague to consider GAMMA.

@acer I suspected there was more to the situation given that in playing around I couldn't get the plot to work without the form of plotting dharr had included. 

@dharr It is also clear it is how you called the plot, which is not how I tend to plot a function. 
 

restart; plots:-setoptions(size = [300, 200])

"F(q):= convert(  (100*400!*(1/(100))^(q)*(1-1/(100))^((400-q)))/((400-q)!*q!)  ,GAMMA):  evalhf(F(5.1))"

15.1978021800000000

(1)

Plot expression

plot(F, 0 .. 20)

 

Traditional method of plotting a function

plot(F(q), q = 0 .. 20)

 

with evalf

plot('evalf(F(q))', q = 0 .. 20)

 

with evalhf:

plot('evalhf(F(q))', q = 0 .. 20)

 

NULL


 

Download Factorial_to_Gamma_failed_plot.mw

@acer  I follow what you did as alternative solutions.

I agree that both the numerator and denominator generate values that are in excess of the hardware floating point representation. But I am not quite sure I understand why it failed. Is it true that, normally, Maple uses its algorithms to derive a precise number;  then, if we use evalf, it takes that number and converts it to a floating point number? On the other hand, in making a plot, Maple calls evalhf to calculate the values to be plotted, and that is where the problem occurs? (I could not find either hardware of evalhf in the plot/details help page. I'm assuming it uses evalfh for reasons of speed.)

Hopefully, I understand correctly. This leads to the next question, is it possible to change the code for plots to ensure that all data points are returned as viable from the hardware before plotting, and if they are not, then the software version of calculating the floating point numbers occurs?

@Carl Love @dharr Thank you for the clarification. And, it appears the copy only works if prev and curr are of identical dimensions.  Educational. 

@Carl Love @dharr I'm confused by the use of the word "copy" here. Neither technique will generate a new vector, which is a copy of the other vector on my version of Maple.  The only ways that I know how to make a copy are to use "Vector(curr)" or "copy(curr)". If you have a moment, please assist me to understand.
 

``

restart;
v := <1, 2, 3>;
z[] := v[];
v[1] := 99;
eval~(z);

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

 

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

 

v[1] := 99

 

table(%id = 36893490278911842588)

(1)

restart;
v := <1, 2, 3>;
z[1..-1] := v[1..-1];
v[1] := 99;
eval~(z);

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

 

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

 

v[1] := 99

 

table(%id = 36893490278911834748)

(2)

z := Vector(v);

Vector(3, {(1) = 99, (2) = 2, (3) = 3})

(3)

z := copy(v)

Vector(3, {(1) = 99, (2) = 2, (3) = 3})

(4)

NULL


 

Download Copy_Vector.mw

3 4 5 6 7 8 9 Last Page 5 of 20