Christopher2222

MaplePrimes Activity


These are answers submitted by Christopher2222

A number of ways exist

a:=Matrix(4,7,rand(1..25)):

op(a) #extracts information about the variable a, the first two elements carrying the size information extracted by op(a)[1]; and op(a)[2]; or op(a)[1..2]; however you prefer.

b:=rtable_dims(a); #will also extract the dimensions 
               b:= 1..4 , 1..7
from which you can extract the value you wish using op

op(b[1])[2];
                      4

op(b[2])[2];
                      7

with(ArrayTools):  #package contains tools for doing exactly what you ask
Size(a);
             [ 4  7 ]

There may also exist other ways.
             

 

I think I see.  So do you mean like this?

a:=solve ( ode2 , { diff(phi(z),z) } ); # notice the extra brackets around the diff part

The brackets will include the diff part on the left hand side of your answers which you want.  Of course you'll end up with brackets around your a[1] ... so op(a[1]) will remove them for you if you want. 

Not too sure on the order, usually the order is smallest to largest but it's also ordered lexicographically.  Someone else could present a situation that might be ordered differently.  I suppose you mean with changing initial conditions on the ode?  By running the program would you still get the same order?  Not exactly sure what you mean there. 

okay looking further into it I managed to almost figure it out .. I think

showstat(SHA)  views the top level part of the code

whithin showstat(SHA) we can see that it points to deeper levels of the code such as SHA1, SHA2 and ModuleApply which we can show by using

showstat(SHA[SHA1]) etc..

print(SHA[SHA1]) reveals a little more slightly different info as to what lies in the code such as Initialize, ModuleApply and ProcessChunk which we can further reveal by doing

print(SHA[SHA1][ProcessChunk]) etc...

I think I covered it but any other insights would be most helpful.

One way is to use the same method you would in choosing the first element in a list.

For example

a:=solve(x^2+4x-2,x)
                                    a:=-2 + sqrt(6) , -2 - sqrt(6)
a[1]
                           -2 + sqrt(6)

 

 

For what it's worth, to do this without loading any packages.  You could do this

Extracting row 3

A[3,..]

Extracting column 3

A[..,3]

 

Works for me in Maple 12

You probably don't have your Maple tabs opened in new windows.  And make sure you aren't mixing any two  combinations of crtl-alt-shift by mistake.  Sorry I had to say that, but it's been done before.  Just eliminating the possibilities, even the simplest of ones, but it should work.

 

Perhaps this is what you seek? 

Analysis of an Aircraft Turbojet - http://www.maplesoft.com/applications/view.aspx?SID=3768 

@erik10 

It is odd that specifying a range too large reduces the number of solutions found.  It is almost as if we should specify a higher numpoints value which isn't allowed anyway.

Why do we need to specify a range?  Leaving out the range, Maple finds all 4 solutions.

If you mean the standard maple gui interface, and initially typing it in you can't delete say a middle row of piecewise function and get the bracket to shrink.

You need to go to the very last condition in your piecewise (or your graphical Matrix insert) at the end and backspace to shrink your paranthesis on the piecewise or bracket on the Matrix.  Other than that I don't think there exists a simple set of shortcut keys to delete a row.

 

Higher spacestep values are needed for piecewise boundary conditions.  In this case here spacestep=500 is needed for a comparable plot to the one shown by Matlab in the slide presentation.

It could be that I need to include a method type in the pdsolve? 

** edit - Actually I didn't take spacestep far enough.  spacestep=1/80 produces a nice smooth graph

taskkill didn't do anything for me in Win XP.  Maybe that's only for Windows 7?

tskill works in xp but only partially and seems to have a more limited use.  If you know the process id number PID you can stop the process but that only has an effect of kernel connect loss.  On top of that you need to know the number and it's not clear on the windows task manager which mserver is associated with which window you want. 

system("tskill maple");  #completely closes maple

system("tskill notepad")  #closed all notepad files

I tried to close a single notepad window in hopes to find out how to close one maple window
system("tskill /id:test3.txt - Notepad")  # but this closed all notepad windows including the test2.txt and test1.txt I had open anyway

system("tskill mserver"); only kills the current session kernal connection but not the window

BTW a roundabout might work if one could programmatically open into a new maple worksheet and programmatically close the one you just left.  However I have no idea how to do this.

If a is your Matrix you can select a single row, the third in this case, using a[3,..]

With a little modification to that, you can write your own little "RemoveRow (rr)" procedure to delete the row of a Matrix.

rr:=proc(a::Matrix,n)
  a[[1..n-1,n+1..op(a)[1]],..]
end proc:

rr(c,5) #removes the 5th row of the Matrix c

 



My initial attempt to the steady state solution to the heat distribution using a piecewise boundary condition for the given example.  It appears Maple produced some unwanted waves at the piecewise boundary.

 

 

Compared to a view in the slide presentation I saw

 

 

A possible modification to the maple code to partially achieve what was obtained by the software used in the slide presentation.  Not the most direct approach nor I believe too accurate but the point was to achieve what the presenter of the slide show displayed.

 



Download heat_equation_modell.mw

There are still slight waves in the soltuion but it is much better than the first.  I'm not sure it is the right way to go about it but for steady state solutions it is probably okay.

First 28 29 30 31 32 33 34 Last Page 30 of 48