dharr

Dr. David Harrington

8235 Reputation

22 Badges

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

@Carl Love Thanks. I was just being cautious. My information is probably out of date, but I had a recollection that in older versions there were some minor differences, perhaps in the maximum setting of Digits. But I don't see any differences mentioned on the website.

@Melvin Brown Looks like you split it into real and imaginary parts. Probably a good idea for a numerical solution, but for an analytical solution, a single complex  equation will probably work better. I'm guessing with this time dependence it's separable into a function of time multiplied by a function of (x,y). I would also probably look for a general solution first - if you can find that then add the BCs/ICs later.

Good luck.

My reading of your problem is that you don't have a way of entering inactive 2-D math, only changing active to inactive by shift-F5. In Maple 2017 (I don't have 2019), entering inactive 2-D math can be done directly with shift-F5, though perhaps you know this already ( @acer 's q1.)

 

@acer Thanks - homedir is the same on Maple and Maple Player (as expected), so I can work relative to there as a workaround.

I usually put my worksheet in the directory with the data files I want to analyze, then open files relative to worksheetdir, which for this case is the same as currentdir. This means the worksheet doesn't need to be modified if I send it to to someone else who operates the same way. In an interactive application I can use a combo box to list the files in worksheetdir and the user can choose one, not having to change or choose a directory.

@ALIKHADEMI to make variable "a" a Vector, use a:=Vector([seq(1..10,0.5)]);

The rest of the code is the same. I don't understand the rest of your question. To better understand elementwise operators, take a look at the help page for elementwise.

@pu397 You'll have to use Eq 27 or the like instead of Eq. (12). I didn't spend much time trying to understand the method, just suggested the general strategy for using Maple. I'm currently travelling, so don't have much time, so suggest you make a first attempt, and pehaps someone here can help correct it for you.

@Carl Love Thanks for the tip.

@acer @nm This is often (usually) a hidden file.

@acer I like to let the OP do some of the work :-). My variation would have been to solve some eqns:
 

Gc := (s^2*t^2+2*s*t*x+1)*(-b*s+1)/(k*(-b*s+1)*s*(t*c+b));

(s^2*t^2+2*s*t*x+1)/(k*s*(c*t+b))

Gc2:=expand(convert(Gc,parfrac,s));

t^2*s/(k*(c*t+b))+2*t*x/(k*(c*t+b))+1/(k*s*(c*t+b))

eqns:={A=coeff(Gc2,s,0),A*C=coeff(Gc2,s,1),A/B=coeff(Gc2,s,-1)};

{A = 2*t*x/(k*(c*t+b)), A/B = 1/(k*(c*t+b)), A*C = t^2/(k*(c*t+b))}

ABC:=solve(eqns,{A,B,C});

{A = 2*t*x/(k*(c*t+b)), B = 2*t*x, C = (1/2)*t/x}

Gc3:=A*(1+1/(B*s)+C*s);
simplify(eval(Gc3,ABC)-Gc);

A*(1+1/(B*s)+C*s)

0

 


 

Download parfrac.mw

@AntoineR Looks like you may have used 2-D input. From your original post, I added multiplications after k, the last s and between t and c. If the first two are omitted, Maple thinks that they are functions f() and s() and so does not think that you have a rational function. In 2-D input use a space or * to distinguish multiplication from functions.

@dharr and to get the coefficients you can use

coeff(Gc2,s,0); coeff(Gc2,s,1); coeff(Gc2,s,-1);

(can't seem to edit my post).

@Joe Riel  Of course I agree the help page is confusing. At one point, it says that all entries of an rtable are "scanned" (as opposed to all opererands), and later that for sparse rtables only the nonzero ones are "scanned", so they can't both be correct.

But I expect (1) any mathematical operation on an rtable to give the same result, whether sparse of not, and (2) some algorithmic efficiencies  may be be applied if it is sparse.

So I think the first point (and the first usage of scan in terms of all entries) means I expect to see seq return the number of elements of the rectangular size. In the case of mul (which has the same strange wording about "scan"), mul(V) returns 0, (as I expect) - it involves the same result as if non sparse, and must involve more that just the stored entries.

I took the second usage of scan (that for sparse rtables only the non-zero entries are scanned), to be associated with the second point, that somehow seq uses a more efficient algorithm, and can be faster because it doesn't attempt to access the non-zero entries. 

But perhaps this is just me being optimistic that there is some resonable meaning behind the second usage (that @vv pointed to as strange)...

 

@eslamelidy You keep changing the worksheet so each seems unrelated to the previous ones, so suggest you start a new post. The error meesage is telling you there is a singularity, so you can only solve up to just before that point, so you need to look at the equations and figure out why - that is a math question and not a Maple question.

@vv Thanks for the improvement. I did expect there to be duplicates, but mainly because the role of the "permutation matrix" 1s and the "extra 1s" could be reversed. Removing duplicates in this case does produce 40320 = 8*7!.

There are other things that could be checked. For example, if there is a 1 on the diagonal, then there must be an extra 1 in that column and an extra 1 in that row ("guard 1s") to prevent the diagonal element being exposed as eigenvalue (which would make the polynomial reducible). In fact for the polynomial given, since the trace must be 1, and there are only two extra 1s, I could devise a more efficient scheme, though it wouldn't be general.

@dharr Thanks for the update. In the meantime, I figured out how to test this case exhaustively in about an hour, assuming I haven't made a logic error. I'll post it as an answer after I tidy it up and rerun it.

First 73 74 75 76 77 78 79 Last Page 75 of 85