dharr

Dr. David Harrington

8235 Reputation

22 Badges

20 years, 343 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are replies submitted by dharr

@acer I stand corrected. I checked in the 2015 help, and assumed it wouldn't return in later versions. My new 2022 version will arrive soon...

@PaulNewton fi is a short form for end if. In older Maple these backward spellings were standard - also od for end do. Now they are no longer documented, but can still be used.

(The FAIL is the result of the else clause, that is returned if there is no match.)

@Carl Love The OP pointed out that when using save there are linebreaks that make it unreadable by matlab.

@PaulNewton You can also use the "Insert code snippet" icon (the one with <> in a box).

Not sure if this is your problem since you didn't upload a worksheet/document. However, you should not use with(plots)within a procedure. Instead put uses plots; at the beginning of the procedure.

foo:=proc(expr)
  local A;
  uses plots;
  A:=plot(expr);
  display(A)
end proc;

foo(x^2);
foo(x^3);

 

(Not sure what A:=Array(1) is doing.)

@astroverted Here the 3D plots as well

DQ4.mw

@astroverted Nice work on the faster method. Use display to combine plots of all kinds.

DQ4.mw

For a 3D plot, I think you will have to use the output=Array option of dsolve, and then use matrixplot or surfdata. I'll try that later when I have a little more time.

The help page for type/float suggests there is support only for double precision. In that case you can do things like in the attached.

Download float.mw

Edit: see my other response for a solution.

@AHSAN Your solution has no variable y. Do you mean x? For phase plots like you show using the commands @tomleslie mentioned, you would need to supply the DE and the initial condions you are interested in.

@mmcdara Sorry if I misunderstood what you meant. I was initially confused about what the OP wanted. My understanding of epsilon is that the contour integration has to be along the real axis but has to include the pole at the origin (the only pole along the real axis in this case). I would write this with integration limits x=-infinity+I*epsilon..+infinity+I*epsilon and leave the epsilon out of the integrand, with the assumption that you need to take the limit as epsilon tends to zero from above. 

Doing it by residues bypasses the details of the contour other than making sure the poles along the real axis are included. I think to do it the hard way would mean having a small semicircle around the poles (into the upper half plane) and taking the limit as their radii went to zero. 

Having said that, I'm still not clear that this is the right definition of the FT, but there seem to be many variations.

Edit: Now I thnk about it, maybe the contour is for the upper half plane excluding the poles along the real axis. That solves the sign problem.

@mmcdara The OP doesn't actually want the Fourier transform of FTI, rather FTI is the definition of the Fourier transform of 1/sinh(x)^2.

@mmcdara I liked your hand solution and voted it up. But since @yangtheary never seems to respond, I agree that it may not be worthwhile.

@astroverted Once I fixed the syntax errors, Maple told me things like "expected 1 boundary condition but found 2" until I had only one initial condition and one boundary condition. That's what I expected since there was one equation first order in time and one first order in z. The other "initial" and "boundary" conditions in the paper are simply found from the others so are not independent. Eq (16) is just putting M=1 (at t=0) into Eq (13) and solving the ode; Eq (18) is from putting I=I0 into Eq (14) and solving.

Maple can't solve equations of this form as it only solves time-based systems. But it can be solved, for example by the method of lines or differential quadrature. Here is an example:
DQ.mw

@zenterix How is that person executing the .mpl file? By running command line Maple? Or (as you suggest above) by reading it into a worksheet? The way I generate packages or help databases is by running a worksheet which gets other files as necessary from the same directory, and uses worksheetdir. (Getting them from a subdirectory is a simple modification of that.) Someone else can run that worksheet which is in the same directory as all the required files on their system, since I would give then the zipped contents of the directory.

If you read a .mpl file with read, then the code is running in the worksheet you read it into, not in the .mpl file.

First 51 52 53 54 55 56 57 Last Page 53 of 85