Carl Love

Carl Love

28015 Reputation

25 Badges

12 years, 297 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Carl Love Here's an option that you may prefer because it makes them prettyprint upright with no quotes at all:

subsindets[2](E, symbol, `#mo("%A");`, nprintf);

@vs140580 Like this:

subsindets(E, symbol, convert, string);

@moh111 Can we assume the following?:

  1. In any given expression containing these functions to be simplified, the first argument (shown as x in your example) will the same throughout the expression?
  2. No term will have a product of more than 2 functions?
  3. The only possible exponents on functions are -2, -1, 0, 1, 2?

If we can assume those, it'll be quite easy. If not, it'll be more complicated, but not very complicated.

@lcz Go to help page ?updates,v2022.

@vs140580 Well, you could give my Answer in the other thread a vote up. That's the main Answer, not the Reply.

@MANUTTM You shouldn't use square brackets [ ] or curly braces { } as a replacement for parentheses (aka round brackets) ( ) for grouping and order-of-operations control in algebraic expressions. You'll need to go through the whole worksheet and change those to parentheses.

@vs140580 In the code in question, I used Maple 2022 syntax for local variable declarations. I just posted a retrofitted revision of the code in the other thread.

@vs140580 The previous code used a local variable declaration syntax that was introduced in Maple 2022. I guess you have an earlier Maple. Here's a retrofit:

LexProd:= proc(G::seq(Graph), $)
uses GT= GraphTheory;
local
    LexProd2:= proc(G::Graph, H::Graph)
    local Vg, Vh, ng, nh, Ng, Nh, i, j, J, P, k, K;
        (Vg,Vh):= op(GT:-Vertices~([G,H]));
        (ng,nh):= op(`..`~(1, nops~([Vg,Vh])));
        (Ng,Nh):= op(op~(4, [G,H]));
        P:= [seq](seq([i,j], j= nh), i= ng);
        k:= 0;
        K:= table((p-> op(p)= ++k)~(P));
        GT:-Graph(
            (curry(nprintf, "%a:%a")@((i,j)-> (Vg[i],Vh[j]))@op)~(P),                
            (
                ((i,j)-> {
                    seq(seq(K[k,J], k= Ng[i]), J= nh), 
                    seq(K[i,k], k= Nh[j])
                })
                @op
            )~(P)            
        )
    end proc
;
    if nargs=0 then error "at least 1 graph needed"
    elif nargs=1 then G[1] 
    else foldl(LexProd2, args) 
    fi
end proc
: 

 

@lcz It has nothing to do with what you typed. You entered the numbers correctly, with significands greater than 1. The string conversion changed them to a substandard form.

q2:= convert(q1, string);
    ".2800000000e-29*a+.2780000000e-28*b+.3000000000e-20+.2000000000e-31*c+.3000000000e-29*d"

I wonder what internal process in Maple generates the above extremely nonstandard numeric format. Every detailed specification for scientific notation or E notation that I can find states that the absolute value of the significand (a.k.a. mantissa) must be greater than or equal to 1. That's also what's taught in elementary and secondary schools.

@synred Yes, certainly there's a simpler way to do it. The problem that I have Answering your Question is that there are several Maple packages that implement tensors, and there are several Maple packages that have commands named Multiply. I need to know which of each you're using. So, all I really need to see---and what I originally asked you for---are any with commands that you used and how you assigned a value to g5. And I need to know which packages and commands you're actually using, which may differ from which you think you're using. So I need to know the order that the with commands are given.

Regarding matrix multiplication, Does this work for you?

A:= <1, 2; 3, 4>; B:= <5, 6; 7, 8>;  #2x2 matrices
A . B;  #matrix-matrix multiplication
5 * A;  #scalar-matrix multiplication

@vs140580 No row in any of the three matrices that you just posted is an equivalence match (using your special forms of "equivalence") to any row in either of the other two matrices, which makes these not very good test cases. Please post some better matrices.

@synred I am asking you to upload *your* worksheet; I wasn't directing you to download some other worksheet.

Your Question shows an interaction between you and Maple, which I guess you took a screenshot of and put in your Question. You can save that interaction as a "worksheet". Just use the File -> Save dialog, pretty much like any other program. Then upload that saved worksheet here by using the green up arrow that's in the editor toolbar when you're posting here.

The portion of your work that you showed in your Question is not enough for me to be able to Answer it; I need to see the whole worksheet. 

Please upload a worksheet (as an attached file---use the green up arrow) that shows any with commands you used and how g5 was created.

@vs140580 I wrote a Maple program for this. I'd like to test it before posting it. Would you upload a Maple worksheet with some test matrices? My program is intended to work for any equivalence relation between rows for which there's an "easy" function which when passed a single row can identify the equivalence class that it belongs to. This includes the two row-equivalence relations already discussed in this thread.

First 80 81 82 83 84 85 86 Last Page 82 of 708