KonstantinW

240 Reputation

9 Badges

18 years, 73 days
Kharkov, Alaska, United States
PhD in Numerical Optimization

MaplePrimes Activity


These are questions asked by KonstantinW

Earlier smoothly working generation of normal distribution in v. 2019 unexpectedly shows the error:

RandV  := Statistics[RandomVariable](Normal(0, 1));
Statistics[Sample](RandV, 10);

Error, (in p) unable to convert Float(undefined) to an integer

 

The issue concerns calculation of 2nd derivative of the numerical solution of 2nd order BVP for an ordinal DE.

Lets consider a test problem:

-y’’(t)+y(t)=t*sin(5*t)

y(0)=0.2, y(1)=1

 Numerical solution was obtained by

dsolve([-diff(F(x), x$2)+F(x)= x*sin(5*x), F(0)=0.2, F(1)=1], [F(x)], type = numeric, 'output' = Array([seq(k/5, k=0..5)]));

 

dsolve returns the values of the solution and its 1st derivative (for the test example, a solution can be obtained analytically, but for general case I require numerical solution)..

It is needed to calculate the 2nd derivative of the solution.

I tried to use the Bessel method, when the solution’s 2nd derivative is calculated as the 2nd derivative of 5th degree polynomial having in consequent points t1, t2, t3 the values y(t1), y(t2), y(t3) and 1st derivatives y’(t1), y’(t2), y’(t3), all obtained from the numerical solution. Later I use Hermit piecewise-polynomial interpolation, based on values of the solution and its 1st and 2nd derivatives (polynomial of 5th degree).

Unfortunately, 2nd derivative of such interpolation has a large non-smoothness.

Here, we see the solution. It is smooth.

Here, 1st derivative. Still smooth enough.

Here, 2nd derivative. Typical view with large and sharp teeth.

 

 

Maybe, there exists a simple method for calculation of more smooth 2nd derivative?

Also. it is desirable that it would be embedded in Maple.

Dear friends,

I noticed that the function numbcomb from the package combinat fails to calculate a value properly.

Let's try to calculate the example from the function's help page:

combinat[numbcomb](7, 3);
combinat[numbcomb](5, 4);

returns 35, 5 correspondingly, whereas should be 15 and 4.

Please, check this in your systems. Maybe, this is a bag in my installation?

 

Dear friends,

maybe, somebody knows how to remove annoying text of the first line of a Code Edit Region when a Region is collapsed.

Here, Region in expanded state:

But after collapsing the first line still remains:

Maple easily solves multi-points problems for an ODE, if the equation can be integrated analytically.

For example, the following 3-points problem  is solvable:

dsolve([diff(y(x), x$3)+diff(y(x), x$2)+y(x)=1, y(0)=0, y(1)=0, y(2)=1], [y(x)]);

But a similar problem cannot be solved numerically.

For example,

dsolve([diff(y(x), x$3)+diff(y(x), x$2)+y(x)=1, y(0)=0, y(1)=0, y(2)=1], [y(x)], type = numeric, 'output' = Array([seq(k/5, k=0..5)]));

generates: Error, (in dsolve/numeric/process_input) boundary conditions specified at too many points: {0, 1, 2}, can only solve two-point boundary value problems

I need to solve a certain number of multi-points problems for ODE systems numerically. Maybe, for this there are some workaround?

1 2 3 4 5 6 7 Page 2 of 7