dharr

Dr. David Harrington

7059 Reputation

21 Badges

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

@janhardo Yikes! DEtools seems to be an old-style table-based package; I thought they had all been upgraded. The workaround would be to use DEtools[DEplot] on the two occasions you need DEtools.

@Hamza Rafiq I think your approach is correct, but I don't know how to complete it.

restart

with(PDEtools); with(plots)

alias(u = u(x, y, t), f = f(x, y, t), g = g(x, y, t), h = h(x, y, t), q = q(x, y, t))

u, f, g, h, q

Eq := diff(u, [y, t])+diff(u, [`$`(x, 3), y])-3*(diff(u, `$`(x, 2)))*(diff(u, y))-3*(diff(u, [x, y]))*(diff(u, x))

diff(diff(u, t), y)+diff(diff(diff(diff(u, x), x), x), y)-3*(diff(diff(u, x), x))*(diff(u, y))-3*(diff(diff(u, x), y))*(diff(u, x))

rf1 := f+g*phi(q)

f+g*phi(q)

rf2 := combine(expand(dsubs(u = rf1, Eq)))

rf3 := dsubs((D(phi))(q) = sigma*phi(q)+phi(q)^2, ((D@@2)(phi))(q) = sigma*(sigma*phi(q)+phi(q)^2)+2*phi(q)*(sigma*phi(q)+phi(q)^2), ((D@@3)(phi))(q) = sigma*(sigma*(sigma*phi(q)+phi(q)^2)+2*phi(q)*(sigma*phi(q)+phi(q)^2))+2*(sigma*phi(q)+phi(q)^2)^2+2*phi(q)*(sigma*(sigma*phi(q)+phi(q)^2)+2*phi(q)*(sigma*phi(q)+phi(q)^2)), ((D@@4)(phi))(q) = sigma*(sigma*(sigma*(sigma*phi(q)+phi(q)^2)+2*phi(q)*(sigma*phi(q)+phi(q)^2))+2*(sigma*phi(q)+phi(q)^2)^2+2*phi(q)*(sigma*(sigma*phi(q)+phi(q)^2)+2*phi(q)*(sigma*phi(q)+phi(q)^2)))+(6*(sigma*phi(q)+phi(q)^2))*(sigma*(sigma*phi(q)+phi(q)^2)+2*phi(q)*(sigma*phi(q)+phi(q)^2))+2*phi(q)*(sigma*(sigma*(sigma*phi(q)+phi(q)^2)+2*phi(q)*(sigma*phi(q)+phi(q)^2))+2*(sigma*phi(q)+phi(q)^2)^2+2*phi(q)*(sigma*(sigma*phi(q)+phi(q)^2)+2*phi(q)*(sigma*phi(q)+phi(q)^2))), rf2)

rf4 := collect(rf3, phi(q))

eqns := [seq(coeff(rf4, phi(q), i), i = 0 .. 5)]

pdsolve(eqns, {f, g, q}, HINT = `+`)

{f = f__1(x)+c__1+f__3(t), g = f__4(x)+c__2+f__6(t), q = f__7(x)+c__3+f__9(t)}

Last equation can be solved directly for f.

eqns[1]; pdsolve(eqns[1], f)

-3*(diff(diff(f, x), y))*(diff(f, x))-3*(diff(diff(f, x), x))*(diff(f, y))+diff(diff(f, t), y)+diff(diff(diff(diff(f, x), x), x), y)

f = -2*tanh(-4*c__2^3*t+c__2*x+c__3*y+c__1)*c__2+_C5

Try g=2*q_x as in Eq (7) - last two are satisfied

eqnsg := eval(eqns, g = 2*(diff(q, x))); eqnsg[5]; eqnsg[6]

0

0

So to get these we solve as the last two equations and take the last solution

pdsolve({eqns[5], eqns[6]}, {g, q})

{g = g, q = f__1(t)}, {g = (2/3)*(diff(f__1(x, t), x)), q = f__1(x, t)}, {g = f__10(x, t), q = f__1(x, t)}, {g = g, q = f__1(y, t)}, {g = 0, q = q}, {g = 2*(diff(q, x)), q = q}

NULL

``

NULL

Download Find_Solution.mw

I see this behaviour on Maple 2024.2 on Windows 11. In fact, after ctrl-alt-delete would get me to the task manager, clicking on java to select it to kill just sent me back to the frozen Maple screen - I had to do a hardware stop of my computer. 

Since I usually start Maple by double-clicking on a preexisting workheet or using recent documents, it's hard for me so say when this started, by 2-3 weeks ago seems about right.

Great detective work on the left panel!

intersectcurves from the algcurves package can do this. In this simple case one doesn't learn much more than directly using solve, but for more complicated cases it may be useful.

restart;

with(algcurves):

f := X^2 + Y^2 - 1:
g := X - Y:

sol:=intersectcurves(f,g,X,Y);

[[1, [X-Y, Y^2-1/2, 1]]]

First value 1 is the multiplicity - curves cross and are not tangent. Call the inner values a,b,c. For the usual case of c=1, solve b to get all y values, then for these solve a to get the x values (same as Y in this case).

yvals:=Y=~[solve(sol[1][2][2],Y)];
xvals:=map2(eval,sol[1][2][1],yvals);
zip((x,y)->{solve(x,{X})[],y},xvals,yvals); # single x solution assumed

[Y = (1/2)*2^(1/2), Y = -(1/2)*2^(1/2)]

[X-(1/2)*2^(1/2), X+(1/2)*2^(1/2)]

[{X = (1/2)*2^(1/2), Y = (1/2)*2^(1/2)}, {X = -(1/2)*2^(1/2), Y = -(1/2)*2^(1/2)}]

NULL

Download intersectcurves.mw

I don't have MapleFlow, but frequently have the same problem in Maple. The only solution I know of is to attempt to exit the program via the window's X button. Then you are given the option to save (yes/no/cancel). Sometimes cancel will get you back to a working state, but saving and then restarting from the OS will work.

This actually finds the solution.

Download solution.mw

@vv I was careful to say "that the elimination process does not lead to any valid solutions", not that there are no solutions. Is there another way to get such a solution or did I (or Maple) make a mistake in the step-by-step elimination? 

Edit: I see it is among the solutions to 

SolveTools:-PolynomialSystem(expr2)

 

@selaf @Preben Alsholm's answer works also for this case:

f ≔ x -> local j; seq(x, j=1..5);

As Preben said, this only works for 1-D input. If you try this with 2D input, you get an "invalid arrow procedure" error.

@Saalehorizontale So in terms of your concerns, I guess the conclusion is RegularChains (and Groebner) are reliable in terms of finding all solutions. RegularChains is the modern way to do it, but is hard to understand. Notice that engine = triade in PolynomialSysyems uses RegularChains but then does the work of outputting the solutions in nice form. @John May suggested earlier SolveTools:-SemiAlgebraic but it was too slow. It also uses RegularChains, but returns an easier-to-understand format. The secret may be to find a good variable ordering.

So using RegularChains to find the variable order, and then SolveTools:-SemiAlgebraic to express the solution in a nice form is a possibilty. Trying this worked and gave one solution. (I reversed the variable order in case an elimination order was required.) So I'm worried that it missed some solutions. I would suggest trying some much smaller systems where you know the exact number of solutions to make sure it is working the way you expect.

RegularChains.mw

@philroe Yes, sort should work on anything; try it on your examples or upload your worksheet if it doesn't seem to be working.

@C_R Nice.

The large y values that don't give reality seem to correspond to the same values of m and m2, but these are supposed to be in different ranges, so something not quite right there. I'm not sure about how those ranges were chosen; I do not fully understand the physics.

I agree with your approach with x as a parameter (or we could try z). The exponents are no longer integers, which makes it a much harder problem than before. It think we are close to a phase transition (at d=3?), in which by definition (in an infinite system) the solution is non-analytic/has a singularity. So we expect it to be numerically very difficult. Perhap your sequence of x values found the phase transition, Perhaps it can be approached from the other side and goes crazy at the same point.

@C_R @Gabriel Barcellos @one man I made some progress in analyzing the expressions and squeezed another 50% efficiency out of the some of the earlier parts of the worksheet. I still intend to tackle the more difficult case of solving the three equations for T. Some observations that are speculative at the moment:

1. I think my efficiencies largely arise from efficient evaluation of multivariate polynomials in Maple, and once you go to another form you lose efficiency.

2. Perhaps related to the previous point, making a function with unapply or makeproc leads to much, much slower evaluations.

3. The efficiency of fsolve depends significantly on how the equations are presented - expression or functions. This is more than just efficiency of evaluations, because in all 3 cases I tried, fsolve uses the same method and the same internal initial guess, but the estimated errors and the number of iterations changes a lot. 

@C_R asked about the physics. There are 8 spins on the vertices of a cube, each of which can take on 8 spin states (those in S0). Z0 is the partition function, the sum of the exp() expressions, one for each of the 8^8 states (possible arrangements). m is the resulting magnetization. I'm not clear on the meaning of the requirements at the end, where T is solved for for close values of d.

Campo_Médio_spin_7_2_new5MP.mw

@mmcdara This capability still exists; try

interface(prettyprint = 2, typesetting = standard, labelling = true, labelwidth = 10)

on eq3, but in this case there are not enough large subexpressions, and the main expression is one line long. I recall it being more flexible, but maybe not.

@MDD I updated it slightly. TestOrder is supposed to see monomials

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