acer

31297 Reputation

29 Badges

19 years, 111 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@segfault We gave different ways that produce the same part for your asympt example, ie. the O term.

I wrapped my first way with order and I wrapped my second way with degree@op, as programmatic followup since you mentioned both the O term as well as the order itself.

You can compare:

s:=asympt(x/(1-x-x^2),x);

s-convert(s,polynom);

series(s,x);

indets(s,specfunc(O))[1];

# or,
indets(s,specfunc(O))[];

@Ronan If we did just Metric:=M then some change to the original Matrix would also be seen when subsequently accessing the stored local Metric.

But such a change to the original Matrix would not be accompanied by a recomputation of the inverse. So the stored inverse could then be wrong.

You wouldn't want that behaviour, as in this modified worksheet, I suspect:
2024-12-30_Q_Module_Global_and_Local_oops.mw

@sursumCorda You can try wrapping that part in an eval call, within the proc to be compiled. Eg.,
   eval(`if`(isprime(j),1,0))
The Compile command may issue a Warning about isprime not being recognized, but in this example it seems to work ok.


ps. The evalhf mechanism also allows for this kind of escape (back to Maple proper).

@Axel Vogt That's a fun idea.

That inner loop could be exited as soon as f ever became zero. Eg,

for k to j-1 do
            f := f*k*k;
            f := f mod j;
            if f=0 then k:=j-1; next; end if;
        end do;

That brings the cJ(40) timing down from 17.4sec to 4.7sec on my machine.

axel_J_ac.mw

Naturally, this is still trying to adhere to the OP's formula using mod, not some faster equivalent.

@nm You wrote that you are making relative paths, but that's not true. Your given cat calls make absolute paths.

And the extra step of applying cat is not necessary, since you had already set currentdir. That concatenation entirely misses the point and purpose of using currentdir.

(If absolute paths were wanted you could also just assign the prefix to any name.)

@vv You may well already know this, but pardon me if I mention that one can extract a value using sol(last) in your code.

Eg. colibri-vv_ac.mw


ps. I'm reminded of this old post, where I was just having fun with dsolve's events option.

@Rouben Rostamian  When n=4 and j=16 then the compiled code tries to compute (15!)^2 which is too big for a 64bit integer in compiled C, and it throws that error.

So one might ask: how to compute ((j-1)!)^2 mod j without having to actually compute ((j-1)!)^2 explicitly.  Handling only the square (via inert `mod` stuff`) is not enough to go much further; the factorial is a sticky wicket.

@ecterrab If I run the same worksheet as I did before, using Maple 2024.1, then some of those diff calls take a while, and then throw an error.

So there was certainly some point release at which it did not work ok in Maple 2024.

I mention all this so that the OP of this Question understands that loading the Physics package can indeed make a difference here.

I leave it to the OP to decide whether to go with Maple 2024.2, or not load Physics, or install the latest add-on Physics update package, etc.

restart

kernelopts(version)

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

with(PDEtools)

with(LinearAlgebra)

with(Physics)

with(SolveTools)

undeclare(prime)

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

declare(u(x, t)); declare(U(xi)); declare(G(xi))

u(x, t)*`will now be displayed as`*u

U(xi)*`will now be displayed as`*U

G(xi)*`will now be displayed as`*G

T := xi = -V*t+x; T1 := u(x, t) = U(-V*t+x)*exp(I*(-k*x+t*w+theta))

xi = -V*t+x

u(x, t) = U(-V*t+x)*exp(I*(-k*x+t*w+theta))

P3 := diff(u(x, t), x, t)

Error, (in anonymous procedure called from Typesetting:-ASM) too many levels of recursion

P33 := diff(u(x, t), x)

diff(u(x, t), x)

P333 := diff(P33, t)

Error, (in anonymous procedure called from Typesetting:-ASM) too many levels of recursion

 

Download why_ac_M2024.1_oops.mw

@salim-barzani It works ok in my Maple 2024.1 without Physics loaded.

restart

kernelopts(version)

`Maple 2024.1, X86 64 LINUX, Jun 07 2024, Build ID 1829667`

with(PDEtools)

with(LinearAlgebra)

NULL

with(SolveTools)

undeclare(prime)

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

declare(u(x, t)); declare(U(xi)); declare(G(xi))

u(x, t)*`will now be displayed as`*u

U(xi)*`will now be displayed as`*U

G(xi)*`will now be displayed as`*G

T := xi = -V*t+x; T1 := u(x, t) = U(-V*t+x)*exp(I*(-k*x+t*w+theta))

xi = -V*t+x

u(x, t) = U(-V*t+x)*exp(I*(-k*x+t*w+theta))

P3 := diff(u(x, t), x, t)

diff(diff(u(x, t), t), x)

P33 := diff(u(x, t), x)

diff(u(x, t), x)

P333 := diff(P33, t)

diff(diff(u(x, t), t), x)

Download why_ac_M2024.1.mw

@nm I suggest using Grid instead of Threads for dsolve computations that you want to run in parallel.

What happens if you omit the with(Physics) line?

The limit and int commands are not Thread-safe, in general, and neither is dsolve.

May I ask, did you file a Software Change Request (ie. bug report) against this, either by form, direct message to Tech Support, or via the Beta forum?

@mmcdara Note that this member has deleted their own earlier Questions, several times, including earlier Question threads that have involved responses.

This member asked whether they ought to delete their own earlier Questions, prior to posting related followup queries. I responded, no, please don't do that; It makes no sense to remove the earlier context, and doing so would be unhelpful. I suggested instead to retain all the earlier details & responses, and either put the followup details/queries in new Replies on the earlier threads, or Branch off earlier threads. That was repeating similar requests made half a dozen times before. In direct response, this member then responded that yes, they'd do that.

The member then admitted to deleting yet more earlier Question material (thread, and responses) of their own. So now it's much harder for any moderator to know whether followup Questions by them are duplicates.

I shall steer clear of all Questions by this member.

ps. Not everyone may have seen the full extent of multiple-posting/reposting by this member (some may get deleted before being seen by all, etc) -- possibly the most extreme I've seen in over 20 years on this site.

Are you asking about Maple Flow, or Maple?

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