Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I learned about Dodgson calculation of the determinant only recently (https://en.m.wikipedia.org/wiki/Dodgson_condensation).
I am only interested in symbolic expressions of the determinant.
Furthermore, I compared several methods. Not surprisingly, the build in method is the fastest. But why is the seq method slower than the proc method for the Dodgson method? Is there anything I could do to program it more efficiently?
 

restart; with(LinearAlgebra)

with(combinat); with(GroupTheory)

DetDef := proc (A) local i, n, sigma; description "Jeremy Johnson. Downloaded from https://www.cs.drexel.edu/~jjohnson/2016-17/winter/cs300/lectures/determinant.mw"; n := RowDimension(A); add(PermParity(Perm(sigma))*mul(A[i, sigma[i]], i = 1 .. n), `in`(sigma, permute([`$`(1 .. n)]))) end proc

InnerMatrix := proc (M::Matrix) SubMatrix(M, 2 .. RowDimension(M)-1, 2 .. ColumnDimension(M)-1) end proc

MatrixDet := proc (M::Matrix) local C, n, i, j; n := RowDimension(M)-1; C := Matrix(n, n); seq(seq(assign('C[i, j]', Determinant(M([i, i+1], [j, j+1]))), j = 1 .. n), i = 1 .. n); return C end proc

Dodgson := proc(M::Matrix)
 MatrixDet(M);
InnerMatrix(M) ^~ (-1) *~ MatrixDet(MatrixDet(M));
do if 1 < RowDimension(%) then InnerMatrix(`%%`) ^~ (-1) *~ MatrixDet(%);
end if;
until RowDimension(%) = 1;
Trace(%):
end proc:

Dodgsonseq := proc (E::Matrix) local w, dim, Z; dim := RowDimension(E); Z[dim] := E; Z[dim-1] := MatrixDet(E); Z[dim-2] := `~`[`*`](`~`[`^`](InnerMatrix(E), -1), MatrixDet(MatrixDet(E))); seq(assign('Z[w-1]', `~`[`*`](`~`[`^`](InnerMatrix(Z[w+1]), -1), MatrixDet(Z[w]))), w = dim-1 .. 1, -1); Trace(Z[1]) end proc

LaPlace := proc (M::Matrix) local c; add((-1)^(c+1)*M[1, c]*Minor(M, 1, c), c = 1 .. ColumnDimension(M)) end proc

dim := 7; A := Matrix(dim, dim, shape = symmetric, symbol = a)

7

(1)

start_time := time(); st := time[real](); Det1 := abs(A); CPUtime_used_Build_in_Determinant := time()-start_time; REALtime_used_Build_in_Determinant := time[real]()-st; start_time := time(); st := time[real](); Det2 := DetDef(A); CPUtime_used_Jeremy_Johnson_Determinant := time()-start_time; REALtime_used_Jeremy_Johnson_Determinant := time[real]()-st; start_time := time(); st := time[real](); Det3 := Dodgsonseq(A); CPUtime_usedDodgsonseq := time()-start_time; REALCPUtime_usedDodgsonseq := time[real]()-st; start_time := time(); st := time[real](); Det4 := Dodgson(A); CPUtime_usedDodgson := time()-start_time; REALtime_usedDodgson := time[real]()-st; start_time := time(); st := time[real](); Det5 := LaPlace(A); CPUtime_usedLaPlace := time()-start_time; REALtime_usedLaPlace := time[real]()-st; simplify(Det1-Det2); simplify(Det1-Det3); simplify(Det1-Det4); simplify(Det1-Det5)
``

0.32e-1

 

0.34e-1

 

0.93e-1

 

.108

 

47.094

 

41.295

 

40.766

 

38.158

 

0.31e-1

 

0.50e-1

 

0

 

0

 

0

 

0

(2)

Download test_Determinants_symbolic.mw

I had purchached reseach licience Maple 2022 towards the end of 2022 only and Quantum Chemistry Toolbox I purchased in Feb 2022 only.

Now i find significant update in toolbox in just 3 months. Now guide me how should i address this issuse.

I had to take loan in india to buy the toolbox.

It is only 3 months.

Can you suggest me how solve the problem to get the update without spending again.

What is the way guide someone.

I calculate the limit

Let me know if there are any errors in my calculations?


 

restart

assume(a > 0)

limit(int(sin(x)/x, x = n .. n+a), n = infinity)

0

(1)

int(sin(x)/x, x = n .. n+a)

-Si(n)+Si(n+a)

(2)

plot3d(-Si(n)+Si(n+a), a = -5 .. 5, n = -5 .. 5)

 

limit(-Si(n)+Si(n+a), n = infinity)

0

(3)

limit(-Si(n), n = infinity)

-(1/2)*Pi

(4)

limit(Si(n+a), n = infinity)

(1/2)*Pi

(5)

NULL


Thank you in advance.

Download limit_int.mw

I have been working in the building construction industry for more than 30 years, and one of the big things which has been coming up is parametric design.

While every major big software company has come up with its own package (Bentley with Generative Components, Autodesk with Dynamo), there is one software now that has won over all them - Grasshopper 3D.

Nowadays all major software products are trying to write bidirectional links to Grasshopper. Inhouse we do have Tekla on the BIM side and FEM-Design on the calculation side where both are capable to link to Grasshopper.

Grasshopper itself is also capable of running Python code, though in a reduced kind of way.

I would very much like to see Maple to have a Grasshopper link, probably achievable through Python.

At least Maplesoft should have a quick look at it, to see if this is possible or not.

I have a polyhedron with A(1,1,0), B(-1,1,0), C(-1,-1,0), H(-1/2,0,1), K(1/2,-1/2,0). How can I calculate volume of polyhedron ABCHK?
 

How can a horizontal axis be curved in a plot? like this

plot(F*r*sin(theta) - m, theta = 0 .. Pi)

When I am setting up the coordinates in the physics package, I use the following command. And it sets it to (r,theta,phi,t).

Setup(dimension = 4, mathematicalnotation = true, coordinates = spherical)

Is there a way to change it to (t,r,theta,phi)?

It gets a bit more confusing when we are looking at rank 2 objects.

Hi, I am working on an activity about conic sections, but I have a small issue with the display of the ellipse and the circle. My outlines are not complete. Any ideas on how to identify my error? Thanks  SectionsConiquesTest.mw

Hi to every one. I have attached a maple for eigenvalues. Please see and tell be solution of problem.

Thanks for time.

Eigen_Values.mw

Hi, here is my question.

test:=v^3;

plot3d(test,u=0..1-v, v=0..1);

How can I  transform this plot in the right triangle into an equilateral triangle? 

So that the three edges of the plot are the same length.

I wanna, squish it, or shear?

any tools i can use? Or can I do it using some tricks to change the function?

 

 

Ever wonder how to show progress updates from your executing code without printing new lines each time?

One way to do this is to use a TextArea component and the DocumentTools package. The TextArea could be inserted from the Components Palette in Maple, or programmatically like so:

restart;

with(DocumentTools):

with(DocumentTools:-Components):

with(DocumentTools:-Layout):

s := "0": #initial text value

T := TextArea(s, identity = "TextArea0"):
xml := Worksheet(Group(Input(Textfield(T)))):

insertedname:=InsertContent(xml)[1,1]: #find the inserted component name in case changed

for i to 10 do #start the demonstration procedure
   Threads:-Sleep(1);
   SetProperty(insertedname,value,sprintf("%d",i),refresh=true);
end do:

Maplets:-Examples:-Message("Done");


Download text-area-update-progress.mw

why the output wont appear eventhough I think the working is right?

y'' + 1/x * u' + u = 6 - 9x + x^2 - x^3

with baundary condition :

u(0) = 0 , and u(1) = 0

 I run the attached code, but after waiting for a few minutes, there is no response, does anyone know the reason?

 It only shows Evaluating!!!!

 sy01.mw

First 77 78 79 80 81 82 83 Last Page 79 of 2097