Alec Mihailovs

Dr. Aleksandrs Mihailovs

4455 Reputation

21 Badges

20 years, 311 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

Social Networks and Content at Maplesoft.com

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

MaplePrimes Activity


These are answers submitted by Alec Mihailovs

Perhaps, I don't understand the question, but maybe eval could be used,

eval(f,T=T(x,y));
                                         2
                            2 T(x, y) + x

Same for a matrix or a vector instead of f.

Alec

Searching this site for eps would help.

In Classic Maple, use commands suggested by Joe Riel in that thread.

Alec

odetest command does that. And if you posted it in the way it could be copied and pasted in Maple instead of latex, I would do that and paste here the exact command and the Maple output.

An advice for improving your latex skills - single characters don't have to be included in braces, and cos-like functions should be entered with a backslash, as \cos.

Alec

Here is the output with 'assuming real' suggested by Alejandro Jakubi in the post above.

v:=A*sin(t)+B*cos(t);
w:=C*sin(t+theta);
solve(identity(v-w,t),{C,theta}) assuming real;
map2(eval,w,[%]);
     2    2 1/2
  [(B  + A )    sin(t + arctan(B, A)),

           2    2 1/2
        -(B  + A )    sin(t + arctan(-B, -A))]

To apply that, the following can be used,

p:=compiletable(
    [A::algebraic*sin(t::algebraic)+B::algebraic*cos(t::algebraic)=
        sqrt(A^2+B^2)*sin(t+arctan(B,A))]):
sol:=[-I0*sqrt(L)*sin(t/(sqrt(L)*sqrt(C)))/sqrt(C)+
    V0*cos(t/(sqrt(L)*sqrt(C))), 
    -sqrt(C)*(-I0*sqrt(L)*cos(t/(sqrt(L)*sqr(C)))/sqrt(C)-
    V0*sin(t/(sqrt(L)*sqrt(C))))/sqrt(L)]:
map(tablelook,expand(sol),p);
   /  2        \1/2                                  1/2
   |I0  L     2|            t                    I0 L
  [|----- + V0 |    sin(--------- + arctan(V0, - -------)),
   \  C        /         1/2  1/2                  1/2
                        L    C                    C

        /  2        \1/2                                1/2
        |V0  C     2|            t                  V0 C
        |----- + I0 |    sin(--------- + arctan(I0, -------))]
        \  L        /         1/2  1/2                1/2
                             L    C                  L

Alec

The proof that eqn < 4 with the given assumptions is pretty simple. But before posting it I'd like to know more about the source of the problem. Is it a homework problem, a test problem, or some competition problem?

Alec

That would be a good thing to have. Sets can not be used for non-commutative operations though, where the order of operands matters (a dot product of matrices, for example, instead of `+`, or [a,b,c,d] instead of a+b+c+d). Lists also can not be used, because [1,-1] may be an operand itself. In such cases also the resulting operand of something like f(a+d) also should be specified. From other point of view, is such cases (and with inverted order of operands), such an operation may be rarely needed.

It is not clear though what would that mean for operands that are not a part of the same expression, as in

applyops(f, {[1,1],[-1,1]}, a[1]+b+c+d[1]);

Alec

For example,

f:=(1+x)*(1+2*x)^2;
                                             2
                       f := (1 + x) (1 + 2 x)

applyop(expand,2,f);

                                             2
                       (1 + x) (1 + 4 x + 4 x )

Alec

It seems as if a lot of problems with understanding Maple results (especially for Calculus students) are caused by initial assumption that all variables are complex. A better design (at least in Student versions) probably, would be assuming initially that all the variables are real, and use assumptions if they are complex.

Alec

That looks very nice!

One possible (very slight) improvement (that I learned from Joe Riel) is that in Maple 12 _rest can be used instead of args[2..-1].

Alec

Seems like a bug to me.

Not that my opinion means anything...

Alec

I think, you made some mistakes in your equations (if I understand them right.).

Nevertheless. In the form they are written, the double integral is infinity for b=1 (because of the singularity at 0) and is positve and approaching 0 for lambda approaching -0 (if lambda is positive, the double integral is infinite. and for lambda=0 it is not defined) if b is not equal to 1. So your minimization problem doesn't have much sense unless you also state the ranges for b and lambda.

Alec

B should be symmetric (otherwise solutions don't exist). In this case, one obvious solution is X=A^(-1).B/2.

But there are a lot of other solutions... Because there are n(n+1)/2 linear equations with n^2 variables.

The additional requirement of X being symmetric, in case if A is symmetric, would make only n(n+1)/2 variables, In this case, the solution could be unique - then it could be found using the formula above. If A is not symmetric, the symmetric X may not exist (as in the given above example).

Alec

For example,

A:=Matrix(2,`-`);
                                 [0    -1]
                            A := [       ]
                                 [1     0]

B:=Matrix(2,`+`);

                                 [2    3]
                            B := [      ]
                                 [3    4]

X:=Matrix(2,symbol=x);

                           [x[1, 1]    x[1, 2]]
                      X := [                  ]
                           [x[2, 1]    x[2, 2]]

solve(convert(A.X+(A.X)^%T-B,set));

  {x[1, 1] = x[1, 1], x[1, 2] = 2, x[2, 1] = -1,

        x[2, 2] = x[1, 1] - 3}

Now, check the answer,

assign(%);
A.X+(A.X)^%T=B;

                         [2    3]   [2    3]
                         [      ] = [      ]
                         [3    4]   [3    4]

Alec

Also, interleaving of e and f can be done as

g:=[seq(i,i in Matrix([e,f]))];
        g := [3, 5, 7, 9, 6, 3, 6, 7, 5, 4, 4, 6, 3, 9, 2, 6]

or

g:=convert(Matrix([e,f]),compose,Vector,list);
        g := [3, 5, 7, 9, 6, 3, 6, 7, 5, 4, 4, 6, 3, 9, 2, 6]

That may be convenient for more than 2 numbers. ListTools:-Interleave can be used for more than 2 lists though, too.

Alec

It should be

c:=exp(h-z);

e in Maple is not exp(1), it is just a name.

Alec

First 51 52 53 54 55 56 57 Last Page 53 of 76