tomleslie

13876 Reputation

20 Badges

15 years, 173 days

MaplePrimes Activity


These are answers submitted by tomleslie

Suggestions below assume your OS is Windows

Assuming that the "download" part of the process worked OK, then provided you can find the relevant "exe", you can try to install manually. So first issue is to locate the relevant file. You are looking for something called

Maple2017.1WindowsX64Upgrade.exe

Your filename might be different if you have a differetn OS - but the "Maple2017.1" part ought to be the same You can use the Windows Start->Search Files and Programs and type the first few characters. If nothing shows up, don't panic! Windows does not "index" files stored in Temp directories, and if you selected "Download and Install" (rather than simple "Download"), then the exe is probably in a Temp directory.

In my case, I located this file in

C:\Users\TomLeslie\AppData\Local\Temp obviously your userName will be different

If you can locate this file then, close all Maple sessions, double click the .exe and the installation process should start. If for any reason this still doesn't work, then try right-clicking the .exe and select Run as Administrator

If you can't locate the file, or having located it you still can't install, then I can only suggest going to the Maple downloads page at http://www.maplesoft.com/support/downloads/m2017_1update.aspx and run the download again. If at all possible, select Download Only rather than Download and Install. This will put the relevant .exe in your default downloads directory, at which point you can try the manual installation process mentioned above.

If this still doesn't work - try to make a note of any message you get during the "install" process, and check your Maple installation directory for the file Maple_2017_Install_2017_06_29_09_07_41.log (date_timesuffix will be differetn for you). This is your installation log and *may* have useful information about why the installation failed.

Report back any messages/info which you get

I didn't really understand the logic of your "simulation", so I went back to the beginning  and wrote my own, see attached


 

restart:
die:= rand(1..6):
numTrials:= 5000:
success:= 0:
for j from 1 by 1 to numTrials do
    nSixes:= 0:
    for k from 1 by 1 to 15 do
        if   die()=6
        then nSixes:=nSixes+1:
        fi:
    od;
    if member(nSixes, [1,3,5])
    then success:=success+1;
    fi
od:
evalf(success/numTrials);
    

.4884000000

(1)

 


 

Download dieSim.mw

Using Maple's Logic() package - and a fair bit of typing, which I cannot guarantee is error-free, I get the following


 

restart;
with(Logic):

expr:= ( &not(A) &and C ) &or
       ( &not(B) &and C ) &or
       ( C &and &not(D) ) &or
       ( A &and &not(B) ) &or
       ( A &and &not(C) ) &or
       ( A &and &not(D) ) &or
       ( C &and D)        &or
       ( B &and D )       &or
       ( B &and C )       &or
       ( A &and D )       &or
       ( A &and C )       &or
       ( A &and B );

Logic:-`&or`(Logic:-`&or`(Logic:-`&or`(Logic:-`&or`(Logic:-`&or`(Logic:-`&or`(Logic:-`&or`(Logic:-`&or`(Logic:-`&or`(Logic:-`&or`(Logic:-`&or`(Logic:-`&and`(Logic:-`&not`(A), C), Logic:-`&and`(Logic:-`&not`(B), C)), Logic:-`&and`(C, Logic:-`&not`(D))), Logic:-`&and`(A, Logic:-`&not`(B))), Logic:-`&and`(A, Logic:-`&not`(C))), Logic:-`&and`(A, Logic:-`&not`(D))), Logic:-`&and`(C, D)), Logic:-`&and`(B, D)), Logic:-`&and`(B, C)), Logic:-`&and`(A, D)), Logic:-`&and`(A, C)), Logic:-`&and`(A, B))

(1)

BooleanSimplify(expr);

Logic:-`&or`(A, C, Logic:-`&and`(B, D))

(2)

 


 

Download logicProb.mw

as in

doubleInt.mw

Essentially you have two choices, either

  • read the whole Excel file, then within Maple select the columns you want to plot
  • read only selected columns from the Excel file, then plot them

The attached worksheet shows a variety of possibilities for plotting from the attached Excel file

excelImp.mw

test3.xlsx

If you have a mixture of "type" in the file to be read then ImportMatrix(fileName, source=csv) does different things depending on whether fields in the file are separated by a comma character, or comma+whitespace.

The first of these exhibits the behaviour which you are seeing, ie a number is returned where you expect a string. In the second case, a string field is returned, containing a string, so you get ""0"" Yikes!!!!

In the second case it is relatively simple to "strip" the extra level of quotation marks, where these occur. Alternatively one could write a fairly simple procedure to perform the operation you require. See the attached


 

  restart;

  currentdir("D:/Users/TomLeslie/myMaple"):
#
# Separator in data1.txt is ',' (no whitespace)
# Separator in data2.txt is ', ' (ie comma+space)
#
  A:=ImportMatrix("data1.txt", source=csv);
  B:=ImportMatrix("data2.txt", source=csv);
#
# Strip one level of quotes from entries in
# matrix 'A' when possible)
#
  f:=x->`if`(type(x,string),parse(x),x):
  f~(A);

_rtable[18446744074331554030]

 

_rtable[18446744074335969278]

 

Matrix(%id = 18446744074335971078)

(1)

#
# Define a procedure to work around this problem
#
  myRead:= proc( fname::string)
                 local l, p,
                       k:= 1,
                       res:= Array():
                 uses StringTools:
                 while true do
                       l:=  readline(fname);
                       if   l=0
                       then return convert(res, Matrix);
                       else p:= Array(parse~(Split(l, ",")));
                            res(k,1..numelems(p)):=p;
                            k:=k+1;
                       fi;
                 od:
          end proc:
A:=myRead("data1.txt");
B:=myRead("data2.txt");

_rtable[18446744074335973494]

 

Matrix(%id = 18446744074335975894)

(2)

 


 

Download readProb.mw

 

Obvious you will have to change the currentdir() setting. I am also attaching the two data files which I used

data1.txt

data2.txt

but for the second one, see the help at (my emphasis)

?Arrange Open Windows

In the Standard worksheet interface, Maple worksheets and documents can be set to open in a new tab. For details, see Tab Panes. You can change this setting so worksheets are opened in a new window from the Tools menu, through the Options>Interface tab.
If your session is set to open worksheets and documents in a new window, you can arrange open windows in several different ways.

By default(?) Maple opens worksheets in a new tab, so you can't 'tile' these. You can change this default using the

Tools->Options->Interface->Open worksheets in

menu entry

I have added some comments to the latest worksheet you provided so that you can see where your (many) problems lie.

The only excutable command I have added is to show that the number of equations you will generate from this code confirms my analysis of the code and will in fact be 21, because it will be

3*nx+ny+nx*ny

which with nx=ny=3 will result in 3*3+3+3*3 - ie 21

matgen.mw

If you have a function of the form

where g(z) has an asymptotic expansion then g(z)/exp(z) is (pretty much) guaranteed to have an asymptotic expansion since exp(z) will head towards infinity faster than most functions, so g(z)/exp(z) will" generally" head for zero

Now consider the function g(1/z)/exp(1/z): g(1/z) may (or may not) have an asymptotic expansion, but exp(1/z) will head for zero faster than"most" possible numerator functions g(1/z), so g(1/z)/exp(1/z) will head for infinity, and thus not have a sensible asymptote.

Can I think of counterexamples - yes obviously, eg g(z)=exp(z). In this case g(z) would not have an asymptotic expansion, but g(z)/exp(z) would asymptote to 1 and g(1/z)/exp(1/z) would also asymptote to 1 - and many other such counterexamples exist

 

My need :
A MAPLE code has to be run from an ECLIPSE session (through a cmaple MyCode).
In this ECLIPSE session the user chooses a data file among many, and ECLIPSE then has to tell MyCode what file it has to read.

So the obvious answer is for your ECLIPSE session to write a simple text file with a defined name (lets call it foo.bar, because everyone does) to a defined location. For the latter C;/users/Username/ would be a reasonable choice.

The contents of C;/users/Username/foo.bar is a sring which is the name of the file you actually want your Maple script to read - you might want to make this a full path.

So your maple script MyCode contains a read() statement, which reads the (hard-wired) filename C:/users/Username/foo.bar, from which it get the (preferably full path) name of the file it really needs to read - and a second read() statement will read this file

you could use implicitplot3d() to plot the solution surface of the equation over three variable ranges as in

   restart;
   with(plots):
   p: .2: # this is nonsense! why does it exist????
   omega[0] := 1:
   epsilon[1] := 1.04493:
   epsilon[2] := .93259:
   delta := 0.2e-1:
   eq:= (omega[0]*a-a*Omega^2+(3/4)*epsilon[2]*a^3)^2+(delta*Omega*a)^2 = p^2;
#
# Use implicitplot3d to allow for three variable ranges.
# Delete plot options which don't make much sense - such
# as gridrefine (NB not 'gridrefin') since this is an option
# for implicitplot() but not implictplot3d(). Also 'thickness',
# which is valid - but just why??????
#
# Correct a variable range definition from 'omega=' to
# 'Omega='
#
   implicitplot3d( eq, Omega=.5..2, a=0..5, p=0..1);

 

is to use the StateSpace() command from the DynamicSystems() package. This accepts input in a variety of forms (pole-zero, transfer function, ODE(s), or state matrices.

Check the help at

?DynamicSystems[StateSpace]

For future reference when uploading code here, use the big green up-arrow in the toolbar. No-one here is going to retype your code from a "picture"

 

by defining the amplitude function A(z,t) as the sum of real and imaginary parts as AR(z,t)+I*AI(z,t)

Then splitting your original PDE into real and imaginary parts - thus generating a system of two PDEs - and solving this system.

As a check the attached plots

  1. the real part of the amplitude function
  2. the imaginary part of the amplitude function
  3. the magnitude of the amplitude function

You should read the comments in the attached very carefully in case I have done anything you disagree with

complexPDE.mw

 

  1. Prim's algorithm is already implemented in Maple see the help at ?GraphTheory/PrimsAlgorithm
  2. If you want to know the code whhc Maple is using for Prim's algorithm then try showstat(GraphTheory:-PrimsAlgorithm). The first dozen or so lines are about argument checking and output options - but after that, you can read how Prim;'s algorithm is actually implemented

     

Consider (as an example) the system of PDEs given as

pdesys:=[-diff(F(r,s),r$2)+diff(F(r,s), s$2)+diff(H(r),r)+diff(G(s),s)+s = 0,
                diff(F(r,s),r$2)+diff(F(r,s),r,s)+diff(F(r,s),s$2)-diff(H(r),r)+diff(G(s),s)-r = 0
              ]

Then

pdsolve(pdesys) will return


{F(r, s) = _F2(s)+_F3(r)+(1/6)*r^2*s+(1/6)*(6*_C1*s+s^2+6*_C2)*r, G(s) = -(1/3)*s^2-(diff(_F2(s), s))-(1/2)*_C1*s+_C4, H(r) = -(1/6)*r^2+diff(_F3(r), r)+(1/2)*_C1*r+_C3}

which is a solution, albeit with quite a few arbitrary functions and constants. Provision of boundary/initial conditions will resolve many/all of these arbitrary functins/constants

It is probably worth bearing in mind that most ODEs (ODEsystems) or PDEs (PDEsystems) cannot be solved analytically. Textbooks tend to give a misleading impresion because they focus on the (very limited) cases where analyic solutions are possible

 

First 163 164 165 166 167 168 169 Last Page 165 of 207