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

Cannot calculate derivative (gradient) of a procedure returned by dsolve.

Say, I solve the equation:

S1 := dsolve([diff(y(x), x$2)-1.0325*diff(y(x), x)+1.36*y(x)=sin(2*x), y(0)=0, y(1)=1], numeric, y(x), 'output' = listprocedure);

Its solution easily can be retrieved and looks fine:

H:=rhs(S1[2]); 

plot(H(t), t = 0..1, thickness = 4);

3

But when I try to calculate the gradient of H, I receive the error:

H1 := codegen[GRADIENT](H);

Error, (in intrep/statement) unable to translate Array(1..4, {(1) = proc (outpoint) local X, Y, YP, yout, errproc, L, V, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; X := Vector(8, {(1) = .0, (2) = .14817993189456188, (3) = .31785812820433257, (4) = .47163479035679234, (5) = .6130306894371967, (6) = .7460958115245858, (7) = .8741894219027533, (8) = 1.0}, datatype = float[8], order = C_order); Y := Matrix(8, 2, {(1, 1) = .0, (1, 2) = .47692145669848085, (2, 1) = 0.7710429970702501e-1, (2, 2) = .5707930170882397, (3, 1) = .1866916935738028, (3, 2) = .7299040171277492, (4, 1) = .3128649714509215, (4, 2) = .9171936...

Gradient of procedures defined by  ":= proc()" is calculated properly.

I experienced strange operation of "union" for sets of vectors.

Mt1:=Matrix(2, 4, [[ 0,1, 0, 0], [ 0,  0,  1, 1]]); Ms := Vector[column](4, [8,4,2,1]); St1 := {}:

St1:= `union`(St1, {Mt1 . Ms});

I am surprised, because each execution of union adds new and the same vector <4 | 3> to set St1:

1

But after copying any set in the clipboard and pasting the set St1 has only one instance of vector <4 | 3>:

2

What does it mean?

Dear friends,

Recently I was surprised when discovered the following error in using the function solve. If I run the simlest example from the help system for the first time (or after restarting), the following error occurs:

If I run this example repeatedly, this brings the following:

1

Previously in earlier versions I used solve many times for very complex computations and have never seen something similar.

Any suggestions are welcomed.

Hi all

Can anybody suggest an algorithm allowing to detect, that two matrices of the same size can be obtained each from other by permutations of rows and columns? Maybe, such an algorithm there exists in LinearAlgebra package?

Maple has a powerful package for manipulation with logical expressions (Logic package). But it lacks for transfomation a boolean expression to algebraic normal form (ANF). In fact, this transfomation is very simple and implements by applying simple rules

to disjunctive normal form.

I suppose that this can be reached by introducing some custom operators and transfomations, if it is possible in Maple.

 

4 5 6 7 Page 6 of 7