[go: up one dir, main page]

Items tagged with kernel

Feed App Center

In the most recent issue of Maple Transactions, I published (with David Jeffrey, and with a student named Johan Joby) a paper that used Jupyter Notebook with a Maple kernel as the main vehicle.  Have a look, and let me know what you think.

Two-cycles in the infinite exponential tower

Have you ever heard of a matrix kernel or nullspace? If not, or you’d like a refresher on the topic, keep reading! We’re doing a Maple Learn document walkthrough today on Fundamental Subspaces.

The document starts by defining the nullspace/kernel and nullity of a matrix. Nullity is defined as the number of vectors in the basis of the kernel for the given matrix. This makes sense, as nullspace is defined as:

                                    

This may still not make sense to you, and that’s okay! We have an example for a reason, where we try to find a basis for Null(A) and state the dimension of the subspace (nullity).

                                              

I won’t go through the solution here, as trying it yourself is always important. But one hint! If you get really stuck, you can find the Reduced Row Echelon Form (RREF) and the kernel using Maple Learn’s context panel, or check out the rest of our Matrices collection for other helpful documents on this topic.

 

Please let us know what you thought of this walkthrough or if there are any specific documents or topics you’d like to see in the comments below this post. I hope you enjoyed this walkthrough!

Hi there!

I'm attempting to develop a custom library in MapleSim (a Modelica solver engine) that can use convolution integrals to model the hydrodynamic behaviour of floating bodies. The convolution integral is mathematically represented as follows:

a general form of a convolution integral, spanning from negative to positive infinity in time

And the equation I'm particularly interested in solving is as follows:

Cummins equation to determine the motion of a floating body in waves

I'm trying to solve this convolution integral in Modelica using a model that can be imported to MapleSim. So far, I've had no luck in implementing this convolution for continuous functions symbolically. I have used a numerical approach on 2 arrays using the following approach in Modelica:

// Modelica function
function convIntegral
  input Real simTime;  // Simulation time
  input Real f[:];     // Kernel function array
  input Real g[:];     // Second function array

  output Real h[(2*simTime) - 1];    // Output the convolution integral in the form of an array
  
  // Define the algorithm to numerically compute the convolution integral of 2 arrays
  algorithm
    // Initialize the output array with zeroes
    for i in 1:((2*simTime) - 1) loop
      h[i] := 0;
    end for;
    
    // Iterate over the simulation time
    // Recursively increment the convolution array with the pointwise product of the 2 functions
    for i in 1:simTime loop
      for j in 1:simTime loop
        h[i+j-1] := (f[i] * g[j]) + h[i+j-1];
      end for;
    end for;
end convIntegral;
// End of function to compute the convolution integral

This works perfectly for discrete samples and I have verified it with output from Matlab's inbuilt function

conv(A,B)  % For 2 arrays A and B

However, I would like to implement this on 2 continuous functions and this numerical approach does not work since MapleSim does not support conversion between discrete and continuous signals.

I understand that convolution is essentially an operation between two functions, where we time-flip one of the functions (kernel) and then slide it across the other function while measuring the bounded area and outputting that as the result of the convolution. I include this image from Wikipedia that sums up convolution: (Not including links as they mark questions as spam)

I've tried implementing this in Modelica using the following code:

// Model to perform convolution on 2 continuous functions
model ConvolutionalIntegral

  extends Modelica.Blocks.Icons.Block;

  // Define model variables
  Real kernelFunction = (e ^ (-0.5 * time)) * cos(0.5 * time);  // I've taken an example of a function I might use
  Real kernelFunctionFlipped = (e ^ (-0.5 * (T_sim - time))) * cos(0.5 * (T_sim - time));  // I've flipped the kernel function about the vertical axis by converting the (time) variable to (T_sim - time) where (T_sim) is a variable storing the simulation duration
  Real secondFunction;  // The other function for the convolution
  Real convolutionIntegralOutput;  // Function to store the output
  
  equation
    // Convolution implementation
    der(convolutionIntegralOutput) = kernelFunctionFlipped * secondFunction;

    // Final equation to solve
    der(secondFunction) + convolutionIntegralOutput = 0;
    // An example of a differential equation I'd like to solve involving the convolution integral
    
end ConvolutionIntegral;

I had hoped that this would yield the output of the convolution since I'm essentially multiplying the time-flipped kernel and the other function and then integrating them over time. However, the output does not provide the expected result and it appears that Modelica interprets my code to mean that I'm integrating the pointwise product of these 2 functions over time instead of sliding the kernel over the other function.

I'd appreciate it if you could take a look at my code and my approach to solving the convolution integral symbolically, and point out where I'm making a mistake and what a possible fix might be.

Thank you!

I try to find kernel and image of a application whose i know the matrix.
restart;
with(LinearAlgebra);
A := Matrix([[1, 1, 1, -1], [-1, 1, -1, -1], [1, -1, -1, -1], [-1, -1, 1, 3]]);
k := op(NullSpace(A));#kernel
MatrixVectorMultiply(A, k);#check
C := op(ColumnSpace(A));
X := <x, y, z, t>;
F := MatrixVectorMultiply(A, X) - a*C[1] - b*C[2] - c*C[2];
G := op(convert(F, list));
solve({seq(G[i] = 0, i = 1 .. 4)}, {a, b, c}); why there is no solution ? Thank you.

Dear all,
I would like to get the Null Vectors of some matrix B but not those which are returned by NullSpace(B), i would like to get specific structure of the Kernel, i mean, i want to get the following structure of the Kernel when the matrix B is 10*10 for example:

Kernel= {
Vector[column](10, [0, 0, 0, 0, 0, 0, 0, 0, 0, alpha]),
Vector[column](10, [0, 0, 0, 0, 0, 0, 0, 0, alpha, beta]),
Vector[column](10, [0, 0, 0, 0, 0, 0, 0, alpha,beta, gamma]),
Vector[column](10, [0, 0, 0, 0, 0, 0, alpha, beta, gamma, delta])
              }
Is it possible to do that with Maple ? Have you some ideas ? 
In other words,  could you help me please ?

Best regards

Hi all,

I've launched a maple program (.mpl) :

nohup maple -F 5_grobner.mpl > 5grobner.out 2>&1 &

on a server to whom I've access through a ssh tunnel.

my code are here :

==========================BEGIN===========================

restart;

with(LinearAlgebra);

F0:=(w*f00+v*f01)/(v+w);

F1:=(u*f10+w*f11)/(w+u);

F2:=(v*f20+u*f21)/(u+v);

T:=(u)^(3)*p0+(v)^(3)*p1+(w)^(3)*p2 + 3*u*v*(u+v)*(u*e01+v*e10) + 3*v*w*(v+w)*(v*e11+w*e20) + 3*w*u*(w+u)*(w*e21+u*e00) + 12*u*v*w*(u*F0+v*F1+w*F2);

coefList:=[p0,p1,p2,e00,e01,e10,e11,e20,e21,f00,f01,f10,f11,f20,f21];

nops(coefList);

for i from 1 to nops(coefList) do

 ind:=coefList[i];

 BF||ind:=subs(w=1-u-v, factor(coeff(T,coefList[i],1)));

end do;

for i from 1 to nops(coefList) do

 ind:=coefList[i];

 DDBF||ind:=factor(diff(BF||ind,u,v));

end do;

QR:=x-> t1*subs(u=u1,v=v1,x) + t2*subs(u=u2,v=v2,x) + t3*subs(u=u3,v=v3,x) + (t4)*subs(u=u4,v=v4,x)+t5*subs(u=u5,v=v5,x);

for i from 1 to nops(coefList) do

 ind:=coefList[i];

 eq[i]:=numer(simplify(int(DDBF||ind, u=0..1-v, v=0..1) - QR(DDBF||ind)));

end do;

sys := [seq(eq[i],i=1..nops(coefList))];

with(Groebner);

res:=Basis(sys,plex(u1,v1,t1,u2,v2,t2,u3,v3,t3,t4,t5,u5,v5));

==========================END===========================

After the program ended, the output file ends with:

......Some outputs of the program....

memory used=1047901.6MB, alloc=32244.7MB, time=147379.36

memory used=1049539.5MB, alloc=32276.7MB, time=147732.14

memory used=1051177.5MB, alloc=32308.7MB, time=148081.18

memory used=1052815.4MB, alloc=32340.7MB, time=148473.81

maple: fatal error, lost connection to kernel

===============================================

I saw some explanations about this message here https://faq.maplesoft.com/hc/en-us/articles/360019491492--Kernel-connection-has-been-lost-error-in-Maple

I guess the reason of my program is " Maple was consuming too much of the RAM or CPU during a calculation;"

But I'm not sure.

Or "Maple sensed that some loop will not terminate,"

So it means there's no solution for my program?

 

Does someone know what this error means?

Or how can I know the right reason that I got this message?

 

Thanks!

jun

 

 

I have noticed a few times now with Maple 2019. It looses kernel connection when it is sitting there idly. This time I observed it. Had saved a document after an intensive calculation. The memory used was about 30Gig. shortly after saving the cpu fan was running hard. I checked task manager and cpu was cycling to 100%, it was mserever. Then the memory usage droped to about 6gig and message as shown. During this time Maple screen down in the LH corner displayed "Ready", so it didn't think it was doing anything.
 

What's going on here? Am I missing something, or is it a bug? If it's a bug, then it's by far the deepest and most profound bug that I've ever found or seen in Maple (and I've seen thousands over the decades). And since that surprises me, my guess is that I'm missing something obvious.

restart:
Op:= (R,F)-> F(['R()'$2]):
Op(rand(1..9), [f,f]);
                     [f([7, 6]), f([2, 4])]

The expected output is [f([7,6]), f([7,6])]. The same thing happens if I replace with seq, or if I replace -> with proc.

In Maple 2017, a simple one-liner can crash the current worksheet (in any mode with any text type it seems).

z[x]:=z

z[x]:=z(x)

Note that z and x can be any two letters, and that you can replace z[x] with the equivalent z+(ctrl shift _)+x (which displays as zx)

 

 

Dear sir

 I am facing the problem with executing the program with Maple13. The software problem is maple13 is not executing the programs and showing the dialogue box as waiting for the kernel. Actually, what is this kernel, which is not understanding me? So please can anyone do a favor in this regard? How to connect to the kernel? 

when I  have transformed symbol expression  from matlab 2017b to  maple 2018 , maple took a mistake that  "maple kernel connection not available", What  is the  reason?Can anyone help me?Thank you!

Why would firewalls cause issues with connecting to the maple kernel if the CAS is entirely self contained (as ive been told before on this forum)

Example 6 from Maple Help.

 

restart:

with(Optimization):

LPSolve(2*x+5*y, {3*x-y = 1, x-y <= 5}, assume = {integer, nonnegative})

 

Kernel crash the same with Maple 2015.

 

Does anyone can confirm?

Mariusz Iwaniuk

Dear all

When may program begin the following massage appears 

kerenl connectio has been lost

Assume we have a map f from a polynomial ring R to another polynomial ring S, I know how to compute kernel (a generator for the kernel ideal) of these maps by Singular, but I want to know can I do it with Maple too? Thanks.

An example;

Consider the homomorphism f:k[x,y]-->k[u,v] sending x to v and y to v^2 then using Singular;

ring r1=0,(x,y),lp;

ring r2=0,(u,v),lp;

ideal i=v,v2;

map f=r1,i;

setring r1;

kernel(r2,f);

_[1]=x2-y

So at above I took k a field of characteristic zero. The kernel is the ideal generated by x^2-y.

1 2 3 4 Page 1 of 4