acer

32490 Reputation

29 Badges

20 years, 8 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Dkunb evalf(Int(...)) uses option remember,system so doing duplicates in rapid succession will utilize "remembered" results.

So your idea to do the numeric integration once (each, followed by substitution) is a well-meaning idea but not beneficial if all's done properly.

What can make a big effect here is using method=_d01akc (periodic), or method=_d01ajc for you evalf(Int(...)) calls. Do that after substituting numeric parameter values, otherwise an inadvertant evalf will strip off that option.

You latest code is too convoluted and perhaps not robust. The combination of Expand and then multiplication by I looks nonrobust. Best would be if you provided the slow code in full, including the float results. Otherwise fixing it up is problematic.

Did you intend exp(x^2) instead of e^(z^2) ?

 

restart;

Eq := -8*(rho + 1)^4*Lambda^4 + 12*(rho + 1)^3*Gamma*(rho - 1)*Lambda^3 - 5*(rho + 1)^2*(-4/5 + Gamma^2*rho^2 + 2*(-2/5 - Gamma^2)*rho + Gamma^2)*Lambda^2 - 4*(rho + 1)*Gamma*(rho^2 - 1)*Lambda + Gamma^2*(rho + 1)*(rho - 1)^2;

-8*(rho+1)^4*Lambda^4+12*(rho+1)^3*Gamma*(rho-1)*Lambda^3-5*(rho+1)^2*(-4/5+Gamma^2*rho^2+2*(-2/5-Gamma^2)*rho+Gamma^2)*Lambda^2-4*(rho+1)*Gamma*(rho^2-1)*Lambda+Gamma^2*(rho+1)*(rho-1)^2

with(RootFinding:-Parametric):

m := CellDecomposition([Eq=0, Lambda>0, Gamma>0], [Lambda]):

CellPlot(m, samplepoints, view=[0..10,-2..2], size=[400,300]);

NumberOfSolutions(m)[2..3];

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

SampleSolutions(m,3);

[[Lambda = .5161075747]]

SampleSolutions(m,3);

[[Lambda = .5161075747]]

 

Download rho-analysis_acc.mw

@C_R

IVPOrder is a local of the Student:-ODEs module, not an export.

A few ways get what you're after,

restart;
kernelopts(opaquemodules=false):
stopat(Student:-ODEs:-IVPOrder1,14);

        [ODEs:-IVPOrder1]

restart;
stopat(Student:-ODEs::IVPOrder1);

        [ODEs:-IVPOrder1]

restart;
stopat((Student::ODEs)::IVPOrder1);

        [ODEs:-IVPOrder1]

I am surprised to see such a mistake in a Library routines. It's pretty common to do instead something like,

   indets(expr, And(name,Not(constant)))

or,

   indets(expr, name) minus {constants};

@MaPal93 Don't spawn more wholly sepatate new threads on this.

In your second to last example you first asked, "What proportion of the population needs to be vaccinated in order to prevent an epidemic...", and then you set p=0.5 where initial condition is R(0)=p, and then ended with the statement,
   "The required vaccination coverage is around 50% ."

Is that supposed to show some deduced computation? Clearly the "required vaccination coverage" was not computed there. We might accept that 50% is adequate (the R(t) plot is flat), but why wouldn't slightly less also work? The word "required" makes it seem as if no less would do.

The same thing happens in the last example. You start by setting p=0.83, and then end with the statement that 83% is required. Why is that much required? What's the computational criterion to accept that 0.83 was the smallest value that was adequate?

@dharr Is this at all related to procedure f in the 3rd attachment in this Answer? (tracking largest positive RootOf, to help with "switch" when, say, roots coincide at a point, or number of real roots changes, etc).

There I used fnormal and simplify(..,zero) and doubled-Digits to help with imaginary artefacts.

Plot problem reported, regression in Maple 2024.0,

plot(Pi/2-arccos(h/sqrt(h^2+2)),h=0..3),
plot(Pi/2-arccos(h/sqrt(h^2+2)),h=0..3,adaptive=true);

plot(arccos(1/sqrt(x))),
plot(arccos(1/sqrt(x)),adaptive=true);

@minhthien2016 The result is correct.

But you can get rid of the warning with,

   solve(temp = Pi/3, h, useassumptions);

What happens if you replace sum by add?

note: It'd be more useful if you would provide the complete code-to-reproduce.

@nmacsai If there were a way to change the color of the edge of a POLYGONS structure then we'd likely give it in an answer.

I believe that a POLYGONS plotting structure can have either a style where the edge is shown and black, or a style where the edge is not shown.

A POLYGONS plotting structure only has one COLOUR substructure, and that relates only to the color on the interior face.

@AHSAN 

You should,
1) define properly (clearly and in full detail) what you mean by, "check the convergence or validity of the numeric method".

2) define properly (dlearly and in full detail) what you mean by, "streamline pattern" in this context. Simply restating it as, say, "stream functions" is not adequate.

If I don't respond further it's likely because I didn't see adequate details.

@AHSAN I didn't put the "error" in before because you hadn't yet told us what you meant by that.

Now that you've responded that you want the absolute error, here it is:
   HelpAhsan_acc.mw

Do you think that your series solution is accurate? If so, why?

@WA573 You didn't mention D[2](s)(n+1,t) before, and I so didn't consider it because as-is it's not like, "functions with s(n+1,t)" as you originally wrote. But it might first be changed to Diff form, to get that.

Is this correct, as far as D[2](s)(n+1,t) goes? I mean, except for your other query. I'd have to think about your other query, about "(∂)/(∂ (sigma2*t))=1/(sigma2)(∂)/(∂ t), sigma2 is constant".

shift_acc.mw

@WA573 I gave three alternatives for assigning to sourcefolder. I don't know whether all three fail for you.

More importantly, I cannot tell whether you have a file named wkptest_cpc in that folder (wherever it may be).

First 44 45 46 47 48 49 50 Last Page 46 of 594