HeiniKlum

20 Reputation

7 Badges

15 years, 76 days

MaplePrimes Activity


These are questions asked by HeiniKlum

Even for very common functions Maple has trouble calculating a series expansion if the center is not zero.

series(sin(x),x=0);

works as expected. But choosing x = 1 as center yields

series(sin(x),x=1);

This strange behavior also happens with other standard functions like cos, cosh, sinh.

Thought it would be a neat way to create identation for loops and if branches in a text editor and copy the code into Maple. But Maple inserts a new prompt at the beginning of every line.

Is there a solution in 2018?

CodeGeneration returns round brackets when converting a matrix to numpy. According to Python syntax it should return square brackets. I am using Maple 18, so maybe this issue has been solved in more recent releases.

MWE

----------------
>restart:
>with(CodeGeneration):
>QLoc:=proc()
local Q:
Q:= Matrix(2,2):
Q(1,1) := 1E5:
Q(2,2) := 1E4:
Q(1,2) := 1E3:
Q(2,1) := 1E3:
return Q:
end proc:
 

>Python(QLoc);

import numpy

def QLoc ():
    Q = numpy.mat([[0,0],[0,0]])
    Q(1, 1) = 0.1e6
    Q(2, 2) = 0.1e5
    Q(1, 2) = 0.1e4
    Q(2, 1) = 0.1e4
    return(Q)

------------

Page 1 of 1