MaplePrimes Questions

Hi,

I want to plot the Tsai Wu failure envelope for a given
composite. The Tsai Wu failure criterion (for a pure biaxial
state of stress) is given by:

F1*x+F2*y+F11*x^2+F22*y^2+F12*x*y=1

can someone help me?please.

Can Maple carry around an unevaluated/inert  Matrix-Vector product(A matrix product without executing the matrix multiplication)? See Maple sheet.

inert_matrix_products.mw

restart

with(LinearAlgebra)

NULLNULL

Can Maple carry around an unevaluated/inert explicit Matrix-Vector product?

 

Define a matrix K and vector U as:

 

U := `<,>`(u1, u2)

Vector[column](%id = 36893490583464982996)

(1)

K := Matrix(2, 2, symbol = k)

Matrix(%id = 36893490583464975884)

(2)

I can take their product using MatrixVectorMultiply( ) I get,

MatrixVectorMultiply(K, U)

Vector[column](%id = 36893490583464964812)

(3)

however output I am really looking for is

 

(Matrix(2, 2, {(1, 1) = k[1, 1], (1, 2) = k[1, 2], (2, 1) = k[2, 1], (2, 2) = k[2, 2]})).(Vector(2, {(1) = u1, (2) = u2}))

NULL

In the later case, K.U is still a product however the actual matrix multiplication is not carried out. Sure, eventually I will want to evaluate the matrix-vector product but sometimes when setting up a problem I want to look at the explicit matrix equation before any explicit matrix multiplication is carried out.NULL

NULL

Here I show some ideas that don't work but may give a sense of what I am going for. I am essentially trying to mute the computation of the product while keeping the elements of the product together for further substitutions elsewhere. This there a standardized way to complish this? Or do I have to write my own procedure for something like this?

 

`&MatrixVectorMultiply`(K, U)

`&MatrixVectorMultiply`(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))

(4)

%MatrixVectorMultiply(K, U)

%MatrixVectorMultiply(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))

(5)

`&.`(K, U)

`&.`(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))

(6)

K*%.U

`&.`(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))*Matrix(%id = 36893490583464939756).Vector[column](%id = 36893490583464982996)

(7)

NULLNULL

Download inert_matrix_products.mw

I'm having trouble performing a direct operation, involving DotProduct, in the piecewise function. Attached is a document. I appreciate any contribution.

Regards,

Oliveira

Example2.mw

Hi,

I am new to Maple and I couldn't really find anything about this problem. Why doesn't Maple automatically simplify the last expression in the following? (see for example the first and last terms, as well as other terms)

total := (((((D^2/(alpha^2*mu^2) + D^2*exp(2*(-t + t1)*alpha*mu)/(alpha^2*mu^2)) + D^2*exp(2*(-t + t1)*alpha*mu)/(alpha^2*mu^2)) + D1*D/((alpha*mu*tau0 + 1)*alpha^2*mu^2) - (-alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 + 1)/tau0) + exp(2*(-t + t1)*alpha*mu))*D*D1/(mu^2*alpha^2*(alpha^2*mu^2*tau0^2 - 1)) + (alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 + 1)/tau0) - exp(2*(-t + t1)*alpha*mu))*D1*D/(alpha^2*mu^2*(alpha^2*mu^2*tau0^2 - 1))) - (-alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 + 1)/tau0) + exp(2*(-t + t1)*alpha*mu))*D*D1/(mu^2*alpha^2*(alpha^2*mu^2*tau0^2 - 1))) + (alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 + 1)/tau0) - exp(2*(-t + t1)*alpha*mu))*D1*D/(alpha^2*mu^2*(alpha^2*mu^2*tau0^2 - 1)) + D1*D/((alpha*mu*tau0 + 1)*alpha^2*mu^2) + D1^2/((alpha*mu*tau0 + 1)^2*alpha^2*mu^2) - (alpha*mu*tau0*exp(-(-t + t1)*(alpha*mu*tau0 - 1)/tau0) + alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 - 1)/tau0) - alpha^2*mu^2*tau0^2 - 1)*D1^2/(alpha^2*mu^2*(alpha^4*mu^4*tau0^4 - 2*alpha^2*mu^2*tau0^2 + 1))) - (alpha*mu*tau0*exp(-(-t + t1)*(alpha*mu*tau0 - 1)/tau0) + alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 - 1)/tau0) - alpha^2*mu^2*tau0^2 - 1)*D1^2/(alpha^2*mu^2*(alpha^4*mu^4*tau0^4 - 2*alpha^2*mu^2*tau0^2 + 1))

D1^2/((alpha*mu*tau0 + 1)^2*alpha^2*mu^2) + 2*D1*D/((alpha*mu*tau0 + 1)*alpha^2*mu^2) + D^2/(alpha^2*mu^2)

r2r2 := %;
 

total - r2r2;

((((((D^2/(alpha^2*mu^2) + D^2*exp(2*(-t + t1)*alpha*mu)/(alpha^2*mu^2)) + D^2*exp(2*(-t + t1)*alpha*mu)/(alpha^2*mu^2)) + D1*D/((alpha*mu*tau0 + 1)*alpha^2*mu^2) - (-alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 + 1)/tau0) + exp(2*(-t + t1)*alpha*mu))*D*D1/(mu^2*alpha^2*(alpha^2*mu^2*tau0^2 - 1)) + (alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 + 1)/tau0) - exp(2*(-t + t1)*alpha*mu))*D1*D/(alpha^2*mu^2*(alpha^2*mu^2*tau0^2 - 1))) - (-alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 + 1)/tau0) + exp(2*(-t + t1)*alpha*mu))*D*D1/(mu^2*alpha^2*(alpha^2*mu^2*tau0^2 - 1))) + (alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 + 1)/tau0) - exp(2*(-t + t1)*alpha*mu))*D1*D/(alpha^2*mu^2*(alpha^2*mu^2*tau0^2 - 1)) + D1*D/((alpha*mu*tau0 + 1)*alpha^2*mu^2) + D1^2/((alpha*mu*tau0 + 1)^2*alpha^2*mu^2) - (alpha*mu*tau0*exp(-(-t + t1)*(alpha*mu*tau0 - 1)/tau0) + alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 - 1)/tau0) - alpha^2*mu^2*tau0^2 - 1)*D1^2/(alpha^2*mu^2*(alpha^4*mu^4*tau0^4 - 2*alpha^2*mu^2*tau0^2 + 1))) - (alpha*mu*tau0*exp(-(-t + t1)*(alpha*mu*tau0 - 1)/tau0) + alpha*mu*tau0*exp((-t + t1)*(alpha*mu*tau0 - 1)/tau0) - alpha^2*mu^2*tau0^2 - 1)*D1^2/(alpha^2*mu^2*(alpha^4*mu^4*tau0^4 - 2*alpha^2*mu^2*tau0^2 + 1))) - D1^2/((alpha*mu*tau0 + 1)^2*alpha^2*mu^2) - 2*D1*D/((alpha*mu*tau0 + 1)*alpha^2*mu^2) - D^2/(alpha^2*mu^2)
couldnt insert "r2r2" properly...

problemfilepdsolve.mw
 

eq1 := diff(p(x, t), x)-p(x, t)*(1/(p(x, t)^2*q(x, t)^(1/3)))

diff(p(x, t), x)-1/(p(x, t)*q(x, t)^(1/3))

(1)

eq2 := diff(q(x, t), x)-(-3*q(x, t))*(1/(p(x, t)^2*q(x, t)^(1/3)))

diff(q(x, t), x)+3*q(x, t)^(2/3)/p(x, t)^2

(2)

pdsolve({eq1, eq2})

Error, (in pdsolve/sys) found the element '_F2' repeated in the indication of blocks variables

 

eq3 := diff(p(x), x)-p(x)*(1/(p(x)^2*q(x)^(1/3)))

diff(p(x), x)-1/(p(x)*q(x)^(1/3))

(3)

eq4 := diff(q(x), x)-(-3*q(x))*(1/(p(x)^2*q(x)^(1/3)))

diff(q(x), x)+3*q(x)^(2/3)/p(x)^2

(4)

dsolve({eq3, eq4})

[{q(x) = -27/(_C1*x+_C2)^3}, {p(x) = (-3*(diff(q(x), x))*q(x)^(2/3))^(1/2)/(diff(q(x), x)), p(x) = -(-3*(diff(q(x), x))*q(x)^(2/3))^(1/2)/(diff(q(x), x))}]

(5)

eq5 := diff(p(x, t), x)-x = 0

diff(p(x, t), x)-x = 0

(6)

pdsolve(eq5)

p(x, t) = (1/2)*x^2+_F1(t)

(7)

eq6 := diff(p(x), x)-x = 0

diff(p(x), x)-x = 0

(8)

dsolve(eq6)

p(x) = (1/2)*x^2+_C1

(9)

NULL

``

(10)


Help me in finding the solution of system eq1 and eq2.

Download problemfilepdsolve.mw

 

Hope the resolution of the images which come via Plot3d and plot commands are atleast 300 dpi

If not how to make them

I previously asked the following question, and a primes member dharr  provided a perfect answer. The question I asked today is slightly different.

An edge cut of a graph G induced by a partition of G's vertices into sets X and Y is the set of all edges with one endpoint in X and another endpoint in Y.

An edge separator is a set of edges whose removal will increase the number of connected components in the graph.

Note that these are two distinct concepts and cannot be considered equivalent.

An edge separator is not necessarily an edge cut. For example, for the complete bipartite graph K3,3, a set of any seven edges of K3,3 is an edge separator, but a set of any seven edges of K3,3 is not an edge cut.

It is easy to determine whether a set of edges is an edge separator.

with(GraphTheory):
with(combinat):
G:=CompleteGraph(3,3);
edge:=choose(Edges(G), 7):
seq(nops(ConnectedComponents(DeleteEdge(G,s,inplace= false))),s in edge) 

4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4

For another exmaple,

In  the left  figure,  the brown edges highlighted represent an edge-separating set, but it is not an edge cut. The set of brown edges on the right is an edge cut.

But how to determine if a set of edges is an edge cut of a graph? I don't have a good idea yet, but I have a rough idea which is to color the set of vertex-ends of edges under consideration and then see if a partition as defined by the edge cut can be found.

I am converting some code from Mathematica. In it there is this solution

eqs={2c2+c0==1,6c3+2c1==2,3c2+12c4==1};
FindInstance[eqs,{c0,c1,c2,c3,c4}]

Which gives

{{c0 -> 0, c1 -> 0, c2 -> 1/2, c3 -> 1/3, c4 -> -(1/24)}}

Maple's solve gives

eqs := [2*c2 + c0 = 1, 6*c3 + 2*c1 = 2, 3*c2 + 12*c4 = 1];
sol:=solve(eqs, {c0, c1, c2, c3, c4})

Gives

sol := {c0 = 1/3 + 8*c4, c1 = -3*c3 + 1, c2 = 1/3 - 4*c4, c3 = c3, c4 = c4}

I know that both are correct solutions. But I'am asking if there is a command or an option I overlooked that will generate the same result as the above from FindInstance, which will make it easier for me.

May be there is another solver package or command I could try?

I am not sure what algorithm FindInstance uses. The documentation page does not say.

I am trying to understand the SymmetryGroup returned in the Logic Package. The help page says "The group is a permutation group; its elements are those permutations which preserve the Boolean structure of expr." [my bold], but later the definition is given as "A symmetry of a Boolean expression expr is a mapping f of each variable to some other variable or negated variable, such that the image of expr after applying f to each of its variables is a Boolean formula which is equivalent to expr." Is logically equivalent meant here, or something else? The help page examples don't answer this question.

The following example shows that a group permutation does not lead to a logically equivalent statement as I was expecting - is this a bug, or am I expecting too much here?

restart

with(Logic)

q := `&and`(`&or`(x[1], x[2]), x[3])

Logic:-`&and`(Logic:-`&or`(x[1], x[2]), x[3])

G, L := SymmetryGroup(q, output = [group, expressions]); g1, g2 := Generators(G)[]

_m1897409254784, [x[1], x[2], x[3], Logic:-`&not`(x[1]), Logic:-`&not`(x[2]), Logic:-`&not`(x[3])]

_m1897409280096, _m1897409281184

Exchanging x[1] with x[2], and (not x[1]) with (not x[2]) leads to a logically equivalent expression, so this is indeed a symmetry.

zip(`=`, L, L[convert(g1, permlist, nops(L))]); q1 := eval(q, %); Equivalent(q, q1)

[x[1] = x[2], x[2] = x[1], x[3] = x[3], Logic:-`&not`(x[1]) = Logic:-`&not`(x[2]), Logic:-`&not`(x[2]) = Logic:-`&not`(x[1]), Logic:-`&not`(x[3]) = Logic:-`&not`(x[3])]

Logic:-`&and`(Logic:-`&or`(x[2], x[1]), x[3])

true

Exchanging x[3] with (not x[3]) leads to an expression that perhaps has the same form but is not equivalent

zip(`=`, L, L[convert(g2, permlist, nops(L))]); q2 := eval(q, %); Equivalent(q, q2)

[x[1] = x[1], x[2] = x[2], x[3] = Logic:-`&not`(x[3]), Logic:-`&not`(x[1]) = Logic:-`&not`(x[1]), Logic:-`&not`(x[2]) = Logic:-`&not`(x[2]), Logic:-`&not`(x[3]) = x[3]]

Logic:-`&and`(Logic:-`&or`(x[1], x[2]), Logic:-`&not`(x[3]))

false

NULL

Download LogicTest.mw

After a long hiatus I have come back to the issue of null tetrads in the physics package in light of the updates to  Maple in 2021. I have uploaded a document file to illustrate. See below. My first question concerns the labelling of elements of a null tetrad. After calling the metric 27,37 from Stephani et al, and using Setup to specify a null tetrad, Maple's choice is such that the elements labelled m and bar m are not complex. Rather, both these elements are in fact real, while the elements lablled l and n are complex, with one being the negative complex conjugate of the other. While these are just labels, they don't agree with the usual conventions for the Newman-Penrose formalism, which is disorienting. What convention is Maple using to label the elments of a null tetrad?

Next, I try to specify the null tetrad used by Stephani et al., first by converting it into covariant form (which I did by hand rather than in Maple). In Maple's default null tetrad, the order in which Maple listed the elements of the null tetrad is n, m, bar m, l (as rows in the matrix display for e_[ ]), so I followed that convention (in the conventions of Stephani et al., the first and fourh element should have scalar product -1, the second and third scalar product 1, and all other scalar products zero, which is the case). After entering the matrix and using Setup to specify the null tetrad by the matrix, I get an error message saying that the components of the metric with respect to my tetrad are not just 0, 1, and -1. Yet,  executing eta_[ ]  does not confirm this warning; nor does a computation by hand.

Finally, IsTetrad asserts the tetrad is not null, contrary to the fact that it is a null tetrad.

Since I have followed the conventions implicit in Maple's default null tetrad for this metric, I am puzzled as to what has gone wrong.SKMHH27_37_2021_New.mw

On the other hand, taking into account how Maple 2019 orders the coordinates in Stephani et al 27.37 and labels the null vectors in a null ttetrad, if I translate accordingly what I have in the 2021 Maple file, Maple 2019 confirms Stephani et al.'s null tetrad is indeed a null tetrad, as one would expect. See the following file.SKMHH27_37_2019_Var.mw.

Consider this example:

    h := proc(x)
        printf("h says: %a evaluates to %a.", x, eval(x));
    end proc:
    f := proc()
        local z, g;
        g := proc(x)
            printf("g says: %a evaluates to %a.\n", x, eval(x));
        end proc;
        z := 2;
        g('z');
        h('z');
    end proc:

    > f()
    g says: z evaluates to 2.
    h says: z evaluates to 2.

I can't figure out, whats going on here. Now it comes as no surprise, of course, that g would be able to see z. After all, its definition is within the lexical scope of z. But how can h possibly see z?

When eval is called in h, does eval somehow look into the call stack, and find out it was called by h, which was in turn called by f and then inspect the local variables of f?

Could you explain, what's going on here, please?

Thank you all!

Hello everybody.

My goal is to solve the following integro-functional equation:

(int(p^2/(f(p)-f(p+q)+omega), p = a .. b))/omega^2 = ln(omega^2+q^2)

(int(p^2/(f(p)-f(p+q)+omega), p = a .. b))/omega^2 = ln(omega^2+q^2)

 

where where is the unknown function and a, b are some numerical values as well as ω and q are real positive variables.

I would be grateful for any ideas.

This is Maple 2019. Suppose a directed graph D is given. 

I know that "Cycles≔CycleBasis(D)" lists down all the cycles in D and "numelems(Cycles)" gives the number of cycles in D. But if I only want to count the number of directed cycles of length k, say k=4, in D, is there a Maple function that gives us that?

Thank you all.

Hello,

I'm considering a question for undergraduates like this:

An investor is looking at a $150,000 home. If 20% must be put down and the balance is financed at 9% over the next 30 years, what is the monthly mortgage payment?

On a basic financial calculator, say TI BA the solution is simply:

 

In the Finance package there is a strangely named function

levelcoupon(face, rate, couponrate, maturity)

that actually calculates the PV, that is the bond price in a basic setup with no dates (all CF are at the end) which is what I need, and another of the same class - yieldtomaturity, but I didn't find a function that returns the payment (coupon). 

Any suggestions are highly appreciated.

Thanks!

First 224 225 226 227 228 229 230 Last Page 226 of 2424