Dr. David Harrington

4449 Reputation

20 Badges

18 years, 281 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 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.

MaplePrimes Activity

These are replies submitted by dharr

@lcz Isomorphic triangulations don't necessarily correspond to isomorphic binary trees, so I think a different approach is needed.

@OtherAlloyMonkey I left all the equations in terms of beta, and made all the constants exact. Then it is easy to see that the 5th and 6th rows of the matrix are identical, and therefore the determinant must be zero.


@MaPal93 b2 appears in the assignment to Var_Omega_S. I see many places your subscripts or superscripts or Greek letters are parts of atomic variables, which I suppose is OK, but not the b2. This is a very strange way to use Maple. For example the line

looks like 1-D math but has Omega in. When converted from the right-click menu 2-D math-convert to 1-D math then we get the real 1-D math Omega := subs(repl, `Ωinst`); If I convert that to 2-Math input I get 

So you are using 2-D math and formatting it as 1-D math? I guess in that context the b2 is OK, but not sure why you would do this.

I only answered the title part of your question, and do not understand what you are trying to do, which is why I replied to rather than answered your question. Hope someone else can help you with that.

Your Var_Omega_S has a (scalar) expression added to a Matrix, which doesn't make sense. This is manipulated and eventually passed to solve, which probably generates the error messages. (Also your 1-D math inputs have superscripts and subscripts, which seem strange - for example b2 instead of b^2.)

@Diasaur @Pascal4QM @ecterrab I think your requirement was for block matrices, and my first attempt below was not successful, but I'm new using the Physics package so I may have missed something here. There have been requests for this capability over the years, and the Physics package is perhaps the best setting for it, but there are other ways of approaching it. 

What capabilities are required? What properties should the blocks have? Some are obvious: non-commutative, (a.b)^(-1) = b^(-1).a^(-1), same with transpose, associative, etc, but do you need conformability checks, where the blocks have specific dimensions? - that would add considerable complexity.

restart; with(Physics)

Setup(quantumoperators = {A, B, a, b, c, d})

[quantumoperators = {A, B, a, b, c, d}]

Block matrices

A := matrix(2, 2, [[a, b], [c, d]]); B := matrix(2, 2, [[b, b], [-a, a]])

A := Matrix(2, 2, {(1, 1) = a, (1, 2) = b, (2, 1) = c, (2, 2) = d})

array( 1 .. 2, 1 .. 2, [( 1, 2 ) = (b), ( 2, 2 ) = (a), ( 2, 1 ) = (-a), ( 1, 1 ) = (b)  ] )

Library:-Commute(a, b)


a.b-b.a; a.b+b.a

Physics:-`*`(a, b)-Physics:-`*`(b, a)

Physics:-`*`(a, b)+Physics:-`*`(b, a)

But in the following, a and b are commuting.


array( 1 .. 2, 1 .. 2, [( 1, 2 ) = (2*a*b), ( 2, 2 ) = (a*d+b*c), ( 2, 1 ) = (-a*d+b*c), ( 1, 1 ) = (0)  ] )


Download BlockMatrix.mw

See https://www.mapleprimes.com/questions/229829-How-I-Can-Download-The-ONEOptimal-Package

(and there are also other Mapleprimes responses if you put ONEOptimal in the MaplePrimes search box).

@zenterix My reply was in response to @PeterTang's, question, which seems to be simpler and not involve .mpl files.

@PeterTang To find the directory of a (previously saved) worksheet from the worksheet, use 



@Carl Love Lucky eyeball!

@vs140580 It is a good general rule that data for processing numerically not differ by too many orders of magnitude from one. So scale independent or dependent data until it is all like this. This is what I did in your case - after scaling all columns had data of similar magnitude, with most values around 1-10.

You say C1 cannot be zero, but it was calculated as zero because of the numerical issue. After scaling, it was evident that it was not zero.

@William Han Sorry for the misleading answer. Here is one way to do it, another variation of the replies from the others.


@toran You can adapt into an algorithm, but it is always best to look at things.


P := x^12*y^3+10*x^11*y^4+43*x^10*y^5+105*x^9*y^6+161*x^8*y^7+161*x^7*y^8+105*x^6*y^9+43*x^5*y^10+10*x^4*y^11+x^3*y^12-x^12*y^2-8*x^11*y^3-17*x^10*y^4+8*x^9*y^5+82*x^8*y^6+128*x^7*y^7+82*x^6*y^8+8*x^5*y^9-17*x^4*y^10-8*x^3*y^11-x^2*y^12-x^12*y-4*x^11*y^2-62*x^10*y^3-341*x^9*y^4-902*x^8*y^5-1410*x^7*y^6-1410*x^6*y^7-902*x^5*y^8-341*x^4*y^9-62*x^3*y^10-4*x^2*y^11-x*y^12+x^12-8*x^11*y-62*x^10*y^2-680*x^9*y^3-3169*x^8*y^4-7312*x^7*y^5-9540*x^6*y^6-7312*x^5*y^7-3169*x^4*y^8-680*x^3*y^9-62*x^2*y^10-8*x*y^11+y^12+10*x^11-17*x^10*y-341*x^9*y^2-3169*x^8*y^3-11838*x^7*y^4-21793*x^6*y^5-21793*x^5*y^6-11838*x^4*y^7-3169*x^3*y^8-341*x^2*y^9-17*x*y^10+10*y^11+43*x^10+8*x^9*y-902*x^8*y^2-7312*x^7*y^3-21793*x^6*y^4-30696*x^5*y^5-21793*x^4*y^6-7312*x^3*y^7-902*x^2*y^8+8*x*y^9+43*y^10+105*x^9+82*x^8*y-1410*x^7*y^2-9540*x^6*y^3-21793*x^5*y^4-21793*x^4*y^5-9540*x^3*y^6-1410*x^2*y^7+82*x*y^8+105*y^9+161*x^8+128*x^7*y-1410*x^6*y^2-7312*x^5*y^3-11838*x^4*y^4-7312*x^3*y^5-1410*x^2*y^6+128*x*y^7+161*y^8+161*x^7+82*x^6*y-902*x^5*y^2-3169*x^4*y^3-3169*x^3*y^4-902*x^2*y^5+82*x*y^6+161*y^7+105*x^6+8*x^5*y-341*x^4*y^2-680*x^3*y^3-341*x^2*y^4+8*x*y^5+105*y^6+43*x^5-17*x^4*y-62*x^3*y^2-62*x^2*y^3-17*x*y^4+43*y^5+10*x^4-8*x^3*y-4*x^2*y^2-8*x*y^3+10*y^4+x^3-x^2*y-x*y^2+y^3

plots:-implicitplot(P, x = -1 .. 2, y = -1 .. 2)

xval := {x = .5}

{x = .5}

yval := {y = fsolve(eval(P, xval), y = 0 .. .5)}

{y = .1478226028}

Check these values are a pair of roots.

eval(P, `union`(xval, yval))



Download bivariate2.mw

@toran Use implicitplot to look at your function in the region you are interested in - you can see where the roots are. Then choose an x value and find the corresponding y by something like


where the y range is where you can see there is a root. (These values would work for the above plot)

If it is an isolated root you want, then algcurves:-singularities may be needed.

Perhaps if you supply the polynomial here, you can get more specific advice.

@nicolesharp100 As a shortcut you can use %,%%, and %%% to refer to the last result (in time), 2nd to last and third-to-last. I use them within an execution group but not across execution groups, to avoid confusing results in time with results by location. I think they work on the command line.

@nicolesharp100 I don't know how to do this. I rarely use eqn numbers (in fact my default is not to show them). But I just put every result in a variable, and that is how I refer to them in the next execution group.

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