acer

32395 Reputation

29 Badges

19 years, 344 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

The following tests that the first indices (yours have just one) of the elements are four distinct values.
 

L:=[ [F[1], F[2], F[3], F[4]],
     [F[1], F[2], F[3], M[1]],
     [F[1], F[2], F[3], M[2]],
     [F[1], F[2], F[3], M[3]],
     [F[1], F[2], F[3], M[4]],
     [F[1], F[2], F[4], M[1]],
     [F[1], F[2], F[4], M[2]],
     [F[1], F[2], F[4], M[3]],
     [F[1], F[2], F[4], M[4]],
     [F[1], F[2], M[1], M[2]] ]:

 

select(LL->nops({map2(op,1,LL)[]})=4,L);

[[F[1], F[2], F[3], F[4]], [F[1], F[2], F[3], M[4]], [F[1], F[2], F[4], M[3]]]


Download map_op_ex.mw

You haven't stated explicitly that all the lists in L will always have elements that are indexed by at least one value, but I have presumed it so.

ps. I didn't see dharr's Answer before posting my own. The fact that they are so similar is really because it's a natural way to approach it.
[edit] dharr's Answer seems to have gone missing. But it was fine, IMO, (presuming all elements have exactly one index, which is also reasonable in the absence of stated details),
    select(x->nops({map(op,x)[]})=4,L);

[edit] Some explanation of the steps, so that next time you might build your own,

Turn the inner lists of indexed items into
lists of just their indices.

map( LL -> map2(op,1,LL), L );

[[1, 2, 3, 4], [1, 2, 3, 1], [1, 2, 3, 2], [1, 2, 3, 3], [1, 2, 3, 4], [1, 2, 4, 1], [1, 2, 4, 2], [1, 2, 4, 3], [1, 2, 4, 4], [1, 2, 1, 2]]

But now also make them sets of the indices, to
get rid of duplicates.

map( LL -> {map2(op,1,LL)[]}, L );

[{1, 2, 3, 4}, {1, 2, 3}, {1, 2, 3}, {1, 2, 3}, {1, 2, 3, 4}, {1, 2, 4}, {1, 2, 4}, {1, 2, 3, 4}, {1, 2, 4}, {1, 2}]

But now take the nops of those sets, and set equal to 4.

map( LL -> nops({map2(op,1,LL)[]})=4, L );

[4 = 4, 3 = 4, 3 = 4, 3 = 4, 4 = 4, 3 = 4, 3 = 4, 4 = 4, 3 = 4, 2 = 4]

Now use those equations as boolean valued tests,
in order to select with this action.

select(LL->nops({map2(op,1,LL)[]})=4,L);

[[F[1], F[2], F[3], F[4]], [F[1], F[2], F[3], M[4]], [F[1], F[2], F[4], M[3]]]

Similarly, but without using select.

map( LL -> ifelse(nops({map2(op,1,LL)[]})=4, LL, NULL), L );

[[F[1], F[2], F[3], F[4]], [F[1], F[2], F[3], M[4]], [F[1], F[2], F[4], M[3]]]

I'm guessing that you'd prefer to have the Product call be shown with the assigned name, rather than with the Vector or list to which that name is assigned.

Here is something that gets that, for Vector or list, in Maple 2021.

restart;

kernelopts(version);

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

with(Statistics):

Dist := proc(N::{posint, name}, alpha::evaln)
  local K;
  uses Statistics;

  K := numelems(eval(alpha));
  
  Distribution( ':-PDF' = (z -> Product(('alpha'[k]+z[k])^N, k=1..K)) )
end proc:

P := Vector(3, [13,2,4]);

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

X := RandomVariable(Dist(N, P)):

res1 := PDF(X, x);

Product((P[k]+x[k])^N, k = 1 .. 3)

eval(res1,1);

Product((P[k]+x[k])^N, k = 1 .. 3)

value(eval(res1,1));

(13+x[1])^N*(2+x[2])^N*(4+x[3])^N

L := [3,17,22];
X2 := RandomVariable(Dist(N, L)):

[3, 17, 22]

res2 := PDF(X2, y);

Product((L[k]+y[k])^N, k = 1 .. 3)

value(eval(res2,1));
value(res2);

(3+y[1])^N*(17+y[2])^N*(22+y[3])^N

(3+y[1])^N*(17+y[2])^N*(22+y[3])^N

eval(res2,1);
res2;

Product((L[k]+y[k])^N, k = 1 .. 3)

Product(([3, 17, 22][k]+y[k])^N, k = 1 .. 3)

V := Vector([1/2,1/3,1/4]):
subs('P'='V', eval(res1,1));
value(eval(%,1));

Product((V[k]+x[k])^N, k = 1 .. 3)

(1/2+x[1])^N*(1/3+x[2])^N*(1/4+x[3])^N

Download Product_error_ac.mw

and a variant on that: Product_error_ac2.mw

Here is something that behaves ok for a list (but not Vector), in Maple 2015: Product_error_ac_2015_list.mw

With a little effort one can guard against collision of the textplots.

restart

L := [sin(x), sin(x)^2, sin(x)^3, sin(x)^4, sin(x)^5, sin(x)^6, surd(sin(x), 2), surd(sin(x), 3), surd(sin(x), 4), surd(sin(x), 5), surd(sin(x), 6)]

Typesetting:-mrow(Typesetting:-mi("clist", italic = "true", mathvariant = "italic"), Typesetting:-mo("≔", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("plots", italic = "true", mathvariant = "italic"), Typesetting:-mo(":-", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mi("setcolors", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi(""), Typesetting:-ms("Niagara"), Typesetting:-mi("")), mathvariant = "normal"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("")), mathvariant = "normal", open = "[", close = "]"), Typesetting:-mo(",", mathvariant = "normal", fence = "false", separator = "true", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.3333333em"), Typesetting:-ms("Black"), Typesetting:-mi("")), mathvariant = "normal", open = "[", close = "]"), Typesetting:-mo(":", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mspace(height = "0.0ex", width = "0.0em", depth = "0.0ex", linebreak = "newline"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo("if", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo("not", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mi("nops", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("L", italic = "true", mathvariant = "italic")), mathvariant = "normal"), Typesetting:-mo("≤", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mi("nops", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("clist", italic = "true", mathvariant = "italic")), mathvariant = "normal"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo("then", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo("error", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-ms("add more colors to clist"), Typesetting:-mo(";", mathvariant = "normal", fence = "false", separator = "true", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.2777778em"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo("end", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo(" ", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo("if", bold = "true", mathvariant = "bold", fontweight = "bold", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.0em"), Typesetting:-mo(";", mathvariant = "normal", fence = "false", separator = "true", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.2777778em"))

plots:-animate(proc (T) local i, j, TL; TL := []; for i to nops(L) do if 0.5e-1 < min(100, seq(eval(abs(L[i]-rhs(TL[j])), x = T), j = 1 .. nops(TL))) then TL := [TL[], i = L[i]] end if end do; plots:-display(plot(L, x = 0 .. T, ':-thickness' = 2.5, ':-color' = clist), ifelse(0.1e-2 < T and T < Pi-0.1e-2, seq(plots:-textplot([T, eval(rhs(TL[i]), x = T), rhs(TL[i])], ':-align' = ':-right', ':-color' = clist[lhs(TL[i])]), i = 1 .. nops(TL)), NULL), ':-xtickmarks' = ':-piticks') end proc, [x], x = 0 .. Pi, frames = 100, size = [800, 500])

NULL

Download Animation_Trigo_ac.mw

Your curves don't change much for such small changes in E1, it seems.

AGM_method_single_line_plot_ac.mw

There's quite a bit of duplicated effort in your approaches (which I didn't try to improve, though I showed a couple or alternative syntax blobs).

It's not clear what your definition of "simplify" is here.

But there are several ways to rationalize the denominator (including just using the rationalize command...).

restart;

expr:=(2500*I*w)/(1+5*I*w)+(200*I*w)/(1-10*I*w)+5;

(2500*I)*w/(1+(5*I)*w)+(200*I)*w/(1-(10*I)*w)+5

rationalize(expr);

-5*(-4850*w^2-(535*I)*w-1)*((5*I)*w+50*w^2+1)/(2500*w^4+125*w^2+1)

map(factor,rationalize(expr));

5*(-4850*w^2-(535*I)*w-1)*(-10*w+I)*(5*w+I)/((25*w^2+1)*(100*w^2+1))

Download rat_ex.mw

I notice that converting the DE to sincos form allows both to work in stock Maple 2025.1.

This makes me suspect that it might not be a hard fix.

restart;

kernelopts(version);

          Maple 2025.1, X86 64 LINUX, Jun 12 2025, Build ID 1932578

ode:=diff(y(x),x) = (2*sin(2*x)-tan(y(x)))/x/sec(y(x))^2:

dsolve(convert(ode,sincos));

    y(x) = -arctan((cos(2*x)-2*c__1)/x)

dsolve(convert(ode,sincos),implicit);

    -c__1+x*tan(y(x))+cos(2*x) = 0

There was quite a lot of invalid syntax in your code attempt.

But, here is one way.

restart;

kernelopts(version);

`Maple 2015.2, X86 64 LINUX, Dec 20 2015, Build ID 1097895`

with(plots):

aa := 4: bb := 2:  

f := -(x^2/(aa^2)+y^2/(bb^(2))-1) * aa^2*bb^2/(aa^2+bb^2);

-(1/5)*x^2-(4/5)*y^2+16/5

ell := (2*x/aa)^2 + (2*y/bb)^2 <= 1;

(1/4)*x^2+y^2 <= 1

plot3d(f, x = 0 .. sqrt(-4*y^2+4), y = 0 .. bb/(2),
       axes = boxed,style = patchcontour, grid = [50, 50],
       orientation = [-115, 70], shading = zhue,
       title = "f(x,y) over quarter ellipse domain",
       labels=[x,y,"f"]);

contourplot(f, x = 0 .. sqrt(-4*y^2+4), y = 0 .. bb/(2),
            contours = 15, filled = true, coloring = [blue, green],
            axes = boxed, title = "Contour plot over quarter ellipse",
            grid = [100,100]);

Download Usman_contplot1.mw

Is this the kind of effect you're after?

[edited]

restart

with(PDEtools, declare); with(PDEtools, undeclare)

undeclare(prime, quiet)

declare(u(x, y, t), quiet); declare(v(x, y, t), quiet)

pde1 := diff(u(x, y, t), t)+diff(u(x, y, t), `$`(x, 3))+diff(u(x, y, t)*v(x, y, t), x)

diff(u(x, y, t), t)+diff(diff(diff(u(x, y, t), x), x), x)+(diff(u(x, y, t), x))*v(x, y, t)+u(x, y, t)*(diff(v(x, y, t), x))

pde2 := diff(u(x, y, t), x)-(diff(v(x, y, t), y))

diff(u(x, y, t), x)-(diff(v(x, y, t), y))

V1 := [indets(pde1, And(specfunc(diff), satisfies(proc (fn) options operator, arrow; depends(fn, {t, x, y}) end proc)))[], `~`[apply]([u, v], x, y, t)[]]; Z1 := map(proc (v) options operator, arrow; v = freeze(v) end proc, V1)

[diff(diff(diff(u(x, y, t), x), x), x), diff(diff(u(x, y, t), x), x), diff(u(x, y, t), t), diff(u(x, y, t), x), diff(v(x, y, t), x), u(x, y, t), v(x, y, t)]

pde_linear1,pde_nonlinear1 := thaw([selectremove(type,eval(pde1,Z1)+__f,
                                                 Or(linear(rhs~(Z1)),
                                                    satisfies(f->not depends(f,[rhs~(Z1)[],x,y,t]))))])[]:
pde_linear1:=pde_linear1-__f:

V2 := [indets(pde2, And(specfunc(diff), satisfies(proc (fn) options operator, arrow; depends(fn, {t, x, y}) end proc)))[], `~`[apply]([u, v], x, y, t)[]]; Z2 := map(proc (v) options operator, arrow; v = freeze(v) end proc, V2)

[diff(u(x, y, t), x), diff(v(x, y, t), y), u(x, y, t), v(x, y, t)]

pde_linear2,pde_nonlinear2 := thaw([selectremove(type,eval(pde2,Z2)+__f,
                                                 Or(linear(rhs~(Z2)),
                                                    satisfies(f->not depends(f,rhs~(Z2)))))])[]:
pde_linear2:=pde_linear2-__f:

pde_linear1;
pde_nonlinear1;
pde_linear2;
pde_nonlinear2;

diff(diff(diff(u(x, y, t), x), x), x)+diff(u(x, y, t), t)

(diff(u(x, y, t), x))*v(x, y, t)+u(x, y, t)*(diff(v(x, y, t), x))

diff(u(x, y, t), x)-(diff(v(x, y, t), y))

0

Download linear_ac.mw

nb. You may wish to apply normal (or expand, possibly frontend'd) first, to get the addends of the DE separated.

The (2) in the pretty-printed output of ifactors if actually the function call  ``(2) , ie. a call to the empty name.

It's easier to work with the result from ifactors, instead.

Or you could use the PrimeFactors command in the NumberTheory package.

You approach missed the special case where there is just one prime factor (of multiplicity > 1), in which case the operands of f are not what was expected.

restart;

 

SumPrimeFactors := proc(n)
    local f,p;
    f := ifactor(n);
    if f=1 then return 0;
    elif f::`^` then return op([1,1],f);
    else
      add(op([1,1], p), p in f);
    end if;
end proc:

 

SPF1 := proc(n) local p;
    add(p[1],p=ifactors(n)[2]);
end proc:

 

SPF2 := n -> add(NumberTheory:-PrimeFactors(n)):

 

seq(SumPrimeFactors(i)-SPF1(i),i=1..28);
seq(SumPrimeFactors(i)-SPF2(i),i=1..28);

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

SumPrimeFactors(360),SPF1(360),SPF2(360)

10, 10, 10

 

ifactor(40);
## the elements in the returned product are powers of
## unevaluated function calls (to an unassigned empty name)
## and their first argument (the base prime) can be retrieved using
## the `op` command.
lprint(%);

``(2)^3*``(5)

``(2)^3*``(5)

op([1], ``(2)^3); lprint(%);
op(1, %);

``(2)

``(2)

2

op([1,1], ``(2)^3);

2

op([1], ``(5)); lprint(%);
op([1,1], ``(5));

5

5

5

Download ifact_fun.mw

It sounds like you're seeing this problem.

I suggest that you use the settings as I described in that previous thread's Answer, but also with (the default),

    interface(typesetting=extended):

The Y[i] in the result from convertsys are not the global names Y[i].

You could instead work with convert(sys0,`global`), as one simple way to replace those names.

带有阻尼的固有频率分析

restart

with(Typesetting); Settings(typesetdot = true)

with(LinearAlgebra); with(linalg); with(plots); with(DEtools)

couple := diff(q(t), `$`(t, 2))+nu*(diff(q(t), t))/omega+q(t)+b*L__1*(diff(x(t), `$`(t, 2)))/L-`&alpha;__11`*L__1*(diff(x(t), t))/(L*omega)-`&alpha;__22`*omega*r*L^2*(diff(q(t), t))^3, diff(eta(t), `$`(t, 2))+nu*(diff(eta(t), t))/omega+eta(t)+b*L__1*(diff(x(t), `$`(t, 2)))/L-`&alpha;__11`*L__1*(diff(x(t), t))/(L*omega)-`&alpha;__22`*omega*r*L^2*(diff(eta(t), t))^3, diff(x(t), `$`(t, 2))+`&nu;__1`*(diff(x(t), t))/omega+(`&omega;__1`/omega)^2*x(t)+g*gamma*L*(diff(q(t), `$`(t, 2)))/L__1+g*gamma*L*(diff(eta(t), `$`(t, 2)))/L__1-`&alpha;__11`*L*(diff(q(t), t))/(omega*L__1)-`&alpha;__11`*L*(diff(eta(t), t))/(omega*L__1)-omega*r*L^3*`&varsigma;`*(diff(q(t), t))^3/L__1-omega*r*L^3*`&varsigma;`*(diff(eta(t), t))^3/L__1

couple1 := seq(remove(has, [couple][i], [(diff(q(t), t))^3, (diff(eta(t), t))^3]), i = 1 .. 3)

NULL

data := nu = 2*xi*`&omega;__2`-(1/2)*a__11*`&rho;__air`*D*h__2*U*p__2^2, `&nu;__1` = 2*xi*`&omega;__1`-(1/2)*a__11*`&rho;__air`*D*h__2*U*p__12^2-(1/2)*a__11*`&rho;__air`*D*h__2*U*p__13^2

eqn := subs(data, [couple1])

with(DEtools)

temp := convertsys({eqn[]}, [], {eta, q, x}, t); sys0 := `~`[rhs](%[1]); vars := `%%`[2]

[Y[1] = eta(t), Y[2] = diff(eta(t), t), Y[3] = q(t), Y[4] = diff(q(t), t), Y[5] = x(t), Y[6] = diff(x(t), t)]

var1 := [seq(Y[i], i = 1 .. 6)]

[Y[1], Y[2], Y[3], Y[4], Y[5], Y[6]]

[indets(var1, specindex({Y}))[]]; map(addressof, %)

[Y[1], Y[2], Y[3], Y[4], Y[5], Y[6]]

[36893628250316374108, 36893628250316374132, 36893628250316374156, 36893628250316374180, 36893628250316374204, 36893628250316374228]

foo := [indets(temp, anyindex(anything))[]][1 .. 6]; map(addressof, %)

[Y[1], Y[2], Y[3], Y[4], Y[5], Y[6]]

[36893628250228598724, 36893628250228598916, 36893628250228599252, 36893628250228599444, 36893628250228599780, 36893628250228599972]

map(addressof, convert(foo, `global`))

[36893628250316374108, 36893628250316374132, 36893628250316374156, 36893628250316374180, 36893628250316374204, 36893628250316374228]

collect(simplify(expand(convert(sys0, `global`))), var1, distributed)

[Y[2], -(1/2)*(b*g*gamma-1)*Y[1]/(b*g*gamma-1/2)+(1/4)*((g*(D*U*a__11*h__2*p__2^2*rho__air-4*xi*omega__2)*gamma+2*alpha__11)*L*b-(D*U*a__11*h__2*p__2^2*rho__air-4*xi*omega__2)*L)*Y[2]/(omega*L*(b*g*gamma-1/2))+(1/2)*b*g*gamma*Y[3]/(b*g*gamma-1/2)+(1/4)*(-g*(D*U*a__11*h__2*p__2^2*rho__air-4*xi*omega__2)*gamma+2*alpha__11)*b*Y[4]/(omega*(b*g*gamma-1/2))-(1/2)*b*L__1*omega__1^2*Y[5]/(L*(b*g*gamma-1/2)*omega^2)+(1/4)*((D*a__11*U*h__2*(p__12^2+p__13^2)*rho__air-4*xi*omega__1)*L__1*b-2*alpha__11*L__1)*Y[6]/(omega*L*(b*g*gamma-1/2)), Y[4], (1/2)*b*g*gamma*Y[1]/(b*g*gamma-1/2)+(1/4)*(-g*(D*U*a__11*h__2*p__2^2*rho__air-4*xi*omega__2)*gamma+2*alpha__11)*b*Y[2]/(omega*(b*g*gamma-1/2))+(1/2)*(-b*g*gamma+1)*Y[3]/(b*g*gamma-1/2)+(1/4)*((g*(D*U*a__11*h__2*p__2^2*rho__air-4*xi*omega__2)*gamma+2*alpha__11)*L*b-(D*U*a__11*h__2*p__2^2*rho__air-4*xi*omega__2)*L)*Y[4]/(omega*L*(b*g*gamma-1/2))-(1/2)*b*L__1*omega__1^2*Y[5]/(L*(b*g*gamma-1/2)*omega^2)+(1/4)*((D*a__11*U*h__2*(p__12^2+p__13^2)*rho__air-4*xi*omega__1)*L__1*b-2*alpha__11*L__1)*Y[6]/(omega*L*(b*g*gamma-1/2)), Y[6], -(1/2)*gamma*g*L*Y[1]/((b*g*gamma-1/2)*L__1)+(1/4)*(g*(D*U*a__11*h__2*p__2^2*rho__air-4*xi*omega__2)*L*gamma-2*alpha__11*L)*Y[2]/(omega*(b*g*gamma-1/2)*L__1)-(1/2)*gamma*g*L*Y[3]/((b*g*gamma-1/2)*L__1)+(1/4)*(g*(D*U*a__11*h__2*p__2^2*rho__air-4*xi*omega__2)*L*gamma-2*alpha__11*L)*Y[4]/(omega*(b*g*gamma-1/2)*L__1)+(1/2)*omega__1^2*Y[5]/((b*g*gamma-1/2)*omega^2)+(1/4)*(4*g*alpha__11*L__1*gamma-(D*a__11*U*h__2*(p__12^2+p__13^2)*rho__air-4*xi*omega__1)*L__1)*Y[6]/(omega*(b*g*gamma-1/2)*L__1)]

 

 

Download nature_frequency_question_ac.mw


ps. I did a similar thing just a few weeks ago, in order to substitute for such names.

There are lots of ways to get such a construction. Here are a few.

restart;

f := x -> x[1]^2 + x[2]^2

proc (x) options operator, arrow; x[1]^2+x[2]^2 end proc

# correction of your attempt
# this inefficiently does the differentations every
# time it gets called.
Gf1 := proc(v::{list,Vector}) local x;
         eval(<diff(f(x),x[1]),diff(f(x),x[2])>,
              [x[1]=v[1], x[2]=v[2]]);
       end proc:

Gf1(<2,3>);

Vector(2, {(1) = 4, (2) = 6})

# this does the differentiations once, up front
# presuming that the procedure f returns the expected
# expression when called with symbolic arguments
Gf2 := unapply(Student:-MultivariateCalculus:-Gradient(f(<x[1],x[2]>),
                                                       [x[1],x[2]]),
               x::{list,Vector}):

Gf2(<2,3>);

Vector(2, {(1) = 4, (2) = 6})

# this does the differentiations once, up front
# presuming that the procedure f returns the expected
# expression when called with symbolic arguments
Gf3 := unapply(<diff(f(x),x[1]),diff(f(x),x[2])>,
               x::{list,Vector}):

Gf3(<2,3>);

Vector(2, {(1) = 4, (2) = 6})

F := (a,b) -> a^2 + b^2;

proc (a, b) options operator, arrow; b^2+a^2 end proc

D[1](F), D[2](F);
D[1](F)(2,3), D[2](F)(2,3);

proc (a, b) options operator, arrow; 2*a end proc, proc (a, b) options operator, arrow; 2*b end proc

4, 6

# this does the differentiations once, up front
# using automatic differentiation of procedure f.
Gf4 := subs( d1f=D[1](F), d2f=D[2](F),
             (v::{list,Vector}) -> <d1f(v[1],v[2]),
                                    d2f(v[1],v[2])> ):

Gf4(<2,3>);

Vector(2, {(1) = 4, (2) = 6})

Download grad_f_ex.mw

Another way is to use the n=i for tickmarks along the vertical axis placed at the right.

Here are some ideas along those lines. I wasn't sure how much of the rest of the stylistic elements from your image you wanted to mimic. There is also a version in the attachment with gridlines, but no left-axis. It's your choice of how you want to mix and match such features. (If you have difficulty please just state exactly what look&feel you want.)

S7MAA_Dveloppement_Limit_ac.mw
 

Looking at the structure of the inert integral representation of the PDF (GG in the attachment) then it's not clear (to me) how an elliptic special-function would not appear in the result of symbolic integration.

But, you can reformulate and get rid of the I appearance. (That instance is not the only contributor of imaginary values here, and is countered by other contributors for which the I doesn't appear explicitly.)

And you can also force some simplification and a specific integration method for which the final integration result is much simpler. But, still an elliptic special-function.

Here, I use Maple 2023 (as you did).

Basics_ac1.mw

This site is not letting me inline my attachment right now. But the simpler result is,

    8*EllipticK((-2 + t)/(t + 2))/(Pi^2*(t + 2))

which evaluates to purely real values (for any real t),

and its plot is,

which doesn't have the unfortunate gaps where your plot of your y expression runs into small imaginary float artefacts which are still large enough to disrupt the plot driver.

ps. You also wrote that, "Even a numerical solution would be fine." But you already have a plot. And you complaint is about the formula. So what does "a numeric solution" mean, in that case!? Do you mean that you would be OK with, say, an approximating rational polynomial with float coefficients?

You get so much numeric error that the implicitplot(s) appear empty if the working precision is too small.

You can get noise (and false implicit level-curves) if Digits is increased but still too low.

If you're lucky you can hope that you can find a high enough setting for Digits to that the numeric error is small enough that you get a decently representative implicitplot.

PLOT11_ac0.mw

In the following plot the blue curve is the implicitplot of the imaginary component of your expression, and the red curve is the implicitplot of the real portion. That is using Digits=50.

It might also be possible to rearrange the expression (or terms in it) and so improve the numeric error situation. I didn't try.

You could compare with results in other Answers threads posted so far, but I am not sure that adequate working precision was used throughout. As explained in my worksheet, raising Digits can get you some results rather than your original empty plots, but it might not be enough (in which case spurious zeroes might even be "found").

As dharr noted, the situation might possibly be further improved if you used higher working precision while forming your mixed float/symbolic expression -- though we have been given no clues at all as to how it was formed. Possibly even better might be if you had an earlier purely exact symbolic expression (with no floats at all), which might be manipulated and then evaluated to float numeric with less running error. We cannot know any of that, being quite in the dark.

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