zenterix

350 Reputation

4 Badges

2 years, 230 days

MaplePrimes Activity


These are questions asked by zenterix

Consider the task of finding the eigenvalues and eigenvectors of a simple 2x2 matrix.

Usually I can insert the contents of a Maple worksheet here, but for some reason the following worksheet cannot be inserted: Eigenvectors.mw

In that worksheet I try to use LinearAlgebra:-Eigenvectors(A). The eigenvalues contain a complex term, even though they are real for the given matrix. It's not clear what criteria are used in selecting a specific eigenvector for each eigenvalue.

I then show a more manual calculation.

I was expecting to obtain a simpler solution to this problem using LinearAlgebra:-Eigenvectors(A). Is this expectation unjustified? I am asking primarily from the perspective of a user of the software. 

It would be interesting to know the answer from the perspective of someone who knows the ins and outs of the implementation of the software as well, but as a user my initial expectation is a more digestible result that doesn't rely on knowing such implementation details.

Consider the worksheet below containing a function that I came across while studying Apostol's Calculus. 

At the origin, this function has a defined directional derivative in all directions. It is not, however, continuous at the origin. We can see this by consider all points on the parabola x=y^2 except for the origin. The function takes on the value 1/2 on all such points but has value 0 at the origin and is thus discontinuous there.

My question is about a 3d plot of this function.

The plot seems a bit inaccurate because the ridge at the top extends all the way to the origin. 

If I hadn't done the calculations to know this, this plot would not give me this information. 

Is there a way to avoid this problem? Ie, to get more accuracy at points such as the origin here?

f := (x,y) -> piecewise(x=0, 0, x <> 0, x*y^2/(x^2+y^4))

f := proc (x, y) options operator, arrow; piecewise(x = 0, 0, x <> 0, x*y^2/(x^2+y^4)) end proc

(1)

plot3d(f,-1..1,-1..1)

 

f(y^2,y)

piecewise(y^2 = 0, 0, y^2 <> 0, 1/2)

(2)

 

Download DiscontScalarField3d.mw

I have a workflow in which I edit files from a package I develop. These are usually mpl files, and I edit them in an editor (VS Code).

Then I have a worksheet called readFile.mw open in Maple that has two commands:

restart:

read("path/to/an/entry/file/that/includes/all/the/other/files")

and another worksheet actual.mw which is the actual worksheet I am working on, which starts with restart: with(MyPackage): and then contains calls to procedures from the package.

With this workflow, I make a change in the editor, execute readFile.mw and then go to my actual worksheet and restart and then use with(MyPackage), and the updates are available.

This works.

However, in actual.mw I may have a bunch of data that I don't want to wipe out with a restart. 

On the other hand, if I don't restart, a new call to with(MyPackage) does not update the import of the package (because it has already been imported. 

Is there an idiomatic or preferred way to accomplish reimporting the package without having to call restart?

PS I don't remember now the exact reason why I don't have the call to read the file in actual.mw but it had something to do with this issue of not getting the package updated correctly.

I think my question can be answered without necessrily providing any code. 

I have a procedure that takes in many arguments and performs heavy calculations (solves multiple sets of differential equations in parallel using Grid:-Map and then does matrix manipulations with results, etc).

It runs fine in a Maple worksheet. 

Until about half an hour ago, I hadn't used the Maple CLI. I would like to run my procedure from the CLI. I did exactly the steps as I do them in a worksheet.

with(MyPackage):

myProcedure(argsList);

But Maple just echoes the second command back to me. myProcedure is in myPackage. There is a much simpler procedure in that package called myProcedure2 and I can call that just fine from the CLI.

What could be happening?

I would like to write some code to test certain functions in a codebase that has gotten relatively large but has no tests. I recently found a bug caused by copying a line and pasting it five times (was supposed to change a parameter on each line but forgot to). Didn't notice the bug until I refactored that procedure to make the code parallelizable for use with the Grid package.

Hence, I am worried about such unknown calculation mistakes in algorithms that involve a sequence of intermediate steps/calculations.

I found there is an assert command

I would write procedures that would call the procedures to be tested with certain arguments and assert the output.

Are there any other tools available or best practices perhaps from experience?

4 5 6 7 8 9 10 Last Page 6 of 18