Robert Israel

6577 Reputation

21 Badges

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

MaplePrimes Activity


These are replies submitted by Robert Israel

What exactly do you mean by that?  Do you mean trajectories corresponding to the eigenvectors of the system? What do you want the 3D picture to look like?

The point is that sign is for computing the sign of the leading coefficient of a polynomial, not the sign of a number (which is what the signum function is for). 
This pitfall is rather tricky because sign works like signum on rational numbers and floats.

The point is that sign is for computing the sign of the leading coefficient of a polynomial, not the sign of a number (which is what the signum function is for). 
This pitfall is rather tricky because sign works like signum on rational numbers and floats.

In this case that works, but some caution is needed in general: symbolic solutions that contain I may sometimes turn out to be real.  In particular, that typically happens with cubics that have three real roots.

 > solve(x^3 -5*x + 1, x);

 1/6*(-108+12*I*1419^(1/2))^(1/3)+10/(-108+12*I*1419^(1/2))^(1/3) ,
-1/12*(-108+12*I*1419^(1/2))^(1/3)-5/(-108+12*I*1419^(1/2))^(1/3)+1/2*I*3^(1/2)*(1/6*(-108+12*I*1419^(1/2))^(1/3)-10/(-108+12*I*1419^(1/2))^(1/3)),
-1/12*(-108+12*I*1419^(1/2))^(1/3)-5/(-108+12*I*1419^(1/2))^(1/3)-1/2*I*3^(1/2)*(1/6*(-108+12*I*1419^(1/2))^(1/3)-10/(-108+12*I*1419^(1/2))^(1/3))

 All three solutions contain I, but all three turn out to be real.

 

> simplify(evalc([%]));

[2/3*5^(1/2)*3^(1/2)*sin(1/3*arctan(1/9*3^(1/2)*473^(1/2))+1/6*Pi), -1/3*5^(1/2)*(3^(1/2)*sin(1/3*arctan(1/9*3^(1/2)*473^(1/2))+1/6*Pi)+3*sin(-1/3*arctan(1/9*3^(1/2)*473^(1/2))+1/3*Pi)), -1/3*5^(1/2)*(3^(1/2)*sin(1/3*arctan(1/9*3^(1/2)*473^(1/2))+1/6*Pi)-3*sin(-1/3*arctan(1/9*3^(1/2)*473^(1/2))+1/3*Pi))]

In this case that works, but some caution is needed in general: symbolic solutions that contain I may sometimes turn out to be real.  In particular, that typically happens with cubics that have three real roots.

 > solve(x^3 -5*x + 1, x);

 1/6*(-108+12*I*1419^(1/2))^(1/3)+10/(-108+12*I*1419^(1/2))^(1/3) ,
-1/12*(-108+12*I*1419^(1/2))^(1/3)-5/(-108+12*I*1419^(1/2))^(1/3)+1/2*I*3^(1/2)*(1/6*(-108+12*I*1419^(1/2))^(1/3)-10/(-108+12*I*1419^(1/2))^(1/3)),
-1/12*(-108+12*I*1419^(1/2))^(1/3)-5/(-108+12*I*1419^(1/2))^(1/3)-1/2*I*3^(1/2)*(1/6*(-108+12*I*1419^(1/2))^(1/3)-10/(-108+12*I*1419^(1/2))^(1/3))

 All three solutions contain I, but all three turn out to be real.

 

> simplify(evalc([%]));

[2/3*5^(1/2)*3^(1/2)*sin(1/3*arctan(1/9*3^(1/2)*473^(1/2))+1/6*Pi), -1/3*5^(1/2)*(3^(1/2)*sin(1/3*arctan(1/9*3^(1/2)*473^(1/2))+1/6*Pi)+3*sin(-1/3*arctan(1/9*3^(1/2)*473^(1/2))+1/3*Pi)), -1/3*5^(1/2)*(3^(1/2)*sin(1/3*arctan(1/9*3^(1/2)*473^(1/2))+1/6*Pi)-3*sin(-1/3*arctan(1/9*3^(1/2)*473^(1/2))+1/3*Pi))]

You can right-click on a Windows launcher icon, click Properties and edit the Target field to include a -T switch (after the closing quotes).  For example, I changed the Target for Classic Worksheet Maple 12 to

"C:\Program Files\Maple 12\bin.win\cwmaple.exe"  -T100,100000

(i.e. 100 seconds, 100000 kB of memory).  I tried the command

> Q:= expand((a+b+c)^(10^8)):

and very soon I got a pop-up window

"Execution stopped: memory allocation failed.  Please see ?alloc for more detail"

According to the Task Manager, mserver.exe was using 404,784K at this point.
Further computation is of course impossible, but the worksheet can be saved, and mserver.exe is shut down successfully.

 

You can right-click on a Windows launcher icon, click Properties and edit the Target field to include a -T switch (after the closing quotes).  For example, I changed the Target for Classic Worksheet Maple 12 to

"C:\Program Files\Maple 12\bin.win\cwmaple.exe"  -T100,100000

(i.e. 100 seconds, 100000 kB of memory).  I tried the command

> Q:= expand((a+b+c)^(10^8)):

and very soon I got a pop-up window

"Execution stopped: memory allocation failed.  Please see ?alloc for more detail"

According to the Task Manager, mserver.exe was using 404,784K at this point.
Further computation is of course impossible, but the worksheet can be saved, and mserver.exe is shut down successfully.

 

I don't know if this would make sense in the model, but if you allow an additional constant term you get a much nicer-looking fit:

>  f:= x -> ((A*exp((2*Pi*x)/L))/(1+exp((2*Pi*x)/L)))
+((B*exp((2*Pi*x)/L))/(1+exp((2*Pi*x)/L))^2)+C; 

f := x -> A*exp(2*Pi*x/L)/(1+exp(2*Pi*x/L))+B*exp(2*Pi*x/L)/(1+exp(2*Pi*x/L))^2+C

> residuals := map(p -> (f(p[1])-p[2]), data):
    R:= LSSolve(residuals);

R := [.10437261427190e-4, [A = -.826228715236747466e-2, B = .200328037553268640, C = -.237241869574103606e-1, L = 3.83727872161095851]]
 

I don't know if this would make sense in the model, but if you allow an additional constant term you get a much nicer-looking fit:

>  f:= x -> ((A*exp((2*Pi*x)/L))/(1+exp((2*Pi*x)/L)))
+((B*exp((2*Pi*x)/L))/(1+exp((2*Pi*x)/L))^2)+C; 

f := x -> A*exp(2*Pi*x/L)/(1+exp(2*Pi*x/L))+B*exp(2*Pi*x/L)/(1+exp(2*Pi*x/L))^2+C

> residuals := map(p -> (f(p[1])-p[2]), data):
    R:= LSSolve(residuals);

R := [.10437261427190e-4, [A = -.826228715236747466e-2, B = .200328037553268640, C = -.237241869574103606e-1, L = 3.83727872161095851]]


 

 

Rather than manually converting to cartesian coordinates as Alec did, you can use

> with(plots):
  changecoords(contourplot(E, r=0..1, phi=0..2*Pi), polar);

In Maple 12 (Standard GUI) you can also get a polar coordinate grid:

> changecoords(contourplot(E, r=0..1, phi=0..2*Pi,
       axiscoordinates=polar), polar);

 

Rather than manually converting to cartesian coordinates as Alec did, you can use

> with(plots):
  changecoords(contourplot(E, r=0..1, phi=0..2*Pi), polar);

In Maple 12 (Standard GUI) you can also get a polar coordinate grid:

> changecoords(contourplot(E, r=0..1, phi=0..2*Pi,
       axiscoordinates=polar), polar);

 

You must be using Maple 9.5 or earlier: source = csv works in more recent versions.
Well, it should still work if you tell ImportMatrix that the delimiter is ",".  Thus:

> M := ImportMatrix("c:/mypath/myfile.txt", delimiter=",");

If you want the z entry to be a slope, you could do something like this:
 

> with(plots): 
   n := LinearAlgebra[RowDimension](M);
   r := (max-min)(seq(M[i,2],i=1..n))/10; 
   display([seq](arrow([M[i,2],M[i,3]], 
         evalf([1, M[i,4]]*r/sqrt(1+M[i,4]^2)), 
       colour=colours[M[i,1]], shape=arrow), 
      i=1..n));

Here r is the length for each arrow; I tried to make a reasonable choice, based on the range of x values in the plot, but you can adjust this according to taste.

You must be using Maple 9.5 or earlier: source = csv works in more recent versions.
Well, it should still work if you tell ImportMatrix that the delimiter is ",".  Thus:

> M := ImportMatrix("c:/mypath/myfile.txt", delimiter=",");

If you want the z entry to be a slope, you could do something like this:
 

> with(plots): 
   n := LinearAlgebra[RowDimension](M);
   r := (max-min)(seq(M[i,2],i=1..n))/10; 
   display([seq](arrow([M[i,2],M[i,3]], 
         evalf([1, M[i,4]]*r/sqrt(1+M[i,4]^2)), 
       colour=colours[M[i,1]], shape=arrow), 
      i=1..n));

Here r is the length for each arrow; I tried to make a reasonable choice, based on the range of x values in the plot, but you can adjust this according to taste.

I don't know if hired staff are necessary for this: there are MaplePrimes members around the world who would notice when the site goes awry.  The only problem is how they can send in this notification (obviously, not through MaplePrimes itself).

Yes, but the Title and Alternate text are

LineInt\left( VectorField\left( \left< \frac{e^x \cos(y)-1}{e^{2x}-2 e^x\cos(y)+1}, \frac{e^x\sin(y)}{e^{2 x}-2 e^x\cos(y)+1} \right>\right), \, Circle(<0,0>,1)\right)

which is TeX, not Maple.

First 127 128 129 130 131 132 133 Last Page 129 of 187