Quick way to find duplicates in a matrix and set t...

I wrote some procedures in an older version of Maple to sort through a matrix and find repeated elements, and then set the matrix elements equal to one another. As an example, consider the matrix:

Due to its symmetric nature the upper triangular matrix is just the same as the lower triangular. i.e. the elements are equal: (2,1)=(1,2), (3,1)=(1,3) etc...

I have attached a minimal working example Maple script, which processes an input matrix, finds repeats and sets the elements equal to one another (e.g. [1,2]=[2,1], literally printing this) and saves the output to a file using a specific format for processing by another program. The matrix in the file is numeric but the actual matrices contain a lot of algebraic terms and can get quite large. This is where my procedures struggle as they take a very, very long time to process larger algebraic matrices to group the repeats. Is there a more Maple friendly way of going about this problem rather than these "archaic" procedures?

Here is the script:

duplicates_matrix_.mw

-Yeti

intial value is not converging...

Dear please check once it showing an error program.mw as intial value is not conververging

Using the Poincare-Dulac Thm to develop an iterati...

proc:=changecoords([x,y],logrithmic);
dsolvediff(x,t):=Matrix([[ 1 , 0],
[ 0 , i ]])x+Vector[column]([ x^i ,
0]);
x:=y+h(y);
for i from 2 to 10;
solve;
end do;

endproc;

MakeIteration := proc( expr::algebraic, x::name )
local iteration := diff(x,t)=Matrix([[ 1 , 0 ],
[ 0 , i]])x+Vector[column]([ x^i ,
0]),x:=y+h(y);
for i from 2 to 10 ;
end do ;
unapply(iteration, x);
endproc;
Error, missing operator or ;

Hi , I would like to solve nonlinear equation by using maple,but I wander how I can write it since there is a change of veriable bysubstiuting the value of y in the diifferenitat . Iactually coudnot write the equation sine it contains differential ,matrix and vector . do Ihave to use dalembertian?

best regards

solve with units...

Hello,

how can I tell Maple that "u" has the dimension of volts?

How Do I Display Fast Parametric Surface with Smoo...

Dear MaplePrimes team,

For display a beautiful parametric surface with hole (or pierced surface), unfortunately unlike CAD (computer-aided design) tool, Maple requires a large grid number. Therefore the computing is too long and requires huge RAM only with grid of [500,500] on a modern computer.

Fig. 1: For a complex surface such an aircraft fuselage here, Needs high grid, therefore, the compilation is too long with modern computer (Intel Core i7, 2.4 GHz CPU, 16 GB RAM). If displays supplementary windows holes on fuselage, the software may bug when the RAM is full.

Question 1:

In matter of low cost computation, do you have better solution to create a fast surface with smooth hole from given a parametric surface equation S(x,y) and given any convex/concave-closed parametric curve C(t) that is projected on surface S(x,y)?

Fig. 2: These surfaces are been created in Maple 2016 from given initial parametric surface equation and curve projected on the surface. But requires huge grid, huge RAM, and long time to get smooth hole when free CAD tools are fast and low RAM.

Question 2:

Because I noted that the Maple’s view option renderers smooth edges of any surface. My question is: Is it possible to use the internal structure of display/view used by Maple to apply at free boundaries? I think it will be possible to create many class of view, for examples: cylindrical sector, spherical sector views or more rather to be limited with conventional cubic view. And thus, I think it will be possible to create own smooth hole or multiple-hole on surface and get smooth pierced surface.

I know that almost of technicians/engineers will recommend me to use a CAD tool to create surface with hole. But the objective here is to keep purely a mathematical mind and work with exact equations (analytic equations).

On a free CAD tool, even the complex holes are created very fast only with low RAM. Why not on Maple?

Best.

Guy.

Bug in contourplot?...

Hi everyone,

as a very basis example I've tried to get the equipotential lines of an 1/r² potential in the x-y-plane using contourplot. However, I obtained the following very strange result. Do you get the same mistake or is there something wrong on my end?

Sören

 >
 >
 >
 >
 >
 >

How to manage the precision of the numerical value...

Hi everybody,

My worksheet begins with these two instructions (this is a notional example)
Digits := 25:
interface(displayprecision = 5):

Then the instruction  evalf(1/3+x/6)  returns  0.33333+0.16667x … which is what I had expected.

I now  want to do a formatted print of  evalf(1/3+x/6)  in some file.
Unfortunately the command

fprintf(fd, "%a\n", evalf(1/3+x/6))

generates a print with the full digits precision (0.333…..33 with 25 "3" for instance).

How could I force fprintf to print the floating point numbers with the number of digits set by interface(displayprecision = 5) ?

(PS : for now I have written some kind of “white elephant” stuff which works well only for very simple algebraic expressions)

Any suggestion or answer will be greatly appreciated

How do I solve a system of complex equations...

Hello everyone, why is maple not able to solve this easy system of equations?

eq1 := 1 = abs(1/(I*Pi*z*(1+I*Pi*a)));
eq2 := -(5/9)*Pi = argument(1/(I*Pi*z*(1+I*Pi*a)));

assuming([fsolve({eq1, eq2}, {a, z})], [a::real, z::real]);

Thanks for helping me! Fabian

Convert max to ILP constraint...

Given

Tour2:=[[[1, 2, 3, 4]], [[1, 2], [1, 3, 4]], [[1, 3], [1, 2, 4]], [[1, 4], [1, 2, 3]], [[1, 2], [1, 3], [1, 4]]]:

Kitonums code

seq(max(seq(add(d[s[i]]*x[s[i],s[i+1]], i=1..nops(s)-1) , s=t))<=K, t=Tour2); produces

18*x[1, 2]+26*x[2, 3]+11*x[3, 4] <= K, max(18*x[1, 2], 26*x[1, 3]+11*x[3, 4]) <= K, max(26*x[1, 3], 18*x[1, 2]+11*x[2, 4]) <= K, max(11*x[1, 4], 18*x[1, 2]+26*x[2, 3]) <= K, max(18*x[1, 2], 26*x[1, 3], 11*x[1, 4]) <= K

correctly. The problem is I want to pass this through LPSolve and it doesn't like it. So what I need is to convert it to a constraint it will accept. I found a method on stackexchange,

http://stackoverflow.com/questions/10792139/using-min-max-within-an-integer-linear-program

i'm not sure it even works.i would be great if a procedure could could convert the max's in the above expression, or change the code in bold.

max(6*x[1, 4],4*x[1, 2]+3*x[2, 3]), where x[i,j] are binary vars.
x4 >= 6*x[1, 4];
x4 >= 4*x[1, 2]+3*x[2, 3];
Objective:= x4;

how to count the number of decimal places if input...

how to count the number of decimal places if input a decimal number

Error, (in unapply) variables must be unique and o...

Error, (in unapply) variables must be unique and of type name

fopen does not work...

The command

fd:=fopen("C:/temp/",'WRITE');

suddenly does not work. I keep getting a 'permission denied' error message. I haven't had to write anything to a file for a while so do you think the recent windows update screwed something up? In fact, I can't seem to write any file anywhere. It was working weeks ago. My apology if this ends up being a lame question. :)

Nonlinear equations ...

Hi , I have question about poincare's theorem which needs to change the veriable and that transform the coordinates , but when I change the variable from x to y if doesn't defined any suggestion ? Please

How do I assume variables as  Matrixs for calculation?

assume(M11::Matrix);
assume(M12::Matrix);
assume(M21::Matrix);
assume(M22::Matrix);
assume(A::Matrix);

A := M12*M21+M11;
M12 M21 + M11
solve(A = 0, M12);
Warning, solve may be ignoring assumptions on the input variables.
M11
- ---
M21
solve(A = 0, M12, useassumptions = true);
M11
- ---
M21

How can I get solution being a matrix?
Thank you very much !!!