acer

32510 Reputation

29 Badges

20 years, 13 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

I suppose that there are several ways to get the plot, depending on which coordinate systems you'd rather use.

restart;

# radius and center of cylinder
(r,cx,cy) := 1/4,1/2,0;

1/4, 1/2, 0

plots:-display(
  plot3d(piecewise((x-cx)^2+(y-cy)^2<r^2,undefined,sqrt(1-x^2-y^2)),
       x=-1..1, y=-1..1,
       color=red,style=surface,grid=[200,200],transparency=0.5),
  plots:-spacecurve([r*cos(th)+cx,r*sin(th)+cy,
                     sqrt(1-(r*cos(th)+cx)^2-(r*sin(th)+cy)^2)],
                    th=0..2*Pi,color=yellow,thickness=5),
  plottools:-transform((x,y,z)->[x+cx,y+cy,ifelse(z>sqrt(1-(x+cx)^2-(y+cy)^2),
                                                     undefined,z)])(
    plot3d(r,th=0..2*Pi,z=0..1,grid=[201,201],coords=cylindrical,
           style=surface,color=cyan,transparency=0.5)),
  orientation=[-50,60,0],scaling=constrained,axes=normal,labels=["","",""]);


Download 3dplotfun.mw

The ImageTools:-Preview command uses a 3D plot and puts the image data on a flat plane and shows it oriented head-on, so that it looks like a flat 2D image.

The ImageTools:-Embed command embeds an image (as a GUI construct) into a so-called Task region, which as you've noticed always gets shown after the usual output portion of an Execution Group or Document Block (paragraph).

But since the ImageTools:-Preview command was devised, 2D plots got the ability to use an image with the background option. The resulting file is quite large when saved, but you might be OK with it scaled even smaller than 500 pixels wide.

restart;

with(ImageTools):

img := Read("download.png"):

newimg := Scale(img, 1..500):
(n,m) := (rhs-lhs+1)~([op(2,newimg)[1..2]])[]:

printf("Before image\n"):
plot(background=newimg, size=[m,n],':-axes'=':-none');
printf("After image\n"):

 

Download img_bg.mw

Using only uneval-quotes (ie, single right-ticks) here is not a robust way to prevent evaluation if you need to pass the expression (or a structure containing it) around in additional command/procedure calls.

The subsequent evaluations that occur for arguments of procedure calls will strip off uneval quotes, and produce the effect you're trying to avoid.

Instead, you could use an inert representation of the expression.

restart

with(plots)

f := InertForm:-Display('sqrt(888*s/(x*(3*y^2+1)))', inert = false)

Typesetting:-msqrt(Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mn("888"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mi("s")), Typesetting:-mrow(Typesetting:-mi("x"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mrow(Typesetting:-mn("3"), Typesetting:-mo("&InvisibleTimes;"), Typesetting:-msup(Typesetting:-mi("y"), Typesetting:-mn("2"))), Typesetting:-mo("&plus;"), Typesetting:-mn("1"))))))

test := textplot([[2, 3, f, 'rotation' = (1/4)*Pi, 'font' = ["times", "roman", 15]]], 'view' = [1 .. 3, 0 .. 4], size = [300, 300])

display(test)

test

NULL

NULL

Download undesired_textplot_format_ac.mw

Is this the kind of effect you're after?

[note: Here I'm starting with the problematic indexed name being present.]

(It could be tweaked/adjusted... I don't know the extent of the kinds of indexes you'd need handled, etc. There are even much simpler/shorter ways, if you only want to handle names indexed by posint, etc.)

restart

Evaluation with `&varphi;`[0] indexed

K := proc (nm::indexed) local v, i, res; v := op(0, nm); i := op(nm); res := Typesetting:-msub(Typesetting:-Typeset(Typesetting:-EV(v)), subs(Typesetting:-mi = Typesetting:-mn, Typesetting:-Typeset(Typesetting:-EV(i)))); nprintf(`#%a;`, res) end proc; Rep := proc () options operator, arrow; subsindets([args], typeindex(algebraic, name), K)[] end proc

K(phi[0])

`#Typesetting:-msub(Typesetting:-mi("&phi;"),Typesetting:-mn("0"));`

K(phi[a, b, c])

`#Typesetting:-msub(Typesetting:-mi("&phi;"),Typesetting:-mrow(Typesetting:-mn("a"),Typesetting:-mo("&comma;"),Typesetting:-mn("b"),Typesetting:-mo("&comma;"),Typesetting:-mn("c")));`

eq := -t(0)+t(`&varphi;`(t)) = Int(1/sqrt(2*C*cos(`&varphi;`)-2*C*cos(`&varphi;`[0])), `&varphi;` = 0 .. `&varphi;`(t), continuous)

-t(0)+t(varphi(t)) = Int(1/(2*C*cos(varphi)-2*C*cos(varphi[0]))^(1/2), varphi = 0 .. varphi(t), continuous)

H := t(0) = 0, `&varphi;`(t) = `&varphi;`[0], t(`&varphi;`[0]) = (1/4)*T

t(0) = 0, varphi(t) = varphi[0], t(varphi[0]) = (1/4)*T

new := subs(H, eq)

(1/4)*T = Int(1/(2*C*cos(varphi)-2*C*cos(varphi[0]))^(1/2), varphi = 0 .. varphi[0], continuous)

cond := C > 0, 0 < `&varphi;`[0] and `&varphi;`[0] < Pi

0 < C, 0 < varphi[0] and varphi[0] < Pi

new2 := Rep(new)

ans := isolate(`assuming`([simplify(value(new2))], [Rep(cond)]), T)

T = 4*InverseJacobiAM((1/2)*`#Typesetting:-msub(Typesetting:-mi("&varphi;"),Typesetting:-mn("0"));`, csc((1/2)*`#Typesetting:-msub(Typesetting:-mi("&varphi;"),Typesetting:-mn("0"));`))*csc((1/2)*`#Typesetting:-msub(Typesetting:-mi("&varphi;"),Typesetting:-mn("0"));`)/C^(1/2)


I don't know whether you want the list of replacements.

With that, you can undo the effect.

You can create such a list to involve just the one indexed name, or any found.
Ie, you can make it as targeted as you want, in case there are other indexed
names that you're prfer lest alone.

S := indets([eq, H], typeindex(algebraic, name))

{varphi[0]}

S := indets([eq, H], specindex(integer, varphi))

{varphi[0]}

L := map(proc (s) options operator, arrow; K(s) = s end proc, {varphi[0]})

{`#Typesetting:-msub(Typesetting:-mi("&varphi;"),Typesetting:-mn("0"));` = varphi[0]}

L := map(proc (s) options operator, arrow; K(s) = s end proc, S)

{`#Typesetting:-msub(Typesetting:-mi("&varphi;"),Typesetting:-mn("0"));` = varphi[0]}

subs(L, ans)

T = 4*InverseJacobiAM((1/2)*varphi[0], csc((1/2)*varphi[0]))*csc((1/2)*varphi[0])/C^(1/2)

lprint(%)

T = 4/C^(1/2)*InverseJacobiAM(1/2*varphi[0],csc(1/2*varphi[0]))*csc(1/2*varphi[
0])


Or you could use such replacement lists instead of procedure Rep.

Lrev := map(proc (s) options operator, arrow; s = K(s) end proc, S)

{varphi[0] = `#Typesetting:-msub(Typesetting:-mi("&varphi;"),Typesetting:-mn("0"));`}

new3 := subs(Lrev, new)

isolate(`assuming`([simplify(value(new3))], [subs(Lrev, [cond])[]]), T)

T = 4*InverseJacobiAM((1/2)*`#Typesetting:-msub(Typesetting:-mi("&varphi;"),Typesetting:-mn("0"));`, csc((1/2)*`#Typesetting:-msub(Typesetting:-mi("&varphi;"),Typesetting:-mn("0"));`))*csc((1/2)*`#Typesetting:-msub(Typesetting:-mi("&varphi;"),Typesetting:-mn("0"));`)/C^(1/2)

NULL

``

Download Evaluation_of_elliptic_integrals_ac.mw

If you just need to handle this one single indexed name, then here is an easier substitution, ie. directly constructed:

L := { varphi[0] = `#msub(mi("varphi"),mn("0"));` }

{varphi[0] = `#msub(mi("varphi"),mn("0"));`}

Of course, if you only needed a single substitution for varphi[0] then you might as well use,

    varphi[0] = varphi__0

which is of course easier still(!) and which you already know to work OK. I wrote you the earlier code so that the approach might be used for more complicated subscripted expressions or situations (for which a mere double-underscore could not suffice), programmatically. I don't know your full scenario(s).

Is this not fundamentally similar to your Question of Sept 2nd?

restart;

ode:=diff(m(t),t) = -k/m(t)^2:
ic:=m(0) = m__0:

simplify([dsolve(ode)])[];

m(t) = (-3*k*t+c__1)^(1/3), m(t) = -(1/2)*(-3*k*t+c__1)^(1/3)*(1+I*3^(1/2)), m(t) = (1/2)*(-3*k*t+c__1)^(1/3)*(-1+I*3^(1/2))

dsolve([ode,ic]) assuming m__0>0;
dsolve([ode,ic]) assuming m__0<0;

m(t) = (m__0^3-3*k*t)^(1/3)

m(t) = (1/2)*(m__0^3-3*k*t)^(1/3)*(-1+I*3^(1/2))


Download why_dsolve_cant_solve_ode_oct_4_2025_maple_ac.mw

I prefer the eval(..,..) way, and the thing you've actually requested is not a great approach IMO.

nb. One way to cause yourself grief is to re-order L, in which case your request can still be done, but in a different way(!) and with consequences that might be awkward for you. IMO this is a hint that it's not a good idea.

restart

with(ScientificConstants)

L := [c, e, m['e'], hbar, epsilon[0], alpha]

[c, e, m[e], hbar, epsilon[0], alpha]

T := Equate(L, `~`[proc (u) options operator, arrow; GetValue(Constant(u))*GetUnit(Constant(u)) end proc](L))

[c = 299792458*Units:-Unit(m/s), e = 0.1602176620e-18*Units:-Unit(C), m[e] = 0.9109383560e-30*Units:-Unit(kg), hbar = 0.1054571800e-33*Units:-Unit(m^2*kg/s), epsilon[0] = (625000/22468879468420441)*Units:-Unit(A^2*s^4/(m^3*kg))/Pi, alpha = 0.7297352566e-2]

``

First, a common way to use the values in expressions involving those names,
but without clobbering those names.

eval(e, T)

0.1602176620e-18*Units:-Unit(C)

expr := c*e

c*e

eval(expr, T)

0.4803204671e-10*Units:-Unit(m/s)*Units:-Unit(C)

Or, if you want...

assign(T)

expr

0.4803204671e-10*Units:-Unit(m/s)*Units:-Unit(C)

c

299792458*Units:-Unit(m/s)

m[e]

0.9109383560e-30*Units:-Unit(kg)

eval(L, 1)

[c, e, m[e], hbar, epsilon[0], alpha]

L

[299792458*Units:-Unit(m/s), 0.1602176620e-18*Units:-Unit(C), 0.9109383560e-30*Units:-Unit(kg), 0.1054571800e-33*Units:-Unit(m^2*kg/s), (625000/22468879468420441)*Units:-Unit(A^2*s^4/(m^3*kg))/Pi, 0.7297352566e-2]

Note:

m[(1.602176620*10^(-19))*Unit('C')]

0.9109383560e-30*Units:-Unit(kg)

NULL

Download Using_the_constants_ac.mw

When you issue,

   Physics:-Setup(assumingusesAssume = true)

the routine `convert/diff` is replaced. And your example's simplify call tries to do,

   convert( (D@@2)(y)(Pi), diff )

which then invokes `convert/diff`.

The replaced `convert/diff` procedure calls,

    Physics:-usepdiff

and (eventually) that causes a call like,

    Physics:-`usegdiff/subD`( (D@@2)(y)(Pi) )

which at one point treats Pi as if it were a variable (non-constant name)

It looks like the snippet,
    Df::'function(name)'
might be better as,
    Df::'function(And(name,Not(constant)))'
in the following Library code,

showstat(Physics::`usegdiff/subD`,1)

`usegdiff/subD` := proc(Df)
local D0, D00, D000, f, z, z2;
   1   if Df::':-`*`' and op(1,Df) = -1 then
           ...
       elif not Df::'function(name)' or Df::'function' and nops({op(Df)})
         < nops(Df) then
           ...
       else
           ...
       end if
end proc

The following example also goes wrong,

restart:
with(Physics):

convert((D@@2)(y)(Pi), diff);
Error, (in unknown) invalid input: diff received Pi, which is not valid for its 2nd argument

Perhaps I can make a hot-edit...

[edit] Well, the following appears to work, but ONLY if the first line conditional of the routine is exactly as it is in my Maple 2024.2. So -- like most such hot-fixes -- it won't be good if the routine has been otherwise changed in that respect.

I would guess that Edgardo or Austin might well fix it in the right/safer way, as part of the Physics Updates, if they see this post or if the pronlem is reported.

restart;

interface(verboseproc=3):

showstat(Physics::`usegdiff/subD`,1);


`usegdiff/subD` := proc(Df)
local D0, D00, D000, f, z, z2;
   1   if Df::':-`*`' and op(1,Df) = -1 then
           ...
       elif not Df::'function(name)' or Df::'function' and nops({op(Df)})
         < nops(Df) then
           ...
       else
           ...
       end if
end proc
 

__bzzz:=_Inert_FUNCTION(_Inert_NAME("And", _Inert_ATTRIBUTE(_Inert_NAME("protected", _Inert_ATTRIBUTE(_Inert_NAME("protected"))))),_Inert_EXPSEQ(_Inert_NAME("name", _Inert_ATTRIBUTE(_Inert_NAME("protected", _Inert_ATTRIBUTE(_Inert_NAME("protected"))))),_Inert_FUNCTION(_Inert_NAME("Not", _Inert_ATTRIBUTE(_Inert_NAME("protected", _Inert_ATTRIBUTE(_Inert_NAME("protected"))))), _Inert_EXPSEQ(_Inert_NAME("constant", _Inert_ATTRIBUTE(_Inert_NAME("protected", _Inert_ATTRIBUTE(_Inert_NAME("protected"))))))))):
kernelopts(opaquemodules=false):
unprotect(Physics:-`usegdiff/subD`):
Physics:-`usegdiff/subD`:=FromInert(subsop([5,1,2,1,1,1,2,1,2]=__bzzz,ToInert(eval(Physics:-`usegdiff/subD`)))):
protect(Physics:-`usegdiff/subD`):
kernelopts(opaquemodules=true):

 

Physics:-Setup(assumingusesAssume = true):

simplify((D@@2)(y)(Pi) = 0);

((D@@2)(y))(Pi) = 0

Download dodgy_hot.mw

The hang (in Maple 2024 at least), seems to depend on having both 

   with(Physics):

and that,

   PDEtools:-undeclare(...):

In fact it seems related just to the 2D prettyprinting of the constructed partial derivatives within the Vx Matrix result under default extended typesetting (and that loaded environment).

(You can check that claim by suppressing the relevant output by making the problematic line end with a full colon as statement terminator. You can also lprint it.)

So, one workaround is to not make that undeclare call. 

I didn't check whether the latest Physics update add-on the Maple 2024 fixes it.

Here is a shorter example that illustrates the hang (which can be avoided with several kinds of workaround...),

restart

kernelopts(version)

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

with(Physics)

PDEtools:-undeclare(prime)

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

diff(omega(x, t), t)

diff(omega(x, t), t)

R := diff(diff(omega(x, t), t), x)

 

lprint(R)

diff(diff(omega(x,t),t),x)


Printing this hangs

R

``

NULL

Download derivativve_ex01.mw

nb. You could also get by here with just,

    collect(F2,[theta1],normal)

The normal call smartens up those negative signs in the "coefficient".

restart;

 

B12 := -6*(p1 + p2)/(p1 - p2)^2:

F2 := (theta1*theta2*p1^2 + (-2*p2*theta1*theta2 - 6)*p1
      + theta1*theta2*p2^2 - 6*p2)/(p1 - p2)^2:

 

collect(F2,[theta1,theta2],normal);

theta2*theta1-6*(p1+p2)/(p1-p2)^2

Download janh_01.mw

You could scale your image to some desired size (in pixels).

restart;

with(ImageTools): with(LinearAlgebra):

M:=1/255*RandomMatrix(8,generator=0..255):
G:=convert(M,Image):

Embed(Scale(G,1..400,method=nearest));

Img_Scale.mw


ps. If you create your Matrix M with the datatype=float[8] option then you could Embed/Scale that, without having to convert to `Image`.

Your result from solve is an expression sequence (ie. a sequence of two expressions).

You can't just pass that sequence straight to the simplify command, as the arguments after the first would get interpreted as incorrectly specifying options. That's why you got that error message.

Instead, you could put those two results from solve into a list, and then simplify that.

restart

Pi1 := (w-i1)*(1/2+(i1-i2)/(2*tau))*(1-(Pn-Pr)/(1-delta))+(s-i1-Crr)*(1/2+(i1-i2)/(2*tau))*((Pn-Pr)/(1-delta)-(-beta*i1*upsilon+Pr)/delta)+Ce*rho0*(((Pn-Pr)/(1-delta)-(-beta*i1*upsilon+Pr)/delta)*eta+1-(Pn-Pr)/(1-delta))

diff(Pi1, i1) = 0

solve(%, i1)

simplify([%])

[(1/3)*(((-1+delta)*((-1+delta)*(tau^2+(6*Ce*eta*rho0-Crr-2*i2+s)*tau+Crr^2+(-2*s+i2)*Crr+s^2-i2*s+i2^2)*beta^2*upsilon^2-2*((s-(3/2)*w-(1/2)*i2-Crr+(1/2)*tau)*delta^2+((-(1/2)*Pr-1/2)*tau+(-(3/2)*Pn+Pr+1)*Crr+(-s+(3/2)*w+(1/2)*i2)*Pr+((3/2)*Pn-1)*s+(1/2)*i2+(-(3/2)*Pn+3/2)*w)*delta-(1/2)*Pr*(s+i2-Crr-tau))*beta*upsilon+(-1+delta)*(delta-Pr)^2))^(1/2)+((s+i2-Crr-tau)*delta-s-i2+Crr+tau)*beta*upsilon-delta^2+(Pr+1)*delta-Pr)/(beta*upsilon*(-1+delta)), (1/3)*(-((-1+delta)*((-1+delta)*(tau^2+(6*Ce*eta*rho0-Crr-2*i2+s)*tau+Crr^2+(-2*s+i2)*Crr+s^2-i2*s+i2^2)*beta^2*upsilon^2-2*((s-(3/2)*w-(1/2)*i2-Crr+(1/2)*tau)*delta^2+((-(1/2)*Pr-1/2)*tau+(-(3/2)*Pn+Pr+1)*Crr+(-s+(3/2)*w+(1/2)*i2)*Pr+((3/2)*Pn-1)*s+(1/2)*i2+(-(3/2)*Pn+3/2)*w)*delta-(1/2)*Pr*(s+i2-Crr-tau))*beta*upsilon+(-1+delta)*(delta-Pr)^2))^(1/2)+((s+i2-Crr-tau)*delta-s-i2+Crr+tau)*beta*upsilon-delta^2+(Pr+1)*delta-Pr)/(beta*upsilon*(-1+delta))]


Download Q_Simplify_ac.mw

Your worksheet contains the input,

   ScrollableMathTableOutput = false

but that would do nothing as Maple input. It's not an assignment and, more importantly, there is no such programmatic option. It can't do anything relevant here.

There can be a meaningful such line, if you add it using an external text editor (preferably while the Maple GUI is not running), in the GUI's stored configuration/preferences file. That is not a file of Maple commands. It's a file of stored GUI options/preferences.

I don't know whether that would resolve your problem. But note that your worksheet did not, in and of itself, disable matrix scrolling. So you may well not have actually successfully tried that yet.
 

ps. Your worksheet attachment was last saved using Maple 2025.0. It may not fix this particular issue, but you might otherwise benefit from the Maple 2025.1 point-release update.

The relevant thing that changed in Maple's behavior is that lowercase int began to try floating-point quadrature (aka numeric integration) in the case that it detects floats in the integrand. (Previously, it did that if only the numeric range contained floats.) This happens to have exposed a weakness in a particular numeric integration method.

So now your example (with the float in the integrand) is attempting numeric rather than symbolic integration, and it goes wrong using the _d01amc method.

Note however that you can disable that computational route, for the int command here, by supplying the numeric=false option. Then you'd get successful symbolic integration here, even for this example with a float in the integrand.

You could also get successful numeric integration here by forcing some other method (or raising Digits).

I believe that covers the relevant details. You can see the commonalities below, run with Maple 2022.2 versus Maple 2024.2. It is only the first variant below which changed, which behaves like the OP's example.

restart;

kernelopts(version);

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

infolevel[`evalf/int`]:=1:

int(1e6*exp(-1e6*t), t=0..infinity);

1.

infolevel[`evalf/int`]:=1:

int(1e6*exp(-1e6*t), t=0.0..infinity);

evalf/int/control: attempting Levin method

evalf/int/control: attempting Levin method

evalf/int/control: attempting Levin method

Control: Entering NAGInt

trying d01amc (nag_1d_quad_inf)

d01amc: result=0.

0.

restart;

infolevel[`evalf/int`]:=1:

evalf(Int(1e6*exp(-1e6*t), t=0..infinity));

evalf/int/control: attempting Levin method

evalf/int/control: attempting Levin method

evalf/int/control: attempting Levin method

Control: Entering NAGInt

trying d01amc (nag_1d_quad_inf)

d01amc: result=0.

0.

restart;

infolevel[`evalf/int`]:=1:

int(1e6*exp(-1e6*t), t=0.0..infinity, numeric=false);

1

restart;

map(M->int(1e6*exp(-1e6*t), t=0.0..infinity, method=M),
    [_d01amc,gquad,_Dexp,_d01ajc]);

[0., 1., 1.000000000, 1.]

restart;
Digits:=16:

map(M->int(1e6*exp(-1e6*t), t=0.0..infinity, method=M),
    [_d01amc,gquad,_Dexp,_d01ajc]);

[1., 1., 1.000000000000000, 1.]

Download int_deta_2022.2.mw

restart;

kernelopts(version);

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

infolevel[`evalf/int`]:=1:

int(1e6*exp(-1e6*t), t=0..infinity);

evalf/int/control: attempting Levin method

evalf/int/control: attempting Levin method

evalf/int/control: attempting Levin method

Control: Entering NAGInt

trying d01amc (nag_1d_quad_inf)

d01amc: result=0.

0.

infolevel[`evalf/int`]:=1:

int(1e6*exp(-1e6*t), t=0.0..infinity);

evalf/int/control: attempting Levin method

evalf/int/control: attempting Levin method

evalf/int/control: attempting Levin method

Control: Entering NAGInt

trying d01amc (nag_1d_quad_inf)

d01amc: result=0.

0.

restart;

infolevel[`evalf/int`]:=1:

evalf(Int(1e6*exp(-1e6*t), t=0..infinity));

evalf/int/control: attempting Levin method

evalf/int/control: attempting Levin method

evalf/int/control: attempting Levin method

Control: Entering NAGInt

trying d01amc (nag_1d_quad_inf)

d01amc: result=0.

0.

restart;

infolevel[`evalf/int`]:=1:

int(1e6*exp(-1e6*t), t=0.0..infinity, numeric=false);

1.

restart;

map(M->int(1e6*exp(-1e6*t), t=0.0..infinity, method=M),
    [_d01amc,gquad,_Dexp,_d01ajc]);

[0., 1., 1.000000000, 1.]

restart;
Digits:=16:

map(M->int(1e6*exp(-1e6*t), t=0.0..infinity, method=M),
    [_d01amc,gquad,_Dexp,_d01ajc]);

[1., 1., 1.000000000000000, 1.]

Download int_deta_2024.2.mw

For example,

type(y(x), And(typefunc(symbol,symbol),
               satisfies(u->nops(u)=1)));

                true

If you actually intended name instead of (either instance of) symbol then you could change accordingly.

The animate export of the solution modules returned by pdsolve,numeric is  considerately more efficient than generating frames as separate plots and thus repeatedly pushing the computation further out.

The results of separate animations can also be ripped out of each structure and then recombined so that they show together.

The following seems reasonably quick, taking about 12 seconds to do the computational work on my machine, ie. generating the 4*2*2*35=560 curves.

I've used Maple 2018, as the OP did.

restart

Nc := .3; M := 1.5; QG := 1.5; Thetaa := .2; n1 := 1; n2 := 0; lambda1 := .1; lambda2 := .1; lambda3 := .1p := 2; a := .5; alpha1 := (1/2)*PiNULL

p1 := 0.1e-1; p2 := 0.1e-1

rf := 997.1; kf := .613; cpf := 4179; betaf := 21*10^(-5)

betas1 := .85*10^(-5); rs1 := 3970; ks1 := 40; cps1 := 765

betas2 := 1.67*10^(-5); rs2 := 8933; ks2 := 401; cps2 := 385

z1 := 1/((1-p1)^2.5*(1-p2)^2.5)

knf := kf*(ks1+2*kf-2*p1*(kf-ks1))/(ks1+2*kf+p1*(kf-ks1)); khnf := knf*(ks2+2*knf-2*p2*(knf-ks2))/(ks2+2*knf+p2*(knf-ks2))

z2 := 1-p1-p2+p1*rs1/rf+p2*rs2/rf

z3 := 1-p1-p2+p1*rs1*cps1/(rf*cpf)+p2*rs2*cps2/(rf*cpf)

z4 := khnf/kf

z5 := 1-p1-p2+p1*rs1*betas1/(rf*betaf)+p2*rs2*betas2/(rf*betaf)

OdeSys := z4*(X*(diff(Theta(X, tau), X, X))+diff(Theta(X, tau), X))/z3-(diff(Theta(X, tau), tau))-Nc*(Theta(X, tau)-Thetaa)^2*z5/z1-M^2*(Theta(X, tau)-Thetaa)^(p+1)*(1+n1*z2/z3)/(z3*(1-Thetaa)^p)-Nr*(Theta(X, tau)^4-Thetaa^4)/z3+QG*X*(1+lambda1*(Theta(X, tau)-Thetaa)+lambda2*(Theta(X, tau)-Thetaa)^2+lambda3*(Theta(X, tau)-Thetaa)^3)/z3; Cond := {Theta(0, tau) = 1+a*sin(alpha1), Theta(X, 0) = 0, (D[1](Theta))(1, tau) = 0}

OdeSys1 := z4*(X*(diff(Theta(X, tau), X, X))+diff(Theta(X, tau), X))/z3-(diff(Theta(X, tau), tau))-Nc*(Theta(X, tau)-Thetaa)^2*z5/z1-M^2*(Theta(X, tau)-Thetaa)^(p+1)*(1+n2*z2/z3)/(z3*(1-Thetaa)^p)-Nr*(Theta(X, tau)^4-Thetaa^4)/z3+QG*X*(1+lambda1*(Theta(X, tau)-Thetaa)+lambda2*(Theta(X, tau)-Thetaa)^2+lambda3*(Theta(X, tau)-Thetaa)^3)/z3; Cond1 := {Theta(0, tau) = 1+a*sin(alpha1), Theta(X, 0) = 0, (D[1](Theta))(1, tau) = 0}

OdeSysa := z4*(X*(diff(Theta(X, tau), X, X))+diff(Theta(X, tau), X))/z3-(diff(Theta(X, tau), tau))-Nc*(Theta(X, tau)-Thetaa)^2*z5/z1-M^2*(Theta(X, tau)-Thetaa)^(p+1)*(1+n1*z2/z3)/(z3*(1-Thetaa)^p)-Nr*(Theta(X, tau)^4-Thetaa^4)/z3+QG*X*(1+lambda1*(Theta(X, tau)-Thetaa)+lambda2*(Theta(X, tau)-Thetaa)^2+lambda3*(Theta(X, tau)-Thetaa)^3)/z3; Conda := {Theta(0, tau) = 1+a*cos(alpha1), Theta(X, 0) = 0, (D[1](Theta))(1, tau) = 0}

OdeSysa1 := z4*(X*(diff(Theta(X, tau), X, X))+diff(Theta(X, tau), X))/z3-(diff(Theta(X, tau), tau))-Nc*(Theta(X, tau)-Thetaa)^2*z5/z1-M^2*(Theta(X, tau)-Thetaa)^(p+1)*(1+n2*z2/z3)/(z3*(1-Thetaa)^p)-Nr*(Theta(X, tau)^4-Thetaa^4)/z3+QG*X*(1+lambda1*(Theta(X, tau)-Thetaa)+lambda2*(Theta(X, tau)-Thetaa)^2+lambda3*(Theta(X, tau)-Thetaa)^3)/z3; Conda1 := {Theta(0, tau) = 1+a*cos(alpha1), Theta(X, 0) = 0, (D[1](Theta))(1, tau) = 0}

colour := [cyan, black]; colour1 := [red, blue]

NrVals := [2.5, 3.5]

NN := 35:
str := time[real]():
for j from 1 to nops(NrVals) do
Ans := pdsolve((eval([OdeSys,Cond],Nr=NrVals[j]))[],numeric,spacestep=1/200,timestep=1/100):
Ans1 := pdsolve((eval([OdeSys1,Cond1],Nr=NrVals[j]))[],numeric,spacestep=1/200,timestep=1/100):
Ansa := pdsolve((eval([OdeSysa,Conda],Nr=NrVals[j]))[],numeric,spacestep=1/200,timestep=1/100):
Ansa1 := pdsolve((eval([OdeSysa1,Conda1], Nr=NrVals[j]))[],numeric,spacestep=1/200,timestep=1/100):

eta[j] := Ans:-animate((int(z3*z5*Nc*(Theta(X, tau)-Thetaa)^2/(z1*z4)+NrVals[j]*(Theta(X, tau)^4-Thetaa^4)/z4+M^2*(Theta(X, tau)-Thetaa)^(p+1)*(1+n1*z2/z3)/(z4*(1-Thetaa)^p), X = 0 .. 1,numeric,epsilon=1e-5,method=_Dexp))/(z3*z5*Nc*(1-Thetaa)^2/(z1*z4)+NrVals[j]*(-Thetaa^4+1)/z4+M^2*(1-Thetaa)*(1+n1*z2/z3)/z4), tau = 0 .. 2, X = 0.01..1.0, frames=NN, linestyle = "solid", 'axes' = 'boxed', labels = [" &tau; ", " &eta; "], color = colour[j], title="X = %4.3f"):
eta1[j] := Ans1:-animate((int(z3*z5*Nc*(Theta(X, tau)-Thetaa)^2/(z1*z4)+NrVals[j]*(Theta(X, tau)^4-Thetaa^4)/z4+M^2*(Theta(X, tau)-Thetaa)^(p+1)*(1+n2*z2/z3)/(z4*(1-Thetaa)^p), X = 0 .. 1,numeric,epsilon=1e-5,method=_Dexp))/(z3*z5*Nc*(1-Thetaa)^2/(z1*z4)+NrVals[j]*(-Thetaa^4+1)/z4+M^2*(1-Thetaa)*(1+n2*z2/z3)/z4), tau = 0 .. 2, X = 0.01..1.0, frames=NN, linestyle = "dash", 'axes' = 'boxed', labels = [" &tau; ", " &eta; "], color = colour[j], title="X = %4.3f");
etaa[j] := Ansa:-animate((int(z3*z5*Nc*(Theta(X, tau)-Thetaa)^2/(z1*z4)+NrVals[j]*(Theta(X, tau)^4- Thetaa^4)/z4+M^2*(Theta(X, tau)-Thetaa)^(p+1)*(1+n1*z2/z3)/(z4*(1-Thetaa)^p), X = 0 .. 1,numeric,epsilon=1e-5,method=_Dexp))/(z3*z5*Nc*(1-Thetaa)^2/(z1*z4)+NrVals[j]*(-Thetaa^4+1)/z4+M^2*(1-Thetaa)*(1+n1*z2/z3)/z4), tau = 0 .. 2, X = 0.01..1.0, frames=NN, linestyle = "solid", 'axes' = 'boxed', labels = [" &tau; ", " &eta; "], color = colour1[j], title="X = %4.3f");
etaa1[j] := Ansa1:-animate((int(z3*z5*Nc*(Theta(X, tau)-Thetaa)^2/(z1*z4)+NrVals[j]*(Theta(X, tau)^4-Thetaa^4)/z4+M^2*(Theta(X, tau)-Thetaa)^(p+1)*(1+n2*z2/z3)/(z4*(1-Thetaa)^p), X = 0 .. 1,numeric,epsilon=1e-5,method=_Dexp))/(z3*z5*Nc*(1-Thetaa)^2/(z1*z4)+NrVals[j]*(-Thetaa^4+1)/z4+M^2*(1-Thetaa)*(1+n2*z2/z3)/z4), tau = 0 .. 2, X = 0.01..1.0, frames=NN, linestyle = "dash", 'axes' = 'boxed', labels = [" &tau; ", " &eta; "], color = colour1[j], title="X = %4.3f");

Plots1[j] := Ans1:-animate(Theta(X, tau), tau = 0..2, linestyle = "dash", labels = ["Y", Theta(Y, tau)], color = colour[j], 'axes' = 'boxed', frames=NN, title="tau = %4.3f");
 Plotsa[j] := Ansa:-animate(Theta(X, tau), tau = 0..2, linestyle = "solid", labels = ["Y", Theta(Y, tau)], color = colour1[j], 'axes' = 'boxed', frames=NN, title="tau = %4.3f");
 Plots[j] := Ans:-animate(Theta(X, tau), tau = 0..2, linestyle = "solid", labels = ["Y", Theta(Y, tau)], color = colour[j], 'axes' = 'boxed', frames=NN, title="tau = %4.3f");
 Plotsa1[j] := Ansa1:-animate(Theta(X, tau), tau = 0..2, linestyle = "dash", labels = ["Y", Theta(Y, tau)], color = colour1[j], 'axes' = 'boxed', frames=NN, title="tau = %4.3f");

end do:
(time[real]()-str)*`seconds`;

11.645*seconds

plots:-display(seq(plots:-display(seq([seq(PLOT(op([1,KK,..],RR[j]),op(2..,RR[j])),
                                           RR=[Plots,Plotsa,Plots1,Plotsa1])][],
                                      j=1..nops(NrVals))),
                   KK=1..NN),insequence,size=[700,700]);

plots:-display(seq(plots:-display(seq([seq(PLOT(op([1,KK,..],RR[j]),op(2..,RR[j])),
                                           RR=[eta,etaa,eta1,etaa1])][],
                                      j=1..nops(NrVals))),
                   KK=1..NN),insequence,size=[700,700]);

``

Download paper2_new_efficiency_plots_2025_acc.mw

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