tomleslie

13876 Reputation

20 Badges

15 years, 165 days

MaplePrimes Activity


These are replies submitted by tomleslie

@Annonymouse 

Using 2D input means that one has to be careful about code indentation and spacing etc - which are never an issue with 1D input. In the attached all I did was to remove indentations etc from the final execution group in the worksheet you posted- and now it works!

hueplot3.mw

 

@tomleslie 

This works in Maple 2019.2 - see the attached

  restart:
  kernelopts(version);
  with(plots):
  display
  ( seq
    ( seq
      ( spacecurve
        ( [i/sin(u), u, j],
          u = 0.00001 .. 3/2,
          color=ColorTools:-Color("HSV", [i*j/100, 0.5, 0.5]),
          thickness=5,
          view = [0 .. 10, 0 .. Pi/2, 0 .. 10]
        ),
        i=1..10
      ),
      j=1..10
    )
  );

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

 

 

 


 

Download hueplot2.mw

 

@Annonymouse 

which Maple version are you using?

@mehran rajabi 

See the attached

  restart;
  A:= Matrix(4, 8, [ [-1, 1-t, 0, 0, 0, 0, 0, 0],
                     [0, 0, 1, 1+t, 0, 0, 0, 0],
                     [0, 0, 0, 0, -1, 1-t, 0, 0],
                     [0, 0, 0, 0, 0, 0, 1, 1+t]
                   ]
             );
  B:= Matrix(4, 8, [ [-1, 1-t[1], 0, 0, 0, 0, 0, 0],
                     [0, 0, 1, 1+t[1], 0, 0, 0, 0],
                     [0, 0, 0, 0, -1, 1-t[2], 0, 0],
                     [0, 0, 0, 0, 0, 0, 1, 1+t[2]]
                   ]
            );
#
# Define function which generates target matrix from
# supplied matrix
#
  genMat:= M-> Matrix( op(1, A),
                       (i,j)-> subs( t=parse(cat(t, [iquo(i-1, 2)+1])),
                                     A[i,j]
                                   )
                     );
  C:=genMat(A);
#
# Check B=C
#
  LinearAlgebra:-Equal(B, C);

Matrix(4, 8, {(1, 1) = -1, (1, 2) = 1-t, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (2, 4) = 1+t, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = -1, (3, 6) = 1-t, (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 1, (4, 8) = 1+t})

 

Matrix(4, 8, {(1, 1) = -1, (1, 2) = 1-t[1], (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (2, 4) = 1+t[1], (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = -1, (3, 6) = 1-t[2], (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (4, 6) = 0, (4, 7) = 1, (4, 8) = 1+t[2]})

 

genMat := proc (M) options operator, arrow; Matrix(op(1, A), proc (i, j) options operator, arrow; subs(t = parse(cat(t, [iquo(i-1, 2)+1])), A[i, j]) end proc) end proc

 

Matrix(%id = 18446744074221119118)

 

true

(1)

 

Download getMat2.mw

@Kitonum 

This can return multiple local minima, if supplied with the correct options

It is not guaranteed to return all local minima - no software package can do that

@mirmir 

see the comments etc in the attached

 

restart;

interface(rtablesize=10):
  interface(version):
  Physics:-Version():
  assume(0 < x, x < 1, 0 < y, y < 1, 0 < t):
  interface(showassumed=0):

pde := diff(f(x, y, t), x $ 2) + diff(f(x, y, t), y $ 2) - diff(f(x, y, t), t)= 0;

diff(diff(f(x, y, t), x), x)+diff(diff(f(x, y, t), y), y)-(diff(f(x, y, t), t)) = 0

(1)

bcs := D[1](f)(0, y, t) = 0, D[1](f)(1, y, t) = 1,
       D[2](f)(x, 0, t) = 0, D[2](f)(x, 1, t) = 1;

(D[1](f))(0, y, t) = 0, (D[1](f))(1, y, t) = 1, (D[2](f))(x, 0, t) = 0, (D[2](f))(x, 1, t) = 1

(2)

ic:= f(x,y,0)=0;

f(x, y, 0) = 0

(3)

#
# Construct a general solution in the absence of
# any bc/ic restrictions
#
  sol := pdsolve(pde);

PDESolStruc(f(x, y, t) = _F1(x)*_F2(y)*_F3(t), [{diff(_F3(t), t) = _c[1]*_F3(t)+_c[2]*_F3(t), diff(diff(_F1(x), x), x) = _c[1]*_F1(x), diff(diff(_F2(y), y), y) = _c[2]*_F2(y)}])

(4)

#
# Note that the solution is separable - ie a product
# of three functions, each of whihc only depends on
# a single variable
#
# Consider thr third equation in the conditions for the
# general solution - that involving an ODE in the
# variable 't'
#
# Notice that the combination of the initial condition
# f(x,y,0)=0 and the general solution
#
# f(x, y, t) = _F1(x)*_F2(y)*_F3(t)
#
# requires that _F3(0)=0, so solve the ODE with this
# condition
#
  dsolve([diff(_F3(t), t) = _c[1]*_F3(t) + _c[2]*_F3(t), _F3(0)=0]);

_F3(t) = 0

(5)

#
# Note that _F3(t) is identically zero for all 't'. One can susbstitute
# this condition in the general solution 'sol' above, which yields
#
#     f(x, y, t) = 0
#
# This will satisfy the boundary conditions
#
#      D[1](f)(0, y, t) = 0
#      D[2](f)(x, 0, t) = 0
#
# But the boundary conditions
#
#      D[1](f)(1, y, t) = 1
#      D[2](f)(x, 1, t) = 1
#
# can *never* be satisfied - hence there is no solution to
# the original system of pde+bcs+ic

Download noSol.mw

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

First 56 57 58 59 60 61 62 Last Page 58 of 207