dharr

Dr. David Harrington

8235 Reputation

22 Badges

20 years, 342 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are replies submitted by dharr

You have numpoints 100000 for the plots, which is probably why I had upload issues. This is only for making more points in the plots to make it look nice, so surely you don't need more that about 200, and probably the default 49 is OK.

Use the green up arrow to load your worksheet

@Preben Alsholm If you open a new worksheet, create code and then run, currentdir() still points to mapledir. But if you save the worksheet and then reopen it, it will point to the same directory as the worksheet, worksheetdir. I guess I have the habit of keeping/creating files where the worksheet is.

Of course the OP can replace the whole filename with whatever they want.

If you upload your worksheet with the green up arrow, then someone can take a look at it without clicking on a strange website.

Note that D has special meaning in Maple, use "local D;" to redefine it as just a variable or (better) use a different name.

But on the face of it the solution looks OK - what makes you think it is wrong?

please upload your worksheet using the fat green up arrow, then someone can check it. 

@zia I haven't heard about that method but it sounds like that is outside the scope of a Maple question unless you have started a Maple worksheet you need assistance with.

@acer  Fair enough. It just seemed to me that the effort to work out many terms of the sequence exceeded the work to figure out the (mixed) recurrence, which somehow was a more logical way to approach the problem.

@Ramakrishnan The 621 points is "pixels" in the documentation for DocumentTools,Tabulate - see also DocumentTools,Table. If you make a table that extends over a page, then page break none seems to just kill the rest of the table at the end of the page, allow within cells allows half a cell to be on one page and half on the next, as you see and don't want, and allow between rows (in 2017.3) finishes a row nicely and then starts the next row on the next page, which is probably what you want.

In general , .pdf output, not just with Tables is never quite what you want, and I haven't spent too much time tryng to control it.

@mmcdara  I also played around a bit and got frustrated before I found the help page. I didn't think too closely about the example other than the fact that you have to prevent full evaluation in both Explore and odeplot, and still be able to change the parameter in the solver. 

@Zeineb In Maple 2017.3 I also don't get an answer. But if I use:

bc[4] := f(L, y) = 0;

Then I get the same answer as @ecterrab but with L instead of _c5(n).

@HaHu  My only other suggestion would be to start from a much simpler model for which you can get a solution, and then gradually add complexity. 

@HaHu If you look at the des you have a tough problem - there are coefficients around 1e-6 along with others much larger. The solver works best with things of the order of 1 so you may want to scale the problem. One way to solve this error is to give an approximate solution as a starting value or use continuation. Maybe if you simplify the system setting the small terms to zero and can solve that, then you can look at what the solution looks like and suggest an approximate starting solution.

Infection_model.mw

@HaHu This is hard to diagnose without the worksheet, which you can upload with the big green up-arrow.

@wswain It's a good point. Using op and elementwise operators (the ~ thing) tends to make Maple unreadable for those who don't use it much. So I would use RowDimension rather than its op equivalent. There are also efficient ways to do things (like map) that avoid using loops. But you can write more "fortranlike" code with loops. You could for example fill a matrix with nested do loops. There is perhaps a tendency on Mapleprimes to suggest short and clever but less readable answers.

(And to answer your question on dynamic Arrays/Vectors/Matrices, you can dynamically extend these by using programmer indices - see ?Indexing Arrays)

@wswain  This might answer some of your questions about @tomleslie 's response.
 

restart;

with(LinearAlgebra):

A:=Matrix([[1,2],[3,4],[5,6]]); #list of lists Matrix construction

_rtable[18446744944491233278]

Matrix([A[1,..],A[2,..],A[3,..]]); #three rows are just next to each other

_rtable[18446744944491236158]

Matrix([A[1,..],A[2,..],A[3,..]],scan=columns); #list Matrix construction - rows below

_rtable[18446744944805409126]

Dimensions(A);
op(1,A); # same thing

3, 2

3, 2

RowDimension(A);
op([1,1],A); # same thing - first op of op(1,A);

3

3

n:=2;
`if`(n=2,A[2,..],"smile");
`if`(n=2,A[2,..],NULL);
B:=Matrix([A[1,..],`if`(n=2,A[2,..],NULL)],scan=columns);

n := 2

_rtable[18446744944805411526]

_rtable[18446744944805404910]

Matrix(%id = 18446744944805405870)

n:=26;
`if`(n=2,A[2,..],"smile");
`if`(n=2,A[2,..],NULL); # nothing so no output
B:=Matrix([A[1,..],`if`(n=2,A[2,..],NULL)],scan=columns);

n := 26

"smile"

Matrix(%id = 18446744944805407670)

f:=x->x^2; #squaring function (procedure)

proc (x) options operator, arrow; x^2 end proc

f(3);

9

map(f,A); #apply to every entry
f~(A);    #same thing

_rtable[18446744944805402254]

Matrix(%id = 18446744944805403574)

 


 

Download MatrixNotes.mw

First 72 73 74 75 76 77 78 Last Page 74 of 85