sursumCorda

1219 Reputation

15 Badges

2 years, 140 days

MaplePrimes Activity


These are replies submitted by sursumCorda

@dharr For instance, what about 

expr1 := a^3*b^3*(12*(a*b+a+b)-28*(a+b+1)^2)+4*a^2*b^2*(a+b+1)*(a^2+b^2+(a+1)*(b+1))*(13*(a+b+1)^2-8*(a*b+a+b))+a*b*(7*(a+b+1)^8-40*(a*b+a+b)*(a+b+1)^6+32*(a*b+a+b)^2*(a+b+1)^4+28*(a*b+a+b)^3*(a+b+1)^2-20*(a*b+a+b)^4)+(a+b+1)*(a*b+a+b)*((a+b+1)^4-6*(a*b+a+b)*(a+b+1)^2+6*(a*b+a+b)^2)^2: # %assuming nonnegative

and

expr2 := (a+b+1)^6-27*(a*b+a+b)*(a+b+1)^4+472*(a*b+a+b)^2*(a+b+1)^2+112*(a-1)*(b-1)*(a-b)*(a*b+a+b)*(a+b+1)-16*a*b*(2*(a+b+1)^2+3*(a*b+a+b))*(a+b+1)-1152*(a*b+a+b)^3: # %assuming real

? The former one is over nonnegative reals, and the latter one is over the real numbers.

Unexpectedly, Maple's solve (or RealDomain:-solve) is rather slow in solving expr1=0. (For the second equation, can Maple simplify or normalize the values?)

@C_R Sorry for the confusion. I don't signify there's a connection between these two questions. I just cite a worksheet that is not created by myself: The purport of it is to show that the problem is irrelevant to the worksheet (by me or by other users).

@C_R As Options Dialog - Export Tab - Maple Help (maplesoft.com) says, there are two different settings. However, this doesn't change the situation. Here is the worksheet: https://www.mapleprimes.com/questions/235749-Better-Way-To-Remove-Entries-In-Piecewise#answer292495.

Export using text for searchable text and smaller file size: remove_undefined1.pdf.
Export using shapes for greater fidelity: remove_undefined2.pdf.

E.g., confirmed.pdf

ph = (pKa-log[10](c))*(1/2) = ph = (1/2)*pKa-(1/2)*ln(c)/ln(10)NULL

ph = (pKa - log[10](c))/2;

ph = (1/2)*pKa-(1/2)*ln(c)/ln(10)

(1)

ph = (pKa-log[10](c))*(1/2)

ph = 1/2*(pKa-log[10](c))

ph = (1/2)*pKa-(1/2)*ln(c)/ln(10)

(2)

ph = 1/2*(pKa - log[10](c)):

ph = 1/2*(pKa-log[10](c))

ph = 1/2*(pKa - log10(c));

NULL

Download confirmed.mw

@Axel Vogt Well, this is hard to say, since I don't check the results (using other CAS’s). But I tend to believe that it's complete.

@Hullzie16 The key is that the domains of variables have been restricted.

Here is a simple example (just for fun): 

SolveTools:-SemiAlgebraic({36*a^2*b^2-9*a*b*((a+b)^2+7)+(a+b)*((a+b)*((a+b-5)*(a+b)+24)-5)+1=0}):

In the field of real numbers, how many possible solutions exist exactly? 
If you thought , you’re wrong. (But this fact is, in effect, not easy to clarify.)

Can you give the values of k and w?

@acer Thanks. I find that the following codes are more or less convenient: 

[`$`](''parse(DocumentTools:-Tabulate([sprintf("%ld", i)], 'exterior' = 'none'), 'noeval', 'statement'), ifactors(2^i - 1)[-1]'', 'i' = 190 .. 200); DocumentTools:-Tabulate([[]]): 

@lcz SVG is an XML-based text format. So the connection between .svg and .xml is, in effect, closer.

In this question@Carl Love posted an example of finding one shortest possible tour through several 3D points. His code only took he around four minutes, and just took @dharr about six minutes. Unexpectedly, executing it takes me nigh on 9 min! Well, these may be determined by one's computer. But how about Steam Deck's performance?
 

restart;

pts := [[1, 1, 0], [3, 2, 0], [2, 3, 1], [1, 3, 1], [1, 4, 2], [1, 5, 0], [2, 5, 1], [3, 5, 3], [4, 5, 3], [3, 4, 5], [4, 3, 2], [5, 3, 2], [5, 4, 1], [5, 2, 1], [5, 1, 0], [4, 1, 2], [3, 1, 2], [2, 1, 2], [1, 2, 1]]

Matrix(`$`(numelems('pts'), 2), proc (i, j) options operator, arrow; linalg['norm'](pts[i]-pts[j], 1) end proc, shape = symmetric, datatype = integer[1])g := GraphTheory:-Graph(%)

_rtable[36893490071532186668]

g := `Graph 1: an undirected weighted graph with 19 vertices and 171 edge(s)`

(1)

cost, route := CodeTools:-Usage(GraphTheory:-TravelingSalesman(g))

memory used=19.08GiB, alloc change=54.00MiB, cpu time=9.44m, real time=8.71m, gc time=75.19s

costd, route := 42, [1, 19, 4, 3, 7, 6, 5, 10, 8, 9, 11, 12, 13, 14, 15, 2, 16, 17, 18, 1]

(2)

perm := pts[route]

perm := [[1, 1, 0], [1, 2, 1], [1, 3, 1], [2, 3, 1], [2, 5, 1], [1, 5, 0], [1, 4, 2], [3, 4, 5], [3, 5, 3], [4, 5, 3], [4, 3, 2], [5, 3, 2], [5, 4, 1], [5, 2, 1], [5, 1, 0], [3, 2, 0], [4, 1, 2], [3, 1, 2], [2, 1, 2], [1, 1, 0]]

(3)

kernelopts(version);

`Maple 2022.2, X86 64 WINDOWS, Oct 23 2022, Build ID 1657361`

(4)


 

Download testTSP.mws (Sorry for a typo in it.) 

The selection works for sets as well.

@mmcdara For a small problem, minimizing the unsquared sum of actual distances (something like perpendicular offsets) remains possible in practice.

\begin{figure}\begin{center}\BoxedEPSF{LeastSquaresOffsets.epsf}\end{center}\end{figure}

But it seems that Maple haven't collected this method yet, so one has to implement these by hand!

@lcz Replace "\n" and/or "\t" between term and datum with " ". For example, 

fontName	"Dialog"

is replaced by 

fontName "Dialog"

and 

LabelGraphics
		[

is replaced by 

LabelGraphics [

 

@acer Thanks again. It's what I want.

@sand15 Cheers. I believe the "smooth" means "antialiased", but I'm unfamiliar with these technical terms, and don't know how to define them.

First 18 19 20 21 22 23 Page 20 of 23