Carl Love

Carl Love

28095 Reputation

25 Badges

13 years, 100 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@fatemeh1090

If you look at the matrix extracted from Excel (as shown in the attached worksheet), it's clear that the 1st row is just labelling and the last 10 rows are garbage, not data at all. Thus, I have

R:= upperbound(XL,1) - 11:

to exclude 11 rows. That's the only change that's needed. The end results are very close to the first case because the data for the subsequent three cases are very close to the first case.

Download 3dModelFit.mw

MaplePrimes apparently can't display my worksheet due to the fully displayed matrices, but you should see what I mean when you download it. Here's the plot:

@fatemeh1090 Maple worksheets alone don't contain the data; they only contain what's shown on the screen. In order to duplicate your results, I need the Excel file. Obviously, you need to filter out the Matrix entries that are just labels like "Y" instead of numeric data.

@Kitonum You wrote:

  • It seems that in the second case Maple first rounds each of the operands to 2 digits, and only then performs the calculation.

Yes, that's exactly what happens, and that's by design. This is nothing new.

@fatemeh1090 Please organize the data into a single matrix in Excel. I don't use Excel, so I can't look all over your worksheet for 4 separate groups of data.

Or, put 4 Excel worksheets in your file with each worksheet having a matrix starting in its upper left corner.

@Scot Gould Yes, that's right, they're substituted first. Arithmetic operations between exact rationals (including integers) are done without regard to floating-point arithmetic. So 1014-1007 is reduced to before it's processed by evalf, and 7 can be adequately represented in 2-digit precision.

@fatemeh1090 Great, you have a model that's linear in its parameters, so it should be easy to find the optimal solution.

Can you get the data into Maple with package ExcelTools?

@fatemeh1090 Yes, there's a few things Maple can do. Do you have a theoretical model to fit to this data? Or do you just want a smooth plot of the surface? Or something else? 

@Magma Thanks, all is clear now.

@Magma What is the upper limit of m? Obviously m <= n^2 - 2*n + 1. But it's trivial to find solutions for m <= (n^2 - n)/2.

@Magma I'm confused by your Reply immediately above. Can the r x matrices be indentified with a field embedding, i.e., an injective function phi: GF(2,r) -> GF(2,1)^(r x r) that preserves field operations? And, if so, can a formula for phi be given? Is the image of phi simply the diagonal matrices?

 

@Magma It is surprising that Maple 2019 shows a substantial speedup of my code, but not much change for VV's. I can't believe that RowReduce has been substantially improved, because it was already extremely efficient. Using the 80x80 matrix that you just posted, I get

CodeTools:-Usage(VVMDS(A,8)): #VV's procedure
memory used=3.82GiB, alloc change=0 bytes,
cpu time=39.83s, real time=39.52s, gc time=5.38s

CodeTools:-Usage(IsMDS(A,8)): #Carl's procedure
memory used=2.65GiB, alloc change=-4.00MiB, 
cpu time=18.56s, real time=17.56s, gc time=5.59s

 

@Kitonum Thanks for the shorter syntax. I see now that that syntax is mentioned on the page ?Line, but I missed it before.

You say "curve", but I wonder if you actually mean surface. Do you want a function z ~ f(x,y)? That's a surface. Or do you want functions x ~ f(t), y ~ g(t), z ~ h(t)? That's a curve.

@Kitonum Like this:

SMC:= Student:-MultivariateCalculus:
L1:= <2-4*t, 5+6*t>:  L2:= <-6-12*t, 17+18*t>: 
SMC:-Equal((SMC:-Line@`[]`@seq)~([L1,L2])[]);
                              true

 

@Magma 

All commands in LinearAlgebra:-Modular work substantially faster if the input matrices are converted to one of the package's native formats via its Mod command. Here's a comparison:

restart:
randomize(23): #arbitrary key number for repeatability
LA:= LinearAlgebra:  LAM:= LA:-Modular:
A:= LA:-RandomMatrix(64$2, generator= rand(0..1)):
n:= rand(2^63..2^64-1)();
                   n := 15162085668718581745
AP1:= CodeTools:-Usage( #Compute A^n in a native format:
    LAM:-Mod(2, LAM:-MatrixPower(2, LAM:-Mod(2,A,float[8]), n), integer[kernelopts(wordsize)/8])
): 
memory used=0.91MiB, alloc change=0 bytes, cpu time=63.00ms, real time=56.00ms, gc time=0ns

AP2:= CodeTools:-Usage(LAM:-MatrixPower(2, A, n)): #naive method, without conversion
memory used=86.39MiB, alloc change=28.99MiB, cpu time=8.02s, real time=8.00s, gc time=62.50ms

LA:-Equal(AP1, AP2); #accuracy check
                              true
8.02/.063; #cpu time ratio
                          127.3015873

 

First 232 233 234 235 236 237 238 Last Page 234 of 709