acer

32989 Reputation

29 Badges

20 years, 161 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

The plots:-inequal command, which you're already using, provides options for fine control of the lines.

But you have already included the 'nolines' option. So, instead of using that you could simply specify the color of the lines (and without a specified linestyle, it won't be dotted).

Also, you can supply options to implicitplot (which plots:-inequal uses under the hood), to get more clearly defined internal edges of the colored regions (even when the lines are not made visible).

For example,

restart

with(plots)

SW_b := (((8*tau*epsilon2-8*Cv+8*Phi)*theta+(3*(Cr-Cv-4*epsilon1*(1/3)))*(Cr-Cv))*Ct^2-((8*tau*epsilon2-8*Cv+8*Phi)*theta+(Cr-Cv)*(Cr-Cv-2*epsilon1))*theta*Ct-2*theta^3*(-tau*epsilon2+Cv-Phi))/(2*(2*Ct-theta)^2*theta)

SW_s := (((8*tau*epsilon2-8*Cv+8*Phi)*theta-(-Cr+Cv+s)*(s+3*Cr-3*Cv-4*epsilon1))*Ct^2+theta*((-8*tau*epsilon2+8*Cv-8*Phi)*theta+(-Cr+Cv+s)*(s-2*epsilon1+Cr-Cv))*Ct-2*theta^3*(-tau*epsilon2+Cv-Phi))/(2*(2*Ct-theta)^2*theta)

SW_i := (((8*tau*epsilon2-8*Cv+8*Phi)*theta+(3*(Cr-Cv))*(-Cv-4*tau*(delta-1)*epsilon2*(1/3)+Cr-4*epsilon1*(1/3)))*Ct^2-((8*tau*epsilon2-8*Cv+8*Phi)*theta+(Cr-Cv)*(-Cv-2*tau*(delta-1)*epsilon2+Cr-2*epsilon1))*theta*Ct-2*theta^3*(-tau*epsilon2+Cv-Phi))/(2*(2*Ct-theta)^2*theta)

DATA := [Cv = .75, delta = .6, Cr = .73, s = .3, tau = .5, Cepr = .3, Phi = .95, epsilon1 = 0.2e-1, epsilon2 = 0.1e-1]

DATA1 := [Cv = .8, delta = .6, Ct = .3, theta = .1, tau = .5, Cepr = .3, Phi = .95, epsilon1 = 0.5e-1, epsilon2 = 0.25e-1]

TM1, TM2, TM3 := (eval([SW_b, SW_s, SW_i], DATA))[]

display(inequal({2*Ct < theta}, Ct = 0 .. .9, theta = .1 .. .9, color = "Chartreuse", transparency = .4, optionsimplicit = [gridrefine = 2, crossingrefine = 7], optionsclosed = [color = black, thickness = 0.5e-1, transparency = 1.0], optionsopen = [color = black, thickness = 2]), inequal({TM2 > max(TM1, TM3)}, Ct = 0 .. .9, theta = .1 .. .9, nolines, color = "LightGray", transparency = .4, optionsimplicit = [gridrefine = 2, crossingrefine = 7], optionsclosed = [color = black, thickness = 0.5e-1, transparency = 1.0], optionsopen = [color = black, thickness = 2]), inequal({TM1 > max(TM3, TM2)}, Ct = 0 .. .9, theta = .1 .. .9, color = "Moccasin", transparency = .4, optionsimplicit = [gridrefine = 2, crossingrefine = 7], optionsclosed = [color = black, thickness = 0.5e-1, transparency = 1.0], optionsopen = [color = black, thickness = 2]), textplot([.6, .7, `#msubsup(mi("SW"),mi(""),mn("S"));` > MAX(SW^B, SW^I)], font = [Verdana, 10, bold]), textplot([.17, .8, Infeasible(2*C__t < theta)], font = [Verdana, 10, bold]), textplot([.6, .15, `#msubsup(mi("SW"),mi(""),mn("B"));` > MAX(SW^S, SW^I)], font = [Verdana, 10, bold]), labels = [C__t, typeset(theta)], labelfont = [Verdana, bold, 14], axesfont = [Verdana, bold, 12], caption = typeset('s' = eval(s, DATA), ", ", 'Cv' = eval(Cv, DATA), ", ", 'tau' = eval(tau, DATA)))

TMA1, TMA2, TMA3 := (eval([SW_b, SW_s, SW_i], DATA1))[]

display(inequal({TMA3 > max(TMA1, TMA2)}, Cr = .65 .. .9, s = .2 .. .9, color = "Chartreuse", transparency = .4, optionsclosed = [color = black, thickness = 0.5e-1, transparency = 1.0], optionsopen = [color = black, thickness = 2]), inequal({TMA2 > max(TMA1, TMA3)}, Cr = .65 .. .9, s = .2 .. .9, nolines, color = "LightGray", transparency = .4), inequal({TMA1 > max(TMA3, TMA2)}, Cr = .65 .. .9, s = .2 .. .9, nolines, color = "Moccasin", transparency = .4), textplot([.7, .3, `#msubsup(mi("SW"),mi(""),mn("S"));` > MAX(SW^B, SW^I)], font = [Verdana, 9, bold]), textplot([.85, .6, `#msubsup(mi("SW"),mi(""),mn("I"));` > MAX(SW^B, SW^S)], font = [Verdana, 9, bold]), textplot([.72, .8, `#msubsup(mi("SW"),mi(""),mn("B"));` > MAX(SW^S, SW^I)], font = [Verdana, 9, bold]), labels = [C__r, typeset(s)], labelfont = [Verdana, bold, 14], axesfont = [Verdana, bold, 12], caption = typeset('Ct' = eval(Ct, DATA1), ", ", 'Cv' = eval(Cv, DATA1), ", ", 'theta' = eval(theta, DATA1)))

 

 

Download Regional_new_ac.mw

It seems that the expanded ln term on the rhs is the problem.

By utlizing combine on that term, either solve or RealDomain:-solve can be used.

These work quickly,

restart;

kernelopts(version);

`Maple 2025.2, X86 64 LINUX, Nov 11 2025, Build ID 1971053`

eqn := ln((y-1)^(1/3)*(y^2+y+1)^(1/3))-ln(y) = 2/5*ln(t^2+1)+_C;

ln((y-1)^(1/3)*(y^2+y+1)^(1/3))-ln(y) = (2/5)*ln(t^2+1)+_C

 

A := simplify({ solve(combine(eqn), y) });

{(-(-1+(t^2+1)^(6/5)*exp(3*_C))^2)^(1/3)/(-1+(t^2+1)^(6/5)*exp(3*_C)), (-(-1+(t^2+1)^(6/5)*exp(3*_C))^2)^(1/3)*(I*3^(1/2)-1)/(-2+(2*t^2+2)*exp(3*_C)*(t^2+1)^(1/5)), -(-(-1+(t^2+1)^(6/5)*exp(3*_C))^2)^(1/3)*(1+I*3^(1/2))/(-2+(2*t^2+2)*exp(3*_C)*(t^2+1)^(1/5))}

 

select(is, simplify(A), real)[] assuming real;

-((-1+(t^2+1)^(6/5)*exp(3*_C))^2)^(1/3)/(-1+(t^2+1)^(6/5)*exp(3*_C))

 

new := combine((lhs-rhs)(eqn)) assuming real;

ln(((y^2+y+1)*(y-1))^(1/3))-ln(y*(t^2+1)^(2/5))-_C

simplify( RealDomain:-solve(new, y ) );

(-(-1+(t^2+1)^(6/5)*exp(3*_C))^2)^(1/3)/(-1+(t^2+1)^(6/5)*exp(3*_C))


Note:

(2*ln(t^2 + 1))/5;
combine(%);
%; # evaluation re-expands it

(2/5)*ln(t^2+1)

ln((t^2+1)^(2/5))

(2/5)*ln(t^2+1)

Download nm_solve_01.mw

Here are various ways you can evaluate the fitted polynomial at arbitrary values of the independent variable.

You can do it with or without forming the polynomial explicitly. You can do it using procedures or eval. And, if forming the procedure explicitly, you can do it with expanded form or Horner form.

The very simplest way (shown at end), is to simply pass an extra name as an argument to the command, and have the command return the explicit polynomial rather than (as you had it) a Vector of the coefficients:
    Statistics:-PolynomialFit(10, X, Y, x)
See also the Help-page, which also describes a returned solution-module which can access various statistics, etc.

And you can then evaluate it for single values, or map that across the elements of X (or any other Vector).

Here are several of those choices. The second to sixth ways include forming the polynomial explicitly. It's your choice whether to also convert such to Horner form.

I also show the ~ syntax for so-called elementwise application of commands, which is a terse way to apply the evaluation across a Vector such as your X.

restart;

X := [seq(0..7,0.5)]:

Y := sin~(X):

PRModel:=Statistics:-PolynomialFit(10, X, Y):


First way: construct a procedure which directly evaluates the polynomial
at the input argument, using a Horner scheme.

Jfun1 := proc(x) local i,S:=0;
           for i from 11 to 1 by -1 do
             S := PRModel[i] + x*S;
           end do;
         return S;
         end proc:

estY := Jfun1~(X);

[HFloat(1.9208708381930906e-7), HFloat(0.4794239159651831), HFloat(0.8414766422714055), HFloat(0.9974850987214798), HFloat(0.9093045947032634), HFloat(0.5984752801663451), HFloat(0.1411117728798407), HFloat(-0.35078291176548543), HFloat(-0.756794509857144), HFloat(-0.9775336934640078), HFloat(-0.9589307175743441), HFloat(-0.7055309585508787), HFloat(-0.27942094279818397), HFloat(0.2151215624411235), HFloat(0.6569864113745757)]

plots:-listplot(estY-Y, size=[600,200]);


Second way: create the explicit polynomial from the Vector PRModel,
                     in Horner form, and then construct a procedure from
                     that expression.

Jfun2 := unapply(foldl( (id,g)->PRModel[g]+x*id, 0, 11-i$i=0..10 ),x);

proc (x) options operator, arrow; HFloat(1.9208708381930906e-7)+x*(HFloat(0.9989224786296512)+x*(HFloat(0.0053770259750101496)+x*(-HFloat(0.17716223340632256)+x*(HFloat(0.01083688759880518)+x*(HFloat(0.0016666827576776375)+x*(HFloat(0.0025752993394169478)+x*(-HFloat(8.295512490827164e-4)+x*(HFloat(9.43697800045293e-5)+x*(-HFloat(4.584687457675352e-6)+HFloat(7.544661906532768e-8)*x))))))))) end proc

estY - Jfun2~(X);

[HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(0.0), HFloat(0.0)]


Third way: create the explicit polynomial from the Vector PRModel,
                  as a sum of coefficients multiplies by powers of x,
                  then convert that to Horner form, and then construct the
                  procedure from that.

Jfun3 := unapply(convert(add(PRModel[i]*x^(i-1),i=1..11),horner),x);

proc (x) options operator, arrow; HFloat(1.9208708381930906e-7)+x*(HFloat(0.9989224786296512)+x*(HFloat(0.0053770259750101496)+x*(-HFloat(0.17716223340632256)+x*(HFloat(0.01083688759880518)+x*(HFloat(0.0016666827576776375)+x*(HFloat(0.0025752993394169478)+x*(-HFloat(8.295512490827164e-4)+x*(HFloat(9.43697800045293e-5)+x*(-HFloat(4.584687457675352e-6)+HFloat(7.544661906532768e-8)*x))))))))) end proc

estY - Jfun3~(X);

[HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(0.0), HFloat(0.0)]

 

Fourth way: same as third way, but construct the polynomial by the call
                    to PolynomialFit with a variable name (here, x) passed
                    as 4th argument.

 

poly := Statistics:-PolynomialFit(10, X, Y, x):
Jfun4 := unapply(convert(poly,horner),x);

proc (x) options operator, arrow; HFloat(1.9208708381930906e-7)+x*(HFloat(0.9989224786296512)+x*(HFloat(0.0053770259750101496)+x*(-HFloat(0.17716223340632256)+x*(HFloat(0.01083688759880518)+x*(HFloat(0.0016666827576776375)+x*(HFloat(0.0025752993394169478)+x*(-HFloat(8.295512490827164e-4)+x*(HFloat(9.43697800045293e-5)+x*(-HFloat(4.584687457675352e-6)+HFloat(7.544661906532768e-8)*x))))))))) end proc

estY - Jfun4~(X);

[HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(0.0), HFloat(0.0)]

 

Note: The second to fourth ways all constructed an explicit polynomial
as an initial step, and then constructed a reusable procedure from that.
Those procedures could each be applied to any x-value, or be applied
elementwise to all values in X. That's what was done above.

But if you have such a polynomial then you could also evaluate it directly
at any x-value by using the eval command. In other words, you don't have to

construct a procedure from that explicit polynomial.

Fifth way: Below I use elementwise syntax to use eval on all values in Vector X.
Note the small numric difference between this and the earlier approach.

 

estY - eval~(poly, x=~X);
fnormal(%);

[HFloat(0.0), HFloat(0.0), HFloat(-2.220446049250313e-16), HFloat(2.3092638912203256e-14), HFloat(4.440892098500626e-16), HFloat(2.5315860519015132e-11), HFloat(-2.7755575615628914e-16), HFloat(4.863809355271087e-11), HFloat(-1.887379141862766e-15), HFloat(-1.4138414883291262e-9), HFloat(8.104628079763643e-15), HFloat(-1.7425811238425126e-8), HFloat(-1.554312234475219e-14), HFloat(4.830070979289225e-8), HFloat(-4.9182879990894435e-14)]

[0., 0., -0., 0., 0., 0., -0., 0., -0., -0., 0., -0.1742581124e-7, -0., 0.4830070979e-7, -0.]


Using this approach, with slightly greater working precision, attains
values which agree more closely with the earlier approaches.

estY - evalf[12](eval~(poly, x=~X));
fnormal(%);

[HFloat(0.0), HFloat(0.0), HFloat(-2.220446049250313e-16), HFloat(-1.1102230246251565e-16), HFloat(4.440892098500626e-16), HFloat(-2.3203661214665772e-14), HFloat(-2.7755575615628914e-16), HFloat(4.799827202361939e-12), HFloat(-1.887379141862766e-15), HFloat(2.313171876267006e-11), HFloat(8.104628079763643e-15), HFloat(4.193736469204623e-10), HFloat(-1.554312234475219e-14), HFloat(-7.038293003969187e-10), HFloat(-4.9182879990894435e-14)]

[0., 0., -0., -0., 0., -0., -0., 0., -0., 0., 0., 0., -0., -0., -0.]


You might ask, is that small floating-point discrepency due to using eval vs procedures,
or due to using expanded vs Horner form? (Answer: it was due to the form, not due to using eval)

Sixth way: same as fifth way, using eval, but now on the Horner form polynomial expression.

poly2 := convert(poly,horner):

estY - eval~(poly2, x=~X);

[HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(-0.0), HFloat(0.0), HFloat(0.0)]

Download regr_fun.mw

You had misplaced extra double-quotes in your color strings, eg, ""Red".

The markup for those subscripted items is a kind of name, and with the special characters such names have to be enclosed in single left-ticks (aka name-quotes in Maple). Eg,

    `#msubsup(mi("&pi;"),mi("r"),mn("B"));`

and not just (as you had it),

    #msubsup(mi("&pi;"),mi("r"),mn("B"));

which gets interpreted as a comment since the # is bare.

nb. Those left-ticks might not(!) show in the rendering on the inlined worksheet below. See the attached worksheet in actual Maple.

restart

with(plots)

_local(Pi)

DATA := [Cv = .9, Cr = .54, tau = .1, Phi = .95, epsilon = 0.1e-1, s = 0.2e-1, delta = .7, Ct = .8]

L1 := ((4*tau*Ce*theta+(Cr-Cv)^2)*Ct-2*Ce*tau*theta^2)/(4*Ct*theta-2*theta^2)

L2 := ((4*tau*Ce*theta+(-Cr+Cv+s)^2)*Ct-2*Ce*tau*theta^2)/(4*Ct*theta-2*theta^2)

L3 := ((4*tau*Ce*theta+(Cr-Cv)^2)*Ct-2*Ce*tau*theta^2)/(4*Ct*theta-2*theta^2)

L11 := subs(DATA, L1); L21 := subs(DATA, L2); L31 := subs(DATA, L3)

NULL

L12 := subs(theta = .4, L11); L22 := subs(theta = .4, L21)

A1 := plot([L12, L22], Ce = 0 .. .8, color = ["Red", "Red"], linestyle = [solid, longdash], labels = [C__e, `&pi;__r`], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("&pi;"),mi("r"),mn("B"));`, `#msubsup(mi("&pi;"),mi("r"),mn("S"));`], axis[2] = [color = "#600000"])

NULL

L13 := subs(theta = .5, L11); L23 := subs(theta = .5, L21)

A2 := plot([L13, L23], Ce = 0 .. .8, color = ["Green", "Green"], linestyle = [solid, longdash], labels = [C__e, `&pi;__r`], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("&pi;"),mi("r"),mn("B"));`, `#msubsup(mi("&pi;"),mi("r"),mn("S"));`], axis[2] = [color = "#600000"])

NULL

L14 := subs(theta = .6, L11); L24 := subs(theta = .6, L21)

A3 := plot([L14, L24], Ce = 0 .. .8, color = ["Blue", "Blue"], linestyle = [solid, longdash], labels = [C__e, `&pi;__r`], labeldirections = ["horizontal", "vertical"], legend = [`#msubsup(mi("&pi;"),mi("r"),mn("B"));`, `#msubsup(mi("&pi;"),mi("r"),mn("S"));`], axis[2] = [color = "#600000"])

display(A1, A2, A3)

Download Graph_legend_error_ac1.mw

You could look at this general support page, in the section (near the bottom) titled "Contact Technical Support". There are three phone numbers there, for different geographic regions.

Note the effect of wrapping the Re and Im calls by evalc.

restart;

with(plots):

setoptions(size=[500,300]); setoptions3d(size=[400,400]);

 

a := 3: L := 2*Pi: d := 0.5: T0 := 2*Pi:

PDE := diff(u(x, t), t, t) = a^2*diff(u(x, t), x, x) - d*diff(u(x, t), t);

diff(diff(u(x, t), t), t) = 9*(diff(diff(u(x, t), x), x))-.5*(diff(u(x, t), t))

IBC := u(x, 0) = cos(Pi*x/L), D[2](u)(x, 0) = 0, D[1](u)(0, t) = 0, D[1](u)(L, t) = 0:

pds := pdsolve({IBC, PDE}, u(x, t));

u(x, t) = -(1/70)*cos((1/2)*x)*35^(1/2)*((I-35^(1/2))*exp((1/4)*(-1+I*35^(1/2))*t)-(I+35^(1/2))*exp(-(1/4)*(1+I*35^(1/2))*t))

F := eval(u(x,t),pds);

-(1/70)*cos((1/2)*x)*35^(1/2)*((I-35^(1/2))*exp((1/4)*(-1+I*35^(1/2))*t)-(I+35^(1/2))*exp(-(1/4)*(1+I*35^(1/2))*t))

# It is purely real for real x and t
FF := evalc(F);

-(1/70)*35^(1/2)*cos((1/2)*x)*(-2*35^(1/2)*exp(-(1/4)*t)*cos((1/4)*35^(1/2)*t)-2*exp(-(1/4)*t)*sin((1/4)*35^(1/2)*t))

plot([Re,Im](eval(F,x=0)), t = 0 .. 6, thickness=3, color=[red,blue]);

# There is only small roundoff error using F rather than FF (FF is "better").
#
plot([Re,Im](eval(FF-F,x=0)), t = 0 .. 6, thickness=3, color=[red,blue]);

plot3d(FF, x=-Pi..Pi, t = 0 .. 6, thickness=3, color=[red,blue]);

G1 := simplify( evalc( eval(F,x=1+I) ) );

-(1/35)*exp(-(1/4)*t)*(35^(1/2)*sin((1/4)*35^(1/2)*t)+35*cos((1/4)*35^(1/2)*t))*(-cos(1/2)*cosh(1/2)+I*sin(1/2)*sinh(1/2))

reG1 := evalc( Re(G1) );

(1/35)*exp(-(1/4)*t)*(35^(1/2)*sin((1/4)*35^(1/2)*t)+35*cos((1/4)*35^(1/2)*t))*cos(1/2)*cosh(1/2)

imG1 := evalc( Im(G1) );

-(1/35)*exp(-(1/4)*t)*(35^(1/2)*sin((1/4)*35^(1/2)*t)+35*cos((1/4)*35^(1/2)*t))*sin(1/2)*sinh(1/2)

complexplot(G1, t=0..6, thickness=3);

spacecurve([reG1, imG1, t], t = 0 .. 6, axes = boxed, thickness=3)

# Again, this is purely real-valued for real t.
# So its imaginary component is just zero.
G2 := simplify( evalc( eval(F,x=0) ) );

(1/35)*35^(1/2)*exp(-(1/4)*t)*(35^(1/2)*cos((1/4)*35^(1/2)*t)+sin((1/4)*35^(1/2)*t))

evalc( Re(G2) );

(1/35)*35^(1/2)*exp(-(1/4)*t)*(35^(1/2)*cos((1/4)*35^(1/2)*t)+sin((1/4)*35^(1/2)*t))

evalc( Im(G2) );

0

complexplot(G2, t=0..6, thickness=3, color=red);

# This lies in the plane Im(G2)=0.
#
spacecurve([Re(G2), Im(G2), t], t = 0 .. 6, axes = boxed, thickness=3, labels=[Re,Im,t])

 

 

Download wingho_1_ac.mw

restart

kernelopts(version)

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

H0 := -S1^2*eta1-S2^2*eta2-S1*gamma1-S2*gamma2

Z0 := exp(-beta*H0)

Z0 := add(Z0, S1 = [-2, -1, 0, 1, 2])

Z0 := add(Z0, S2 = [-2, -1, 0, 1, 2])

G0 := -ln(Z0^((1/2)*N))/beta

G01 := -ln((2*exp(4*beta*eta1)*cosh(2*beta*gamma1)+2*exp(beta*eta1)*cosh(beta*gamma1)+1)^((1/2)*N)*(2*exp(4*beta*eta2)*cosh(2*beta*gamma2)+2*exp(beta*eta2)*cosh(beta*gamma2)+1)^((1/2)*N))/beta


Remove/apply common factor

H1 := G01*2*beta/N:      H := G0*2*beta/N:


For H1, convert cosh to exp, and combine ln calls (using real assumption)

T1 := combine( convert(combine(H1),exp) ) assuming real;

ln(1/(((exp(4*beta*gamma2)+1)*exp(4*beta*eta2-2*beta*gamma2)+(exp(2*beta*gamma2)+1)*exp(beta*eta2-beta*gamma2)+1)*((exp(4*beta*gamma1)+1)*exp(4*beta*eta1-2*beta*gamma1)+(exp(2*beta*gamma1)+1)*exp(beta*eta1-beta*gamma1)+1)))


For H, combine to bring the leading negative sign into the ln call.

Ta := combine( H ) assuming real:


Now expand only the exp calls in Ta, but not the ln call.
And then factor.

T := factor( evalindets(Ta,specfunc(exp),expand) );

ln((exp(beta*gamma1))^2*(exp(beta*gamma2))^2/(((exp(beta*eta2))^4*(exp(beta*gamma2))^4+(exp(beta*eta2))^4+exp(beta*eta2)*(exp(beta*gamma2))^3+exp(beta*eta2)*exp(beta*gamma2)+(exp(beta*gamma2))^2)*((exp(beta*eta1))^4*(exp(beta*gamma1))^4+(exp(beta*eta1))^4+exp(beta*eta1)*(exp(beta*gamma1))^3+exp(beta*eta1)*exp(beta*gamma1)+(exp(beta*gamma1))^2)))


At which point simplify can handle it.
 

simplify(T1 - T)

0

Download TESTE_ac.mw

You can use the caption option for that, and one way to construct that from your DATA values would be using sprintf.

caption=sprintf("sigma=%.1f, Cn=%.2f, Crm=%.2f, b=%.2f",
                eval([sigma,Cn,Crm,b],DATA)[])

Q_legend_ac.mw

Or, if you'd like that any/all of those names pretty-printed, eg. sigma rendered as the Greek letter glyph,

Q_legend_ac2.mw


note: I have deliberately not merely used uneval quotes (single right-ticks),
because those are ephemeral, and if you later assigned to any of those
names then an evaluation of the plot construct would result in the caption
turning into, say, 0.65=0.65, etc. Maybe unlikely, but that's defensive programming. Q_legend_ac3.mw

[edit] Yet another reasonable way to construct the caption, and to guard names against further evaluation, involves using InertForm:-Display. This too pretty-prints the sigma character as the Greek letter, etc. This might even be my preferred way, over the 1st and 2nd ways. Q_legend_ac4.mw

This duplicates each frame three times (to slow down the exported .gif file).

It reduces the line thickness as n increases.

restart;

S:=CodeTools:-Usage(
  [seq(eval(subs(THICKNESS(0)=THICKNESS(max(0.01,1-1.2*n*0.02)),
                GraphTheory:-DrawGraph(GraphTheory:-CompleteGraph(n),showlabels=false)),
           _HOVERCONTENT=NULL)$1..3,
       n=3..40)]):

plots:-display(S,insequence=true);

Download graph_anim01.mw

 

 


Or, with labelled vertices, up to n=50, with just two repetitions per frame, and with lines getting thinner slightly more slowly.

restart;

S:=CodeTools:-Usage(
  [seq(eval(subs(THICKNESS(0)=THICKNESS(max(0.01,1-1.0*n*0.02)),
                GraphTheory:-DrawGraph(GraphTheory:-CompleteGraph(n))),
           _HOVERCONTENT=NULL)$1..2,
       n=3..50)]):

memory used=2.19GiB, alloc change=191.18MiB, cpu time=22.31s, real time=20.94s, gc time=2.53s

plots:-display(S,insequence=true);

Download graph_anim02.mw
 

Here's an example for the legend, and making the axes' labels and tickmark values bold.
 

Q1_3_ac.mw

I look forward to reading about what other bits you might have forgotten to mention.

The title option seems to have been broken in Maple 2023. It works ok in Maple 2022.2 and earlier.

I will submit a bug report.

The problem seems to be simply that a new outer Table (hidden borders on those inside it) was put around the assembly. And the title is still being put on the a Table that is just inside that. But the GUI only shows Table caption & title on the outermost of a collected of nested Tables. So the title's being attached to the wrong Table now, and not shown in consequence.

Here are two workarounds:

1) Use Explore's overview option instead (adjusting the padding, for the width),

Explore(plot(a*sin(b*t),t=0..10),
   parameters=[[a=1..20], [b=1..20] ],
  initialvalues=[a=6,b=5],placement='right',width=300,
  'overview'=cat("\n"," "$32,"My Explore"));

2) Utilize a (re-usable) procedure instead, which constructs the xml, fixes it up, and embeds it,

NExplore := proc(U::uneval,{title::string:=""}) local temp;
 temp:=XMLTools:-FromString(Explore(U,_rest,insert=false,returnxml=true));
 DocumentTools:-InsertContent(subsop(1=_XML_Table("captionalignment"="1",
   "title"=title,"captionposition"="0","drawtitle"="true",
   remove(type,[op([1,..],temp)],
          identical("captionalignment","title",
                    "captionposition","drawtitle")=anything)[]),temp));
 return NULL; end proc:

NExplore(plot(a*sin(b*t),t=0..10),
         parameters=[[a=1..20], [b=1..20]],
         initialvalues=[a=6,b=5], placement='right',
         width=300, title="My Explore");

explore_title_ex07.mw

Your Question's title asks, "why Explore gives error...", but it did not give an error. It gave 2 Warnings  and the exploration appears to run ok.

Internally, Explore makes a couple of evaluations of the expression, using right & left parameter end-points, to try and gauge what the maximal viewing range might be. It's only substituting the Slider value, not the TextArea value, when doing that.

If you don't want to be disable warnings you can avoid those messages by preventing the adaptive viewing mode (in which it tries to retain the largest `view` range found for any parameter values).

For example,

Explore(plot(a*sin(b*t),t=0..10),
   parameters=[              
        [a=1..20],
        [b,'controller' = 'textarea','label'="b" ]
        ],
  adaptview=false,
  initialvalues=[a=6,b=5],placement='right',width=300);

Notice how the vertical view changes dramatically as parameter `a` changes? It's somewhat awkward. That's what the (new in the past couple of releases) `adaptview=true` option is for, to get a more stable view experience.

Of course, you can force a widest view with,

Explore(plot(a*sin(b*t),t=0..10,view=-20..20),
   parameters=[              
        [a=1..20],
        [b,'controller' = 'textarea','label'="b" ]
        ],
  adaptview=false,
  initialvalues=[a=6,b=5],placement='right',width=300);

Yet another way to get rid of those two warning messages, while keeping the adaptiveview=true default, is to simply make it produce an empty plot (silently) when the parameter is non-numeric.

F := proc(ap,bp)
  if not ( ap::numeric and bp::numeric ) then
    return plot(axes=none); end if;
  plot(ap*sin(bp*t),t=0..10);
end proc:

Explore(F(a,b),
   parameters=[              
        [a=1..20],
        [b,'controller' = 'textarea','label'="b" ]
        ],
  initialvalues=[a=6,b=5],placement='right',width=300);

explore_slider_textarea_ex06.mw

As I explained in my Answer your Question yesterday, the slider controllers that Explore inserts are all Embedded Components Sliders. In fact, the very first URL link in my Answer yesterday is the very same link that you've cited here.

Consider this example, where the Slider snaps to only multiples of 10.

Explore( plot(a*sin(x), x=-3*Pi..3*Pi, gridlines),
         parameters=[ [a=0 .. 1000, majorticks=500,
                       minorticks=10, snaptoticks=true] ],
         initialvalues=[a=1000], width=500, placement=right );

nb. There is a minimal granularity that the GUI itself will allow, in terms of how it perceives small movements of a slider control. Ie, you can't make the slider be manually moved any arbitrarily small portion of the whole.

Also, the question about arbitrary values, entered manually, has come up before. (Prof. R.Lopez once asked me about that.) The code might be revised so that the (current, separate) Label component which shows the running Slider value is instead a TextArea component and that it serve double duty as both output (running value) and input (manual).

[edit] While they don't update each other, a Slider and a separate TextArea component can both be used in the same exploration to set the value of a common name in the "expression" (here, a function call F(a,aa) ).

F := module() local aval,ModuleApply;
  ModuleApply:=proc(a,aa) local use_a;
    if nargs=2 and aa::numeric and aval<>aa then
      aval:=aa; use_a:=aa;
    else use_a:=a;
    end if;
    plots:-display(plots:-textplot([5,30,typeset("a=",use_a)],color=blue),
                   plot(use_a*sin(x),x=-3*Pi..3*Pi,gridlines));
  end proc:
end module:

Explore(F(a,aa),
  parameters=[[a=0 .. 50, majorticks=10],
              [aa, controller=textarea, label="", width=3]],
  initialvalues=[a=50,aa=a],
  width=500, placement=right);

They each update the plotted expression (but not each other, as entry components).

explore_slider_ex05.mw

If you are using full-screen for the Maple GUI then you might try placement=right (or left) for the Sliders (optionally aligning them horizontally or vertically as you want). You can actually mix&match the placements. That might help keep your full plot visible while sliding. Of course for side-placementt you would not utilize your width=300 choice (which I personally feel is not going to be good for overall look&feel, in almost any event...).

I am not aware of a way to set the font family or size for the values markers shown on Sliders, a kind of Embedded Component (EC).

It can be mentioned that Table ECs don't have the fancy grid/etc layout or as many alignment choices that Maplets tables/cells do, and so fine placement within the assembly is cobbled together with a few invisible subtables. (It's a bit like trying to build a palace out of mud and sticks.) If I recall correctly the internal cell padding is already set to 0 for the internal layout of the Explore Tables. But you're right, it does look cludgy.

You can make the Sliders a bit longer, which can visually relieve a little bit of the awkwardness wrt the value markers.  Their length is constrained a bit by the internal layout (so they're limited by the overall width), but here's an example of the syntax: Explore_slider_width_ex01.mw

I'll also mention that the fonts in Embedded Components are quite different(!!) according to platform, including in terms of size as well as look/feel. Here's a Linux ubuntu screenshot, in which the Slider tickmark values look remarkably different than in the OP's screenshot (noticeably smaller, bolder, different font family, ie. noticeably different in all the key ways that fonts can be different). I don't know whether the differences are mostly a Java thing, a Maple GUI thing, or an OS thing.

I suspect that some of that vertical whitespace might be alleviated if the implementation were changed so that the hidden internal Table EC used for animation controls/etc were altogether not present when those controls are not used/shown. In EC, even an empty sub-Table with zero-padding adds bulk and white-space (again, unlike what can be done with Maplets, iirc). I could log a bug ticket for that.

How about a Matrix, using,

   <eval~(N, results) | eval~(tbo, results) | eval~(two, results)>

or,

   Matrix(map[2](eval, [N, tbo, two], convert(results, list)))

PrimesQuestion_ac.mw

Naturally, you could make a DataFrame from that Matrix, etc.

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