Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

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

Social Networks and Content at Maplesoft.com

Maple Application Center

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

I might help you if you didn't post that 6 times in the forums and 4 times in private messages.

Alec

There are many ways to do such things. In particular, using SolveTools:-CancelInverses. But it may be as simple as evaluating the result - for example, doing % after it. It is hard to tell from the information you provided.

Alec

Great examples, everybody - that could, probably, go directly to the wiki, since it seems to be a frequently asked question.

Alec

I would do such things with strings - using sprintf instead of converting to base 10, and then using StringTools.

Alec

It would be easier if you posted your code (so that it could be copied and pasted). It takes long time to invent a similar example, and it may be far from what you actually have.

At least - the input that you have (you posted only the desirable output).

Alec

Worked OK for me,

int(u,z);
                               2          3          2
              sin(theta) (1/2 s  z + 1/6 z  + 1/2 h z )

int(u,z=s..h);
                   3    3                       2    2
  1/6 sin(theta) (h  - s ) + 1/2 sin(theta) h (h  - s )

                           2
         + 1/2 sin(theta) s  (h - s)

simplify(%);

                                        3    3
                       2/3 sin(theta) (h  - s )

Alec

PS The standard reference recommendation is the manuals that come with Maple and available for downloading from Maplesoft Documentation Center. -Alec

In this example,

F:=(13/10-x)*x+3/10*(1-y)*(y-x);

                      /13    \     3 (1 - y) (y - x)
                 F := |-- - x| x + -----------------
                      \10    /            10

maximize(F,location);

                     16         23      30   16
                     --, {[{x = --, y = --}, --]}
                     37         37      37   37

evalf(%);

  0.4324324324,

        {[{x = 0.6216216216, y = 0.8108108108}, 0.4324324324]}

That means that f(t)=16/37=0.(432) for 0<=t<=23/37=0.(62). So it is safe to use the starting value of 23/37=0.(62) for t, as in the examples given by acer. With quoting, the equality sign also can be used,

fsolve('f(t)'=0.4,t=0.6..0.9);
                             0.8088533865

The following error seems to be a bug,

fsolve(f-0.4,0.6..0.9);
Error, (in fsolve) Can't handle expressions with typed procedures

because Maple evaluates f-0.4 without problems,

(f-0.4)(0.7);
                             0.0267500000

As usual, the error message is unclear. In what sense f-0.4 is typed? And what does a typed procedure mean in Maple, in general? - I couldn't find it in help pages.

Alec

 

Suppose that F(x,t) = F1(x)*F2(t). Now,

value(F(0,t)) assuming positive;
                                  1/2
                                Pi
                                ------
                                   1/2
                                2 t

From here, F2(t) = c/sqrt(t) which doesn't satisfy the conditions given in the PDE solutions. That means that F(x,t) can not be written as a product of F1(x) and F2(t).

Alec

Not all solutions are returned by pdsolve. Without the build option, it gives

pdsolve(PDE, f(x,t));
  (f(x, t) = _F1(x) _F2(t)) &where

           2
          d                          d
        [{--- _F1(x) = _c[1] _F1(x), -- _F2(t) = -_c[1] _F2(t)}]
            2                        dt
          dx

which is only a part of all possible solutions, not including such solutions as f(x,t) = x^2 - 2t, for example.

Alec

There are 2 problems here.

First - premature evaluation. Maple evaluates arguments of functions - in this case, f(t), and gives an error. To prevent this, 2 standard ways are usually used - either quote it,'f(t)', or use f instead (and don't use t in the interval definition.)

Second, the maximal value of f is 16/37 < 0.5, so f(t)=0.5 doesn't have solutions.

Alec

As far as I understand, the original idea was to create Student package with the same functionality as it was in student.

However, the original developer of the first functions in Student package left Maplesoft, and the development was continued by other people, with other design ideas.

As a result, not all of functionality of student package exists in the Student package, and some functions implemented there work in the opposite way to other Maple functions. For example, Student:-LinearAlgebra:-RotationMatrix rotates in the opposite direction to plottools[rotate].

Alec

$include is a preprocessor directive. It works only in command line maple for files read from the stdin, see ?preprocessor.

If your myplot.wm is in correct Maple input format, then it should have a correct extension, such as .mpl, for example. It can be read using read command.

A better way of using it would be by adding it to your own Maple library, see ?LibraryTools.

Alec

What about just typing in different lines,

a:=proc() description 
"a        
b        
c"; 
end:
Describe(a);

# a        
# b        
# c
a( )

I didn't get any warnings.

Personally, I prefer series of strings in the description - for indentation purposes (in the code). Indenting code as in this example would lead to indenting it in the display given by Describe, which is not desirable usually.

Alec

S:=Sum((A*x[i]+B)^2, i = 1 .. n);

                              n
                            -----
                             \                2
                       S :=   )   (A x[i] + B)
                             /
                            -----
                            i = 1

value(expand(map(op(0..-1,expand(S)))));

                /  n        \         /  n       \
                |-----      |         |-----     |
              2 | \        2|         | \        |      2
             A  |  )   x[i] | + 2 A B |  )   x[i]| + n B
                | /         |         | /        |
                |-----      |         |-----     |
                \i = 1      /         \i = 1     /

Alec

\n in a string should start a new line when it is printed using Describe. For example,

a:=proc() description "a\nb\nc\n"; end:
Describe(a);

# a
# b
# c
# 
a( )

Alec

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