mmcdara

7891 Reputation

22 Badges

9 years, 56 days

MaplePrimes Activity


These are replies submitted by mmcdara

@Christopher2222 

There is another possibility, but the result is not guaranteed..
 

with(DocumentTools):
with(DocumentTools:-Layout):
L := [60, 1100, 13, 1, 110, 66, 2, 2, 101, 1008, 28, 1038, 100, 3, 8, 33, 1161, 4, 50, 101];
Ls := convert(L, string)[2..-2]:
T := Table(Column(), width=7, widthmode=percentage, Row(Cell(Ls))):
InsertContent(Worksheet(Group(Input( T ))));  # Maple 2015
#InsertContent(Worksheet( T ));  # Maple >= 2019

@vv 

I already observed that assuming works generally better than assume and that the way the assumptions are formulated is not inoccuous ; for instance:

assumptions := a::nonnegative, b::nonnegative, a < 1/b:

is( (1 + sqrt(1-a^2*b^2))/(a*b) >0 ) assuming assumptions;
is( (1 + sqrt(1-a*b))/(a*b) >0 ) assuming assumptions;
is( (1 + sqrt(1-a^2*b^2)) >0 ) assuming assumptions;
is( (1 - sqrt(1-a^2*b^2)) >0 ) assuming assumptions;
is( (1 - sqrt(1-a*b)) >0 ) assuming assumptions;
is( (1 + sqrt(1-a*b)) >0 ) assuming assumptions; 
                              true
                              true
                              true
                             false
                             false
                              true

 

To complete Rouben's answer:

Help pages say:
dsolve - solve ordinary differential equations  (ODEs)

A n order ODE is a differential equation whose form is x(n)(t) = F(t, x(t), x(1)(t), ..., x(n-1)(t))
In some cases a DE G(x(n)(t)) = F(t, x(t), x(1)(t), ..., x(n-1)(t)), or more generally H(t, x(t), x(1)(t), ..., x(n)(t)), can be rewritten as an ODE and you then use dsolve.
But it's nor always the case (your case) and you meust do some preliminary work (Rouben's answer).

Generally these DE can have multiple branches.

@tomleslie 

Sorry, I made a mistake: the axis is indeed linear but the space between the horizontal gridlines (the gray ones) seems to be logarithmic...
BUT... as you said it is "illusion" (I set axis[2]=[ gridlines=[color=blue]] and axis[2]=[ gridlines=[color=red]] for the second and the illusion disappears).

Good point for you

@tomleslie 

What happens if you use lists instead of sequences?


(unable to check for newer versions)


 

interface(version)

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

restart:

A := 1, 2, 3:

B := 4, 5, 6:

AB := B - A;

3, 3, 3

(2)

restart:

with(Units):

A := 1, 2, 3:

B := 4, 5, 6:

AB := B - A;

3, 3, 3

(3)

 


 

Download Check_2015.mw

@Rouben Rostamian  

Great Rouben, I vote up

So I did with Maple 2020 on W8 and W10 (64 Gb).
I can't remember if I noticed that for earlier versions, but I'm sure this never happens with Maple 2015 on OSX.

BTW: It is indeed very annoying, so don't forget to save the work before going to lunch. :-)

@vv 

Great demonstration, I vote up!

@Carl Love 

Of course, where was my head !!!
Thanks for correcting me.

@dharr @vv

Thanks to both of you for your involvement. Concerning the required precision I quite agree with @dharr , all the more that using en eigenvector decomposition does the job in a more efficient way (memory and  cpu time).
While this is not a bug per se, my feeling is that not giving MatrixPower the capability to perform this decomposition is a flaw.

Computing the square root matrix of symmetric positive definite (SPD) matrices is at the core of many statistical algorithms (I agree they are alternative ways to write them).
These SPD matrices are correlations matrices which, unless strong dependencies among the random variables, are even matrices with a relative low condition number.
It's common these matrices have dimensions of a few tens.
Here is an example with a matrix of dimension 50 (still a quite low value in factor analysis) MatrixPower  is about to become almost unusable:

Download Dimension_50.mw

@Carl Love 

The expansion of the expression in term of powers of cos(2) plus some other strange stuff.

For_fun.mw

@dharr 

I vote up.

@dharr 

Thanks Dharr for your comments and your procedure, which can be useful.

BTW, I agree that the initial question is not clear.



@Sphericalmoments  : A cycle basis is defined only on  UNDIRECTED graph (see https://en.wikipedia.org/wiki/Cycle_basis);
On the example provided by @dharr :

DG := Graph(`~`[convert](Edges(G), list)):
       DG := `Graph 5: a directed unweighted graph with 6 vertices and 12 arc(s)`

DrawGraph(DG): 
Cycles := CycleBasis(DG);

Error, (in GraphTheory:-CycleBasis) input graph must be undirected



@dharr : how many "directed" cycles (I guess the OP means "for a given path direction" ???) do we have?
Two

G := Graph({{1, 2}, {2, 3}, {3, 4}, {4, 1}, {1, 3}}):
Cycles := CycleBasis(G);
                     [[1, 2, 3], [1, 3, 4]]
ListTools:-Occurrences(3, map(numelems, Cycles))
                               2

or Six
[1, 2, 3], [2, 3, 1], [3, 1, 2], [1, 3, 4], [3, 4, 1], [4, 1, 3] 

First 54 55 56 57 58 59 60 Last Page 56 of 154