tomleslie

13876 Reputation

20 Badges

15 years, 182 days

MaplePrimes Activity


These are replies submitted by tomleslie

The variable 'gamma' is used in the definition of the expression 'R0'.

So far as I can tell, 'gamma' is never given a value, so your fsolve() will always fail.

I don't think hat you can use GenerateMAtrix in  any meaningful way

I really have no idea whatyour are trying to achieve, but the attached will allocate entries to an Array f[i.j], and subsequently convert this arrya to a matrix. If this isn't what you want then you are going to have to get a lot clearer abut what you are trying to achieve

matgen3.mw

refers to the damp soggy mess existing within your skull - also known as a brain. So "apply wetware" means think.

Since you have never given an example function f(z) or g(z) which "fails" - asking for a line number in showstat(asymptt) which "fails" is pretty pointless

The one thing you have to try to accept is that some functions do not have an asymptote. Therefore when Maple does not return an asymptote for such a function - this is success, not failure: think about it!

I also respectfully suggest that yuo re-read my original post very carefully

I'm with DSkoog on this: just go to the Maple download page referenced at

http://www.mapleprimes.com/posts/208353-Maple-20171-Update

and download from fresh. This *ought* to be way easier than trying to figure out your windows+firefox configuration

and assuming that you have not done any kind of "customisation", then the "downloads" directory will probaby be at either

C:\Users\Default\Downloads, or
C:\Users\Public\Public Downloads

You may have reconfigured where your 'default' download directory is. This is generally a setting within your Web browser, so determining the location depends on whether you are using Firefox/Chrome/IE/whatever. But in whichever browser you use, it ought to be one of the "first" entries on a "Tools" or "Preference" page

Might be easier to go to the link given above and perform the download process again!

 

Check the comments I have added in the attached to see whether your code *actually* does what you want

matgen2.mw

Go to your Maple installation directory (probably" C:\Program Files\Maple 2017", but might be "C:\Program Files\Maple 2017 (x86)" ).

This directory should contain installation log files - eg mine contains

Maple_2017_Install_2017_05_26_09_14_24.log

Maple_2017_Install_2017_06_29_09_07_41.log

The first of these is my inbstallation log for Maple2017.0, which I did on "2017_05_26" at "09_09_14_24" (American date/time form). The second of these is the installation log for Maple2017.1, which I have just performed - hence date/time field 2017_06_29_09_07_41.

These are simple text files, and in my case the last couple of lines in the second one are

Installation completed
Log finished 06/29/2017 at 09:08:12

So check that you have two installation logs, that the date stamp on the second is roughly correct (ie todays date) and that the log file itself ends with the "Installation completed" message.

If this second log file does not exist, then the download may be in your Downloads directory, waiting for you to run it manually

If

Since you do not supply the function of interest, and your definition of the plotting conditions is ambiguous (at best), I can only provide general suggestions

  1. It is possible in a plot() command to define plot ranges which are functions of other ranges - although a little experimentation convinces me that this capabilty is somehat limited - and you want a rather 'complicated' definition of valid ranges
  2. A better solution is probably to 'define' the function you want to plot using piecewise(). This will allow you to define the function for pretty much any combination of independent variables. Any combination which you don't want to end up being plotted would just be identified as 'undefined'

so obviously no numeric solution is possible.

~Once you fix this, you can go back to fixing the problems I described in my previous post

Still too many logical/syntax errors for me to get abywhere. Suggest you read the following very carefully. Then submit an executable worksheet with all of the obvious syntax/logical errors corrected

pdeProblem.mw

but only by playing with some of the dsolve options - in particular by increasing 'abserr' to a value somewhat higher than I would like, given the values of coefficients, dependent and independent variables in the original problem

See attached

odeProb.mw

  1. You have a system of  four ODEs containing six indeterminate functions f(eta), g(eta), h(eta), j(eta), phi(eta), theta(eta). The first stage in numerical solution of an ODE system is convert it to a first-order. In order to do this you need to have as many equations as there are indeterminates
  2. Your ODE system is order 3 in f(eta), order 3 in g(eta), order 2 in h(eta), order 2 in j(eta), order 1 in phi(eta),and order 1 in theta(eta): so you are going to need 3+3+2+2+1+1=12 boundary/initial conditions. You only have 10
  1. In the code you supply, alpha, beta[2], beta[3], and omega[0] are undefined - so no-one can run your code to reproduce the error. VAlues for these parameters are exxential
  2. Your first boundary condition (D[2](A))(z, 1), is not really a boundary condition since it is not given a value. (I suppose Maple *might* assign it to zero, but I wouldn't like to bet on it, so you probably shouldn't do it
  3. So far as I am aware Maple's numeric PDE solvers do not handle complex functions. The normal method to get around this is to write the indeterminate function as an explicit sum of real and imaginary parts , ie A(z,t)=Ar(z,t)+I*Ai(z,t). Then take real and imaginary parts of the resulting equation to produce two 'real' equations. Split the boundary conditions in the same way. Then solve the resulting system

I have absolutely no problem with Carl's response - but it avoids the primary issue?

The code modification suggested by the OP (and explained by Carl) will change the entries in the passed array, but not the indexing. So I fail to see why making this change causes the

Error, (in compiledOGi) array index out of bounds

to disappear.

The attached file runs the OP's original code with the procedure uncompiled and then compiled. The former executes, but thelatter errors with index out of bounds.

It then runs the OP's modified code: this modification does not seem to affect any aspect of array indexing, but now both the compiled and uncompiled versions execute, and provide the same answer. The answer is incorrect/meaningless, but that is not the point. Why does a code change which only affects array entries remove an error array bounds??

compilerIssue.mw

PS this problem may (or may not) be related to ProjectEuler problem 46. I resurrected my original code for this problem from when I was teaching myself Maple programming. My code runs (uncompiled) in ~150mS, which is well within ProjectEuler timing limits, so I'm really not sure why the OP wants a compiled version!

on 64-bit Win7 running 64-bit Maple 2017.

Cannot replicate Markiyan's comment about the second version running "much faster"


 

restart;
pde:=diff(u(x,t),t)=k*diff(u(x,t),x$2);
bc:=D[1](u)(0,t)=0,D[1](u)(L,t)=0:
assume(L>0):
ic:=u(x,0)=piecewise(0<x and x<=L/2,0,L/2<x and x<L,1);
CodeTools:-Usage(pdsolve([pde,bc,ic],u(x,t)));

pde := diff(u(x, t), t) = k*(diff(u(x, t), x, x))

 

u(x, 0) = piecewise(0 < x and x <= (1/2)*L, 0, (1/2)*L < x and x < L, 1)

 

memory used=209.25MiB, alloc change=144.59MiB, cpu time=2.18s, real time=2.08s, gc time=218.40ms

 

u(x, t) = Sum(-2*sin((1/2)*Pi*_Z2)*cos(_Z2*Pi*x/L)*exp(-k*Pi^2*_Z2^2*t/L^2)/(Pi*_Z2), _Z2 = 1 .. infinity)

(1)

restart;
pde:=diff(u(x,t),t)=k*diff(u(x,t),x$2);
bc:=D[1](u)(0,t)=0,D[1](u)(L,t)=0:
assume(L>0):
ic:=u(x,0)=piecewise(0<x and x<=L/2,0,L/2<x and x<L,1):
ic:=convert(ic,piecewise,x):
CodeTools:-Usage(pdsolve([pde,bc,ic],u(x,t)));

diff(u(x, t), t) = k*(diff(diff(u(x, t), x), x))

 

memory used=207.84MiB, alloc change=115.57MiB, cpu time=2.04s, real time=2.01s, gc time=109.20ms

 

u(x, t) = Sum(-2*sin((1/2)*Pi*_Z2)*cos(_Z2*Pi*x/L)*exp(-k*Pi^2*_Z2^2*t/L^2)/(Pi*_Z2), _Z2 = 1 .. infinity)

(2)

 


 

Download PCWissue.mw

First 118 119 120 121 122 123 124 Last Page 120 of 207