dharr

Dr. David Harrington

8195 Reputation

22 Badges

20 years, 334 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 answers submitted by dharr

The first error message says "Warning, expecting only range variable x1 in expression 29239.76608*Ex*x1+794956140.3-29239.76608*Ma-131578.9474*Ey to be plotted but found names [Ex, Ey, Ma]". So you have not given numerical values to Ma, Ex, and Ey. The thing you are trying to plot is

29239.76608*Ex*x1 + 7.949561403*10^8 - 29239.76608*Ma - 131578.9474*Ey

but it can have only the name x1 in. You can try, say 

and you do get a plot, but I don't know what values of these parameters would be sensible.

restart;

eqqq := map(simplify,{sqrt(beta*rho*xi[8]^2 - beta*xi[8]^2)/xi[8] = sqrt(beta*rho - beta), (-rho + 1 + sqrt(beta*rho*xi[8]^2 - beta*xi[8]^2))/(xi[3]*xi[8] - 1) = sqrt(beta*rho - beta), -(-rho*xi[3]*xi[8] + sqrt(beta*rho*xi[8]^2 - beta*xi[8]^2) + xi[3]*xi[8])/(xi[8]*(xi[3]*xi[8] - 1)) = rho - 1}):

In general, simplification on an expression to give zero is easier than comparing both sides of an equation. So I convert the equations to solve to expressions. (I could do this on the solutions after solving.)

eq3:=map(eq->(rhs-lhs)(eq),eqqq);

{(beta*(rho-1))^(1/2)-(beta*xi[8]^2*(rho-1))^(1/2)/xi[8], (beta*(rho-1))^(1/2)-(-rho+1+(beta*xi[8]^2*(rho-1))^(1/2))/(xi[3]*xi[8]-1), rho-1-(-(beta*xi[8]^2*(rho-1))^(1/2)+(rho-1)*xi[3]*xi[8])/(xi[8]*(xi[3]*xi[8]-1))}

sol:=solve(eq3,{xi[8],xi[3]});

{xi[3] = (1+(beta*(rho-1))^(1/2)-rho)/(beta*(rho-1))^(1/2), xi[8] = -(1+(beta*(rho-1))^(1/2)-rho)/(rho-1)}

simplify(subs(sol,eq3));

{(-(beta*(rho-1))^(1/2)+(beta*(1+(beta*(rho-1))^(1/2)-rho)^2/(rho-1))^(1/2)+beta)*(beta*(rho-1))^(1/2)/(rho-(beta*(rho-1))^(1/2)+beta-1), -(-(beta*(rho-1))^(1/2)+(beta*(1+(beta*(rho-1))^(1/2)-rho)^2/(rho-1))^(1/2)+beta)*(rho-1)/(-1-(beta*(rho-1))^(1/2)+rho), -(beta*(rho-1))^(1/2)*(-(beta*(rho-1))^(1/2)+(beta*(1+(beta*(rho-1))^(1/2)-rho)^2/(rho-1))^(1/2)+beta)*(rho-1)/((rho-(beta*(rho-1))^(1/2)+beta-1)*(-1-(beta*(rho-1))^(1/2)+rho))}

We didn't get zero, and it looks like the square roots are a problem. It seems to prevent negatives under the sqrt in sqrt(beta*(rho-1)) we could have

simplify(subs(sol,eq3)) assuming beta>0,rho>1;

{beta^(1/2)*(rho-1)^(1/2)*(1-signum(-1-beta^(1/2)*(rho-1)^(1/2)+rho)), (-1+signum(-1-beta^(1/2)*(rho-1)^(1/2)+rho))*(rho-1)*beta/(beta^(1/2)*(rho-1)^(1/2)-beta-rho+1), (-1+signum(-1-beta^(1/2)*(rho-1)^(1/2)+rho))*(-1-beta^(1/2)*(rho-1)^(1/2)+rho)*beta/(-beta^(1/2)*(rho-1)^(1/2)+beta+rho-1)}

or

simplify(subs(sol,eq3)) assuming beta<0, rho<1;

{0}

If we did want beta>0, rho>1 then the signum is telling us what additional assumption we need

simplify(subs(sol,eq3)) assuming beta>0, rho>1, -1 - sqrt(beta)*sqrt(rho - 1) + rho>0;

{0}

The other way doesn't work

simplify(subs(sol,eq3)) assuming beta>0, rho>1, -1 - sqrt(beta)*sqrt(rho - 1) + rho<0;

{2*beta^(1/2)*(rho-1)^(1/2), 2*beta*(rho-1)/(-beta^(1/2)*(rho-1)^(1/2)+beta+rho-1), -2*beta*(-1-beta^(1/2)*(rho-1)^(1/2)+rho)/(-beta^(1/2)*(rho-1)^(1/2)+beta+rho-1)}

NULL

Download solve.mw

I don't think you can expect sum to give an analytical result, but you can use add to get a numerical result for summing up a large but finite number of terms. (Of course you can use ":" before the evalf to suppress the fraction.) There are probably ways of speeding this up if you want more terms and are only interested in a floating answer.

restart

N := 1000

1000

add(add(ifelse(igcd(m, n) = 1, 1/(m*n)^2, 0), m = 1 .. N), n = 1 .. N); evalf(%)

5532445055376352006682628927753145528970667544410067992788570677846174322152934183442457503057224363774497507108665400532629550147843469142124226144969302173888708851044382140074091091625372693584503837173054948044029528919671403205510054993010871918037249386694096481338979359318665748778806702963161427960903337340452417488905776370472967032563487798981104129939895109772524045706301025651789483034868390590922231566748924949345613510806389477671058222477327056360065465369147452780198772560906625740852672775258980646385235690587185435917247758298832233771101650765956189840592453209825297894908550280663940637781299927315001515221384354297300290305482815046958809041292631478681328638837766548333582204272087678340598645177195671315533413220497463591109093306748119462417424109251101985974126660902042939400696410680608319010223720314403587072423901839/2215401765060199076871263557853118332227324601140256306024979859440747275310142812207631932825650126671317379797411656038492320603818343789239712164205258985121991061929760226402685186979855643381508827056625534669188365623376886098004863359138577635190930503803887889088780257560088147168755709313653758428025570278533530080776685678078392356194935299124340796410605389047851560210858491934810059642988452458045697112532780427976931584727648213025020456341176857124077097214832965005503367731448481531372552150464264617839463298112873781392628562590811184388683738493384943941907659916412512149340044747767907762101305160442358620219612360864537601408693594131025312188123291925844326343537050086070608574762214943201652242835382225022686382300632553803831113114236647288464851072241277028587590660356505813282143777727693670787533236697203835602688000000

2.497264895

NULL

Download igcd.mw

I usually use a colon at the end of an assignment statement storing a plot in a variable, then display it:

plt0 := implicitplot3d(pln, x = -3 .. 3, y = -3 .. 3, z = -3 .. 3, style = patchnogrid, transparency = 0.6):
display(plt0);

What you see with a semicolon in the first line has changed over various versions (plot structure, miniplot, full plot); I didn't check here. But also I would store the plot and not the display of the plot.

That format is hardcoded somewhere hard to find. Here's a hack that takes the existing output and substitutes different strings. Here I use the 5.1f format to get one decimal place.

VennHack.mw

You can collect your Usol values in a table by indexing them. See in red.

ode.mw

0 means an exact result. In general in Maple, numbers with a decimal point are approximate (floats) and without are exact. So if the numbers in your guesses were entered as, e.g., 3. instead of 3 or with an e (1e3 instead of 1000), then you will get an approximate result which will be displayed with a decimal point. evalf() will convert an exact expression to an approximate one ("f" for float).

Minpoly looks for the monic polynomial of least degree that has the expression as a root.

restart

y_1 := RootOf(_Z^5-2*_Z^4+9*_Z^3-14*_Z^2+9*_Z-2, .4687 .. .4727); y_2 := 2*RootOf(2*_Z^5-9*_Z^4+14*_Z^3-9*_Z^2+2*_Z-1, 2.109 .. 2.118)^4-9*RootOf(2*_Z^5-9*_Z^4+14*_Z^3-9*_Z^2+2*_Z-1, 2.109 .. 2.118)^3+14*RootOf(2*_Z^5-9*_Z^4+14*_Z^3-9*_Z^2+2*_Z-1, 2.109 .. 2.118)^2-9*RootOf(2*_Z^5-9*_Z^4+14*_Z^3-9*_Z^2+2*_Z-1, 2.109 .. 2.118)+2

evala(Normal(y_1-y_2))

0

Show that y_1 is the index=1 root.

convert(y_1, RootOf, form = index); evalf(%)

RootOf(_Z^5-2*_Z^4+9*_Z^3-14*_Z^2+9*_Z-2, index = 1)

.4723554543

RootOf(evala(Minpoly(y_2, _Z))); evalf(%)

RootOf(_Z^5-2*_Z^4+9*_Z^3-14*_Z^2+9*_Z-2)

.4723554543

``

Download simplify_symbolic_numbers.mw

interface(version);

`Standard Worksheet Interface, Maple 2025.0, Windows 11, March 24 2025 Build ID 1909157`

restart;

ode:=diff(y(x),x)*(x-ln(diff(y(x),x))) = 1;
maple_sol:=dsolve(ode):

(diff(y(x), x))*(x-ln(diff(y(x), x))) = 1

the_residue:=odetest(maple_sol,ode);

(-x+ln(-1/LambertW(-1/exp(x)))-LambertW(-1/exp(x)))/LambertW(-1/exp(x))

The following suggests we can probably do it by some assumptions.

simplify(the_residue,symbolic);

0

Note LambertW has a bramch point at -exp(-1), which is the argument to LambertW when x=1, so we need to avoid that

simplify(the_residue) assuming x>1;

0

simplify(the_residue) assuming x<1;

0

NULL

Download odetest_challange_may_15_2025.mw

Your lines

P3 = (5/2)*x^3-(3/2)*x;
R3 = GM3*(rho1/rho2)^3*P3/rho2;

should have := rather than = 

This is fixed in Maple 2025

restart

with(inttrans)

mellin(BesselK(0, x), x, p)

2^(p-2)*GAMMA((1/2)*p)^2

mellin(BesselK(0, x^(1/2)), x, p)

2*2^(2*p-2)*GAMMA(p)^2

NULL

Download mellin.mw

It's not clear to me what you mean by simple elements. Normal will simplify the rational function in F11 as below, but the answer is just the reciprocal of your original polynomial. In future please upload your worksheet using the green up-arrow in the Mapleprimes editor so we don't have to retype and can diagnose more subtle issues such as why the parfrac did not work.

restart

`mod`(Berlekamp(x^9+x^6-x+1, x), 11)

{x^2+1, x^2+4*x+9, x^5+7*x^4+6*x^3+2*x^2+5*x+5}

F := `mod`(Factor(x^9+x^6-x+1), 11)

(x^2+4*x+9)*(x^2+1)*(x^5+7*x^4+6*x^3+2*x^2+5*x+5)

G := 1/F

1/((x^2+4*x+9)*(x^2+1)*(x^5+7*x^4+6*x^3+2*x^2+5*x+5))

G2 := `mod`(Normal(G), 11)

1/(x^9+x^6+10*x+1)

`mod`(Normal(F*G2), 11)

1

NULL

Download mod11.mw

collect is really only for polynomials and here the powers are not integer (though it works with a few other things like diff or exp). So you can do it by subs and then collect (the expand you had is essential).

 collect_term.mw

If you don't take the sqrt of the ode (which has consequences for the validity of the assumptions on signs), then many of the odetest's give zero. I didn't check them all.

17-ode.mw

In this case there is a simple solution. But in principle, your question doesn't have a clear answer - what do you want to do with terms that only have only diff(G(xi),xi) for example - do you want to write that as (diff(G(xi),xi)/G(xi))*G(xi) and count it?

restart

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

`There is no more prime differentiation variable; all derivatives will be displayed as indexed functions`

L := (-6*f^3*g*a[2]+6*f*g^3*a[2]+6*f*g*a[2]^2)*(diff(G(xi), xi))^4/G(xi)^4+(f*g^3*(10*lambda*a[2]+2*a[1])-f^3*g*(10*lambda*a[2]+2*a[1])+12*f*g*a[1]*a[2])*(diff(G(xi), xi))^3/G(xi)^3+(f*g^3*(2*a[2]*lambda^2+3*lambda*a[1]+10*mu*a[2]+2*a[2]*(lambda^2-mu))-4*f*p*a[2]-6*k*l*a[2]-f^3*g*(2*a[2]*lambda^2+3*lambda*a[1]+10*mu*a[2]+2*a[2]*(lambda^2-mu))+6*f*g*(2*a[0]*a[2]+a[1]^2))*(diff(G(xi), xi))^2/G(xi)^2+(f*g^3*(a[1]*(lambda^2-mu)+3*a[1]*mu+6*lambda*a[2]*mu)-4*f*p*a[1]-6*k*l*a[1]-f^3*g*(a[1]*(lambda^2-mu)+3*a[1]*mu+6*lambda*a[2]*mu)+12*f*g*a[0]*a[1])*(diff(G(xi), xi))/G(xi)+f*g^3*(lambda*mu*a[1]+2*mu^2*a[2])-4*f*p*a[0]-6*k*l*a[0]-f^3*g*(lambda*mu*a[1]+2*mu^2*a[2])+6*f*g*a[0]^2

collect and coeff deal with positive and negative powers

L1 := collect(L, {G(xi), diff(G(xi), xi)}, 'distributed')

eqns := coeffs(L1, {G(xi), diff(G(xi), xi)}, 'monomials')

f*g^3*(lambda*mu*a[1]+2*mu^2*a[2])-4*f*p*a[0]-6*k*l*a[0]-f^3*g*(lambda*mu*a[1]+2*mu^2*a[2])+6*f*g*a[0]^2, -6*f^3*g*a[2]+6*f*g^3*a[2]+6*f*g*a[2]^2, f*g^3*(10*lambda*a[2]+2*a[1])-f^3*g*(10*lambda*a[2]+2*a[1])+12*f*g*a[1]*a[2], f*g^3*(3*lambda*a[1]+2*a[2]*lambda^2+10*mu*a[2]+2*a[2]*(lambda^2-mu))-4*f*p*a[2]-6*k*l*a[2]-f^3*g*(3*lambda*a[1]+2*a[2]*lambda^2+10*mu*a[2]+2*a[2]*(lambda^2-mu))+6*f*g*(2*a[0]*a[2]+a[1]^2), f*g^3*(a[1]*(lambda^2-mu)+3*a[1]*mu+6*a[2]*lambda*mu)-4*f*p*a[1]-6*k*l*a[1]-f^3*g*(a[1]*(lambda^2-mu)+3*a[1]*mu+6*a[2]*lambda*mu)+12*f*g*a[0]*a[1]

See what the coefficients are of. If this is what you want then eqns has the correct equations.

monomials

1, (diff(G(xi), xi))^4/G(xi)^4, (diff(G(xi), xi))^3/G(xi)^3, (diff(G(xi), xi))^2/G(xi)^2, (diff(G(xi), xi))/G(xi)

NULL

 

Download collect-coe.mw

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