## dharr

Dr. David Harrington

## 6120 Reputation

19 years, 329 days
University of Victoria
Professor or university staff

## Social Networks and Content at Maplesoft.com

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

## QR...

@mehdibgh I didn't attempt to follow the method, just fixed the Maple.

Edit: Q2 must surely be square for the congruences to work correctly.

@acer Thanks. The tubeplot was only intended as a workaround. I noticed the tubeplot flattening; it is the distortion because the plot is not constrained, and does indicate the inadequacy of the method.

You are right of course about the T,X,V,PX,PV:=rhs~(sol)[ ] ) line. I added the comment about ordering as a reminder, but eval is better (I may have used that in the past, but I don't remember.)

I was frustrated by the inefficiency of

fR := t->cols[signum(X(t)),signum(V(t))][1]:
fG := t->cols[signum(X(t)),signum(V(t))][2]:
fB := t->cols[signum(X(t)),signum(V(t))][3]:

and tried just

f := t->cols[signum(X(t)),signum(V(t))]: with
color=f(t) or color=[f(t)[]]

but only got red (full evaluation?) and an error respectively.

I then debated producing the single number for the HUE instead, but I do have some time constraints.

I certainly hope the color function can be implemented into spacecurve; it seems a strange omission.

## Bug and extra information...

@mehdibgh M__11 should have been Mm__11 when creating RS. I always keep things real and symmetric, so use transpose instead of Hermitian transpose, and as I tried to emphasize before: tell the routines when things are symmetric (and positive definite). Now Eigenvectors works, is much faster and gives real eigenvalues. They still aren't accurate (according to your expected values), bocause your matrices are ill-conditioned. You could scale K so the values are more comparable to those in M, and then scale the resulting eigenvalues to compensate, but I don't think that will help much.

ProblemXX.mw

## subscription/colouring...

@mmcdara If you check the subscribe box when you post/answer/reply, then you will get email notifications and the thread will remain alive. But perhaps you won't notice this and find out.  :)

In terms of the possibilty of spacecurve coloring, when I found spacecurve gave me an error I assumed it couldn't be done. I was too lazy to check the plots,structure help page, but I used the word "think" not to be definitive.

So now I "think" only implicitplot3d's ISOSURFACEs can't take a color function. That one has frustrated me for a long time since I want to add phase colouring to those surfaces.

## ill-conditioned matrices...

@mehdibgh Your Eig method doesn't work because the pseudoinverse is singular.

I attach my version of your LV method, which avoids taking an inverse and makes some use of the fact that M is diagonal, though that could be avoided. I only did operations that kept the matrices symmetric, and avoided some of the slow conversions you had. Accuracy probably cannot be improved, because some data in M11 are small and inaccurate, so the inverse square root now has large inaccurate values. As you tried, some scaling can help but the matrices are all ill-conditioned. I'm guessing the input data does not have enough sig. figs.

Problem2.mw

## DLMF...

@ecterrab Actually, I stole my ranges from DLMF. I debated putting a link to the nice rotatable graphics there, but I am trying to promote Maple!

## plot...

@janhardo Your plot of the integral is just a horizontal line because the evaluated integral is just the number Pi*cosh(1)-Pi*sinh(1), and the default plot range is -10..10. So it is like plot(1.8,x=-10..10).

cos(z) is not exp(I*z). Try convert(cos(z),exp) to see what it is.

Suggest you use complexplot to visualize some of the functions you are using.

## default...

@acer @Carl Love Thanks for the info. I'm a little surprised that the default would become extended but then the special function rules would be off by default - it seems many probably share the OPs confusion.

## Technical issue...

@Kevin Dragnet  I think you should contact technical support - something definitely wrong here. https://www.maplesoft.com/support/ [Edit: see @Carl Love's answer below]

MeijerG typesets in mathematical notation; I don't have FoxH in my version.

 > restart;
 > interface(version);

 > interface(typesetting=extended):
 > MeijerG([[1, 1, 1, 1], []], [[], [4, 3, 2, 2]], Pi);

 >

## binomial expansion...

@mmcdara I'd probably combine these two, so 1/(sqrt(1-x)) = (1-x)^(-1/2) =1-(-1/2)x+... approx= 1+(1/2)x for x small, using the binomial expansion, (1+x)^n = 1+n*x+... or (1-x)^n = 1-x*n

## pochhammer...

@The function See the help page ?pochhammer, which says

pochhammer(z, n) = z*(z+1) .. z+n-1

so there are n factors going up in steps of 1, starting at z.

## simpler...

@Carl Love convert(sqrt(x), FormalPowerSeries, x = 1) will work directly here.