Joe Riel

9530 Reputation

23 Badges

20 years, 26 days

MaplePrimes Activity


These are answers submitted by Joe Riel

That generally means that the xml (the format used in the *.mw file) is not syntactically valid. Maybe a closing tag is missing.  Frequently you can fix that be directly editing the *.mw file in a text editor, preferably in one that can parse xml, though isn't a requirement.

The Maple structure array is deprecated; use Array.  With that you can then do 

min(T);

How large are the Vectors? What are the Vector components? Numeric? Symbolic?  If appropriate, that is, the components are considered real, then pass the option conjugate=false.

I'm not quite sure what you want.  Maybe something like the following,

dydt := 3.7*b*d*exp(-0.4/c):

F := Array(-1..3, 1..5
           , [[t,      a,      b,     c,      d   ],
              [0,    0.5,     38,     0,   0.9e-5 ],
              [1,    5.2,     45,   0.1,   1.2e-5 ],
              [2,    7.8,     51,   0.7,   1.6e-5 ],
              [3,   12.3,     74,   0.8,   2.1e-5 ]]):


eqs := [seq(F[-1,j]=f[i,j], j=op([2,2],F))]:

Dy := unapply(subs(eqs, f='F', dydt), i);
                                                        0.4
                 Dy := i -> 3.7 F[i, 3] F[i, 5] exp(- -------)
                                                      F[i, 4]


Dy(0);
Error, (in Dy) numeric exception: division by zero
Dy(1);
                               0.00003659464650

 

read "latool.m":
LibraryTools:-Save('latool', "latool.mla"):

This works because the only thing saved in latool.m is the table latool.

The book is dated.  The double quote in op(2,") is the ditto operator from Maple V; the equivalent in modern Maples is op(2,%).

Using William's suggestion:

getbit := proc( num :: posint )
local code,content,headers,uri;
    uri := sprintf("http://www.mysterytwisterc3.org/cgi-bin/mtc3-ramae-11-homomorphic.cgi/?c=%d", num);
    (code,content,headers) := HTTP:-Get(uri);
    if content = "0\n" then
        return 0;
    elif content = "1\n" then
        return 1;
    else
        error "problem with content: %1", content;
    end if;
end proc:


map(getbit, [seq(1..20)]);
     [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0]

The pattern is rather simple




for i from 1 to 5 do
    t12[i] := ...;
    for n from 1 to 15 do
         Cn[i,n] := F(t12[i], ... );
     end do;
end do;

You wrote Cn(i,n), which in Maple notation indicates a function call to Cn.  I assume that is not what you really want.  Possibly you were just using it as a notational device.  In the above code I assigned to a table Cn (hence the square brackets).

An example of what you want would be useful.  The ?op procedure can be used to pick a term by position.  The ?select procedure is useful for selecting components, while ?indets can be used to select stuff at different levels.

The procedure ?combinat[randperm] uses an external compiled routine to generate a random permutation. It does not use the seed that is set with ?randomize. This can be demonstrated by reseeding randomize and calling randperm:

(**) randomize(23): combinat:-randperm(10);
                                             [10, 9, 7, 6, 3, 2, 1, 5, 4, 8]

(**) randomize(23): combinat:-randperm(10);
                                             [10, 8, 2, 6, 9, 7, 5, 1, 3, 4]

There should be  way to reseed the random generator used by randperm. I'll submit an SCR.

I'm not sure what you want.  You could use ?series to return a truncated series expansion. Maybe ?convert/Sum is what you want:

(**) y := 1/sqrt(9+4*x^2);
                                              1
                                   y := -------------
                                                2 1/2
                                        (9 + 4 x )

(**) convert(y,Sum);      
                    infinity
                     -----   /        _k1  (-_k1)           (2 _k1)\
                      \      |    (-1)    9       (2 _k1)! x       |
                       )     |1/3 ---------------------------------|
                      /      |                       2             |
                     -----   \                 (_k1!)              /
                    _k1 = 0

Change R := [][]; to R := Matrix(n*s,m*s);  Also, change M := matrix(...); to M := Matrix(...); matrix is an old data structure that has been superceded by Matrix.

You could use an indexed name, x[i].  If you really want the symbol, x1, etc., do cat(x,i) or x||i.

Here is Georgios' suggestion, used with ?ListTools:-MakeUnique.  For simplicity I used Vectors rather than Matrices. Note that the structure you gave is a list, not a set.

L := [<1>,<2>,<1.0>]
ListTools:-MakeUnique(L, 1, LinearAlgebra:-Equal);
                         [<1>,<2>]

Could you upload the model?  It's hard to say what could be wrong from just the description.

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