Robert Israel

6577 Reputation

21 Badges

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

MaplePrimes Activity


These are answers submitted by Robert Israel

You're doing the wrong integrals.  The density is


> f := piecewise(a < x and x < b, 1/(b-a), 0);
  

So

 

> M1:= simplify(int(x*f,x=-infinity..infinity)) assuming b>a;
  M2:= simplify(int(x^2*f,x=-infinity..infinity)) assuming b>a;
  sigma:= simplify(sqrt(E2 - E1^2)) assuming b > a;

If your Matrix has shape=symmetric and float entries, I believe the eigenvalues will in fact be sorted in increasing order.  But let's say you have a non-symmetric matrix.  The eigenvalues may be complex, but I'll sort them in order of decreasing absolute value.  You could use sorting with attributes, which (by coincidence?) Joe Riel just posted about:

> E, V:= Eigenvectors(M);
  P := map(attributes, sort([seq(setattribute(evalf(abs(E[i])),i), i = rtable_dims(E))],`>`));
  SortedEs:= [seq(E[p],p=P)];
  SortedVs:= [seq(Column(V,p),p=P)];
   

 

In other words, Maple 11 isn't able to sum the series, Maple 13 is.

In Maple 11 you could try

> simplify(value(convert(FaN1, exp)));

In Maple 13:

> value(FaN2);

Or do you mean that you want to go from the expression in terms of LerchPhi and polylog to the Sum? 
That's not so easy...

 

> plot([seq(a*x^2+5, a = [4,8,12,16])], x=-5..5);

 

Try plotting parametrically.

> plot([y^2, y, y = -1..1]);

 

With the input you gave, it works for me.  Somehow, neither the diff nor the Xx have been evaluated in your J.  What was the actual input?  Were you delaying evaluation, e.g. with

> J:= < 'diff(Xx,q1)' | 'diff(Xx,q2)' | 'diff(Xx,q3)'>;

In any case, it should work with

> Matlab(eval~(J)); # for Maple 13

or 

> Matlab(map(eval, J));

I assume you mean y = a*exp(-I*10*t) + b*exp(I*10*t).  I think the best way is to do an ordinary least-squares fit on the real and imaginary parts.  Statistics[Fit] wants only one dependent variable, but Optimization[LSSolve] is more flexible in this matter.
 

> with(Optimization):  
  LSSolve( evalc([seq((Re,Im)(Y[i] - (ar+I*ai)*exp(-I*10*X[i]) - (br+I*bi)*exp(I*10*X[i])), 
     i=1..3)]));
   

[15.0833069464601532, [ai = -2.04208824372692499, ar = .211343957335151406, bi = .715157697607572084, br = -.707738023109680480]]


So the best fit function is
 

> eval((ar+I*ai)*exp(-I*10*x) - (br+I*bi)*exp(I*10*x), %[2]);

 

 

 

You can use either spacecurve or pointplot3d in the plots package to plot a list of points, optionally joining them with line segments.  For example:

V[0]:= -1:
V[1]:= -2:
for i from 2 to 100 do V[i]:= 0.3*V[i-1] - V[i-2] end do:
plots[pointplot3d]([seq([V[i],V[i-1],i],i=1..100)],
   colour=black,axes=box);

You might use some of the commands in the plottools package: translate, rotate and scale.

I hope you defined your functions something like this, not as you wrote them:

> N40 := xi -> piecewise(0<xi and xi<=1, a, b);
  N50 := xi -> piecewise(1 < xi and xi <= 2, c, d);

Then to combine them:

> N41 := xi -> (xi-1)*N40(xi) + (2-xi)*N50(xi);

Or you could even do this, with the help of an "identity function":

> id:= x -> x:
  N41 := (id - 1)*N40 + (2-id)*N50;

 

> f:= x -> x^2;
  M:= Matrix([seq([seq(f(x-y),x=0..2, 0.5)],y=0..2, 0.5)]);
  ExportMatrix("c:/test/mlab.mat",M, target=Matlab, arraynames="f");

Do you mean this?

> diff(D(w)(q(x,y,t)), x);

(D@@2)(w)(q(x,y,t))*diff(q(x,y,t),x)

> de:= u(x,y,t) = a[0](x,y,t) + a[1](x,y,t)*w(q(x,y,t)) + a[2](x,y,t)*D(w)(q(x,y,t)) 
    + a[3](x,y,t)*w(q(x,y,t))^2;

It looks like you've had a crash with a core dump.  Unfortunately, the signal, being UNKNOWN, doesn't give me much of a clue about what actually happened.   Since alloc is only 78.7 MB, it doesn't look like you've run out of memory.  My guess is that it may be some sort of input/output problem, but that's only a guess.

You have run into a bug.  Here it is in simpler form:

> simplify(sqrt(omega^2 + omega[0]));

Error, (in content/content) invalid arguments

I hope you'll submit an SCR. 

A work-around is to use a different name instead of omega[0].  Thus:

> simplify(subs(omega[0]=omega0, ss1 - ss2));

F[0]*((omega^2+omega0^4-2*omega0^2*omega^2+omega^4)^(1/2)*sin(omega*t)*omega0^2-(omega^2+omega0^4-2*omega0^2*omega^2+omega^4)^(1/2)*(omega^2*(1+omega^2))^(1/2)*cos(omega*t-arctan(omega^2,omega))+cos(omega*t-arctan(-omega0^2+omega^2,omega))*omega^2+cos(omega*t-arctan(-omega0^2+omega^2,omega))*omega0^4-2*cos(omega*t-arctan(-omega0^2+omega^2,omega))*omega0^2*omega^2+cos(omega*t-arctan(-omega0^2+omega^2,omega))*omega^4)/(omega^2+omega0^4-2*omega0^2*omega^2+omega^4)^(3/2)

But to see that the two expressions are the same, you can use expand:

> expand(ss1 - ss2);

                                  0

1) When finding the limits of integration, tell it that you want to solve for x.  And what is that s doing there?

>   solve(L(x) = h(x), x);

2) If you do that, you won't need rhs.

3) You probably want to actually do the integral, so int rather than Int.

4) Where did you use the number 1000?

 

First 54 55 56 57 58 59 60 Last Page 56 of 138