Alec Mihailovs

Dr. Aleksandrs Mihailovs

4470 Reputation

21 Badges

19 years, 290 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 Posts that have been published by Alec Mihailovs

Recently, working on Nested Verification, I took a look at the whattype procedure. First, I couldn't find any use of local variables t1, t2, L, k1, k2 declared in it. That seems odd. Second, the order of types in it seems to be not exactly right. In particular, symbol is located earlier than `module`. Also, some types are missing, record for example. That leads to not recognizing modules and records,
r := Record( 'a', 'b' ):
m := module() end:
whattype(r);
                                symbol
whattype(m);
                                symbol
Similarly to the compact and efficient version of Nested Verification, I wrote a "compact and efficient" version of whattype,

Nested verification can be done in Maple using the following command,

VerifyTools:-AddVerification('nested'=proc(x,y,ver::verification)
if whattype(x)=whattype(y) then 
if x::Vector then verify(x,y,'Vector'('nested'(args[3..-1])))
elif x::Matrix then verify(x,y,'Matrix'('nested'(args[3..-1])))
elif x::Array then verify(x,y,'Array'('nested'(args[3..-1])))
elif x::array then verify(x,y,'array'('nested'(args[3..-1])))
elif x::set then verify(x,y,'set'('nested'(args[3..-1])))
elif x::list then verify(x,y,'list'('nested'(args[3..-1])))
elif x::relation then verify(x,y,'relation'('nested'(args[3..-1]))) 
elif x::range then verify(x,y,'range'('nested'(args[3..-1]))) 
else verify(x,y,args[3..-1]) fi 
else verify(x,y,args[3..-1])
fi end);
Here is a simple procedure doing numerical inverse Laplace transform using Post's inversion formula,
ILT:=proc(f,s) local k,dig;
if nargs>2 and type(args[-1],'posint') then dig:=args[-1] 
else dig:=Digits fi;
proc(T) local t,d,a;
d:=dig;
a:=Limit();
t:=evalf(T,dig);
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,dig) end end:
It would be very helpful if Maple could not only export plots to gif and some other formats, but also import them by executing a command looking like PlotImport("something.gif");. In that case, for plots with huge outputs (like in Simulation of Brownian Motion), one could use plotsetup to export plot to gif, and then use PlotImport to display it in the worksheet (to avoid inserting picture manually). The worksheet size in that case would be considerably smaller (and, perha
I wrote a procedure for drawing a 1d phase portrait of an equation
                        `x′`=f(x)
in Classic Maple,
phase:=proc(f,r)
local a,b,bn,bs,U;
a:=op([1,1],plot(args));
bn:=-`-`(op([2,1..2],r));
bs:=[a[1,1],seq(`if`(
(a[i-1,2]-0.0001*bn*signum(a[i-1,2]))*(a[i,2]-0.0001*bn*signum(a[i,2]))<0,
`if`(a[i-1,2]*a[i,2]<0, (a[i-1,1]*a[i,2]-a[i-1,2]*a[i,1])/(a[i,2]-a[i-1,2]),
fsolve(f,subsop([2,1]=a[i,2]-0.02*bn,[2,2]=a[i,2]+0.02*bn,r))),NULL),
i=2..nops(a)),a[-1,1]];
b:=bs/bn;
U:=remove(x->abs(x[2,1])<0.04,
[seq([[b[i]+0.01,0],[b[i+1]-b[i]-0.02,0]],i=`if`(a[1,2]<0,2,1)..nops(b)-1,2),
seq([[b[i+1]-0.01,0],[b[i]-b[i+1]+0.02,0]],i=`if`(a[1,2]<0,1,2)..nops(b)-1,2)]);
plots[display](plots[arrow](
U,width=0.02,head_length=0.04,view=[b[1]..b[-1],-1..1],color=blue),
plots[pointplot](map(x->[x,0],b[2..-2]),symbol=circle,symbolsize=19),
plots[textplot](map(x->[x/bn,-0.07,sprintf("%.2f",x)],bs[2..-2])),
axes=none)
end:
It works as in the following example for f(x)=sin(x),
phase(sin(x),x=-8..8);
First 16 17 18 19 20 21 22 Page 18 of 23