Alec Mihailovs

Dr. Aleksandrs Mihailovs

4455 Reputation

21 Badges

20 years, 308 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

For example,
plot(map(solve,[x-2*y=4,x+2*y=12],y),x=6..10,color=[red,blue]);
or
plots[implicitplot]([x-2*y=4,x+2*y=12],x=6..10,y=1..3,color=[red,blue]);
or
geometry:-line(a,x-2*y=4,[x,y]),geometry:-line(b,x+2*y=12,[x,y]):
geometry:-draw([a,b],axes=normal);
Actually, there is another workaround,
_EnvExplicit:=false:
maximize(t^2*(1-t)^2*(1+t^2)*(1+(1-t)^2),t=0..1,location);

                       25                25
                       ---, {[{t = 1/2}, ---]}
                       256               256
A simple workaround is to add a decimal dot to one of the numbers in your function. For example,
f:=t^2*(1.-t)^2*(1+t^2)*(1+(1-t)^2):

maximize(f,t=0..1,location);

         0.09765625000, {[{t = 0.5000000000}, 0.09765625000]}
Also, if you have relatively new version of Maple that has the Optimization package, you could find the maximum as
Optimization:-Maximize(t^2*(1-t)^2*(1+t^2)*(1+(1-t)^2), t = 0 .. 1);

      [0.0976562500000000002, [t = 0.499999999999999888]]
The easiest way is just to add a decimal dot to either numerator or denominator,
1/7.;

                          0.1428571429
The usual way is to use either evalf or evalhf,
evalhf(1/7);
                      0.142857142857142849
evalf(1/7,30);
                0.142857142857142857142857142857
The second parameter in evalf tells Maple how many digits you want to get after initial zeros. If it is omitted, the number of digits printed, excluding initial zeros, is equal to the value of Digits (usually 10).
I think, the LaTeX style files in the ETC folder (in the Maple installation folder) can be used. For the example of their use one can export a worksheet to LaTeX (File - Export As - LaTeX...) and open the exported .tex file in a LaTeX editor. __________ Alec Mihailovs http://mihailovs.com/Alec/
For example,
s:=solve({E3,E4},[a1(t),b1(t)]);

                s := [[a1(t) = c1(t), b1(t) = c1(t)]]
If you need only the first equation,
s[1,1];

                            a1(t) = c1(t)
Solutions can be obtained as
Digits:=30:
Zp:=solve(eq3,zp):
e1,e2:=subs(zp=Zp,[eq1,eq2])[]:
Zh:=solve(e2,zh):
f:=subs(zh=Zh,e1):
plot(lhs(f),A=0.2..0.5);



plot(lhs(f),A=0.41..0.412);



A:=fsolve(f);

                A := 0.230350448173499110121150479753

zh:=evalf(Zh);

                                                       7
              zh := 0.143999967240441866956466765172 10

zp:=evalf(Zp);

                zp := 104624.683611898761516433517263

evalf([eq1,eq2,eq3]);

                                      -24
  [0.641779019150802739055532126914 10    = 0.,

                                            -25
        -0.996435082091580494663306380117 10    = 0., 0. = 0.]

unassign('A','zh','zp'):
A:=fsolve(f,A=0.4114);

                A := 0.411422343504183469273571551356

zh:=evalf(Zh);

                zh := 551489.361702127659574468085090

zp:=evalf(Zp);

                zp := 354874.236823025310276796438146

evalf([eq1,eq2,eq3]);

                                      -23
  [0.489659690382962664352348873787 10    +

                                           -34
        0.382156418787333348476221194218 10    I = 0.,

                                           -23              -30
        0.548986183050247894437307734597 10    = 0., -0.3 10    = 0.]
Note, however, that both of these solutions don't have much of practical sense, because values of zh are closer to values giving 0 in denominators than they should with your precision,
restart;
fsolve(24000000-50/3*zh);
                                        7
                            0.1440000 10

fsolve(-8640000+47/3*zh);

                             551489.3617
Also, the 3rd equation has solution A=0, but that can not be substituted into the second equation which has terms with A in the denominator.
If you don't know the number of iterations, it is better to put values in a table first. Then you can convert it to a list, a Matrix, or whatever. For example (similar to that Roman Pearce showed in Trimming an array),
for n while n^3-2*n<120 do data[n]:=[n,n^2] od:
M:=Matrix(convert(data,list));

                                 [1     1]
                                 [       ]
                                 [2     4]
                                 [       ]
                            M := [3     9]
                                 [       ]
                                 [4    16]
                                 [       ]
                                 [5    25]
For example,
B:=Matrix(3);

                               [0    0    0]
                               [           ]
                          B := [0    0    0]
                               [           ]
                               [0    0    0]

C:=<<1|2|3>,B>;

                               [1    2    3]
                               [           ]
                               [0    0    0]
                          C := [           ]
                               [0    0    0]
                               [           ]
                               [0    0    0]

A:=<<1,2,3>|B>;

                            [1    0    0    0]
                            [                ]
                       A := [2    0    0    0]
                            [                ]
                            [3    0    0    0]
First, in such situations it is better to use assuming instead of assume.
test:=-5/81*n^5+b*n^4+c*n^3+d*n^2+e*n+f assuming n>0;
wouldn't create any problems and assumptions need not to be cleaned. Second, variables of test can be found by using indets, so you can do something like
indets(test);

                         {b, f, c, e, n~, d}

n:=%[5];

                               n := n~

coeff(test,n,5);

                                  -5
                                  --
                                  81
The array command has been superseded by the Array command. Trimming Arrays can be done as in the following example,
a:=Array(1..10,i->i);

                 a := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

a[1..5];

                           [1, 2, 3, 4, 5]
I wrote a procedure for doing matrix algebra over finite fields and put it in my blog, Matrix Algebra over Finite Fields _________ Alec Mihailovs http://mihailovs.com/Alec/
With your cursor next to that expression, click View, then ExpandDocumentBlock.
It is described in ?libname, ?march, and ?LibraryTools, as well as in ?savelib, ?repository, ?repository/management, ... As far as I can tell, the use of modules is recommended.
interface(displayprecision=8):
kernelopts(display_zero_complex_part=false):
First 67 68 69 70 71 72 73 Page 69 of 76