mmcdara

6408 Reputation

17 Badges

8 years, 20 days

MaplePrimes Activity


These are questions asked by mmcdara

I get a problem while selecting elements from sets.

I have a list of two sets apparently ordered in the same order.
When I pick this, for instance, first set from each of these two samples I get the first one from the first set, and the second one from the second set.

restart:

DF := [ {diff(Theta(x), x), diff(Theta(x), x, x)}, {diff(g(x), x), diff(g(x), x, x)} ]

[{diff(Theta(x), x), diff(diff(Theta(x), x), x)}, {diff(diff(g(x), x), x), diff(g(x), x)}]

(1)

# Why are the elements of DF[2] not returned in their correct order?

i := 1;
DF[i], DF[i][1], DF[i][2];
print():
i := 2;
DF[i], DF[i][1], DF[i][2];

1

 

{diff(Theta(x), x), diff(diff(Theta(x), x), x)}, diff(Theta(x), x), diff(diff(Theta(x), x), x)

 

 

2

 

{diff(diff(g(x), x), x), diff(g(x), x)}, diff(diff(g(x), x), x), diff(g(x), x)

(2)

# I suppose we must not trust what is displayed and that lprint is more
# trustworthy?

lprint(DF)

[{diff(Theta(x), x), diff(diff(Theta(x), x), x)}, {diff(diff(g(x), x), x), diff(g(x), x)}]

 

# I expected that converting each element of DF into a list would fix this
# problem. but anothr does appear:
# "Why does the conversion into list change the order of the elements?"
# I had never seen that before

LDF := convert~(DF, list)

[[diff(Theta(x), x), diff(diff(Theta(x), x), x)], [diff(diff(g(x), x), x), diff(g(x), x)]]

(3)

 

Download Selection_from_a_set.mw

Running this command

map(sort, LDF)

displays LDF, which suggests that LDF is already sorted according to some order.
What is this order which makes diff(Theta(x), x$2) the successor of diff(Theta(x), x)  but diff(g(x), x) the successor of diff(g(x), x$2)  ?

When you use

restart:
with(Physics):
Setup(mathematicalnotation=true):
diff(x(t), t)

the output is $\dot{x}(t)$
When you write 

restart:
alias(x=x(t)):
diff(x, t)

the output is $\frac{\partial}{\partiall t} x$

Is it possible to "mix" these two in such a way that diff(x, t) appears as $\dot{x}$ ?
Notation.mw

Thanks in advance

Not the first time that a question (OP's name  PhearunSeng ) is removed as I am writing an answer (I guess other people have already faced the same inconvenience). 
Why doesn't exist a mechanism which prevents removing, deleting, displacing a question where someone (here Carl) has akready given an answer ???

Whatever the reason, here is my answer

Title: Can be done quickly if you write the matrix in a more abstract form

MyKGff := Matrix(5, 5, 
  {
    (1, 1) = A+(1/63368)*B, 
    (1, 2) = -(1/63368)*B, 
    (1, 3) = -(1/39605)*B, 
    (1, 4) = 0, 
    (1, 5) = 0, 
    (2, 1) = -(1/63368)*B, 
    (2, 2) = (1/63368)*B+C, 
    (2, 3) = (1/39605)*B, 
    (2, 4) = -C, 
    (2, 5) = 0, 
    (3, 1) = -(1/39605)*B, 
    (3, 2) = (1/39605)*B, 
    (3, 3) = (8/198025)*B, 
    (3, 4) = 0, 
    (3, 5) = 0, 
    (4, 1) = 0, 
    (4, 2) = -C, 
    (4, 3) = 0, 
    (4, 4) = C+(1/63368)*F, 
    (4, 5) = -(1/39605)*F, 
    (5, 1) = 0, 
    (5, 2) = 0, 
    (5, 3) = 0, 
    (5, 4) = -(1/39605)*F, 
    (5, 5) = (8/198025)*F
  }
);

Then (Maple 2015.2)

PseudoInverse := CodeTools:-Usage( LinearAlgebra:-MatrixInverse(MyKGff, method=pseudo) ):
memory used=28.38MiB, alloc change=68.00MiB, cpu time=312.00ms, real time=314.00ms, gc time=24.90ms

To recover the pseudo inverse with original data do

Rewrite := [
             A = (D__pile*W[1] . E__c)/3000, 
             B = (D__pile*W[2] . E__c)*89^(1/2), 
             C = (D__pile*W[3] . E__c)/1000, 
             F = (D__pile*W[4] . E__c)*89^(1/2)
           ]:

eval(PseudoInverse, Rewrite):

InverseMatrix_mmcdara.mw

@ASHAN's question was about a linestyle which wasn't displayed as expected.

Maybe a handling error on my part?

To ASHAN:

Does anyone have any idea why Maple can obtain a closed form of 

Int(f, t=1..3);

but doesn't for 

Int(g, t=1..3);

?

The Int forms are quite close and I don't understand what makes Maple's task that difficult in the second case (the issue seems to come from the conditions in the piecewise function).
Can we force Maple to perform the second integration ?

TIA

restart:

interface(Version)

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

(1)

f := piecewise(z/t < 0, 0, z/t < 1, 630*z^8/t^8-2520*z^7/t^7+3780*z^6/t^6-2520*z^5/t^5+630*z^4/t^4, 0)/t:

Int(f, t=1..3);

value(%);  # returns a closed form of the integral

g := piecewise(z/t < 1, 0, z/t < 2, 10080-60480*z/t+156240*z^2/t^2-226800*z^3/t^3+202230*z^4/t^4-113400*z^5/t^5+39060*z^6/t^6-7560*z^7/t^7+630*z^8/t^8, 0)/t:

Int(g, t=1..3);

value(%): # unable to return a closed form of the integral

Download MyIntegral.mw

First 7 8 9 10 11 12 13 Last Page 9 of 43