Scot Gould

Scot Gould

872 Reputation

14 Badges

11 years, 232 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

@acer Seriously, another maple.ini file? Couldn't they have named it something else?

That said, it doesn't look like one could simply add a call to the interface procedure in the Maple initialization file to change the interface. Or am I missing something? 

If not, I might request one. I like the scrollable matrices. The only time I need it to not scroll is when I generate a PDF. 

@Rouben Rostamian, I have never needed to solve a PDE beyond the more common cases of boundary conditions, so I appreciate your confirmation that there is a mathematical solution but that Maple cannot obtain it. Both @nm and I had looked at other full Robin condition examples and also had come up with wrong answers. 

As for solving the problem by hand, I leave it to the person who approached me about it. LOL!

@dharr Thanks for your work. nm, whose posts have disappeared, gave me a recommendation from the Wikipedia page. 

which allowed me to solve the problem and reproduce the initial state of the system, and the steady-state outcome.

However, I very much appreciate your solution because your use of the selectremove procedure is far more elegant than my kludgy use of the op procedure, multiple times. What I had hoped to do was to use either eval or sub to somehow not have to do what we both ended up doing - using a loop. (I used add, which worked, but was not as readable as a sum. ) I've tagged your work as a favorite since I rarely use selectremove

 

@nm All your work is gone. I have seen it, fortunately. Working on the directions of the BCs. 

@nm I wondered about my formulation of the boundary conditions. Neither of my two sources on Robin BC made the point you found on the Wiki page.

I find the potential solution to my problem ironic. As a physics instructor, I often am telling a student that it is not Maple failing to solve their problem; it is their equations that are physically impossible. Clearly, more research is required on my part. 

Hopefully, you receive this reply. I am no longer receiving notifications in the little flag in the upper lefthand corner. Is anyone else?

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/mapleprimes_integral.mw .

Download MaplePrimes_Integral.mw

☹️  Contents won't load. 

 

@Rouben Rostamian  Appreciated. A check of the integral of the terms inside the double summation appears to confirm your belief in the lack of assumption in deriving the anti-derivatives. 

Heat Equation in 2D

 

restart; interface(imaginaryunit = I); heat_equation := diff(T(x, y, t), t) = k*(diff(T(x, y, t), x, x)+diff(T(x, y, t), y, y))

 

bces := T(0, y, t) = 0, T(L, y, t) = 0, T(x, 0, t) = 0, T(x, L, t) = 0; ice := T(x, y, 0) = T__0(x, y)

 

Solving without defining the state of the system at t = 0.

sols := `assuming`([pdsolve({bces, ice, heat_equation}, T(x, y, t))], [k > 0, L > 0])

T(x, y, t) = Sum(Sum(4*sin(n*Pi*x/L)*sin(n1*Pi*y/L)*exp(-Pi^2*k*t*(n^2+n1^2)/L^2)*(Int(sin(n1*Pi*y/L)*(Int(sin(n*Pi*x/L)*T__0(x, y), x = 0 .. L, AllSolutions)), y = 0 .. L, AllSolutions))/L^2, n = 1 .. infinity), n1 = 1 .. infinity)

(1)

 

Extracting out the term within the double summation

s := op(1, op(1, rhs(sols)))

4*sin(n*Pi*x/L)*sin(n1*Pi*y/L)*exp(-Pi^2*k*t*(n^2+n1^2)/L^2)*(Int(sin(n1*Pi*y/L)*(Int(sin(n*Pi*x/L)*T__0(x, y), x = 0 .. L, AllSolutions)), y = 0 .. L, AllSolutions))/L^2

(2)

 

Calculate the value of the integrals

 

1) No assumption about the integrals

"`T__0`(x,y) :=1/(4)*sin((2 Pi*x)/(L) )^(2)*sin((3 Pi*y)/(L)):     value(s)"

4*sin(n*Pi*x/L)*sin(n1*Pi*y/L)*exp(-Pi^2*k*t*(n^2+n1^2)/L^2)*(-1+cos(n*Pi))*piecewise(n1 = -3, -1, n1 = 3, 1, -6*sin(n1*Pi)/(Pi*(n1^2-9)))/(Pi*n*(n^2-16))

(3)

This term fails at n = 4.

 

2) With with the assumption about the values of n, n1.

 

s := `assuming`([value(s)], [n::posint, n1::posint])

4*sin(n*Pi*x/L)*sin(n1*Pi*y/L)*exp(-Pi^2*k*t*(n^2+n1^2)/L^2)*piecewise(n = 4, 0, piecewise(n1 = 3, L^2*(-1+(-1)^n)/(Pi*n*(n^2-16)), 0))/L^2

(4)

Here, all is good. And a solution can be rebuilt

 

"s := MakeFunction(s, (x, y, t, n, n1)):  `T__sol`(x, y, t, N) := (∑)((∑)s(x, y, t, n, n1))"

proc (x, y, t, N) options operator, arrow, function_assign; sum(sum(s(x, y, t, n, n1), n1 = 1 .. N), n = 1 .. N) end proc

(5)

L := 1; k := 0.5e-1; plot3d(T__sol(x, y, 0, 20), x = 0 .. L, y = 0 .. L, scaling = constrained, size = [500, 500])

 

H := .25; plots:-animate(plot3d, [T__sol(x, y, t, 20), x = 0 .. L, y = 0 .. L], t = 0 .. .25, scaling = constrained, view = [0 .. L, 0 .. L, 0-H .. H], size = [600, 600], paraminfo = false, frames = 40)

 

 

Download Heat_Eq_2D.mw

In 2D input, it catches the error, reporting a missing operation. IMO, this is preferable to a FORTRAN-like outcome. 

@smart2718 I was working on testing something else when I decided to use your problem with Acer's answer as a test case. If you can use it, it is yours. Sorry for not uploading it earlier. Click on the link to download the .mws file. 

MaplePrimes_Reg_IV.mw

@Ronan 

with(LinearAlgebra):
Norm(l1 &x l2)

Yeah, I wish '=' was sufficient to detect equal vectors, but this isn't MATLAB. (And I'm very much happy that it isn't.)

@GFY I added the line dsolve( [couple] ). !!! the worksheet. If it doesn't work for you, then your Maple has other problems

 question928.mwquestion928.mw

Or put a pair of square brackets around the expression couple

dsolve( [ couple ] )

It is a set or list of odes, not one followed by another. 

@maltz

May I suggest that, as a new user, you learn a few Maple-specific truths to help you solve problems.

 

1) Start any worksheet with "restart." This unassigns (zeros out) all variables:

 

restart

 

2) Explicitly place a multiplication sign " * " (shift-6) between any two expressions

eqn1 := y = (1/2)*(x-5)^2-6

y = (1/2)*(x-5)^2-6

(1)

eqn2 := y = 3*x-2

y = 3*x-2

(2)

3) Assign answers to a variable so that you can refer to them later:

sols := solve({eqn1, eqn2}, {x, y})

{x = RootOf(_Z^2-16*_Z+17), y = 3*RootOf(_Z^2-16*_Z+17)-2}

(3)

(Notice nm does this. Either the explicit option or the allvalues procedure writes out all the solutions.)

sols := allvalues(sols)

{x = 8-47^(1/2), y = 22-3*47^(1/2)}, {x = 8+47^(1/2), y = 22+3*47^(1/2)}

(4)

4) To refer to the solutions, use the eval procedure.

 

For example, let us choose the first set of solutions.

x_sol := eval(x, sols[1])

8-47^(1/2)

(5)

Your questions are not unique. It is often enough that I made a video series I made on YouTube that might help you. See: https://www.youtube.com/playlist?list=PL9CSPVCv3f026xttJqtesuMZnhIqnZ9O4

 

Download MaplePrimes_rootof_solutions.mw

I strongly suspect you are using 2D input, which I prefer, but you copied and pasted the 1d-input Maple code, which made your work virtually unreadable.

That said, your use of the back quotes in the print statement makes me question my assumption.

Regardless, If you use the large green up-arrow to upload your document, then the smart folks here can read it and reply in the format you are using.

@FDS I just want to say: you are not alone in importing an Excel spreadsheet with the first row as the column names.

I downloaded a file from the internet, which is in CSV format. I then exported it using ExcelTools:-Export to a file on my desktop. Then, I imported it using the ExcelTools:-Import with the output=DataFrames option. The headers never appeared. I tried editing the file after it had been exported as an xslx file with no luck in getting it to work the way it worked with the toy example. 

I guess we both have to continue to use the import and build column names by hand technique. 

1 2 3 4 5 6 7 Last Page 3 of 26