Applications

acer's picture

undoing one form of symbolic root

In this previous post, an example is shown that demonstrates the potential problems that can arise following symbolic conversions such as from sqrt(x^2)  to x^(1/2).

This provides a Maple solution to compute the bivariate normal distribution by recursions for numerical inputs. It works even for extreme cases and handles situations, where usual integration with Maple has serious problems (even after reducing to dimension 1), it seems to be reliable and fast and works in 'arbitrary' precision.

To use it call N2_as_sum(1.0, 2.0, 0.8,  200) to compute the BVN for x = 1.0, y = 2.0 and correlation rho = 0.8 with at most 200 recursion steps (it will stop earlier, if no more improvements can be seen).

cube roots of negative numbers

Why does the following give me an imaginary number?

 (-.008)^(1/3);

discontinuities

My calculus book says that y = (x^2 - 2)/(x - sqrt(2)) is discontinuous at 2, but Maple finds a limit of

 

unwith

Does the following error message mean that the only way to remove RealDomain is to exit Maple & then start a new session?

 unwith(RealDomain):

Robert Israel's picture

When Is Runge-Kutta Exact?

A recent posting of Mario Lemelin showed that Maple's default numerical methods produced wrong results for a certain differential equation.  Further investigation revealed that the problem stemmed from the fact that the fourth and fifth order Runge-Kutta methods used within the rkf45 method both produce the same (exactly correct) result at any step size, causing the adaptive error analysis to go badly wrong.  This leads to the question: when do Runge-Kutta methods produce exact results for arbitrary step sizes and initial conditions?

For a partial answer, see this worksheet: View 4541_runge.mw on MapleNet or Download 4541_runge.mw

Limit problem

Here's a limit where Maple stalls:

Ø     limit((sqrt(h^2+4*h+5)-sqrt(5))/h,x=0,right);
Ø      

The best it can do is

command help

I want to use the differentiate function for this problem.

y=(x^3+3x+11)(x-1)^5,

and the other one I need help with is

Differentiate y=sqrt3x-1/x

Having difficulty in know how to enter problems in Maple.

acer's picture

int() and float input

This is one sort of Maple inconsistency that interests me. Why should the first example behave like evalf(Int(...)) and call `evalf/int` while the second example does not?

alec's picture

Bernoulli Distribution with Serial Correlation

A random sample of length n drawn from Bernoulli distribution with probability of success prob, that has a correlation c with itself shifted back lag steps, can be generated using following procedure,

SampleWithCorr:=proc(prob::And(numeric,satisfies(c->c>=0 and c<=1)),
lag::posint,c::And(numeric,satisfies(c->c<=1 and c>=-1)),n::posint)
local X,B,S,C,s,i;
uses Statistics;
X:=RandomVariable(Bernoulli(prob));
S:=Sample(X,n);
if n<=lag or s=0 then S else
s:=signum(c);
B:=RandomVariable(Bernoulli(abs(c)));
C:=Sample(B,n-lag);
if s=1 then 
for i from lag+1 to n do
if C[i-lag]=1 then S[i]:=S[i-lag] fi od;
else for i from lag+1 to n do
if C[i-lag]=1 then S[i]:=1-S[i-lag] fi od
fi fi; S end:
Syndicate content
}