acer

32303 Reputation

29 Badges

19 years, 307 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

I agree that it is a bug, the behaviour is at odds with the Description on the ?convert,Vector Help page which states that the default orientation is column.

I notice that Description says that an Array or list would each be passed straight to the Vector constructor. But notice the following difference in behavior (which appears to be the explanation of the behavioral side of the coin here):

A := Array([1, 2, 3]);

Vector[row](3, {(1) = 1, (2) = 2, (3) = 3})

Vector(A);

Vector[row](3, {(1) = 1, (2) = 2, (3) = 3})

L := [1,2,3];

[1, 2, 3]

Vector(L);

Vector(3, {(1) = 1, (2) = 2, (3) = 3})


It's possible that the person who wrote the ?convert,Vector Help page overlooked the fact that no single orientation satisfies that act of passing some structures straight to the constructor; ie. it varies by nature of the argument. It's even reasonable that someone might deem the appropriate fix to be to amend that documentation and retain the current behavior.

Having said that, I usually prefer do that kind of thing like,

    Vector[column](A);

I also convert-to-Matrix in a similar manner. Those constructor calls preserve datatype which is often quite important to me, and also storage=sparse (which, while much rarer for me, is something I'd often prefer my code respect by default unless I was deliberately coding to clobber it).

For example, if I had a list L I'd convert it to a Vector with,
    Vector(L)
rather than,
    convert(L,Vector)
which is both longer as well as (for my purposes, often) inferior. Similarly I'd handle a listlist LL with,
    Matrix(LL)
rather than,
    convert(LL,Matrix)

nb. In other words, I'd prefer to call the constructor directly, rather than write out a convert call which is more verbose while getting to the same act. I see less merit in calling convert in many such situations.

This was reported by someone else a little while ago, also for Maple 2025.

You might need to wait for the 2025.1 point-release, to get a GUI-update that fixes this.

(I do not believe that this can be fixed by a pure Library-side change, eg. in SupportTools).

That's the way it is, for 3D plots.

For 3D plots, the GUI places the largest "square" inside the inline plot window (the thing that has resizable borders, when you place the mouse focus on the plot). The `size` option only specifies the dimensions of the inlined plot window, and has no effect on the aspect ratios between the three extents of the displayed axes. I believe that the design intention is to allow the full plot to remain fully visible upon any manual rotation angles.

It is possible to use the DocumentTools package to embed an inline plot with the zoom factor programmatically specified. This can give the effect of stretching (only) horizontally, without the wasted white space above and below. If you look at the InlinePlot call in the very last example here ( Help Topic ?DocumentTools,Components,Plot ) then you can see such a programmatic zooming effect in which a long, short 3D thing is plotted without wasted vertical white space. (The effect is better see if you run the example in your Maple; the online Help page's rendering muddies the effect.)

The idea here is that the size option forces a long&short inlined plotting window, and then the rendered 3D plot seen through that window is forcibly zoomed in. That's the only way I know, to get such an effect programmatically at present. Another example, here.

Let us know, with an actual example, if you have trouble getting that effect to work for you. nb. I also don't know whether the effect maintains properly, on Close & Reopen of the sheet.

I've wanted 3D axes aspect ratios, as programmatic options, for some time now. But, in their absence, you're left with the choice of either unconstrained scaling (ie. all-equal aspect ratios) or a poor man's (still not fully satisfactory) effect if you manually rescale all your plot data/functions to mimic the desired aspect ratio.

The OP has encountered a common usage difficulty for users new to Maple.

In summary,
i) Using unevaluation quotes to delay the evaluation of the first argument works here, but is not the best general solution. Yes, it works for this example. But I've seen this usage devolve into even murkier difficulties far too often.
ii) Using irem vs modp happens to work for this example (and can have better efficiency) but is not by itself the best general solution because many similar difficulties arise for problems having nothing to do with modp/irem.
iii) The add command is more appropriate that sum here. It's specifically designed to better and more more generally handle this kind of issue. Yes, it's unfortunate that the 2D Input Sigma symbol is hooked into sum rather than add. But the allure of the typeset Sigma notation doesn't generally make up for the shortfalls of using sum in such situations.
iv) Similar distinctions can arise with product vs mul.

Altogether,
    add(irem(5, mul(2, t = 0 .. irem(q - 1, 3))), q = 1 .. 2)

And now, for some details,

restart;

sum(modp(5, product(2, t = 0 .. modp(q - 1, 3))), q = 1 .. 2);

10

The following is being evaluated, in the sum call, before q gets
any actual numeric value.

This call is being prematurely evaluated.

modp(5, product(2, t = 0 .. modp(q - 1, 3)));
eval(%,q=1)+eval(%,q=2);

modp(5, 2^(q+3))

10

One alternative is to delay the evaluation of the first
argument to the sum call, using single right-ticks
(a.k.a. unevaluation quotes)

sum('modp(5, product(2, t = 0 .. modp(q - 1, 3)))', q = 1 .. 2);

2

You can also get by with this, for this example,

sum(modp(5, 'product(2, t = 0 .. modp(q - 1, 3))'), q = 1 .. 2);

2

Hence you can also get by with the following.
nb. This is not as general a workaround, since not all sum evaluation
problems involve the tasks of modp or irem.

sum(irem(5, product(2, t = 0 .. irem(q - 1, 3))), q = 1 .. 2);

2

The previous example worked because the following happens
to return unevaluated for unknown q.

irem(5, product(2, t = 0 .. irem(q - 1, 3)))

irem(5, 2^(irem(q-1, 3)+1))

A generally better approach here is to use the add command instead of
the sum command.

The add command has so-called special evaluation rules, which
delays the evaluation of is first argument until the summation
index q gets some actual numeric values.

add(modp(5, product(2, t = 0 .. modp(q - 1, 3))), q = 1 .. 2);

2

You can also do the following: use add instead of sum, mul instead of
product (for the same reasons), and irem for suitability to this
particular computation (as well as efficiency).

add(irem(5, mul(2, t = 0 .. irem(q - 1, 3))), q = 1 .. 2);

2

Download sum_add_eval.mw

This is a common issue for new Maple users. There are lots of examples of this kind of problem on this forum.

There are also several Help Pages devoted specifically to the issue: eg,
1) special evaluation rules
2) sum vs add

Does this work for you? (Check that it makes good sense. It's late in the day...)

restart;

ode := y(x)*diff(y(x),x)-y(x)=A*x+B;

y(x)*(diff(y(x), x))-y(x) = A*x+B

book_sol := y(x)=_C1*t*exp( - Int( t/(t^2-t-A),t));

y(x) = _C1*t*exp(-(Int(t/(t^2-A-t), t)))

eq := x=_C1*exp(  - Int( t/(t^2-t-A),t))-B/A;

x = _C1*exp(-(Int(t/(t^2-A-t), t)))-B/A

new := t=RootOf(subs(t=_Z,rhs(eq))-x,_Z);

t = RootOf(_C1*exp(-(Int(-_Z/(-_Z^2+A+_Z), _Z)))*A-A*x-B)

eval(book_sol,new);

y(x) = _C1*RootOf(_C1*exp(-(Int(-_Z/(-_Z^2+A+_Z), _Z)))*A-A*x-B)*exp(-Intat(_a/(_a^2-A-_a), _a = RootOf(_C1*exp(-(Int(-_Z/(-_Z^2+A+_Z), _Z)))*A-A*x-B)))

odetest(eval(book_sol,new), ode);

0

alt := simplify(eval(book_sol,new));

y(x) = RootOf(c__1*exp(Int(_Z/(-_Z^2+A+_Z), _Z))*A-A*x-B)*(A*x+B)/A

odetest(alt, ode);

0


Download how_to_verify_parametric_solution_to_ode_ac.mw

You have defined the substitution equation T1 as,

   T1 := u(x, t) = U(-t*v + x)*exp(k(t*w + x)*I)

where you are missing a multiplication symbol between the k and the opening bracket. That gives you a function call k(t*w + x) , ie. a call to unknown function k. When you then substitute into the derivative wrt t the chain rule applies, and you get D(k)(...) terms.

You may have intended, instead,

   T1 := u(x, t) = U(-t*v + x)*exp(k*(t*w + x)*I)

restart

with(PDEtools)

undeclare(prime, quiet)

declare(u(x, t), quiet); declare(U(xi), quiet); declare(V(xi), quiet)

pde := I*(diff(u(x, t), `$`(t, 2))-s^2*(diff(u(x, t), `$`(x, 2))))+(1/24)*c[1]*(diff(u(x, t), t, `$`(x, 4)))-alpha*s*c[1]*(diff(u(x, t), `$`(x, 5)))+diff(c[2]*u(x, t)*U(-t*v+x)^2+c[3]*u(x, t)*U(-t*v+x)^4+c[4]*u(x, t)*(diff(U(-t*v+x)^2, `$`(x, 2))), t)-beta*s*(diff(u(x, t), `$`(x, 5)))+diff(c[2]*u(x, t)*U(-t*v+x)^2+c[3]*u(x, t)*U(-t*v+x)^4+c[4]*u(x, t)*(diff(U(-t*v+x)^2, `$`(x, 2))), x)

G1 := U(-t*v+x) = U(xi); G2 := (D(U))(-t*v+x) = diff(U(xi), xi); G3 := ((D@@2)(U))(-t*v+x) = diff(U(xi), `$`(xi, 2)); G4 := ((D@@3)(U))(-t*v+x) = diff(U(xi), `$`(xi, 3)); G5 := ((D@@4)(U))(-t*v+x) = diff(U(xi), `$`(xi, 4)); G6 := ((D@@5)(U))(-t*v+x) = diff(U(xi), `$`(xi, 5))

T := xi = -t*v+x; T1 := u(x, t) = U(-t*v+x)*exp(I*k*(t*w+x))

u(x, t) = U(-t*v+x)*exp(I*k*(t*w+x))

P1 := I*(diff(u(x, t), `$`(t, 2))-s^2*(diff(u(x, t), `$`(x, 2))))+(1/24)*c[1]*(diff(u(x, t), t, `$`(x, 4)))-alpha*s*c[1]*(diff(u(x, t), `$`(x, 5)))+diff(c[2]*u(x, t)*U(-t*v+x)^2+c[3]*u(x, t)*U(-t*v+x)^4+c[4]*u(x, t)*(diff(U(-t*v+x)^2, `$`(x, 2))), t)-beta*s*(diff(u(x, t), `$`(x, 5)))+diff(c[2]*u(x, t)*U(-t*v+x)^2+c[3]*u(x, t)*U(-t*v+x)^4+c[4]*u(x, t)*(diff(U(-t*v+x)^2, `$`(x, 2))), x)

P11 := eval(P1, {T, T1})

P111 := subs({G1, G2, G3, G4, G5, G6}, P11)

pde1 := P111 = 0

numer(lhs(pde1))*denom(rhs(pde1)) = numer(rhs(pde1))*denom(lhs(pde1))

%/(-exp(I*k(t*w+x)))

exp(I*k*(t*w+x))*(-48*(diff(U(xi), xi))*k*s^2-120*c[3]*U(xi)^4*(diff(U(xi), xi))+48*(diff(U(xi), xi))^3*v*c[4]-72*c[2]*U(xi)^2*(diff(U(xi), xi))-48*U(xi)^2*(diff(diff(diff(U(xi), xi), xi), xi))*c[4]+24*(diff(diff(diff(diff(diff(U(xi), xi), xi), xi), xi), xi))*beta*s+(diff(diff(diff(diff(diff(U(xi), xi), xi), xi), xi), xi))*v*c[1]+(24*I)*(diff(diff(U(xi), xi), xi))*s^2-(24*I)*(diff(diff(U(xi), xi), xi))*v^2-240*(diff(diff(diff(U(xi), xi), xi), xi))*alpha*k^2*s*c[1]+192*(diff(diff(U(xi), xi), xi))*(diff(U(xi), xi))*U(xi)*v*c[4]-(24*I)*U(xi)^5*k*w*c[3]+(24*I)*U(xi)*beta*k^5*s-I*U(xi)*k^5*w*c[1]-(240*I)*(diff(diff(U(xi), xi), xi))*beta*k^3*s-(4*I)*(diff(diff(U(xi), xi), xi))*k^3*v*c[1]+(6*I)*(diff(diff(U(xi), xi), xi))*k^3*w*c[1]-(24*I)*U(xi)^3*k*w*c[2]-(48*I)*(diff(diff(U(xi), xi), xi))*U(xi)^2*k*c[4]-(48*I)*(diff(U(xi), xi))^2*U(xi)*k*c[4]+(120*I)*(diff(diff(diff(diff(U(xi), xi), xi), xi), xi))*beta*k*s+(4*I)*(diff(diff(diff(diff(U(xi), xi), xi), xi), xi))*k*v*c[1]-I*(diff(diff(diff(diff(U(xi), xi), xi), xi), xi))*k*w*c[1]-48*(diff(U(xi), xi))^3*c[4]+120*(diff(U(xi), xi))*alpha*k^4*s*c[1]+120*c[3]*U(xi)^4*(diff(U(xi), xi))*v+120*(diff(U(xi), xi))*beta*k^4*s+(diff(U(xi), xi))*k^4*v*c[1]-4*(diff(U(xi), xi))*k^4*w*c[1]-48*(diff(U(xi), xi))*k*v*w+72*c[2]*U(xi)^2*(diff(U(xi), xi))*v+48*U(xi)^2*(diff(diff(diff(U(xi), xi), xi), xi))*v*c[4]-240*(diff(diff(diff(U(xi), xi), xi), xi))*beta*k^2*s-6*(diff(diff(diff(U(xi), xi), xi), xi))*k^2*v*c[1]+4*(diff(diff(diff(U(xi), xi), xi), xi))*k^2*w*c[1]-192*(diff(diff(U(xi), xi), xi))*(diff(U(xi), xi))*U(xi)*c[4]+24*(diff(diff(diff(diff(diff(U(xi), xi), xi), xi), xi), xi))*alpha*s*c[1]-(24*I)*U(xi)^5*k*c[3]-(24*I)*U(xi)^3*k*c[2]-(24*I)*U(xi)*k^2*s^2+(24*I)*U(xi)*k^2*w^2+(24*I)*U(xi)*alpha*k^5*s*c[1]-(240*I)*(diff(diff(U(xi), xi), xi))*alpha*k^3*s*c[1]-(48*I)*(diff(diff(U(xi), xi), xi))*U(xi)^2*k*w*c[4]-(48*I)*(diff(U(xi), xi))^2*U(xi)*k*w*c[4]+(120*I)*(diff(diff(diff(diff(U(xi), xi), xi), xi), xi))*alpha*k*s*c[1])/exp(I*k(t*w+x)) = 0


Download tr_ac.mw

Is this something like you what you're after, without the fractions? (Below are two ways, for this example)

restart

with(PDEtools)

undeclare(prime, quiet)

declare(u(x, t), quiet); declare(U(xi), quiet); declare(V(xi), quiet)

RR := (2*v*(1/3)+2*alpha*beta*(1/3))*U(xi)^3+(-3*alpha*k^2*lambda-4*alpha^2*k-k^2*v+2*k^2*w-4*k*v*w)*U(xi)+(alpha*lambda+v)*(diff(diff(U(xi), xi), xi)) = 0

IM := -2*(diff(diff(U(xi), xi), xi))*v*k-2*U(xi)*k^2*w^2-2*(diff(diff(U(xi), xi), xi))*alpha^2+2*(diff(diff(U(xi), xi), xi))*v^2+(diff(diff(U(xi), xi), xi))*k*w+2*U(xi)^3*k*w-2*U(xi)^3*alpha*beta*k-3*(diff(diff(U(xi), xi), xi))*alpha*k*lambda-U(xi)*k^3*w+2*U(xi)*alpha^2*k^2+U(xi)*alpha*k^3*lambda = 0

collect(%, {U(xi), diff(diff(U(xi), xi), xi)})

P := %

C1 := v = solve(2*v*(1/3)+2*alpha*beta*(1/3) = 0, v)

C2 := k = solve(-3*alpha*k^2*lambda-4*alpha^2*k-k^2*v+2*k^2*w-4*k*v*w = 0, k)

C22 := subs(C1, C2)

C222 := k = -(4*(-alpha*beta*w+alpha^2))/(-alpha*beta+3*alpha*lambda-2*w)

ode := subs({C1, C222}, P)

temp := numer(lhs(ode))*denom(rhs(ode)) = numer(rhs(ode))*denom(lhs(ode))

temp2 := simplify(temp)

temp3 := temp2/(-64*alpha)

PP := numer(lhs(temp3))*denom(rhs(temp3)) = numer(rhs(temp3))*denom(lhs(temp3))

expr := collect(PP, {U(xi), diff(U(xi), xi), diff(diff(U(xi), xi), xi)})

(-4*alpha^3*beta^4*w+24*alpha^3*beta^3*lambda*w-36*alpha^3*beta^2*lambda^2*w+4*alpha^4*beta^3-24*alpha^4*beta^2*lambda+36*alpha^4*beta*lambda^2-12*alpha^2*beta^3*w^2+24*alpha^2*beta^2*lambda*w^2+36*alpha^2*beta*lambda^2*w^2+12*alpha^3*beta^2*w-24*alpha^3*beta*lambda*w-36*alpha^3*lambda^2*w-48*alpha*beta*lambda*w^3+48*alpha^2*lambda*w^2+16*beta*w^4-16*alpha*w^3)*U(xi)^3+(32*alpha^3*beta^3*lambda*w^3-16*alpha^4*beta^3*w^2-48*alpha^4*beta^2*lambda*w^2-16*alpha^2*beta^3*w^4-48*alpha^2*beta^2*lambda*w^4+32*alpha^5*beta^2*w+32*alpha^3*beta^2*w^3+96*alpha^3*beta*lambda*w^3+32*alpha*beta^2*w^5-16*alpha^6*beta+16*alpha^6*lambda-16*alpha^4*beta*w^2-48*alpha^4*lambda*w^2-64*alpha^2*beta*w^4+32*alpha^3*w^3)*U(xi)+(-alpha^4*beta^5+9*alpha^4*beta^4*lambda-27*alpha^4*beta^3*lambda^2+27*alpha^4*beta^2*lambda^3-2*alpha^3*beta^4*w+6*alpha^3*beta^3*lambda*w+18*alpha^3*beta^2*lambda^2*w-54*alpha^3*beta*lambda^3*w-3*alpha^4*beta^3+21*alpha^4*beta^2*lambda-45*alpha^4*beta*lambda^2+27*alpha^4*lambda^3+6*alpha^2*beta^3*w^2-48*alpha^2*beta^2*lambda*w^2+90*alpha^2*beta*lambda^2*w^2-12*alpha^3*beta^2*w+48*alpha^3*beta*lambda*w-36*alpha^3*lambda^2*w+16*alpha*beta^2*w^3-48*alpha*beta*lambda*w^3-12*alpha^2*beta*w^2+12*alpha^2*lambda*w^2+8*beta*w^4)*(diff(diff(U(xi), xi), xi)) = 0

I suppose that you don't want the fractions in this result from simplify

ans0 := collect(PP, {U(xi), diff(U(xi), xi), diff(diff(U(xi), xi), xi)}, simplify)

16*(-alpha*beta+w)*((1/2)*(beta-3*lambda)*alpha+w)^2*(beta*w-alpha)*U(xi)^3+32*((1/2)*(-beta+lambda)*alpha^3+w*beta*alpha^2*lambda-(1/2)*w^2*(beta+3*lambda)*alpha+w^3)*alpha*(beta*w-alpha)^2*U(xi)+8*((1/2)*(-beta^3+3*beta^2*lambda-3*beta+3*lambda)*alpha^2+w*beta*(beta-3*lambda)*alpha+beta*w^2)*((1/2)*(beta-3*lambda)*alpha+w)^2*(diff(diff(U(xi), xi), xi)) = 0

alt1 := collect(PP, [U(xi), diff(U(xi), xi), diff(diff(U(xi), xi), xi)], factor)

4*(alpha*beta-w)*(alpha*beta-3*alpha*lambda+2*w)^2*(-beta*w+alpha)*U(xi)^3-16*(-2*alpha^2*beta*lambda*w+alpha^3*beta-alpha^3*lambda+alpha*beta*w^2+3*alpha*lambda*w^2-2*w^3)*alpha*(-beta*w+alpha)^2*U(xi)-(alpha^2*beta^3-3*alpha^2*beta^2*lambda-2*alpha*beta^2*w+6*alpha*beta*lambda*w+3*alpha^2*beta-3*alpha^2*lambda-2*beta*w^2)*(alpha*beta-3*alpha*lambda+2*w)^2*(diff(diff(U(xi), xi), xi)) = 0

simplify(PP-alt1)

0 = 0

alt2 := eval(collect(expr, [U(xi), diff(U(xi), xi), diff(diff(U(xi), xi), xi)], proc (u) options operator, arrow; subsindets(simplify(u), And(`+`, satisfies(proc (uu) options operator, arrow; type(denom(uu), {integer, `&*`(integer, specfunc(__K))}) end proc)), proc (uu) options operator, arrow; map(`*`, uu, denom(uu))/__K(denom(uu)) end proc) end proc), __K = (proc (u) options operator, arrow; u end proc))

4*(-alpha*beta+w)*((beta-3*lambda)*alpha+2*w)^2*(beta*w-alpha)*U(xi)^3+16*((-beta+lambda)*alpha^3+2*w*beta*alpha^2*lambda-w^2*(beta+3*lambda)*alpha+2*w^3)*alpha*(beta*w-alpha)^2*U(xi)+((-beta^3+3*beta^2*lambda-3*beta+3*lambda)*alpha^2+2*w*beta*(beta-3*lambda)*alpha+2*beta*w^2)*((beta-3*lambda)*alpha+2*w)^2*(diff(diff(U(xi), xi), xi)) = 0

simplify(PP-alt2)

0 = 0


Download B-R_ac.mw

> restart;
> kernelopts(version);
   Maple 2025.0, X86 64 LINUX, Mar 24 2025, Build ID 1909157

> A := -x*(x - 4*exp(x/2) + 2):
> B := x*sqrt((-8*x - 16)*exp(x/2) + x^2 + 4*x + 16*exp(x) + 4):

> simplify(simplify(A-B, {exp(x)=exp(x/2)^2})) assuming x::real;

                    0

Another way to forcibly attack the issue,

restart;

kernelopts(version);

`Maple 2024.2, X86 64 LINUX, Oct 29 2024, Build ID 1872373`

A := (-8*x - 16)*exp(x/2) + x^2 + 4*x + 16*exp(x) + 4;

(-8*x-16)*exp((1/2)*x)+x^2+4*x+16*exp(x)+4

simplify(A, {exp(x)=exp(x/2)^2});

(x-4*exp((1/2)*x)+2)^2

Download nm_simp_exA.mw

Naturally, many such temporary replacements may be constructed in an ad hoc manner. How well the system might be taught to do it automagically, I don't know.

restart;


The following canonicalization happens during the
automatic simplification stage, and so cannot be prevented
using unevaluation quotes.

'n>m';

m < n

But, an inert form will do.

G := InertForm:-Display(`%>`(n, m), 'inert'=false);

Typesetting:-mcomplete(Typesetting:-mrow(Typesetting:-mi("n"), Typesetting:-mo("&gt;"), Typesetting:-mi("m")), Typesetting:-_Hold([`%>`(n, m)]))

latex(G, output=string);

"n >m "


You could also easily write a reusable procedure/operator
to construct the above, for other arguments.

And, there are other ways. Eg,

H := `#mrow(mi("n"),mo("&gt;"),mi("m"));`;

`#mrow(mi("n"),mo("&gt;"),mi("m"));`

latex(H, output=string);

"n >m"

Download inert_gt_latex.mw

You posited, "It seems Maple like to make everything  based on "<" internally and that is why it reverses it?". Yes.

You can easily form a similar rule to sustitute in the reciprocals. And you could also use both within the single subs call, to avoid having to distinguish which is present (or even if both are present).

restart

PDEtools:-undeclare(prime)

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

S := (diff(G(xi), xi))^2-r^2*G(xi)^2*(a+b*G(xi)+l*G(xi)^2) = 0

(diff(G(xi), xi))^2-r^2*G(xi)^2*(a+b*G(xi)+l*G(xi)^2) = 0

SS := diff(G(xi), xi) = sqrt(r^2*G(xi)^2*(a+b*G(xi)+l*G(xi)^2))

diff(G(xi), xi) = (r^2*G(xi)^2*(a+b*G(xi)+l*G(xi)^2))^(1/2)

Se := sqrt(r^2*G(xi)^2*(a+b*G(xi)+l*G(xi)^2)) = diff(G(xi), xi)

(r^2*G(xi)^2*(a+b*G(xi)+l*G(xi)^2))^(1/2) = diff(G(xi), xi)

Se2 := map(proc (u) options operator, arrow; 1/u end proc, Se)

1/(r^2*G(xi)^2*(a+b*G(xi)+l*G(xi)^2))^(1/2) = 1/(diff(G(xi), xi))

dub := diff(SS, xi)

diff(diff(G(xi), xi), xi) = (1/2)*(2*r^2*G(xi)*(a+b*G(xi)+l*G(xi)^2)*(diff(G(xi), xi))+r^2*G(xi)^2*(b*(diff(G(xi), xi))+2*l*G(xi)*(diff(G(xi), xi))))/(r^2*G(xi)^2*(a+b*G(xi)+l*G(xi)^2))^(1/2)

Dubl2 := simplify(dub)

diff(diff(G(xi), xi), xi) = (1/2)*r^2*G(xi)*(diff(G(xi), xi))*(4*l*G(xi)^2+3*b*G(xi)+2*a)/(r^2*G(xi)^2*(a+b*G(xi)+l*G(xi)^2))^(1/2)

subs(Se2, Dubl2)

diff(diff(G(xi), xi), xi) = (1/2)*r^2*G(xi)*(4*l*G(xi)^2+3*b*G(xi)+2*a)

You can supply both, so you don't need to figure
out which applies.

subs(Se, Se2, Dubl2)

diff(diff(G(xi), xi), xi) = (1/2)*r^2*G(xi)*(4*l*G(xi)^2+3*b*G(xi)+2*a)

eval(Dubl2, [Se, Se2])

diff(diff(G(xi), xi), xi) = (1/2)*r^2*G(xi)*(4*l*G(xi)^2+3*b*G(xi)+2*a)

For fun, frontend'd simplify-with-side-relations

frontend(simplify, [Dubl2, {Se}], [{`*`, `+`, `=`, set}, {}])

diff(diff(G(xi), xi), xi) = (1/2)*r^2*G(xi)*(4*l*G(xi)^2+3*b*G(xi)+2*a)

Download subs_ac.mw

One fault seems to be that the derivativedivides method fails for integrand_2, while it succeeds (and produces that simpler result) for integrand_1.

A second fault is that int returns the result with ln and I=sqrt(-1) (which can obtain from the risch method) for integrand_2 instead of returning the better result from the orering method. The orering method's result is longer, but doesn't contain I or ln, and can be simplified directly to the short result using merely the normal command.

restart;

kernelopts(version);

`Maple 2024.2, X86 64 LINUX, Oct 29 2024, Build ID 1872373`

integrand_1:=x^2*(-arctan(x) + x)*exp(-arctan(x) + x)/(x^2 + 1);

x^2*(-arctan(x)+x)*exp(-arctan(x)+x)/(x^2+1)

int(integrand_1,x,method=DDivides);

(-arctan(x)+x)*exp(-arctan(x)+x)-exp(-arctan(x)+x)

integrand_2:=evala(integrand_1);

-x^2*(arctan(x)-x)*exp(-arctan(x)+x)/(x^2+1)

int(integrand_2,x,method=DDivides);

int(-x^2*(arctan(x)-x)*exp(-arctan(x)+x)/(x^2+1), x, method = DDivides)

normal( int(integrand_2,x,method=orering) );

-(arctan(x)-x+1)*exp(-arctan(x)+x)

anti_2:=int(integrand_2,x); # from Risch method it seems

-(1-x+((1/2)*I)*ln(1-I*x)-((1/2)*I)*ln(1+I*x))*(1-I*x)^(-(1/2)*I)*(1+I*x)^((1/2)*I)*exp(x)

simplify(evalc(diff(anti_2,x)-integrand_2)); # check, for x::real at least

0

simplify(combine(evalc(anti_2)));

(-arctan(x)+x-1)*exp(-arctan(x)+x)


Download int_weakness_02.mw

There are at least two parts to this Question.

1) Your evalf (at default Digits=10 working precision) does not produce 10 accurate
digits of an apprximation of the second exact root obtained by solve. Substituting
the poor root approximation happens to also produce zero in the denominator.
But substituting a more accurate approximation happens not to.

2) Your plotting problem is the same as in one of your earlier Questions from today. (This site has faulty inlined display of the worksheet below, but my actual worksheet contains the adaptive=true and smartview=false options.)
 

restart

S := [solve(x^2/(10^(-8)-x) = 5*10^(-3))]

[-1/400-(3/200000)*27778^(1/2), -1/400+(3/200000)*27778^(1/2)]

evala(eval(x^2/(10^(-8)-x), x = S[1]))

1/200

evala(eval(x^2/(10^(-8)-x), x = S[2]))

1/200


This is not an accurate approximation of S.
It is not accurate to Digits=10 decimal places.

evalf[10](S)

[-0.5000010000e-2, 0.10000e-7]


This is a better approximation.

evalf[20](S)

[-0.50000099999800000800e-2, 0.99999800000800e-8]

eval(x^2/(10^(-8)-x) = 5*10^(-3), x = 9.999980000*10^(-9))

0.4999980000e-2 = 1/200

f := proc (x) options operator, arrow; x^2/(1/100000000-x) end proc = proc (x) options operator, arrow; x^2/(1/100000000-x) end proc 

plot(f, .99999*10^(-8) .. .999999*10^(-8), smartview = false)

plot(f, .99999*10^(-8) .. .999999*10^(-8), smartview = false, adaptive = true)

NULL

Download plotq_ac.mw

The small imaginary components of your result can be seen to be an artefect of solving a cubic in terms of radicals, and then computing as a floating-point approximation (in which case the small imaginary artefacts don't vanish due to floating-point concerns -- roundoff error, loss or precision, etc).

You can read about the notion that the purely real roots of some cubics may not be expressible in terms of radicals without the "I" (ie. sqrt(-1)) being present. But a reformulation in terms of trig expressions can get a form in which "I" does not appear, and for which floating-point evaluation produces no such small imarginary artefacts.

restart

S := [solve((x^2-10^(-14))/(10^(-3)-x+10^(-14)/x) = 5*10^(-3), x)]

evalf(S)

[0.854101976e-3-0.4e-11*I, -0.5854101969e-2-0.465063510e-12*I, -0.9e-11+0.3865063510e-11*I]


Increasing the working precision makes the float approaximation
of S have even smaller (artefacts of) imaginary components.

evalf[20](S)

[0.8541019764671763721e-3-0.4e-21*I, -0.58541019664671764921e-2-0.12310889132455352635e-21*I, -0.99999998801e-11+0.48310889132455352635e-21*I]

evalc(S)

[(1/15000000)*4000000003^(1/2)*sin((1/3)*arctan((3/237499999550000)*843750039749999989500000003^(1/2))+(1/6)*Pi)-1/600, -(1/30000000)*4000000003^(1/2)*sin((1/3)*arctan((3/237499999550000)*843750039749999989500000003^(1/2))+(1/6)*Pi)-1/600-(1/30000000)*3^(1/2)*4000000003^(1/2)*cos((1/3)*arctan((3/237499999550000)*843750039749999989500000003^(1/2))+(1/6)*Pi), -(1/30000000)*4000000003^(1/2)*sin((1/3)*arctan((3/237499999550000)*843750039749999989500000003^(1/2))+(1/6)*Pi)-1/600+(1/30000000)*3^(1/2)*4000000003^(1/2)*cos((1/3)*arctan((3/237499999550000)*843750039749999989500000003^(1/2))+(1/6)*Pi)]

evalf(evalc(S))

[0.854101977e-3, -0.5854101968e-2, -0.10e-10]

eq := (x^2-10^(-14))/(10^(-3)-x+10^(-14)/x) = 5*10^(-3)

(x^2-1/100000000000000)/(1/1000-x+(1/100000000000000)/x) = 1/200


A lovely cubic, whose roots correspond to S above.

ee := numer((lhs-rhs)(eq))

-20000000000000000*x^3-100000000000000*x^2+100000000200*x+1


Better than evalf(...(solve(...)...) is to use fsolve on the cubic.

fsolve(ee)

-0.5854101966e-2, -0.9999999880e-11, 0.8541019765e-3

evalf(solve(ee))

0.854101976e-3-0.4e-11*I, -0.5854101969e-2-0.465063510e-12*I, -0.9e-11+0.3865063510e-11*I

NULL

Download concentrations_ac.mw

I marked your Question to be Product=Maple 2022, since that's the version in which your attachment was last saved. It'd be more helpful if you could mark the Product version yourself, for future Questions.

In Maple 2022 your examples are running into issues with the (then new) adaptive=geometric default, and/or the default smartview=true option. Some improvement might be had automatically in the newer Maple 2025.

Each of your examples can be forced to comply (in versions M2022 to M2025) by adjusting those options:

restart

plots:-setoptions(thickness = 3)

kernelopts(version)

`Maple 2022.2, X86 64 LINUX, Oct 23 2022, Build ID 1657361`

plot(-log[10](0.1e-3+x), x = 0 .. 10, adaptive = true, smartview = false)

x := -0.2550000000e-2+0.5000000000e-4*sqrt(2601.+(2.000000000*10^6)*C__i)

-0.2550000000e-2+0.5000000000e-4*(2601.+2000000.000*C__i)^(1/2)

plot(-log[10](0.1e-3+x), C__i = 0 .. 10, adaptive = true, smartview = false)

I want to see the plot being 4 at C__i = 0.

 

Note that subs({C__i = 0}, x) = 0. and evalf(subs({C__i = 0}, -log[10](0.1e-3+x))) = 4.000000000 

NULL

plot(-log[10](0.1e-3+x), C__i = 0 .. 1, smartview = false, adaptive = true)

plot(-log[10](0.1e-3+x), C__i = 0 .. 1, view = [0 .. 1, 1 .. 4], adaptive = true)

plot(-log[10](0.1e-3+x), C__i = 0 .. 1, view = [0 .. .1, 1 .. 4], adaptive = true)

NULL

Download plotatzero_ac.mw

2 3 4 5 6 7 8 Last Page 4 of 336