Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi !

I am importing a matrix from a text file. I am using the command,

ImportMatrix("Filelocation/Filename.txt", 'source' = 'delimited', 'delimiter' = " ");

I see the following error:

Error, (in ImportMatrix) cannot interpret file

I think it is because of the huge size.(700 MB, and 28 GB respectively)

How to import such a matrix in maple?

thanks,

I just found that Maple 17 and Maple 16 do not have the option "output=string" in the latex command.

And I need a way to convert the Latex generated to the screen to a string and save it to a variable like I can do with Maple 2017

Here is an example. In current Maple 2017 this works

result_of_int:=int((-5+3*x)^2/(2*x-1)^(7/2),x):
my_latex:= latex(result_of_int,output=string);

But in Maple 16, it gives an error

If I remove the output, then the result is not string.

How to capture the above output which is on the screen and save it as string in a variable?

I do not want to send the output to a file as is. I need to first convert it to a string, and save
it to variable first.

 

 

Hello!

I have a problem with solving of my differential equation second order. Whenever I Try to draw a plot of it I have this "Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up".

All "A", "B", "C", "K" and Vare constants which can be any number except Vwhich is only a positive number.

 

restart;
v[0] := 500; C[0] := 1; B[0] := 1; K[1] := 1; C[1] := 1; K[2] := 1; C[2] := 1; eqn := x(t) = v[0]*t-C[0]*B[0]*K[1]*C[1]*(D(x))(t)*t^2/(1+C[0]*x(t))^2-C[0]*B[0]*K[2]*C[2]*(C[0]*x(t)*((D@@2)(x))(t)-2*C[0]*(D(x))(t)^2)/(1+C[0]*x(t))^3;
sln := dsolve({eqn, x(0) = 0, (D(x))(0) = 500}, numeric);
plots[odeplot](sln, t = 0 .. 1);

I would like to implement a persistent variable inside a procedure. That is:

  1. A variable that is first initialized if it does not exist.
  2. Its value is kept over multiple call of the procedure where it is defined.

As an example, the following procedure counts the number of times it is called:

restart;
CountProc := proc () 
     global m; 
     if `not`(m::integer) then      
          m := 0;
     end if; 
     m := m+1; 
     return m;
end proc;

CountProc(); CountProc(); CountProc();
                               1
                               2
                               3

That’s almost what I need, except the variable "m" should be local instead of global. How to do that?

Hello dear!

Hope you all are fine. I am trying to sloution the system of nonlinear system of ODEs (see attached file) but my solutions not converging please see and fix the problem. I am waiting your quick response.

Graph.mw

Is there a possiblity to print exponents in the axis labeling?

Say I have large numbers in 10^6. Then I want to write

labels=["x","y [10^6]"]

However I only found the e-notation within

sprintf("%0.0e", 10^6)

for example, which is not really what I want though.

restart; CodeTools:-Usage(plots:-inequal({abs(abs(x-y)-abs(x+y)) >= 2*y-x+1, (x+1)^2+(y+1)^2 <= 2}, 
optionsimplicit = [gridrefine = 2, rational = true], x = -3 .. 1, y = -3 .. 0., scaling = constrained));

memory used=0.57GiB, alloc change=184.01MiB, cpu time=16.22s, real time=17.24s, gc time=1.58s

?

Mathematica 11.2.0.0 says

113053/146523-8/169 sqrt(22)+32/289 sqrt(30)-3/169 sqrt(214-24 sqrt(22))-
2/169 sqrt(1177-132 sqrt(22))-1/289 sqrt(94-16 sqrt(30))-
4/289 sqrt(705-120 sqrt(30))+1/146523 293046(Pi)-
arcsin(1/13 sqrt(2) (3+sqrt(22)))-arcsin(1/17 sqrt(2) (1+2 sqrt(30)))

(see Area.pdf).

Hello, 

I want to insert a histogram for weighted data in my  question Maple TA. I have difficulties in my code. 

Some ideas?

Thks

I searched the questions for an answer before posting and found that I had asked the question 10 years ago! I still do not understand although it appears every other Maple user does. Embarrassing!
 

I have done some time consuming computations in my worksheet and would like to save the results for further investigation. Let's say, for example, that I have a long list L of numbers, strings etc, and a very large Matrix A . I am working on a Mac running 10.12.6.
From reading the documentation many times I gather that I can create a file with the values of L and A. I might then be able to open another worksheet and read the values of L and A into that worksheet but I cannot figure out how to do that.

Here are some of the (unhelpful) error messages I get using toy examples:

after creating a text file by hand

> read "testZ";
Error, unable to read `testZ` 

or

read testn. txt;
Error, read must have a file name

ro

read "Users/awass/Desktop/testn";
Error, unable to read `Users/awass/Desktop/testn`
 

So, how do I write my info to a file? Must I somehow create the file before I save?
Where should that file be placed? Desktop? Folder?
How do I read from the file after I have saved.
Can I save both L and A to the same file? Do I need 2 commands?

I would appreciate some explicit toy examples. Many thanks.
 

 

 

 



 

This presentation is about magnetic traps for neutral particles, first achieved for cold neutrons and nowadays widely used in cold-atom physics. The level is that of undergraduate electrodynamics and tensor calculus courses. Tackling this topic within a computer algebra worksheet as shown below illustrates well the kind of advanced computations that can be done today with the Physics package. A new feature minimizetensorcomponents and related functionality is used along the presentation, that requires the updated Physics library distributed at the Maplesoft R&D Physics webpage.
 

 

Magnetic traps in cold-atom physics

 

Pascal Szriftgiser1 and Edgardo S. Cheb-Terrab2 

(1) Laboratoire PhLAM, UMR CNRS 8523, Université Lille 1, F-59655, France

(2) Maplesoft

 

We consider a device constructed with a set of electrical wires fed with constant electrical currents. Those wires can have an arbitrary complex shape. The device is operated in a regime such that, in some region of interest, the moving particles experience a magnetic field that varies slowly compared to the Larmor spin precession frequency. In this region, the effective potential is proportional to the modulus of the field: LinearAlgebra[Norm](`#mover(mi("B"),mo("&rarr;"))`(x, y, z)), this potential has a minimum and, close to this minimum, the device behaves as a magnetic trap.

 

 

 

Figure 1: Schematic representation of a Ioffe-Pritchard magnetic trap. It is made of four infinite rods and two coils.

_________________________________________

 

Following [1], we show that:

 

  

a) For a time-independent magnetic field  `#mover(mi("B"),mo("&rarr;"))`(x, y, z) in vacuum, up to order two in the relative coordinates X__i = [x, y, z] around some point of interest, the coefficients of orders 1 and 2 in this expansion, `v__i,j` and `c__i,j,k` , respectively the gradient and curvature, contain only 5 and 7 independent components.

  

b) All stationary points of LinearAlgebra[Norm](`#mover(mi("B"),mo("&rarr;"))`(x, y, z))^2 (nonzero minima and saddle points) are confined to a curved surface defined by det(`&PartialD;`[j](B[i])) = 0.

  

c) The effective potential, proportional to LinearAlgebra[Norm](`#mover(mi("B"),mo("&rarr;"))`(x, y, z)), has no maximum, only a minimum.

 

Finally, we draw the stationary condition surface for the case of the widely used Ioffe-Pritchard magnetic trap.

  

 

  

Reference

  

[1] R. Gerritsma and R. J. C. Spreeuw, Topological constraints on magnetostatic traps,  Phys. Rev. A 74, 043405 (2006)

  

 

The independent components of `v__i,j` and `c__i,j,k` entering B[i] = u[i]+v[i, j]*X[j]+(1/2)*c[i, j, k]*X[j]*X[k]

   

The stationary points are within the surface det(`&PartialD;`[j](B[i])) = 0

   

U = LinearAlgebra[Norm](`#mover(mi("B",fontweight = "bold"),mo("&rarr;",fontweight = "bold"))`)^2 has only minima, no maxima

   

Drawing the Ioffe-Pritchard Magnetic Trap

   


 

MagneticTraps.mw or in pdf format with the sections open: MagneticTraps.pdf

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

How do i plot

in one plot with this paraellogram (it has to come out of the center of it)

How to get a function value for this HPM code. in the equations p-value 0 to N also some problem.

 

Still in Maple 2017 the palette is almost not readable without the help of a magnifier under a UHD screen (3840x2160) resolution. I have set all things which could be set for scaling and sizing, no effect on the palette. With the trend to higher resoluiton screen this should be fixed in the near future - or is there any work around?

https://gist.github.com/hoyeunglee/b0c6b61fafd1bee988fcafef3cfe6025
https://gist.github.com/hoyeunglee/a1e0ca335be8bbc8fde301c6aded66f8

test1 = o(a(x,y),z)

test1.args[0]

python sympy can not get function name o and a

Hi. I am using JetCalclulus to prolong infinitesimal generators.

Then I want to find invariants, it means I want to act on some function by these differential operators and to solve linear PDEs.

Is it possible to do it automatically?

First 894 895 896 897 898 899 900 Last Page 896 of 2214