acer

32313 Reputation

29 Badges

19 years, 313 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

For interest,

restart;

u1 := RootOf(4*_Z^2 + (4*RootOf(60*_Z^3 - 60*_Z^2 + 15*_Z - 1) - 4)*_Z
             + 4*RootOf(60*_Z^3 - 60*_Z^2 + 15*_Z - 1)^2
             - 4*RootOf(60*_Z^3 - 60*_Z^2 + 15*_Z - 1) + 1):

 

evalc([solve(evala(Minpoly(u1, x)), x)]);

[(1/3)*cos((1/3)*arctan(3/4))+1/3, -(1/6)*cos((1/3)*arctan(3/4))+1/3-(1/6)*3^(1/2)*sin((1/3)*arctan(3/4)), -(1/6)*cos((1/3)*arctan(3/4))+1/3+(1/6)*3^(1/2)*sin((1/3)*arctan(3/4))]

evalf(%);

[.6590276223, .1090390090, .2319333686]

 

p := evala(Minpoly(u1, x));

x^3-x^2+(1/4)*x-1/60

solve(p, x, explicit=false); # that friend

RootOf(60*_Z^3-60*_Z^2+15*_Z-1)

Download RO_exB.mw

@dharr I don't see that this Answer's results are correct.

@dharr I plan to submit one bug report for that weakness in simplify (of the form with the pesky sqrts), and another for the failure of allvalues on the original RootOf.

So is it the case that you want to find values of the parameters sU and sV such that u(bV)=betaU and v(bV)=betaV?

You have some coding miskakes. eg. you don't provide a mechanism to force shootNL to return just one of u(bV) or v(bV), upon request. Such mistakes can be corrected, but I think perhaps you ought to provide an extra detais:

1) How close to u(bV) and v(bV) have to be to betaU and betaV, for you to accept the parameter values?

2) Why do you think that there is a solution in the narrow ranges you gave?

@C_R For plot3d an alternative to the color option is the colorscheme option. It has some fancy functionality, as well as some simple things such as using just a ColorTools Palette name (Maple 2023),

plot3d(argument(re+I*im), re=-2..2, im=-2..2,
       colorscheme="turbo", grid=[100,100],
       style=surfacecontour, lightmodel=none,
       labels=[Re(z),Im(z),``], orientation = [-90, 0, 0]);

I'm not sure whether your forced orientation is because you want only a 2D effect. If that's so then in Maple 2023 you could also do something like,

with(plots):
display(
  densityplot(argument(re+I*im), re=-2..2, im=-2..2,
              restricttoranges=true, grid=[100,100],
              colorscheme="turbo", style=surface),
  contourplot(argument(re+I*im), re=-2..2, im=-2..2,
              grid=[100,100], thickness=0.5,
              color=black, colorbar=false),
       labels=[Re(z),Im(z)], axes=box, size=[550,500]);

ps. Unfortunately densityplot doesn't accept style=surfacecontour, hence the accompanying call to contourplot.

@Art Kalb I don't know what kinds of expression you might have in general, ie. whether there might be other symbolic powers or functions of xi. But the case discussed so far can have a K*xi^0 term handled as follows.

restart;

 

expr := a*xi^2 - b*xi^4 - c + d/xi^4;

a*xi^2-b*xi^4-c+d/xi^4

map(t->H(degree(t,xi))*t, expr);

H(2)*a*xi^2-H(4)*b*xi^4-H(0)*c+H(-4)*d/xi^4


If you actually wanted to see the inert powers:

F := proc(t) local d:=degree(t,xi);
       H(d)*coeff(t,xi,d)*xi%^d;
     end proc:

 

alt := map(F, expr);

H(2)*a*`%^`(xi, 2)-H(4)*b*`%^`(xi, 4)-H(0)*c*`%^`(xi, 0)+H(-4)*d*`%^`(xi, -4)

value(alt);

H(2)*a*xi^2-H(4)*b*xi^4-H(0)*c+H(-4)*d/xi^4


If expr were not a sum of terms, ie.  type(expr,`+`)=false
then one could apply the transformer to it direrctly.

Download repl_ex4.mw

The dummy mechanism I used for my applyrule approach could be used also for the subsindets approach (instead of freeze/thaw).

As mentioned, I did it two ways on purpose.

expr := xi - xi^2 + 1/xi^3 - 1/xi;

xi-xi^2+1/xi^3-1/xi

eval(subsindets(expr,identical(xi)^integer,
                u->(H*__P)(op(2,u))),
     [xi=H(1)*xi,__P=(u->xi^op(u))])

H(1)*xi-H(2)*xi^2+H(-3)/xi^3-H(-1)/xi

Carl's idea to use temp name for xi is shorter than my use of temp __P calls for storing k the exponent. And such a modification can also shorten my earlier applyrule solution:

expr := xi - xi^2 + 1/xi^3 - 1/xi;

xi-xi^2+1/xi^3-1/xi

eval(applyrule([xi^(k::integer)=H(k)*__P^k],expr),
     __P=xi);

H(1)*xi-H(2)*xi^2+H(-3)/xi^3-H(-1)/xi

The temporary name (whether __P or %xi or what have you) is used to avoid the infinite recursion.

@Carl Love Right, one subsindets call can clearly do both steps. Thanks. (My mind was on whether I could do much better than the freeze/thaw to avoid the infinite recursion, rather than how I delivered it...)

The OP hasn't yet explicitly asked why the endless loop occurred for him. I expect it's just that he was seeing the applyrule or subsindets action being re-applied to the new xi^k instances in the inserted H(k)*xi^k expressions, over and over.

I tried to make it fun by having my subsindets approach bypass the recursion using freeze, while my applyrule approach used the dummy __P.

It's still not entirely clear to me whether the OP wants an original xi=xi^1 and xi^(-1) handled, etc.

@vv You could get by with,

   <seq(`<|>`(seq(M[i])),i=1..2)>

@C_R You may have misunderstood me. I was not suggesting that you use a projected map of the Earth as image, or anything else as large, complicated, or hard to find as that.

I just intended this suggestion as a quick and easy way to get going with testing of a variety of pre-made, low-resolution patterns.

For example one could quickly use the Read and Scale commands of the ImageTools package, combined with the image option of the plot3d command. That Read command works with a URL for the string/name, so pattern images from the web may be tried.

Once you find a simple pattern that's effective for your task you might write the Maple code that produces it (or something akin to it).

@RezaZanjirani I can, but not for a few days.

@nm I don't understand why you chose your initial example, as opposed to your followup example.

@Zeineb You haven't explained what you're trying to accomplish.

The code is somewhat murky to me; I don't understand how you're intending to use the names t and x.

You also haven't told us what exact results you're expecting.

Are you perhaps looking for something like this?

restart;

kernelopts(version);

`Maple 17.02, X86 64 LINUX, Sep 5 2013, Build ID 872941`

(1)

int( (diff(psi(t), t))*(psi(x)-psi(t))^(alpha-1),
     t = 0 .. x, continuous )/GAMMA(alpha);

(psi(x)-psi(0))^alpha/(alpha*GAMMA(alpha))

(2)

Download compute_integral_1_ac.mw

@sursumCorda There is no super-special syntax for pairing multiple rules and transformations, but such a thing may be accomplished in a straightforward manner, although it may involve duplicate coding of the types.

The indets family of commands use Maple types for the second argument. There is a Help-page for building up structured (compound) types. I'm sure that you already know that {...} and Or(...) can be used to specify alternate types.

But you also want multiple conversions.

The third argument to subsindets/evalindets can be any custom procedure you want. It could be an appliable module. It should be able to involve overload. Such customization can distinguish between multiple types (in whatever heirarchy you want), and dispatch accordingly, in several different ways. You might need to duplicate the alternate types from the second argument in the dispatch mechanism.

First 51 52 53 54 55 56 57 Last Page 53 of 591