Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

with(Physics[Vectors]);

This should  equal Dirac delta function

I know this must have been addressed somewhere previously.  However I have searched extensively and not been able to find an answer.  Sorry for asking again.

The set and list produced by map (see below) contain duplicates.  How to remove duplicates?
 

p := (1+5^(1/2))*(1/2)

1/2+(1/2)*5^(1/2)

(1)

with(Bits)

[And, FirstNonzeroBit, GetBits, Iff, Implies, Join, Nand, Nor, Not, Or, Settings, Split, String, Xor]

(2)

with(LinearAlgebra)

[`&x`, Add, Adjoint, BackwardSubstitute, BandMatrix, Basis, BezoutMatrix, BidiagonalForm, BilinearForm, CARE, CharacteristicMatrix, CharacteristicPolynomial, Column, ColumnDimension, ColumnOperation, ColumnSpace, CompanionMatrix, CompressedSparseForm, ConditionNumber, ConstantMatrix, ConstantVector, Copy, CreatePermutation, CrossProduct, DARE, DeleteColumn, DeleteRow, Determinant, Diagonal, DiagonalMatrix, Dimension, Dimensions, DotProduct, EigenConditionNumbers, Eigenvalues, Eigenvectors, Equal, ForwardSubstitute, FrobeniusForm, FromCompressedSparseForm, FromSplitForm, GaussianElimination, GenerateEquations, GenerateMatrix, Generic, GetResultDataType, GetResultShape, GivensRotationMatrix, GramSchmidt, HankelMatrix, HermiteForm, HermitianTranspose, HessenbergForm, HilbertMatrix, HouseholderMatrix, IdentityMatrix, IntersectionBasis, IsDefinite, IsOrthogonal, IsSimilar, IsUnitary, JordanBlockMatrix, JordanForm, KroneckerProduct, LA_Main, LUDecomposition, LeastSquares, LinearSolve, LyapunovSolve, Map, Map2, MatrixAdd, MatrixExponential, MatrixFunction, MatrixInverse, MatrixMatrixMultiply, MatrixNorm, MatrixPower, MatrixScalarMultiply, MatrixVectorMultiply, MinimalPolynomial, Minor, Modular, Multiply, NoUserValue, Norm, Normalize, NullSpace, OuterProductMatrix, Permanent, Pivot, PopovForm, ProjectionMatrix, QRDecomposition, RandomMatrix, RandomVector, Rank, RationalCanonicalForm, ReducedRowEchelonForm, Row, RowDimension, RowOperation, RowSpace, ScalarMatrix, ScalarMultiply, ScalarVector, SchurForm, SingularValues, SmithForm, SplitForm, StronglyConnectedBlocks, SubMatrix, SubVector, SumBasis, SylvesterMatrix, SylvesterSolve, ToeplitzMatrix, Trace, Transpose, TridiagonalForm, UnitVector, VandermondeMatrix, VectorAdd, VectorAngle, VectorMatrixMultiply, VectorNorm, VectorScalarMultiply, ZeroMatrix, ZeroVector, Zip]

(3)

with(VectorCalculus)

[`&x`, `*`, `+`, `-`, `.`, `<,>`, `<|>`, About, AddCoordinates, ArcLength, BasisFormat, Binormal, Compatibility, ConvertVector, CrossProduct, Curl, Curvature, D, Del, DirectionalDiff, Divergence, DotProduct, Flux, GetCoordinateParameters, GetCoordinates, GetNames, GetPVDescription, GetRootPoint, GetSpace, Gradient, Hessian, IsPositionVector, IsRootedVector, IsVectorField, Jacobian, Laplacian, LineInt, MapToBasis, Nabla, Norm, Normalize, PathInt, PlotPositionVector, PlotVector, PositionVector, PrincipalNormal, RadiusOfCurvature, RootedVector, ScalarPotential, SetCoordinateParameters, SetCoordinates, SpaceCurve, SurfaceInt, TNBFrame, Tangent, TangentLine, TangentPlane, TangentVector, Torsion, Vector, VectorField, VectorPotential, VectorSpace, Wronskian, diff, eval, evalVF, int, limit, series]

(4)

b := proc (x, w) options operator, arrow; (-1)^GetBits(x, w, output = number) end proc

proc (x, w) options operator, arrow; (-1)^Bits:-GetBits(x, w, output = number) end proc

(5)

l := proc (x, t, u, v) options operator, arrow; frac(x)*Vector([b(floor(x), 0)*t, b(floor(x), 1)*u, b(floor(x), 2)*v])+(1-frac(x))*Vector([b(floor(x), 0)*v, b(floor(x), 1)*t, b(floor(x), 2)*u]) end proc

proc (x, t, u, v) options operator, arrow; VectorCalculus:-`+`(VectorCalculus:-`*`(frac(x), VectorCalculus:-Vector([VectorCalculus:-`*`(b(floor(x), 0), t), VectorCalculus:-`*`(b(floor(x), 1), u), VectorCalculus:-`*`(b(floor(x), 2), v)])), VectorCalculus:-`*`(VectorCalculus:-`+`(1, VectorCalculus:-`-`(frac(x))), VectorCalculus:-Vector([VectorCalculus:-`*`(b(floor(x), 0), v), VectorCalculus:-`*`(b(floor(x), 1), t), VectorCalculus:-`*`(b(floor(x), 2), u)]))) end proc

(6)

map(l, {0, 1, 2, 3, 4, 5, 6, 7, 8}, 0, 1, p)

{Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian])}

(7)

map(l, [0, 1, 2, 3, 4, 5, 6, 7, 8], 0, 1, p)

[Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian])]

(8)

q := ListTools:-MakeUnique(%)

q := [Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian])]

(9)

Equal(q[1], q[9])

true

(10)

qq := [op({q[]})]

qq := [Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = -1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = -1/2-(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian]), Vector(3, {(1) = 1/2+(1/2)*5^(1/2), (2) = 0, (3) = 1}, attributes = [coords = cartesian])]

(11)

LinearAlgebra:-Equal(qq[1], qq[5])

true

(12)

NULL


 

Download cp.mw

To restrict the domain of a vector field, I have multiplied a coordinate with a non-real complex number (namely a sqrt(of negative expression)). This does work, as shown in this Maple 2017 worksheet program (below). My question is whether this is the best technique of accomplishing this result, or else how to do it better? Would be interested in suggestions for improvements. Here is my program so far:

restart;
#
with(plots):
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(` Vector Field inside Torus`);
print(` ------- ------- ------- ------- ------- ------- -------`);
print(` Assignment:  `);
print(` In a circular pipe of radius (my2r), water is flowing in the direction `);
print(` of the pipe, with speed (my2r)^2-(mya)^2, where (mya) is the distance  `);
print(` to the axis of the pipe.  `);
print(` Depict the vector field describing the flow if the pipe goes around in `);
print(` the shape of a torus with major radius (my1r).  `);
print(`   `);
print(`   `);
print(`   `);
print(` ------- ------- ------- ------- ------- ------- -------`);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 1) major radius of torus:`);
#
my1r  := 5;     
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 2) minor radius of torus (pipe radius):`);
#
my2r := 4; 
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 3) definition of torus (polar coordinates):`);
#
c00 := [(my1r+my2r*cos(s))*cos(t),(my1r+my2r*cos(s))*sin(t),my2r*sin(s)];
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 4) 3D plot of solid torus (polar coordinates):`);
#
plot3d({c00},scaling=constrained,color=red);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 5) 3D plot of wireframe torus (polar coordinates):`);
#
P1 := plot3d({c00},scaling=constrained,style=wireframe);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 6) implicit definition of torus (cartesian coordinates):`);
#
c01 := (sqrt(x^2+y^2)-my1r)^2+z^2-my2r^2;
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 7) implicit 3D plot of solid torus (cartesian coordinates):`);
#
gx := my1r+my2r; # min and max of each coordinate
#
implicitplot3d(c01,x=-gx..gx,y=-gx..gx,z=-gx..gx,numpoints=9000);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 8) vector field definition (cartesian coordinates):`);
#
my1vfx := -y;
my1vfy := x;
my1vfz := 0;
#
my1fld := [my1vfx,my1vfy,my1vfz];
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 9) 3D plot of vector field (cartesian coordinates):`);

#
fieldplot3d(my1fld,x=-gx..gx,y=-gx..gx,z=-gx..gx);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 10) definition of vector field with unit length vectors (cartesian coordinates):`);
#
my1vl := sqrt(my1vfx^2+my1vfy^2+my1vfz^2); # vector length
#
my2fld := [my1vfx/my1vl,my1vfy/my1vl,my1vfz/my1vl];
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 11) 3D plot of vector field with unit length vectors (cartesian coordinates):`);
#
fieldplot3d(my2fld,x=-gx..gx,y=-gx..gx,z=-gx..gx);
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 12) definition of vector field with asked for length vectors (cartesian coordinates):`);
#
mya := sqrt((sqrt(x^2+y^2)-my1r)^2+z^2);
c01r := sqrt(my2r^2-mya^2); # also used for domain restricting vector field below
#
my1tsz := solve([c01],[z]);
#
assign(my1tsz[1][1]);
my1tz := z;
unassign('z');
#
assign(my1tsz[2][1]);
my2tz := z;
unassign('z');
#
my1vp := c01r/my2r; # vector length (maximum one unit)
#
my3fld := [my1vp*my1vfx/my1vl,my1vp*my1vfy/my1vl,my1vp*my1vfz/my1vl];
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 13) 3D plot of vector field with asked for length vectors (cartesian coordinates):`);
#
fieldplot3d(my3fld,x=-gx..gx,y=-gx..gx,z=-gx..gx);
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n(Section 14) same asked for vector field with 3-D arrow vectors:`);
print(`   `);
print(` (to get this to display properly it was necessary to do:  `);
print(` -> Maple 2017 -> Preferences... -> Precision ->   `);
print(`   [unselect] Limit expression length to   `);
print(`   Apply to Session`);
print(`   `);
#
gr := 15;
#
P3 := fieldplot3d(my3fld,x=-gx..gx,y=-gx..gx,z=-gx..gx,arrows=`3-D`,grid=[gr,gr,gr]);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);
print(`\n display asked for vector field within wireframe torus:`);
#
display([P1,P3]);
#
#
print(` ------- ------- ------- ------- ------- ------- -------`);

I got decimal places problem,

not known correct or not

the value are different but difference is constant 

i do not know how many places needed to get exact result

i do not believe the difference is constant

because the matrix are different

but even if using 36 decimal places still constant, 

i notice increasing decimal places , the constant difference is changed

is it possible  to output fraction when calculate eigenvector?

Ok embarassing I posted this one and now it outputs this java error file log and yep i dont know that much about java at all. 

 

Sometimes it works, sometimes it closes maple automatically and spits out the .txt error log i have attached if thats any help... MAPLE_EXAMPLE_16.mw  i honestly have never ever seen maple behave this way in more than a decade of playing around in it with stuff like this.

EDIT: Here is a version with smaller plot components that seems to be working.... MAPLE_EXAMPLE_17.mw

It says i am not allowed to upload a log file but this is what it looks like:

#
# A fatal error has been detected by the Java Runtime Environment:
#
# java.lang.OutOfMemoryError: requested 1024000 bytes for GrET in C:\BUILD_AREA\jdk6_18\hotspot\src\share\vm\utilities\growableArray.cpp. Out of swap space?
#
 
V  [jvm.dll+0x15df8a]
V  [jvm.dll+0x1e1e14]
V  [jvm.dll+0x1a1aad]
V  [jvm.dll+0xc834f]
V  [jvm.dll+0xca01c]
V  [jvm.dll+0xca370]
V  [jvm.dll+0xce42a]
V  [jvm.dll+0x1d8592]
V  [jvm.dll+0xc9398]
V  [jvm.dll
Java Threads: ( => current thread )
  0x522e7c00 JavaThread "Timer-28" [_thread_blocked, id=23236, stack(0x5f2f0000,0x5f6f0000)]
  0x522e7400 JavaThread "Timer-22" [_thread_blocked, id=24248, stack(0x6b440000,0x6b840000)]
  0x522e2c00 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=11140, stack(0x6a2d0000,0x6a6d0000)]
  0x522e7000 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=6792, stack(0x64d30000,0x65130000)]
  0x522e6400 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=20280, stack(0x6a6d0000,0x6aad0000)]
  0x522e4400 JavaThread "Timer-18" daemon [_thread_blocked, id=23888, stack(0x63f20000,0x64320000)]
  0x522e6800 JavaThread "Timer-17" [_thread_blocked, id=17320, stack(0x69ed0000,0x6a2d0000)]
  0x522e5000 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=13480, stack(0x69ad0000,0x69ed0000)]
  0x522e4800 JavaThread "Timer-16" daemon [_thread_blocked, id=18184, stack(0x68ed0000,0x692d0000)]
  0x522e3000 JavaThread "Timer-15" [_thread_blocked, id=23296, stack(0x692d0000,0x696d0000)]
  0x522e3800 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=16388, stack(0x66820000,0x66c20000)]
  0x522e1400 JavaThread "Timer-14" daemon [_thread_blocked, id=24500, stack(0x61c50000,0x62050000)]
  0x522e0c00 JavaThread "Timer-13" [_thread_blocked, id=15848, stack(0x659b0000,0x65db0000)]
  0x522e0000 JavaThread "WMI:MapleClientSocket:Kernel Connection " daemon [_thread_blocked, id=7260, stack(0x655b0000,0x659b0000)]
  0x466cb000 JavaThread "Timer-12" daemon [_thread_blocked, id=1112, stack(0x64320000,0x64720000)]
  0x4699b800 JavaThread "Timer-11" [_thread_blocked, id=24540, stack(0x64930000,0x64d30000)]
  0x4699b400 JavaThread "Timer-10" daemon [_thread_blocked, id=21144, stack(0x60bf0000,0x60ff0000)]
  0x4699d400 JavaTh
 
How to translate the elliptic curve from the 4th to the 3rd curve with maple?

thanks.

Is there any way to get random numbers in Maple with the Sobol method?

Thank you.

can anyone tell me the difference between subs and eval and  evalf ?

The  partition function is geven as'

Zvib(Beta)"=integrate(exp^Beta*alpha^2*h^2/4*units*m *(B-2A)+Beta*alpha^2*h^2*B^/8*units*m*(n+c)^2+Beta*alpha^2*h^2*rho^2*drho,rho=(c+n) from to lambda+c

I need to find the intersection points of two circles (x-7)^2+(y-2)^2=100 and (x-11)^2+(y-5)^2=75 using the modified Newton secant method. 

I have already done this by using these two equations to make one in terms of x. But, i am looking for suggestions on how to make a multiple variable version of the secant method.

I believe I am having memory issues which is causing the MAPLE kernal to terminate.  If I assign m a value then it seems to work, but I would like to leave m unassigned so that S1 can later be evaluated for any arbitrary m.  Is there a way around this?


 

T := M*tau;

`assuming`([simplify(expand(combine(S1)))], [m::integer])

``


 

Download MAPLE_crashing.mw

can maple code saved into database for self modifying easily?

self modifying , metaprogramming , database, snapshot, blockchain for code integrity etc

For my own use, I am attempting to port Joe Riel’s glyph package for geometric algebra into a module more compatible with recent versions of Maple. To this end, I have been testing individual procedures extracted from the package into Maple 2016, both to understand the algorithms and to check for glitches caused by the code running in more current Maple 2016. The procedure for carrying out the exterior multiplication of blades does not seem to work reliably, and I haven’t the necessary knowledge of Maple language to determine whether this is due to an error on my part or a feature of Maple V that no longer works.  I have attached a worksheet,tablemultiplyexample.mw,  that includes the procedures necessary for the multiplication routine to work, but I can’t get any consistency in the results.  Can anyone advise me what is the problem?  

As I understand the routine, setup defines a anti-symmetric root blade table with an indexing function that precludes assignment to the table. Clifford blades are then represented as indexed variables using the root table. The process is as follows see worksheet for actual code):

initialize := proc ()
 global _e, tableroot;
tableroot := table(antisymmetric, blade);
tableroot[] := 1;
_e := tableroot;
end proc:
#The index function `blade` is as follows:

`index/blade` := proc (Indices, tableau)
 if nargs = 2 then if Indices = [] then 1
          else tableau[op(checkindices(Indices))] end if
elif Indices = [] then tableau[Indices[]] := 1
 else ERROR("cannot assign to a blade", Indices) end if
end proc;

#Exterior multiplication is performed by the following routine.
b_exteriorp := proc (u, v)
option remember;
 if  u = 1 or v = 1 then u*v
else _e[op(u), op(v)] end if
end proc:

As near as I understand, the procedure joins the lists representing the two input blade into a single list that is processed by the antisymmetric indexing function and outputs the indexes as the product blade. I don’t understand how the case of duplicate indexes (which should return 0) is supposed to be handled by the procedure.  What the procedure usually returns is simply the appended list of the two blades without modification by the indexing function.

Can anyone give me a hint about how to fix this procedure?

tablemultiplyexample.mw

Hi
sry guys i have a problem with my maple when i use my fsolve sometimes it gave me no solution but i khow we have a solution ill use simplify to gave it a simplified input but also no awenser is there any other command yo make my problem easier for maple and also is there anyway that i can force my cpu and memory to focus more on solving problems

and at last what is default method for fsolve ( i mean is it newton method or something else and can i change it )

tnQ for your attentions
thats my maple file problem.mw

 

How do I animate a matrixplot frame by frame so it displayes the highest and lowest value first and then sort of starts "relaxing" to the boundary conditions that will be set to 0? Thank you.

First 105 106 107 108 109 110 111 Last Page 107 of 2097