Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 337 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 replies submitted by Alec Mihailovs

Debugger can be used,
stopat(Student:-Calculus1:-AntiderivativeTutor):
Student:-Calculus1:-AntiderivativeTutor();
Debugger starts, type at the debugger prompt
showstat(AntiderivativeMaplet);
After the procedure has been displayed, type stop at the debugger prompt, or, if Standard Maple is used, copy the output (maplet is located on line 32) and click Quit. For the second question, sin(x) is located under the 3rd button in the palette and ln(x) and ex are under the 4th button. I would use a TextField for the expression input and a MathMLViewer to see it. __________ Alec Mihailovs http://mihailovs.com/Alec/
I agree that NAG library functions should be available for external calling. In earlier versions of NAG dlls (in Maple 8, I think), the functions had standard names, and it was easy to call functions from those dlls. Now the situation is different, because most of the functions got renamed. Ideally the dlls would come equipped with both lib and include files, but even without them, the list of functions in them should be presented, I think, so that they were available for external calling. __________ Alec Mihailovs http://mihailovs.com/Alec/
The main difference is that in assign the arguments are evaluated, including the left part of an assignment, but in := the left part is not evaluated. That's why assign works as it should in this example, and your 2nd method doesn't,
v,w:=<a,b,c>,<1,2,3>:
v[1]:=w[1]:
changes only the first element of v, but a stays unchanged,
v[1];
                                  1
a;
                                  a
while using assign, the first element of v is first evaluated to a, so a gets assigned,
v,w:=<a,b,c>,<1,2,3>:
assign(v[1],w[1]);
v[1];
                                  1
a;
                                  1
Note that v[1] is still assigned to a,
a:=2:
v[1];
                                  2
__________ Alec Mihailovs http://mihailovs.com/Alec/
The main difference is that in assign the arguments are evaluated, including the left part of an assignment, but in := the left part is not evaluated. That's why assign works as it should in this example, and your 2nd method doesn't,
v,w:=<a,b,c>,<1,2,3>:
v[1]:=w[1]:
changes only the first element of v, but a stays unchanged,
v[1];
                                  1
a;
                                  a
while using assign, the first element of v is first evaluated to a, so a gets assigned,
v,w:=<a,b,c>,<1,2,3>:
assign(v[1],w[1]);
v[1];
                                  1
a;
                                  1
Note that v[1] is still assigned to a,
a:=2:
v[1];
                                  2
__________ Alec Mihailovs http://mihailovs.com/Alec/
The easiest way to be able to receive that answer in Maple is adding it to the table of known fourier transforms,
with(inttrans):
addtable(fourier,1/(exp(b*x)-exp(-b*x)),
-I*Pi/2/b*tanh(t*Pi/2/b),x,t,{b},b::Range(0,infinity));
addtable(fourier,1/(-exp(b*x)+exp(-b*x)),
I*Pi/2/b*tanh(t*Pi/2/b),x,t,{b},b::Range(0,infinity));
Then you would be able to calculate not only
fourier(x/sinh(x*Pi/2),x,t);

                    (-2 tanh(t) + 2) (tanh(t) + 1)

simplify(%);
                                  2
                               --------
                                      2
                               cosh(t)
but also such things as
fourier(x^5/sinh(2*x),x,t);

          6 /     t Pi     \ /     t Pi     \
  1/256 Pi  |tanh(----) - 1| |tanh(----) + 1|
            \      4       / \      4       /

        /        t Pi 2           t Pi 4    \
        |15 tanh(----)  - 15 tanh(----)  - 2|
        \         4                4        /

simplify(%);

                 /       t Pi 4           t Pi 2     \   6
                 |2 cosh(----)  - 15 cosh(----)  + 15| Pi
                 \        4                4         /
           1/256 -----------------------------------------
                                     t Pi 6
                                cosh(----)
                                      4
__________ Alec Mihailovs http://mihailovs.com/Alec/
The easiest way to be able to receive that answer in Maple is adding it to the table of known fourier transforms,
with(inttrans):
addtable(fourier,1/(exp(b*x)-exp(-b*x)),
-I*Pi/2/b*tanh(t*Pi/2/b),x,t,{b},b::Range(0,infinity));
addtable(fourier,1/(-exp(b*x)+exp(-b*x)),
I*Pi/2/b*tanh(t*Pi/2/b),x,t,{b},b::Range(0,infinity));
Then you would be able to calculate not only
fourier(x/sinh(x*Pi/2),x,t);

                    (-2 tanh(t) + 2) (tanh(t) + 1)

simplify(%);
                                  2
                               --------
                                      2
                               cosh(t)
but also such things as
fourier(x^5/sinh(2*x),x,t);

          6 /     t Pi     \ /     t Pi     \
  1/256 Pi  |tanh(----) - 1| |tanh(----) + 1|
            \      4       / \      4       /

        /        t Pi 2           t Pi 4    \
        |15 tanh(----)  - 15 tanh(----)  - 2|
        \         4                4        /

simplify(%);

                 /       t Pi 4           t Pi 2     \   6
                 |2 cosh(----)  - 15 cosh(----)  + 15| Pi
                 \        4                4         /
           1/256 -----------------------------------------
                                     t Pi 6
                                cosh(----)
                                      4
__________ Alec Mihailovs http://mihailovs.com/Alec/
Axel, Thank you again. The input here is in html, so html entities should be used for special characters, see the list of them at HTML 4.01 Entities Reference or at ASCII - ISO 8859-1 (Latin-1) Table with HTML Entity Names. In particular, less-than sign can be entered as &lt; __________ Alec Mihailovs http://mihailovs.com/Alec/
Originally I had the same form of calling as in invlaplace, ILT(f,s,t), but then I changed it to a more convenient form ILT(f,s)(t), but didn't change the example. I hope I changed the example in my blog. It should be
ILT(2/s^3,s)(10);

                             100.0000000
__________ Alec Mihailovs http://mihailovs.com/Alec/
It returns the answer if the entered value is a float,
ILT(2/s^5,s)(10.);
                             833.3333333
Thank you for mentioning that, I'll add convertion to floats. The inverse Laplace transform is an ill-posed numerical problem, so there is no a solution that is good for all cases. Bromwich integral requires knowing the maximum real part of the poles. It also has numerical problems related to calculating of large exponentials. Is a method practical or not, is a matter of opinion. Every method has it's own boundaries. Thank you for welcoming me back. Who knows how long that will last this time... __________ Alec Mihailovs http://mihailovs.com/Alec/
Here is a simple procedure doing numerical inverse Laplace transform,
ILT:=proc(f,s) local k;
proc(T) local t,d,a;
d:=Digits;
t:=evalf(T);
a:=Limit();
while op(0,a)='Limit' do
a:=evalf(Limit((-1)^k/k!*(k/t)^(k+1)*eval(diff(f,s$k),s=k/t),k=infinity),d); 
d:=2*d od;
evalf(a) end end:
For example,
inttrans[invlaplace](2/s^3,s,t);
                                  t^2
ILT(2/s^3,s,10);
                             100.0000000
I put it in my blog, Numerical Inverse Laplace Transform and may improve it, or add another procedure later. ______________ Alec Mihailovs http://mihailovs.com/Alec/
It was not your post that reminded me of that, it was my answer :)
It was not your post that reminded me of that, it was my answer :)
Also, declare can be used. That doesn't simplify the input, but the output looks nicer,
PDEtools[declare](x(t),theta(t),prime=t);

convert(simplify(diff(tan(theta(t))=1/x(t),t)),sec);

                     theta^`'`*sec(theta)^2 = -1/x^2*`x'`
__________ Alec Mihailovs http://mihailovs.com/Alec/
You have to specify that x and θ are functions of t,
diff(tan(theta(t))=1/x(t),t);
            (1+tan(theta(t))^2)*diff(theta(t),t) = -1/x(t)^2*diff(x(t),t)
simplify(%);
                      diff(theta(t),t)/cos(theta(t))^2 = -1/x(t)^2*diff(x(t),t) 
convert(%,sec);
               diff(theta(t),t)*sec(theta(t))^2 = -1/x(t)^2*diff(x(t),t)
__________ Alec Mihailovs http://mihailovs.com/Alec/
Actually, it is better to replace Unit in my examples with Units:-Unit so that it would work even if the Units package is not loaded. For example,
with(Units:-Natural):
eval(1.7*m,Unit=1);
                               1.7 [m]

eval(1.7*m,Units:-Unit=1);

                                 1.7
In this case Joe Riel's suggestion requires 1 character less of typing than mine if map is not used,
convert(1.7*m,unit_free);

                                 1.7
I also couldn't find a link to convert/unit_free on the ?Units help page that might be especially confusing because it contains links to RemoveDimension and RemoveSystem help pages and users trying to find out how to get rid of units, might spend unnecessary time reading them. _____________ Alec Mihailovs http://mihailovs.com/Alec/
First 155 156 157 158 159 160 161 Last Page 157 of 180