Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 364 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@John Dolese Yes, essentially, compiling forces hfloats.

@AngelaRURU 

I'm not sure what you mean. Do you mean this?

plots:-display([
     seq(plots:-spacecurve([t, i, 5*ln(6*t/sin(Pi/12*(i-1)))], t= -Pi..Pi), i= 2..12)
], axes= boxed, thickness= 3);

(Note that your function isn't defined for i = 1.)

@tomleslie

Tom: The OP wants to estimate the order of convergence of the numerical method. That is, they want to estimate the exponent n in the equation ||error|| = C*stepsize^n. This is equivalent to finding the slope n in the least-squares regression line log(||error||) = log(C) + n*log(stepsize). The command to do this is Statistics:-PowerFit, which combines the steps of taking the logarithms and doing the least squares.

In the following example, I use this technique to test the order of convergence of the fourth-order Runge-Kutta algorithm for IVPs.

restart:
Digits:= 99:
N:= 16:
for n to N do
     step:= 2^(-n);
     sol:= dsolve(
          {diff(y(x),x)=y(x), y(0)=1},
          numeric, stepsize= step, method= classical[rk4], maxfun= 0
     );
     err:= abs(eval(y(x), sol(1)) - exp(1.));
     X[n]:= step;  Y[n]:= err
end do:

Digits:= 10:
Statistics:-PowerFit(convert(X,list), convert(Y,list), delta);

So, the experimental order of convergence is 3.98, which agrees closely with the theoretical order of convergence, 4.

 

@faisal Most of what I know about the BVP methods is what is given on the help page ?dsolve,numeric,bvp. There are four methods, which seem closely related. My guess is that they all use a mesh of points evenly spaced on the interval. The function values at these points are obtained by solving a system of equations with Newton's method. Interpolation is then used to get the function values at points between the mesh points, if the user requires that.

@Josolumoh You have the wrong Sample command. The Sample command for filling the Matrix M (which I gave a few Replies above) is

Statistics:-Sample(B1, M, method= [discrete, range= 0..n]);

rkf45 is an IVP method. Your problem is a BVP, so it wasn't using rkf45. For information about the methods used for BVPs, see ?dsolve,numeric,bvp.

@Josolumoh 

Please post your executed Maple worksheet as an attached file.

@John Dolese 

There are many top-level (i.e., non-package) Maple commands for converting to integer: round, ceil, floor, trunc.

The default numbers in Maple aren't floats because conversion from exact results to floats is mostly a one-way process---the floats cannot usually be converted back to exact values. The exact results can always be converted to floats with evalf. There are not many results of substantial mathematical interest that can be proven with floats.

@AngelaRURU 

Go to menu Tools => Options => Precision. The last item is "Limit expression length to...." Uncheck the box. Then click on Apply to Session or Apply Globally.

@Josolumoh 

Please read the help page ?ExportMatrix

The ... wasn't intended to be used literally! It's meant to be filled with other options, which you'll find if you read the help page.

@Josolumoh I gave the ExportMatrix syntax wrong. It should be

ExportMatrix(F, M, ...);

where F is the filename, M the matrix, and ... the other options. See ?ExportMatrix.

@SamNaval That being the case, your differential order is 8: 4 with respect to x and 4 with respect to y. So you need 8 boundary conditions. You only have six.

@Josolumoh What is your Maple version? Also, please post an executed worksheet that contains this erroneous result.

@Josolumoh Suppose that you want to fill an n by m Matrix for export to another package. Then do

M:= Matrix((n,m), datatype= float[8]);
Statistics:-Sample(B1, M, method= [discrete, range= 0..n]);
ExportMatrix(M,
...);

where ... represents whatever ExportMatrix options are appropriate for the target package.

@SamNaval 

In your original differential equation there appears a term w''(x)''(y). I'm not familiar with that notation. Does it mean

diff(w(x,y), x, x, y, y);

?

 

First 443 444 445 446 447 448 449 Last Page 445 of 709