Carl Love

Carl Love

28050 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@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.

It doesn't have a Taylor series for epsilon=0 because sqrt(epsilon) isn't differentiable at 0. You could use another expansion point though.

@pallav The error message gets truncated by being put in the title. Please transcribe the complete error message into the body of a message.

Also, since it worked for me in Maple 2022.1, I ask What version are you using?

@JAMET Don't make it seem as if the information that I gave you before was incorrect by saying that you still have errors. The truth is that you added the solve command, so you have new errors related to a new command that wasn't present for the question that I answered. My solution worked for the question as it was asked.

I'm having difficulty with combining assumptions (in assuming form) with the geometry package and then using solve. The variable a becomes localized in the equations, and solve sees two different variables a. It's much easier to not use geometry. Then assumptions aren't needed at all.

Since you have two equations and three variables (x, y, a), you need to tell solve to solve for {x, y} by giving {x, y} as the second argument.

restart:
b:= a*(1/2 + 1/6*sqrt(45 - 24*sqrt(3)))^2:
r:= b*sqrt(b)/(sqrt(a + b) + sqrt(a)):
E:= x^2/a^2 + y^2/b^2 = 1:
C3:= (x - (1+sqrt(3))*r)^2 + (y+r)^2 = r^2:
sol:= solve((simplify@numer@(lhs-rhs))~({E, C3}) union ({x, -y, a} >~ 0), {x, y}):
sol1:= simplify(sol) assuming a>0:
PP:= eval([x,y], sol1[]); 


 

@JAMET Use the command 

assume(a > 0);

somewhere before (the exact placement doesn't matter) the ellipse command.

@tomleslie My Reply was directed to the OP to answer their immediately preceding "Why...?" I wasn't criticizing your Answer, and I think that your use of fsolve was totally appropriate.

First 81 82 83 84 85 86 87 Last Page 83 of 709