acer

32405 Reputation

29 Badges

19 years, 349 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

You have made a mistake, by attempting to pass on to the simplify command a bare sequence of three elements returned by the solve command.

The error message you see arises due to that. If you wrap the sequence result from solve in a list then that error does not occur.

Simplification of very large expressions can take a while. The results coming out of your solve call are very large (you have complicated symbolic coefficients with several parameters).

The following doesn't take a huge amount of time (about 50sec, all told), but does cut down the size quite a bit, relatively speaking.

I've used Maple 2019, which you seem to have.

restart

kernelopts(version)

`Maple 2019.2, X86 64 LINUX, Nov 26 2019, Build ID 1435526`

`πer` := proc (w, delta) options operator, arrow; w*delta*tau2*d+Cepr*tau2*d+l*(1-delta)*tau2*d+Cex*tau01*d-Clr*tau2^2-Aer*tau2*d-Rer*tau2*d+R0er*tau2^2*d^2 end proc

proc (w, delta) options operator, arrow; w*delta*tau2*d+Cepr*tau2*d+l*(1-delta)*tau2*d+Cex*tau01*d-Clr*tau2^2-Aer*tau2*d-Rer*tau2*d+R0er*tau2^2*d^2 end proc

D4er := simplify(subs([tau2 = -(-Cv*delta-delta*s2+delta*w+Cepr-s1)/(2*d*g2*delta^2), tau1 = -d*(Am-Cv+Rm-s1-s2)/(2*(-R0m*d^2+d^2*g1+Clm))], `πer`(w, delta)))

(1/4)*(4*d^2*g2*(d*tau01*g2*Cex+(1/2)*(w-Cv-s2)*(-w+l))*delta^4+2*d^2*((l-2*w+Cv+s2)*Cepr+(Rer-l+s1+Aer)*w+(-Rer+l-Aer)*Cv-l*s1-s2*(Rer-l+Aer))*g2*delta^3+((2*(Cepr-s1)*(-Cepr+Rer-l+Aer)*g2+R0er*(w-Cv-s2)^2)*d^2-Clr*(w-Cv-s2)^2)*delta^2+2*(w-Cv-s2)*(Cepr-s1)*(R0er*d^2-Clr)*delta+(Cepr-s1)^2*(R0er*d^2-Clr))/(d^2*g2^2*delta^4)

D5er := diff(D4er, w) = 0

(1/4)*(4*d^2*g2*((1/2)*l-w+(1/2)*Cv+(1/2)*s2)*delta^4+2*d^2*(-2*Cepr+Rer-l+s1+Aer)*g2*delta^3+(2*R0er*(w-Cv-s2)*d^2-2*Clr*(w-Cv-s2))*delta^2+2*(Cepr-s1)*(R0er*d^2-Clr)*delta)/(d^2*g2^2*delta^4) = 0

simplify(solve(D5er, w))

(-d^2*g2*(l+Cv+s2)*delta^3+2*d^2*g2*(Cepr+(1/2)*l-(1/2)*s1-(1/2)*Aer-(1/2)*Rer)*delta^2+(Cv+s2)*(R0er*d^2-Clr)*delta-(Cepr-s1)*(R0er*d^2-Clr))/(delta*(-2*d^2*delta^2*g2+R0er*d^2-Clr))

D6er := diff(D4er, delta) = 0

(1/4)*(16*d^2*g2*(d*tau01*g2*Cex+(1/2)*(w-Cv-s2)*(-w+l))*delta^3+6*d^2*((l-2*w+Cv+s2)*Cepr+(Rer-l+s1+Aer)*w+(-Rer+l-Aer)*Cv-l*s1-s2*(Rer-l+Aer))*g2*delta^2+2*((2*(Cepr-s1)*(-Cepr+Rer-l+Aer)*g2+R0er*(w-Cv-s2)^2)*d^2-Clr*(w-Cv-s2)^2)*delta+2*(w-Cv-s2)*(Cepr-s1)*(R0er*d^2-Clr))/(d^2*g2^2*delta^4)-(4*d^2*g2*(d*tau01*g2*Cex+(1/2)*(w-Cv-s2)*(-w+l))*delta^4+2*d^2*((l-2*w+Cv+s2)*Cepr+(Rer-l+s1+Aer)*w+(-Rer+l-Aer)*Cv-l*s1-s2*(Rer-l+Aer))*g2*delta^3+((2*(Cepr-s1)*(-Cepr+Rer-l+Aer)*g2+R0er*(w-Cv-s2)^2)*d^2-Clr*(w-Cv-s2)^2)*delta^2+2*(w-Cv-s2)*(Cepr-s1)*(R0er*d^2-Clr)*delta+(Cepr-s1)^2*(R0er*d^2-Clr))/(d^2*g2^2*delta^5) = 0

sols := CodeTools:-Usage([solve(D6er, delta)])

memory used=0.92MiB, alloc change=0 bytes, cpu time=10.00ms, real time=10.00ms, gc time=0ns

`~`[length](sols)

[3598983, 7197328, 7197328]

new := CodeTools:-Usage(`~`[simplify](sols, size))

memory used=282.99MiB, alloc change=48.00MiB, cpu time=3.24s, real time=2.98s, gc time=532.00ms

`~`[length](new)

[93584, 158428, 158428]

new2 := CodeTools:-Usage(map(proc (u) options operator, arrow; simplify(numer(u))/simplify(denom(u)) end proc, new))

memory used=5.34GiB, alloc change=166.32MiB, cpu time=42.85s, real time=36.73s, gc time=9.55s

`~`[length](new2)

[11552, 9879, 9879]

 

``

Download Q_simplify_solv_ac.mw

One reasonable way to do that in your old Maple 2021 is to use the applyrule command.

That is somewhat like a pattern-matching approach. It has the benefits that:
1) You don't have to supply or mention the variable name `x`, yourself. It will figure that out, and also apply the rule to additional candidates like sin(y+z)/cos(y+z) that might appear in the same expression.
2) It doesn't force conversion to tan of other less appropriate trig calls.

restart

kernelopts(version)

`Maple 2021.2, X86 64 LINUX, Nov 23 2021, Build ID 1576349`

M := sin(x)/cos(x)

sin(x)/cos(x)

applyrule(sin(a::anything)/cos(a::anything) = tan(a), M)

tan(x)

K := 1/sinh(x)

1/sinh(x)

applyrule(1/sinh(a::anything) = csch(a), K)

csch(x)

Q := sqrt(beta[0]/(B[1]*cosh(xi*sqrt(-lambda))))

(beta[0]/(B[1]*cosh(xi*(-lambda)^(1/2))))^(1/2)

applyrule(1/cosh(a::anything) = sech(a), Q)

(beta[0]*sech(xi*(-lambda)^(1/2))/B[1])^(1/2)

 

 

Download identity_change_applyrule.mw

Note that in Maple 2024 you can get those results just using the simplify command.

restart

kernelopts(version)

`Maple 2024.1, X86 64 LINUX, Jun 25 2024, Build ID 1835466`

M := sin(x)/cos(x)

sin(x)/cos(x)

simplify(M)

tan(x)

K := 1/sinh(x)

1/sinh(x)

simplify(K)

csch(x)

Q := sqrt(beta[0]/(B[1]*cosh(xi*sqrt(-lambda))))

(beta[0]/(B[1]*cosh(xi*(-lambda)^(1/2))))^(1/2)

simplify(Q)

(beta[0]*sech(xi*(-lambda)^(1/2))/B[1])^(1/2)

Download identity_change_M2024.mw

ps. I marked your Question as being for Maple 2021, since all your Questions's attachments are last saved by you using that version. As you can see, it matters. Please mark your furture Questions with the specific version yourself.

pps. Here's a bad way to get those same effects:

restart

M := sin(x)/cos(x)

sin(x)/cos(x)

convert(M, tan)

tan(x)

K := 1/sinh(x)

1/sinh(x)

convert(K, csch)

csch(x)

Q := sqrt(beta[0]/(B[1]*cosh(xi*sqrt(-lambda))))

(beta[0]/(B[1]*cosh(xi*(-lambda)^(1/2))))^(1/2)

convert(Q, sech)

(beta[0]*sech(xi*(-lambda)^(1/2))/B[1])^(1/2)


Note that all those ways are pretty useless, because:
1) You have to supply the target function yourself
2) They also affect other trig calls in the expression, which
can actually make them far less simple.

For example,

convert(M+sin(x), tan)

tan(x)+2*tan((1/2)*x)/(1+tan((1/2)*x)^2)

convert(K+cos(x), csch)

csch(x)-I/csch(I*(x+(1/2)*Pi))

convert(Q+tan(x), sech)

(beta[0]*sech(xi*(-lambda)^(1/2))/B[1])^(1/2)-sech(I*x)/sech(I*(x+(1/2)*Pi))

Download identity_change_care.mw

Try NULL instead of your null.

That is the empty value/statement which you mentioned. It will be seen an nothing by the display command.

One might imagine/hope that the size option or a background image on a 2D plot might allow one to force an aspect ratio of the axes. If that were the case, and since plottools:-getdata can pretty much obtain the extent of the axes, then we could programatically force agreement with the textplot rotation angle.

Alas these things appear disconnected, because the size option controls only the inline bounding box dimensions, and is thrown off by caption, axes labels and tickmark width/heights.

restart;

with(plots):

 

plot(-x^2, size=[400,200]);

We can see that the next red curve extends
over a wider portion of the inline box.

display( plot(x^2, size=[400,200]),
         axes = none );

Now it's even smaller than the first one,
because the tickmarks take up space in the
inline box.

display( plot(x^2, size=[400,200]),
         axes = boxed );

The labels can also take up space.
Notice that the in the following rendering
the aspect ratio of the axes box is not the
same as that of the bounding box.

Since we therefore not use the size option to
control the aspect ratio of the axes then we cannot
programatically get force the aspect ratio of the
axes to match appropriately with the rotation angle
of a textplot.

(I feel that this incompatibility is a design mistake.)

display( plot(x^2, size=[400,200]),
         labels = [rrrrrrrrrrrrr,uuuu],
         labeldirections = [vertical, horizontal],
         axes = boxed );


Download plot_box_dims.mw

Next, here's a worksheet showing and explaining how the things mentioned above will affect matching a textplot with rotation. (Sorry, the site's not letting me display that here. So, download only.)
2024-10-15_text_not_always_parallel_ac.mw

As for rotated text in an image, well it's hard to get that right because the GUI and your OS don't know that the pixels represent text and so cannot anti-alias, etc. It's hard to have the rotated text be legible without making it thick and chunky.

Having said that, FWIW here, in modern Maple versions you can make such rotated text images entirely with ImageTools.

restart;

with(ImageTools): with(Draw):

f := 3.3*x:

img := Create(700,700,channels=1,background=white):

Text(img, 325, 350, "parallel piece of text", rotation=Pi/4,
     font_size=16, font=12, weight=2, color="Black"):

plot(f(x), x=0..461, background=img);


Download img_text_plot_rot.mw

A 12pt font character (say, "m") is about 16 pixels wide, at 100% zoom factor.

That's approximate, and it'll vary by font (esp. variable width font, by character, of course). But you can easily find such information on the interwebs, eg. here. (note also this kind of thing)

The size info is used by the GUI to set the dimensions of the inlined plot bounding box. So things like caption, the difference in height of x-axis labels/ticks vs y-axis label/tick (including their orientation) will all throw off the actual aspect ratio of the rendered axes.

I mean to mention some of that to you in response to your recent rotated text Question, but got busy with other things, sorry. I'll try and do that soon.

You have mistakenly entered your expression assigned to F, in 2D Input.

You have terms like l(...) and m(...) without either a space or an explicit multiplication sign between the first term and the opening bracket.

That makes those terms be function calls, instead of products of terms. It's just like having f(x+y) a function call of f with argument x+y, instead of f*(x+y) a product of two terms.

simplify_b_ac.mw

Using Maple 2022.2, I get the following,

restart

s := -2*B1*(A1^2*B2^2*exp((-(2*I)*exp(2*beta2*t)*lambda2^2+2*x*lambda2*(a*beta1-beta)*exp(beta2*t)+beta1*t*beta2)/beta1)-2*A1*A2*B1*B2*exp(((2*I)*(beta1-2*beta2)*lambda2^2*exp(2*beta2*t)+2*x*lambda2*((a*beta2+beta)*beta1-2*beta*beta2)*exp(beta2*t)+beta2^2*t*beta1)/(beta1*beta2))+A2^2*B1^2*exp(((4*I)*lambda2^2*(beta1-3*beta2*(1/2))*exp(2*beta2*t)+(2*((a*beta2+2*beta)*beta1-3*beta*beta2))*x*lambda2*exp(beta2*t)+beta2^2*t*beta1)/(beta1*beta2)))*(beta1-beta2)*B2*lambda2/(sigma*(-A2*exp(2*exp(beta2*t)*lambda2*(beta1-beta2)*(I*exp(beta2*t)*lambda2+beta*x)/(beta1*beta2))*B1+A1*B2)^3)

simplify(expand(s))

-2*(beta1-beta2)*B1*B2*exp(2*x*lambda2*exp(beta2*t)*a+beta2*t)*lambda2/((A1*B2*exp(2*lambda2*exp(beta2*t)*(I*exp(beta2*t)*lambda2+beta*x)/beta1)-A2*exp(2*lambda2*exp(beta2*t)*(I*exp(beta2*t)*lambda2+beta*x)/beta2)*B1)*sigma)

(1)


The above is zero is any of these (individually) is satisfied:

`~`[remove](evalb, solve(%, [A1, A2, B1, B2, beta1, beta2]))

[[beta1 = beta2], [B1 = 0], [B2 = 0]]

(2)


Download ss_ac.mw

(We can also get solution lambda2=0 from the numerator, by eye or by a more general solve. You could also find conditions for which the denominator of the above is zero, using solve.)

ps. Not everone has Equation Labels enabled in their GUI preferences. So your mentioning Eq (1). is not immediately useful to everyone. (I don't see such labels even when I merely Open your .mw file. I have to go to GUI Options, enable that, then reexecute the whole sheet, and hope nothing was Cut since your own last execution. Luckily this example is simple enough to guess or re-do.) If you mean the expression assigned to s, then it's more immediately helpful to state that, thanks.

With the assumptions provided later in a Reply by the OP, a single result for eliminating {h, v1, t} can be obtained directly from solve.

restart;

kernelopts(version);

`Maple 2024.1, X86 64 LINUX, Jun 25 2024, Build ID 1835466`

solve({v1^2 = 2*g*(h - h1), 1/2*g*t^2 = h2, v1*t + 1/2*g*t^2 = h1},
      {h, t, v1}, useassumptions) assuming g > 0, t > 0;

{h = (1/4)*(h1^2+2*h1*h2+h2^2)/h2, t = 2^(1/2)*(g*h2)^(1/2)/g, v1 = (1/2)*(h1-h2)*g*2^(1/2)/(g*h2)^(1/2)}


Download solve_pos_ex.mw

nb. The OP has not indicated whether he prefers to eliminate g rather than t, or vice versa. These equations can be solved explicitly for [h,v1,t], or for [h,v1,g], but we don't (yet) know which the OP would prefer.

What is a candidate/typical value for your a parameter? What range for the r parameter?

Have you looked at the IterativeMaps package? (It can be fast, but finicky, and sometimes unstable.) You might start with the Bifurcation command [here, or here], or the more flexible command. Eg. some_bif_ex.mw

You could also try modifying earlier code variants to get the usual Logistic map image (but some done more like plots). [more references..]

If you want it colored/shaded, rather than monotone, then nice rescaling of values can get tricky.

@Susana30 For your followup question:
[Alternative to these below which both restrict the viewing range, you could play with a restricted domain for the red curve.]

restart;

with(plots):

 

display(polarplot([$1..12], color="LightGray"),
        plot([seq(x/tan(i*Pi/6), i=[$-2..-1,$1..2])], color="LightGray"),
        polarplot([4+4*sin(theta), 3/(1-sin(theta))],
                       color=["Green","Red"]),
        axiscoordinates=cartesian, scaling=constrained,
        tickmarks=[[seq(i=String(i),i=-9..6)],
                   [seq(i=String(i),i=-4..10)]],
        font=["Times",7],
        view=[-9..7, -5..10.6]);

polarplot([4+4*sin(theta), 3/(1-sin(theta))],
          color=["Green","Red"],
          coordinateview=[0..11,default]);

 

 

Download pol_fun.mw

This followup action line-prints the variable=value pairs, and formats the display of a procedure body with line-breaks and indenting.

You should be able to copy&paste that line-printed display of the proc (as 1D Maple input, aka Maple Notation). Or you could use fprintf instead, to write it straight to a text file.

(If you still have trouble, you might zip up the .m file and then upload and attach it here.)

restart;

foo,bar := blah,17:

 

show := proc(f::string)
  local temp := {anames(':-user')};
  read f;
  map(u -> parse(String(u)) = eval(u),
      {anames(':-user')} minus temp);
end proc:


The following returns the set of name=value pairs.
 

res := show("mydotfile.m");

{blech = proc (f, t) local i, n, r, x, f0; option `Copyright (c) 1993 by the University of Waterloo. All rights reserved.`; global D; if nargs < 2 or not (args[-1])::'list' then error "invalid arguments" elif type(f, 'function') then f0 := op(0, f); if type(f, 'constant') and type(f0, 'mathfunc') then f elif f0 = '`@`' then n := nops(f); if type(t, '[function]') and type(op(0, t[1]), 'anything@@anything') and op(n, f) = op([0, 1], t[1]) then (`@`(op(1 .. n-1, f)))((op(n, f)@@(op([0, 2], t[1])+1))(op(t[1]))) else r := op(t); for i from n by -1 to 1 do x := op(i, f); if (x = 'eval' or sprintf("%a", x) = "eval") and nops([r]) = 2 then r := x(eval(r[1], 1), r[2]) else r := x(eval(r, 1)) end if end do; eval(r, 1) end if elif f0 = '`@@`' then n := op(2, f); if type(t, '[function]') and op(0, t[1]) = op(1, f) then (op(1, f)@@(n+1))(op(t[1])) elif type(t, '[function]') and type(op(0, t[1]), 'anything@@anything') and op(1, f) = op([0, 1], t[1]) then (op(1, f)@@(n+op([0, 2], t[1])))(op(t[1])) elif type(n, 'integer') then if 0 <= n then r := t; for i to n do if type(r, [('specfunc')(op(1, f))]) then break end if; r := [(proc (F, X) F(args[2 .. -1]) end proc)(op(1, f), r[])] end do; if n < i then r[] else (proc (f) ('f')(args[2 .. nargs]) end proc)(op(1, f)@@(n-i+2), op(r[])) end if else subsop(1 = op(t), 'f(x)') end if elif nops(t) = 1 and type(op(1, f), '{identical(D), specindex(D)}') and (t[1])::'{`=`, algebraic}' then r := op(1, f); if r = D then r := setattribute(D[`$`(1, n)], f) else r := D[seq(`$`(i, n), i = op(1, f))] end if; i := r(t[1]); if op(0, i) <> r then if i = 'i' and i::'{table, `D/procedure_or_applyable_module`}' then eval(i, 2) else i end if else ('f')(op(t)) end if else ('f')(op(t)) end if elif f0 = 'DESol' then if not type(f, 'DESol(operator)') then error "cannot apply non-operator differential equation" end if; `DESol/apply`(f, t) elif type(f0, 'name') then userinfo(1, evalapply, `general function case`, [f, t]); n := f0; if type(n, 'indexed') then r := `evalapply/` || (op(0, n)); if type(r, 'procedure') then try r[op(n)](f, t) catch: error  end try else ('f')(op(t)) end if else r := cat('`evalapply/`', n); if type(r, 'procedure') then r(f, t) else ('f')(op(t)) end if end if elif f0::'{identical(D), specindex(D)}@@nonnegint' and nops(f) = 1 then return `evalapply/@@/D`(op(f0), op(f), t) else ('f')(op(t)) end if else subs(x = op(t), 'f(x)') end if end proc, x = 4, y = 3.1}


The following line-prints the entries of that set using printf, where
the %P format to get nice line-breaking of a saved procedure.
 

interface(verboseproc=2):
map[2](printf,"%P\n",eval(res,1)):

blech = (proc(f, t)
    local i, n, r, x, f0;
    global D;
    option `Copyright (c) 1993 by the University of Waterloo. All rights\
     reserved.`;
    if _npassed < 2 or not _passed[-1]::'list' then
        error "invalid arguments";
    elif type(f, 'function') then
        f0 := op(0, f);
        if type(f, 'constant') and type(f0, 'mathfunc') then
            f;
        elif f0 = '`@`' then
            n := nops(f);
            if type(t, '[function]') and
            type(op(0, t[1]), 'anything@@anything') and
            op(n, f) = op([0, 1], t[1]) then
                `@`(op(1 .. n - 1, f))(
                    ((op(n, f))@@(op([0, 2], t[1]) + 1))(op(t[1])));
            else
                r := op(t);
                for i from n by -1 to 1 do
                    x := op(i, f);
                    if (x = 'eval' or sprintf("%a", x) = "eval") and
                    nops([r]) = 2 then
                        r := x(eval(r[1], 1), r[2]);
                    else
                        r := x(eval(r, 1));
                    end if;
                end do;
                eval(r, 1);
            end if;
        elif f0 = '`@@`' then
            n := op(2, f);
            if type(t, '[function]') and op(0, t[1]) = op(1, f) then
                ((op(1, f))@@(n + 1))(op(t[1]));
            elif type(t, '[function]') and
            type(op(0, t[1]), 'anything@@anything') and
            op(1, f) = op([0, 1], t[1]) then
                ((op(1, f))@@(n + op([0, 2], t[1])))(op(t[1]));
            elif type(n, 'integer') then
                if 0 <= n then
                    r := t;
                    for i to n do
                        if type(r, ['specfunc'(op(1, f))]) then
                            break;
                        end if;
                        r := [(proc(F, X) F(_passed[2 .. -1]); end proc)(
                            op(1, f), r[])];
                    end do;
                    if n < i then
                        r[];
                    else
                        (proc(f) 'f'(_passed[2 .. _npassed]); end proc)(
                            (op(1, f))@@(n - i + 2), op(r[]));
                    end if;
                else
                    subsop(1 = op(t), 'f(x)');
                end if;
            elif
            nops(t) = 1 and type(op(1, f), '{identical(D), specindex(D)}')
             and t[1]::'{`=`, algebraic}' then
                r := op(1, f);
                if r = D then
                    r := setattribute(D[1 $ n], f);
                else
                    r := D[seq(i $ n, i = op(1, f))];
                end if;
                i := r(t[1]);
                if op(0, i) <> r then
                    if i = 'i' and
                    i::'{table, `D/procedure_or_applyable_module`}' then
                        eval(i, 2);
                    else
                        i;
                    end if;
                else
                    'f'(op(t));
                end if;
            else
                'f'(op(t));
            end if;
        elif f0 = 'DESol' then
            if not type(f, 'DESol(operator)') then
                error "cannot apply non-operator differential equation";
            end if;
            `DESol/apply`(f, t);
        elif type(f0, 'name') then
            userinfo(1, evalapply, `general function case`, [f, t]);
            n := f0;
            if type(n, 'indexed') then
                r := `evalapply/` || (op(0, n));
                if type(r, 'procedure') then
                    try r[op(n)](f, t); catch: error ; end try;
                else
                    'f'(op(t));
                end if;
            else
                r := cat('`evalapply/`', n);
                if type(r, 'procedure') then
                    r(f, t);
                else
                    'f'(op(t));
                end if;
            end if;
        elif f0::'{identical(D), specindex(D)}@@nonnegint' and nops(f) = 1
        then
            return `evalapply/@@/D`(op(f0), op(f), t);
        else
            'f'(op(t));
        end if;
    else
        subs(x = op(t), 'f(x)');
    end if;

end proc)
                                     x = 4
                                    y = 3.1


Download read_ex1.mw

You might consider a revision to your first (symbolic series dsolve) approach. You could instead search your Y1 list with a binary search. On my machine that reduces its time from 41.1 sec down to just 0.33 sec.

Note also that Y gets formed by merely splitting the range -2..5  by increments of 0.002. So the first element of Y1 which makes exp1>exp2 is a coarse root approximation. A little hammering can make a procedure with which fsolve can find finer resolution roots for your X1 values. On my machine that takes 3.9 sec.

Proc_Error_ac2.mw

If you also adjust your second approach to do a binary search (of Y1) then you can quickly determine that the numeric integration is not succeeding for some avar,bvar values. I'm not sure how that integration issue might be best resolved, or even whether it first occurs before exp1>exp2 is satisfied, etc. But this attachment also shows such problematic values.

Proc_Error_ac.mw


(Could the DE be augmented, instead of doing a separate integration involving the dsolve solution? I didn't really look, to see if that makes sense... Sorry, no time)

A minor adjustment can switch the x- and y- roles in the data, before the interpolation. This flips the densityplots across the x=y line (...one of several ways to do that).

Also, in your fourth construction your final call to plots:-display is wrongly using C11 (from earlier), instead of the new C22 as in that fourth part. I've corrected that. Now the fourth pair agree, with the switch.

Help_4_ac.mw

For example, here is that fourth pair overlaid, with the variable switch before interpolation as well as the C11->C22 correction.

(This code looks like it may have been a modification of this.)

ps. I used Maple 2015.2 for this, since that's your version. In later Maple versions some aspects might be easier or more flexible.

@salim-barzani Another choice for experimenting with plotting options is to use the PlotBuilder (either by right-click on an expression/output or -- my preference -- using the command).

PB_3d_ex.mw

If you put the mouse cursor/focus back on the PlotBuilder's plot then the right-panel gets repopulated with its menus, etc. But you can also switch back-and-forth between that and other work areas in your worksheet.

It's not clear what you mean by "template" above. Are you saying that you want to extract the numeric data generated in the plot structure, and then export that (as a Matrix of numbers, say), to Matlab or other programs? That's trickier for densityplot, but for plot3d you can use the plottools:-getdata and ExportMatrix commands.

For densityplot, one could extract the genetrated numeric Array of shading color values. Let us know if that's what you need, in say your Maple 2021.

You can combine multiple 3D plots by passing them to the plots:-display command.

I'm marking this Question as being for the "Maple 2021" Product, since that's your version (and, for some commands, the version matters). In future, could you please do that yourself? Also, please don't mark your queries about Maple as being for "Mapleprimes" and other products, thanks.

First 14 15 16 17 18 19 20 Last Page 16 of 336