MaplePrimes Questions

I have seen that this is possible (for example in the example:  2-D Flexible Spin-up Beam).

When I copy an image to the Windows10 clipboard it does paste to other applications but not to MapleSim. Instead, I get an audio notification from the system that is played on other instances when an action cannot be performed.

Within MapleSim copy and paste works (also between models). However, copying an image from a Maplesim Model to another Windows App does not work.

Can someone confirm that pasting images works in recent verions?

(Clearing the Clipboard removes images copied with MapleSim.

Observed on 2 Windows 10 installations with the version 2022 and 2021.)

I want to integrate the function int(1/(A^2 - B^2*cos(t))^(1/2), t = 0 .. 2*Pi), I get the correct solution, but I want to prevent all the "if" statements from appearing. I have tried to use "assume" but the if statement still does not disappear.  

FunWithFibonacci.mw contains a short program with curious behaviour.

f := proc(n) option remember; if n < 2 then 1; else f(n - 1) + f(n - 2); end if; end proc;
F := Compiler:-Compile(f);

This gives a warning message that I don't understand, but never mind*.  I don't know much about the compiler, except that it uses float[8] or complex[8] as universal data types somehow. And maybe I am wrong about that, too.

Now F(n) returns the same number as combinat[fibonacci](n+1) for small n.  This is fine, the difference is one of indexing.  Both f and F return the same thing for small n.  Good.  Both return *integers*.  Checking with whattype confirms that.

Now, F(100) returns a large NEGATIVE integer.  Ok then, this looks like an overflow of an unsigned integer somewhere.

Even before that, though, F(91) returns an integer that is *plausible* but *wrong* :  7540113804746345472 where it should be 7540113804746346429.

So.  My explanation is that the compiler is, indeed, using float[8] internally, and then (for whatever reason) silently converting to integer on return.  Because floats are being used internally, numbers bigger than 2^53 cannot be represented exactly and rounding errors occur.  This happens at f(78) and F(78) which return 14472334024676221 and 14472334024676220 respectively.  

The sign error happens with F(92), where f(92) is just bigger than 2^63.  This suggests that an unsigned 64 bit integer is what the compiler is silently casting its result as.

The help file says "Integer data are limited to word-sized integers on the current hardware. Computations that produce larger integers will raise an overflow exception." So, the overflow exception is being suppressed?

* I may have figured out the error message: if I replace "f" internally by procname, maybe that will fix it.  Will try. Ok, if I do that, the warning message is suppressed, great.  G(30) works, great, though curiously slowly.  G(100) goes into an infinite loop.

Documentation doesn't talk about recursive programs or interaction with option remember.  So maybe that's not allowed?

The spectral radius  is maximum of the absolute values of the eigenvalues of the matrix A.  We can use the function SpectralRadius in Student package. But we noticed a sentence in the help document:

The output from this procedure will be as symbolic as computationally feasible. If the exact spectral radius of A is too time-consuming to compute, it may be computed numerically.

This means that SpectralRadius will evaluate the exact value when it can. Anyway, the internal evaluation process will take time. So for the sake of efficiency, we just want the numerical results of the spectral radius of a matrix. 


I tried to write the following function, but I feel that it is not very efficient, especially for solving characteristic polynomials and their roots.  I even feel that there is a way to find the spectral radius without taking the absolute value of all the eigenvalues and ordering them. 

Spectralradius := proc(A::Matrix)
 local Spectrum;
 Spectrum := sort(abs~([fsolve(LinearAlgebra:-
 CharacteristicPolynomial(A,x)=0,x )]),`>`);
 Spectrum[1]
end proc:

 

One example: In general, the matrices I encounter come from adjacency matrices of graphs, which are always real symmetric. So their eigenvalues are always real. But the Eigenvalues command very slow because it's always trying to get the exact value. So If we use Eigenvalues  to find all the eigenvalues and then sort them, it will be very slow.  Thus  I'm thinking about finding the numerical results.


 

with(LinearAlgebra):
with(GraphTheory):
G2:=Graph({{1,2},{2,3},{3,1},{3,4}}):
A2:=AdjacencyMatrix(G2):
Eigenvalues(A2);

Vector(4, {(1) = -1, (2) = (1/3)*(1+(3*I)*sqrt(111))^(1/3)+(10/3)/(1+(3*I)*sqrt(111))^(1/3)+1/3, (3) = -(1/6)*(1+(3*I)*sqrt(111))^(1/3)-(5/3)/(1+(3*I)*sqrt(111))^(1/3)+1/3+((1/2)*I)*sqrt(3)*((1/3)*(1+(3*I)*sqrt(111))^(1/3)-(10/3)/(1+(3*I)*sqrt(111))^(1/3)), (4) = -(1/6)*(1+(3*I)*sqrt(111))^(1/3)-(5/3)/(1+(3*I)*sqrt(111))^(1/3)+1/3-((1/2)*I)*sqrt(3)*((1/3)*(1+(3*I)*sqrt(111))^(1/3)-(10/3)/(1+(3*I)*sqrt(111))^(1/3))})

(1)

evalsN:=evalf(%);

Vector(4, {(1) = -1., (2) = 2.170086486-0.4000000000e-9*I, (3) = -1.481194304-0.5062177830e-9*I, (4) = .3111078169+0.7062177830e-9*I})

(2)

``

(3)

with(Student):
SpectralRadius(A2)

2.170086487

(4)

 

Maybe I need a way to find all the numerical eigenvalues of a real symmetric matrix not using  CharacteristicPolynomial or Eigenvalues.

Download zlc_1.mw

function is F(x)= x-tanh(4*x/T) and diff(F(x))= 1-(4/T)*(1/T*Cosh(4*x/T)^2). x and t variable T max value=7, i want to do plots ising models function. Anyone can help me?

Graphich will be this 

https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTSo2BHyF5fvb8Dy6bWhELRAAIoaWmxp89G3w&usqp=CAU

Hi everyone.

Let M and N square matrices of same order (over finite fields).

Is there an easy way to find the positive integer "i" so that M^i - N = 0 ?

Best, Gustavo

Download Plot.mw

Is there any way to save "explore plot" in such a way that the slider of constants should appear in the extension file?

So that I can see the constant changing in the extension file too.

@ecterrab I have a related question. I define a hopping Hamiltonian H := sum(((Ket(e, n)) . (Bra(e, n + 1))) + ((Ket(e, n + 1)) . (Bra(e, n))), n = 1 .. d). Now I compute H.H. Maple is smart enough to write double sums with KroneckerDeltas but I don't manage to make it simplify them to single sums?

I have not found anything in the corresponding help page and mouse over does not work.

 

macOS 12.3 + Maple 2021.2

* --> Print
* --> Print to PDF

The created document essentially has no left border (margin). This has been a problem over at least the last three versions in Maple. I end up having to use an extra PDF cropping tool to reset the margins on the document.

What is the solution to this problem?

macOS 12.3 + Maple 2021.2

* select a region on a document
* context click
* --> Copy as image

Copy as image does not put an image on the clipboard.

What is solution?

Hi
One or two days ago, there was a question here by @nm about an integral that was resulting in an infinite loop. I don't know if this question was accidentally deleted, but I don't see it anymore.

The question was about the computation of 

> integrand := (a + b*(c*x^n)^(1/n))^p/x;
> int(integrated, x);

Indeed, there was a problem in the routines to derive assumptions, surfacing as the problem in int pointed out by @nm . Thanks to Austin Roche ( @aroche ) for his quick fix; the fix is distributed to everybody using Maple 2022 in the Maplesoft Physics Updates v.1184.

Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Dear all

` The aim of this code: to construct a non-abelian group of  odd order

such that the product of its elements not necessary identity element. 

symmetric_group.mw

But, the code doesn't display the elements. 

Thank you

First 326 327 328 329 330 331 332 Last Page 328 of 2426