Robert Israel

6577 Reputation

21 Badges

18 years, 210 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are answers submitted by Robert Israel

Hmmm: MakeDirectory in the FileTools package should create a subfolder, but it doesn't seem to be working right now for me (Maple 13 under Windows Vista).  It worked in Maple 12.  For example:

> FileTools[MakeDirectory]("c:/temp/Subfolder");

I'm submitting an SCR.

 If the subfolder already exists, you just include the path in the command.  Thus

> ExportMatrix("c:/temp/Subfolder/A", A);

 

 

You can do it with the system or ssystem command.  For example:

> system("c:/windows/notepad.exe");

However,  these may be disabled for security reasons, in which case you'll get a "permission denied" error.  If so, go to Tools, Options, Security,
click the box for "Enable system/ssystem commands", and then "Apply to session" (or "Apply Globally" to make it permanent).

 

 

Progress bars have been discussed before: see www.mapleprimes.com/forum/progressbarwhentypingreturn .

But do you really need 80 million evaluations of your function?  You're not using Euler's method, are you?

You could use the ytickmarks option.  And to make the numbers larger, use the axesfont option.  For example:

plot([first,second,sqrt((4)+(6)) ],rho=2.5..50,
  y=10^(-5)..10^(-3), axesfont=[HELVETICA,15],  
  ytickmarks=[seq(v=sprintf("%3.0e",v),v=[1e-5, 2e-5, 4e-5, 6e-5, 8e-5, 1e-4, 2e-4, 4e-4, 6e-4, 8e-4, 1e-3])],
  legend=["first_Emm", "second_emm","first+second"], labels=[rho,sigma[Emm]],axis=[mode=log, gridlines=true]);

If I understand you correctly, you have a 4 x n array, let's call it A, such that [A[1,j], A[2,j]] and [A[3,j],A[4,j]] are the positions of the person and the limo at a time corresponding to j.  You can make an animation as follows:

> with(plots):
  display([seq(pointplot([[A[1,j],A[2,j]], [A[3,j],A[4,j]]], colour=[red,blue], symbol = box), j = 1 .. n)], 
     insequence=true);

 

Click on Source, and you can write html code.

<FONT COLOR="#FF0000">  ... </FONT>:

This is red

<FONT COLOR="#00FF00">  ... </FONT>:

This is green

<FONT COLOR="#0000FF">  ... </FONT>:

This is blue

 The Input format must be set to "Worksheet HTML".

Oops, I see now you said "without going to HTML source mode".  Well, once you have something that was put in colour as above, you can copy it, paste it somewhere else, and then edit it there.
For example, those last three blue words were done without going to source mode, by copying and pasting the "This is blue" and then editing.

You might try

> newexpr:= simplify(expr, {w^3 = 0});

 

As you have found, it's very inefficient to add elements to a list one at a time.  Much better is to start by creating an Array of the appropriate size and then
assign individual elements of that.

 

 

By exhibiting a unitary matrix U such that  U.A.U^(-1) = B.   It's a bit tricky, though, unless you use a change of variables.

> with(LinearAlgebra):
   A:= <<cos(theta), sin(theta) > | <-sin(theta), cos(theta)>>;
   map(convert, A, exp);

    
                        [cos(theta)    -sin(theta)]
                   A := [                         ]
                        [sin(theta)    cos(theta) ]


        [1/2 exp(theta I) + 1/2 exp(-I theta) , 1/2 I (exp(theta I) - exp(-I theta))]

        [-1/2 I (exp(theta I) - exp(-I theta)),  1/2 exp(theta I) + 1/2 exp(-I theta)]

> A1:=subs(exp(I*theta)=w,exp(-I*theta)=1/w,%);

                   [          1                        ]
                   [   w/2 + ---        1/2 I (w - 1/w)]
                   [         2 w                       ]
             A1 := [                                   ]
                   [                              1    ]
                   [-1/2 I (w - 1/w)       w/2 + ---   ]
                   [                             2 w   ]
> E,V:= Eigenvectors(A1);

                               [ w ]  [I    -I]
                       E, V := [   ], [       ]
                               [1/w]  [1    1 ]
Now V is not quite unitary.
 
> HermitianTranspose(V) . V;
                               [2    0]
                               [      ]
                               [0    2]

> U:= V/sqrt(2);

                        [       1/2            1/2]
                        [1/2 I 2       -1/2 I 2   ]
                        [                         ]
                   U := [    1/2           1/2    ]
                        [   2             2       ]
                        [   ----          ----    ]
                        [    2             2      ]


 

> f:= z -> (Re(z^4),Im(z^4));
  p1:= plot([seq([f((1+I)/2+j/20*exp(I*t)),t=0..2*Pi],j=1..10)],
     colour=red):
  p2:= plot([seq([f((1+I)/2+r*exp(I*Pi*j/10)),r=0..1/2],j=0..19)],
     colour=blue):
  plots[display](p1,p2, scaling=constrained);

Presumably EU, Px and Py are expressions involving the variables.  Without knowing them, it's hard to help.  But I suspect that what you have is a set of non-polynomial equations that Maple is not able to solve.  There may in fact be no closed-form solutions.
If all parameters have numerical values, you might be able to get numerical solutions using fsolve instead of solve.

 

> MultiSeries:-series((sum(a^k*b[k], k = 1 .. infinity))^m, a);

b[1]^m*a^m+b[2]/b[1]*m*b[1]^m*a^(1+m)+1/2*m*(2*b[3]*b[1]+b[2]^2*m-b[2]^2)*b[1]^m/b[1]^2*a^(2+m)+1/6*m*(6*b[4]*b[1]^2+6*b[3]*b[2]*b[1]*m-6*b[3]*b[2]*b[1]+b[2]^3*m^2-3*b[2]^3*m+2*b[2]^3)*b[1]^m/b[1]^3*a^(3+m)+1/24*m*(24*b[5]*b[1]^3+24*b[1]^2*b[4]*b[2]*m-24*b[1]^2*b[4]*b[2]+12*b[1]^2*b[3]^2*m-12*b[1]^2*b[3]^2+12*b[3]*b[2]^2*b[1]*m^2-36*b[3]*b[2]^2*b[1]*m+24*b[3]*b[2]^2*b[1]+b[2]^4*m^3-6*b[2]^4*m^2+11*b[2]^4*m-6*b[2]^4)*b[1]^m/b[1]^4*a^(4+m)+O(a^(5+m))

 

1010077555131151225 is not Power(y,(p+1)/4) mod p, it is Power(x,2) mod n.

Aha!  363278601055491705 is Power(1414213562373095048, 2) mod n.  Your notes have a misprint: x is supposed to be 1414213562373095048, not 141213562373095048.

 

I use 1D "Maple notation" input, usually in Classic, and just copy-and-paste directly into the post.  From Classic Maple output, copy-and-paste generally works.  For Standard output, lprint will produce a text version that can be copied and pasted.  Alternatively, for Standard output or 2D input, after copying I use "Paste Special" in WordPad (choosing "Unformatted Text"), then copy and paste from there into the post or into a Maple Tag.

Something like this, perhaps

> with(plots):
  P1:= densityplot(x*exp(-x^2-y^2),x=-1..1,y=-1..1,grid=[25,25],
     colourstyle=HUE,axes=box):
  P3:= plot3d(x*exp(-x^2-y^2),x=-1..1,y=-1..1,grid=[25,25]):
  ZA:= op([1,3],indets(P3,specfunc(anything,GRID))):
  zmax, zmin:= (min,max)(ZA):
  cbar:= densityplot(z,x=0.. 0.1, z=zmax .. zmin,grid=[2,25],
    colourstyle=HUE,axes=box,tickmarks=[0,5],labels=["",""]):
  display(Array([P1,cbar]));

Now the colour bar is much too wide, so click on its right edge with the mouse and resize.

Unfortunately this only works in the Standard  GUI: it seems to be impossible to export the resulting plot as a single image to gif or jpeg formats (what I show below is two separate files, which strangely enough were given different heights).  And in Classic the display command seems to run forever.

 

First 61 62 63 64 65 66 67 Last Page 63 of 138