dharr

Dr. David Harrington

3125 Reputation

17 Badges

17 years, 356 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 professor of chemistry at the University of Victoria, BC, Canada, where 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

@nrussoniello  The rank looks OK to me. The zero pattern means that columns 1, 2, 4, and 5 are linearly independent. Columns 2 and 3 have the same zero pattern, but are independent since the first entries have different variables (e1 vs e2). Note that Maple views the rank in the general case, for example there may be specific values of the variables that reduce the rank, e.g. e1=e2, but assuming thay all have arbirary unrelated values, the rank seems OK.

Maybe I've missed something - which dependence do you think there is between columns  (or rows)?

@gawati2611 Sorry, I misunderstood your zig-zag order. But still I don't know what you want. Do you want a function that produces two indices i and j from the zig-zag order single digit, or a function that takes i and j and produces the single digit? I can't imagine what you would do with that other than just fill arrays always with the same numbers, in which case you are presumably happy with @acer's filling method.

@Umang Varshney To add to Tom's comment, the palette entry an with the same color is a__n in 1-D, and that means the n has no special significance, it just appears as a subscript; the palette entry with two colors is a[n], where the n has some special significance, e.g,, the nth entry of a Vector or list.

The same is true for the layout panel. To see what is happening, you can just use a 1-D prompt (ctrl-M) and see what happens when you click on the layout or expression entry.

If you just want to fill in row order, you can supply a list of entries. To access in row order, you can use programmer indices (in parentheses ()) provided the matrix has order=C_order.
 

A:=Matrix(3,3,[seq(i^2,i=1..9)],order=C_order);

A := Matrix(3, 3, {(1, 1) = 1, (1, 2) = 4, (1, 3) = 9, (2, 1) = 16, (2, 2) = 25, (2, 3) = 36, (3, 1) = 49, (3, 2) = 64, (3, 3) = 81}, order = C_order)

A[2,1];

16

A(4);

16

 


 

Download Indexing.mw

 

Suggest you upload a worksheet trhat produces the multiplication table, and then it will be easier to undestand what you want converted to a Matrix. Use the fat green up arrow.

@ianmccr Thanks. I figured most of the stuff out by trial and error. You prompted me to post it in the hope it might help others. It is in a suboptimal state - I had always been meaning to tidy up the code and post it, but never got the time. 

@Anthrazit  I don't have the right version to really comment specifically about your document (On your earlier document, I saw strange behaviour that I didn't understand, including the datatable extending briefly and then returning.) A long time ago, I wrote an app with datatables extending and reducing as required, and there was no problem - http://web.uvic.ca/~dharr/software/statmech/ I don't have any expectation that the size of the array and the number of visible columns or rows will automatically track each other - I always put the code to extend the array and to increase the visible columns together, and usually within a button code.

I do recall that forcing updates can sometimes be an issue, as @acer pointed out,

@Anthrazit  When I run that Document it leaves the number of visible columns at 1.

Adding the line SetProperty("DataTable0",VisibleColumns,8); at the end of the worksheet I uploaded before works consistently as I change the number of columns. I don't use document mode; maybe it is to do with that or a version issue (I'm using Maple 2017).

@Anthrazit  The Matrix A must exist first before the button is pressed, or the line 

A:=Matrix(nrows,2,A);

gives the error message.

@GPU Programmer  the *.maple files were not successfully uploaded to Mapleprimes. .maple is a workbook extesion, so maybe your files are OK with a change of extension. I posted an answer that uses text files and does work.

@ogunmiloro Remove the ";" between the proc( ...) and local testRes: (I know; it does seem wrong)

proc( ...g)  #no semicolon here
local testRes:

@Carl Love  @nm

IMO most of the problem is trying to use Maple's D notation for something it isn't suited to. It wasn't until I read Carl's reply I actually realised what the OP wanted, because that wasn't just the conversion into D notation that the OP seemed to want (they mentioned D).

And the assymmetry in D(x) cf D(y(x)) seems strange.

Certalnly some more checking would be needed, but a different notation would be better. Something like DEtools:-de2diffop and diffop2de, where a new notation Dx can be set up (used for Linear operators, but not quite what is required here).

@GPU Programmer  I think you are agreeing with me, but I'm still not clear. If you want to incorporate a user function generated when using the module, I would do it this way.

Test:=module()
  option package;
  export Lth;
  local Sqr;
  Sqr:=proc(A) A^2 end proc;
  Lth:=proc(A,B,usersqrt) usersqrt(Sqr(A)+Sqr(B)) end proc;
end module;

 

_m992441226848

Sqr is used by Lth without the user needing to know about it. The following is a user function to be used by Lth

mysqrt:=proc(x) sqrt(x) end proc;

proc (x) sqrt(x) end proc

Test:-Lth(3,5,mysqrt);

34^(1/2)

 


 

Download module.mw

@Hnx  Your mixed differential and algebraic equation (DAE) system can be solved by Maple's dsolve command - just give the two equations to dsolve and it will use a special DAE solver.

First 11 12 13 14 15 16 17 Last Page 13 of 30