MaplePrimes Questions

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!

please help me solve equation ${\sqrt {x^2-10 x+1}=\sqrt {-8 x^2+9 x-1}}$

above equation, maple gives 2 solutions x=2, x=1/9
but in fact the equation has no solution

please help me.

solve(sqrt(x^2-10*x+1) = sqrt(-8*x^2+9*x-1))

1/9, 2

(1)

``

Download solve_eq_help.mw

Hello I cant sign in on my other MapleCloud account to view all my other Maple Documents. 

It says "Oops an error stopped us, from verifying your account. Please sign in again or continue using public MapleCloud features maple" Any suggestions on how to fix it? 

Maple 2020 beginner user - matrices shows 10 rows and columns on worksheet, by default. How to increase this value up to 16 and more? Of course, there is possibility (browse matrix) to see all values and export to Excel also, but better to see all 16 on worksheet. 

For instance, I'd like to find the integer solutions of the following system (unknowns: k[1], k[2], k[3], k[4], k[5], and k[6]): 

eqs:=eval~(k[1]*x^3+k[2]*x^2*y+k[5]*x^2*z+k[3]*x*y^2+k[6]*x*y*z+k[8]*x*z^2+k[4]*y^3+k[7]*y^2*z+k[9]*y*z^2+k[10]*z^3,{{x=1,y=1,z=1},{x=RootOf(_Z^3-4*_Z^2+_Z+1,index=1),y=RootOf(_Z^3-4*_Z^2+_Z+1,index=2),z=RootOf(_Z^3-4*_Z^2+_Z+1,index=3)},{x=RootOf(_Z^3-4*_Z^2+_Z+1,index=2),y=RootOf(_Z^3-4*_Z^2+_Z+1,index=3),z=RootOf(_Z^3-4*_Z^2+_Z+1,index=1)},{x=RootOf(_Z^3-4*_Z^2+_Z+1,index=3),y=RootOf(_Z^3-4*_Z^2+_Z+1,index=1),z=RootOf(_Z^3-4*_Z^2+_Z+1,index=2)}}):
{isolve}(eqs=~0);

It seems that the isolve command cannot solve such a system of linear equations, but its integer solutions do exist: 

sol := [k[1] = _Z1, k[2] = _Z2, k[3] = _Z3, k[4] = _Z4, k[5] = _Z5, k[6] = _Z1 + 2*_Z3 + 2*_Z4 + _Z5 + 3*_Z6, k[7] = 2*_Z1 + _Z3 + 8*_Z4 - _Z6, k[8] = -21*_Z1 + 2*_Z2 - _Z4 - 4*_Z5 + _Z6, k[9] = 24*_Z1 - 4*_Z2 - 5*_Z3 - 12*_Z4 + 3*_Z5 - 4*_Z6, k[10] = -7*_Z1 + _Z2 + _Z3 + 2*_Z4 - _Z5 + _Z6]: (*results from Mathematica*)
evala(subs(sol, eqs));
 = 
                              {0}

Here _Z1, _Z2, _Z3, _Z4, _Z5, and _Z6 are integer parameters. However, how do I get this result in Maple?

I am trying to solve a nonlinear equation frequently and use the solution result to draw a plot. I was wondering when some solutions are complex numbers (I), how Maple treats them. Can we add a condition saying that if the solution is complex, it should be replaced by a real number (e.g., zero)

dear all:

    here I try to repeat the results as follows:

 (23) is my target

my 2 solving processes are included in the attachment.

using LinearSolve(A, b) and regular solve command can not generate results as (23)

Please take a look.

question_DHT.mw

thanks for your help.

best regards

First 108 109 110 111 112 113 114 Last Page 110 of 2308