tomleslie

6247 Reputation

17 Badges

10 years, 109 days

MaplePrimes Activity


These are replies submitted by tomleslie

For example

  1. You say you have ~20years of accumulated "problems". How many "problems" is that - hundreds? thousands?
  2. In what format do these "problems" currently exist? Paper? electronic (eg pdf or something more or less equivalent)?, files from a math package other than Maple?

@panke 

In your original worksheet you have used expressions which in current MAple versions, render as (for example)

2*L^2*m[w] + d^2*m[c] + I[c] + 2*I[m]

which contains the indexed entries I[c] and I[m]. Given that 'I' represents squareroot(-1) ..... you might want to reconsider this.

I can't test anything as old as Maple 13 (this version is now more than 10 years old! and Maple's subscript handling was substantially changed in version Maple 17 - which is 7 years old, and I can check you worksheet  ineither of these)

Why take the risk? Just change 'I' to (for example) 'J' and see what happens

 

The attached worksheet shows inert operators working despite your claim that

I don't see how this is any different than the one I showed. It doesn't work.

 

 (3^3)%/3;
                        %/(27, 3)

The output you are posting ( ie %/(27, 3) ) simply does not occur using Maple's default interface. Hence the repeated request that you post a worksheet illustrating your problem (using the big green up-arrow in the Mapleprimes toolbar).

If you are using the command-line interface, you should make this clear. With this interface, you are pretty much disabling all typesetting options.

So what happens when you execute the attached??


 

   restart;
   kernelopts(version);

`Maple 2019.2, X86 64 WINDOWS, Nov 26 2019, Build ID 1435526`

(1)

#
# Inert operators working: compare the outputs of
#
  a/b*c;
  a%/b*c;
#
# but in the second case one has to use the 'value()'
# command to make operators "active" again, rather
# than inert
#
  value(%);

a*c/b

 

`%/`(a, b)*c

 

a*c/b

(2)

#
# With exponents (and probably other things),
# parentheses have to be used because "normal"
# operator precedence doesn't "usuually" work
# with inert operators
#
  (3^3)%/3;

`%/`(27, 3)

(3)

 


 

Download inOp.mw

 

@mirmir 

shows my original code working in Maple 2019.2 with no problems.

Since you do not post a worksheet (use the big green up-arrow in the Mapleprimes toolbar for this) showing any issue you might be having, I can only suggest

  1. Ensure you have the very latest Maple 2019.2. The original release of this subversion had some "issues" - so if you aare in any doubt at all about whihc subversion you are running then download the latest and greates from the MapleSoft webite
  2. Ensure that you are running the latest version of the  "Physics Updates". The "Physics" package version may change the capabiities of Maple's PDE sovers. To get this version click on the entry at the top right of Maple's menu bar, click on the updates icon, and select Physics. To be safe you should probably restart Maple after performing this update

If you have any questions about my response to this topic, then post it on this forum

         User                      CPU                                      OS           Hyperthreading Speed-up     CPU 'Tweaks'

        CarlLove             i7-7700HQ @2.80 GHz        Win10                        6x                                  No 
        tomleslie            
i7-3770k @ 3.5 GHz             Win 7                         6x                                  No 
         glowing             
i7-6700HQ                            Win 10                       5x                                  Yes

Based on the information above, I'd have to conclude

  1. It isn't a Maple 2019.2 problem - because Carl and I both achieve ~6x speed-u
  2. It isn't a processor issue - because Carl and I have different processors, running at different clock speeds, and we both achieve ~6x speed-up
  3. It isn't an OS issue -  because Carl is running Win10, I'm running Win7, and we both achieve ~6x speed-up
  4. So we are left with the "suspicious" entry in the above table  - ie OP's CPU 'tweaks'               

@Carl Love 

to turn off hyperthreading is in BIOS/UEFI.

OP should probably check his/her BIOS to see what the current hyperthreading setting actually is

@Glowing 

The attached shows most of the code examples discussed in this post running in Maple 2019.2.

I get pretty much the same answers as before - which is to be expected - I'm running the same hardware and these trivial examples are unlikely to have been affected by any "improvements" to Maple itself.

So exactly what is your issue??

  restart;
#
# Get versions and hardware spec (numcpus)
#
  interface(version);
  Physics:-Version();
  kernelopts(numcpus);
  interface(rtablesize=11):

`Standard Worksheet Interface, Maple 2019.2, Windows 7, November 26 2019 Build ID 1435526`

 

`The "Physics Updates" version in the MapleCloud is 559; the version installed in this computer is 537 created 2019, December 15, 13:7 hours, found in the directory C:\Users\TomLeslie\maple\toolbox\2019\Physics Updates\lib\`

 

8

(1)

  Waste:= proc(N)
               local st:= time();
               while time() - st < N do
               end do;
               kernelopts(numactivethreads)
          end proc:

#
# Simple multithreaded test
#
  CodeTools:-Usage(Threads:-Map[tasksize= 1](Waste, [20$8]));

memory used=1.15GiB, alloc change=237.31MiB, cpu time=20.67s, real time=5.98s, gc time=2.66h

 

[8, 8, 8, 8, 8, 8, 8, 8]

(2)

#
# "Longer" multithreaded test
#
   Array( [ [cpuTime, realTime],
            seq( [ CodeTools:-Usage
                   ( Threads:-Map[tasksize= 1]( Waste, [j*20$8] ),
                     output=['cputime','realtime'],
                     quiet
                   )
                 ],
                 j=1..10
               )
          ]
       );

Matrix(11, 2, {(1, 1) = cpuTime, (1, 2) = realTime, (2, 1) = 20.545, (2, 2) = 5.746, (3, 1) = 40.591, (3, 2) = 10.750, (4, 1) = 60.295, (4, 2) = 9.079, (5, 1) = 80.138, (5, 2) = 11.826, (6, 1) = 100.059, (6, 2) = 14.632, (7, 1) = 120.089, (7, 2) = 18.204, (8, 1) = 140.167, (8, 2) = 20.842, (9, 1) = 160.229, (9, 2) = 24.180, (10, 1) = 180.056, (10, 2) = 27.004, (11, 1) = 200.227, (11, 2) = 30.108})

(3)

 

Download threadtest.mw

@Kitonum 

to check if lines are identical, rather than "merely" parallel

You wanted the determinant calculated modulo 2, whihc is a "simple" option, as in the attached


 

  restart;
  with(LinearAlgebra):
#
# Generate a (random) 64*64 binary matrix
#
  A:=RandomMatrix(64, 64, generator=rand(0..1)):
  r:=8:
  n := upperbound(A)[1]/r:
  B := Matrix(n, n, 0):
  for i to n do
      for j to n do
          B[i, j] := SubMatrix(A, [(i-1)*r+1 .. i*r], [(j-1)*r+1 .. j*r])
      end do;
  end do;
 

#
# Get the determinants for all the subMatrices in B
#
  Determinant~([entries(B,`nolist`)], method=modular[2]);

[1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1]

(1)

#
# Are any determinants 0?
#
  member(0, %);

true

(2)

 


 

Download doDets2.mw

@Carl Love

I don't see a 'Save variables' menu entry anywhere which is why my previous response was titled "A guess"

How I think it works

  1. assuming you have saved as a workbook
  2. you can select multiple variables in the palette ( shift+leftclick)
  3. then rightclick/save on the context menu will save all selected variable assignments

@Carl Love 

I think the OP might be referring to a context menu entry associated with the variables palette.

AFAIK the 'save' option only "ungreys" if the one's work has been organised/saved as a Maple workbook. It is greyed out for simple worksheets.

It is intended as a means of computing/assignng variables in one worksheet (of a workbook) and having these assignments available in other worksheets (of the same workbook). See the 'Variables Palette' section of ?Workbook Overview

@HS 

See the attached

BTW why are you using inert forms of commands eval() and normal() - is this deliberate?

 PS1 := 1;
 PS2 := 10*q;
 QS1 := 8;
 QS2 := 5*q;

1

 

10*q

 

8

 

5*q

(1)

gP, gQ, S1, S2, P1, P2, Q1, Q2:=
(q*x + 9*q + y)^33*(4*q*x + 6*q + y)^16/((x + 3)^48*(x + 10)), (q*x + 9*q + y)^33*(4*q*x + 6*q + y)^16/((x + 3)^48*(x + 10)), 8, 6*q, 1, q, 1, -10*q    

(q*x+9*q+y)^33*(4*q*x+6*q+y)^16/((x+3)^48*(x+10)), (q*x+9*q+y)^33*(4*q*x+6*q+y)^16/((x+3)^48*(x+10)), 8, 6*q, 1, q, 1, -10*q

(2)

#
# OP's original expression - nno idea why (s)he is
# using INERT forms of 'eval' and 'normal'.
#
# The terms Eval(gQ, {x = S1, y = -S2}) in the
# numerator and denominator, should cancel - even
# although the 'Eval' command is inert
#
Normal(Eval(gP, {x = QS1, y = QS2})*Eval(gQ, {x = S1, y = -S2})*1/(Eval(gP, {x = PS1, y = PS2})*Eval(gQ, {x = S1, y = -S2}))) mod p;
#
# Check that the above has performed cancellation correctly
# by doing the cancellation "manually".
#
Normal(Eval(gP, {x = QS1, y = QS2})/(Eval(gP, {x = PS1, y = PS2}))) mod p;

modp(Normal((Eval((q*x+9*q+y)^33*(4*q*x+6*q+y)^16/((x+3)^48*(x+10)), {x = 8, y = 5*q}))/(Eval((q*x+9*q+y)^33*(4*q*x+6*q+y)^16/((x+3)^48*(x+10)), {x = 1, y = 10*q}))), p)

 

modp(Normal((Eval((q*x+9*q+y)^33*(4*q*x+6*q+y)^16/((x+3)^48*(x+10)), {x = 8, y = 5*q}))/(Eval((q*x+9*q+y)^33*(4*q*x+6*q+y)^16/((x+3)^48*(x+10)), {x = 1, y = 10*q}))), p)

(3)

 


 

Download cancel.mw

@666 jvbasha 

as in the attached?

You never actually used a "function" definition for f() which would have been (note the syntax)

f:=x->1 - x^2 + c[1]*(-x^3 + x^2) + c[2]*(-x^4 + x^2)

and since such a function definition is not actually required in your worksheet, I just replaced the function f(x), with the name f, everywhere.

restart; with(plots); ha := 15; alp := (1/180)*(5*3.14); rkVals := [5, 10, 15, 20]; f := 1-x^2+c[1]*(-x^3+x^2)+c[2]*(-x^4+x^2); eq1 := diff(f, `$`(x, 3))+2*alp*rk*f*(diff(f, `$`(x, 1)))+(4-ha)*alp^2*(diff(f, `$`(x, 1))); eq2 := collect(expand(eq1), c); a[1] := subs(x = 1/6, eq2); a[2] := subs(x = 2*(1/6), eq2); plts := NULL; colors := [red, green, blue, black]; for j to numelems(rkVals) do rk := rkVals[j]; p := fsolve({a[1], a[2]}); plts := plts, plot(eval(f, p), x = 0 .. 1, color = colors[j]) end do; plots:-display([plts])

 

 


 

Download plotLoop2.mw

if you psoted your complete worksheet using the big green up-arrow in the Mapleprimes toolbar.

From just reading your code, the first loop

for i to 4 do u[i, 1] := sort(collect(expand(-h*(sum(int(K2[i, j]*g[j](t), t = 0 .. x), j = 1 .. 4))), h)) end do

computes the indexed names u[i, 1]. The second loop

for i to 4 do u[i, 2] := sort(collect(expand((1+h)*u[i, 1](x)-h*(sum(int(K2[i, j]*u[j, 1](t), t = 0 .. x), j = 1 .. 4))), h)) end do;

uses these indexed names as if they were functions, ie the terms u[i, 1](x) and u[j, 1](t).

A named (indexed) variable and a named (iindexed) function are two very different things

First 6 7 8 9 10 11 12 Last Page 8 of 157