dharr

Dr. David Harrington

6792 Reputation

21 Badges

20 years, 102 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

@Alfred_F Well, I used to derive physical models with pages and pages of handwritten equations. If I do the same steps with Maple, I can catch mistakes. (Particularly with signs, which as you have pointed out, are easy to get wrong.) Of course Maple can do many things I cannot easily do; my first published result of something more complicated than I could have done myself was a sum of an infinite series.

So for me, now I do everything with Maple - sometimes validating easy steps and sometimes looking for results that are complicated and perhaps unexpected. Ocassionally I do someting on paper still, but that usually involves some sort of diagram.

@janhardo The final solution seems to be the same as "ans" in my first worksheet for lambda=mu=1

@Alfred_F That's probably what Maple does, so doing those individual steps in Maple could be done, but I wouldn't say it is easier :-)

@janhardo Thanks for the worksheet. As I suspected, the sin/cos form also works without assumptions, i.e., for all lambda, mu.

restart

# Define the coupled differential equations
de1 := diff(F(eta), eta) = lambda * G(eta);
de2 := diff(G(eta), eta) = mu * F(eta);

diff(F(eta), eta) = lambda*G(eta)

diff(G(eta), eta) = mu*F(eta)

Cut and paste from @janhardo

sol := {F(eta) = (c__1 + c__2)*cos(sqrt(-lambda)*sqrt(mu)*eta) + (c__1 - c__2)*sin(sqrt(-lambda)*sqrt(mu)*eta)*I, G(eta) = (-(c__1 - c__2)*cos(sqrt(-lambda)*sqrt(mu)*eta)*I + sin(sqrt(-lambda)*sqrt(mu)*eta)*(c__1 + c__2))*sqrt(mu)/sqrt(-lambda)}

{F(eta) = (c__1+c__2)*cos((-lambda)^(1/2)*mu^(1/2)*eta)+I*(c__1-c__2)*sin((-lambda)^(1/2)*mu^(1/2)*eta), G(eta) = (-I*(c__1-c__2)*cos((-lambda)^(1/2)*mu^(1/2)*eta)+sin((-lambda)^(1/2)*mu^(1/2)*eta)*(c__1+c__2))*mu^(1/2)/(-lambda)^(1/2)}

odetest(sol, [de1, de2]);

[0, 0]

NULL

Download dsolve2.mw

 

@janhardo Since cosh(x) = cos(I*x), cos(x) = cosh(I*x) etc, I agree that there is also a sin/cos form that is equivalent to the sinh/cosh one (probably the one you show but since you didn't upload your worksheet I can't verify that). I would say they both work for all lambda, mu. Certainly one or the other is nicer for various positive/negative values of lambda, mu and I would choose the form that avoids square roots of negative numbers in practice.

But that is not really my point, which is that case (II) is incorrect as stated. The odetest fails. I have added a specific numeric example with lambda = -1, mu =-1 to my answer above to more clearly show this. It doesn't satisfy the odes with the same negative lambda and mu.  It would satisfy different odes with additional negative signs, which might be what the author meant to say, but is not the way it currently reads IMO.

For me, this has been the case for a long time. I just looked back at some Maple 18 code I wrote in 2015, and there are several cases. I can't really say reliably if this has got better or worse in later versions, but I do notice it in Maple 2024.2.

@Carl Love Thanks - I must have run things out of sequence.

@Harry Garst My comment was intended for the specific example you gave, i.e., dense matrices with different symbolic values for each entry; of course for structured and especially sparse matrices you can do somewhat better. I didn't interpret your comment about basic math correctly since it was disconnected to the worksheet you gave. @acer has given some details of that aspect, so I would only add that the Physics package has some facility for working with operators with certain properties, for example quantum operators work like abstract matrices for regular matrix product, e.g., (A.B)^1 simplifies to B^(-1).A^(-1). But for Kronecker product this is not the rule you want. Perhaps you could define such a rule but I don't have much experience with the Physics package. You can give certain properties to abstract operators in regular Maple, but the Physics package is more advanced in that respect.

@lemelinm But you don't have any assumptions, so the table is empty. If you have assume(x>0); b:=sin(x); before you try it, you will get an answer.

@PinheiroRJ If you want each section to be self-contained, you can just put a restart at the beginning of each section.

@PinheiroRJ Sorry, I was confused by your use of "label" for equations, which in Maple are the numbers in parentheses on the right-hand side of the worksheet. a1 and a2 are variables in which results are stored. The statements such as a1:=x^2 are in "execution groups", which have the prompt ">" and a line like [ to the left. The calculation is done or "executed" by pressing "enter" in the execution group.

If I paste the new section in from another worksheet the a1:=3*x is not executed, but if the insert a new section and hit enter after entering a1:=3*x then it is executed and the earlier value of a1 is overwritten. You could go back to the line a1 := x^2 and hit enter to execute it, then skip down to the line a2 := 2*a1 and hit enter there (without hitting enter on a1 :=3*x) and you will get the result you want.

However, people tend to expect the result to be as in the sequance going down the page (and this is what you get executing the whole worksheet with the "!!!" icon), so it is less confusing if you just change a1 in the line a1 := 3*x to be something else, say b1. I don't know a way to do this automatically.
 

@WD0HHU This is on the plot3d help page: "If the first argument in any of the calling sequences is a set or list of surfaces, then the surfaces are plotted together. There is one exception to this: a list of three algebraic expressions or procedures is always interpreted as a parametric plot. To specify a list of three distinct plots, use the option plotlist=true (or simply plotlist)."

@acer I added back the negative sign in the last step, but combine would have been better. I'm always nervous about doing things by hand, and was hoping IntegrationTools:-Expand would put the integral inside the sum.

@one man Thanks. I first played round with it with various options in PolynomialSystems without much success. My past experience has been that the polynomial system doesn't have to be very large before it is intractable, but once @vv showed it could be done I wanted to pursue it a bit more.

Please provide some more details, including your Maple version, and preferably uploading some sample files (with the green up-arrow).

In Maple 2024.2, if I have two worksheets A and B open, and copy contents from A into the middle of B, the equation labels in B are automatically renumbered. Are you using some other method?

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