tsunamiBTP

292 Reputation

9 Badges

15 years, 172 days

MaplePrimes Activity


These are replies submitted by tsunamiBTP

@John Fredsted 

You are correct.  I incorrectly thought the STEP function becomes 1 @ t >= -T instead of  t<=-T.  Thanks for clarifying the convention.  With that clarification I was able to correct my code.

@Kitonum 

Yeah, if you are only evaluating to 3 significant figures then a P(k,t) might stay constant for small intervals in time; hence, a more jagged appearance when viewing P(k) vs t.

@Kitonum 

Plot the results of each matrix against time, which is the 1st column of each matrix.  There is a WIERD numerical oscillation and offset associated with your output as opposed to mine.  You might question the significance of this discrepancy, but the solution is analytical.  So I do not understand the discrepancy in the output especially since the time step is identical in both cases?

 

@Kitonum 

THANKS, I used the := for the assignments for T, tau, & N & not for k.  What a blunder.

@Preben Alsholm 

I noticed some numerical oscillation in Kitonum's code which got worse for higher k values.  I had the EXACT solutions for specific harmonics.  So ro a single harmonic say k = 50 I simply summed from 50 to 50 instead of 1 to 50 so that Kitonum could correct his code.  I was not sure why his code had that wierd oscillation and how to correct it.

@Kitonum 

Check the link below.  I found a flaw in your code, but I do not know how to fix it.  I hope you are able to do so.  P(k) is a pressure profile for a specific k value.  You employed a nested seq() command to generate P(k=1 to 100).  The 2nd Matrix command I included generates P(k=5, 10, 20, 50, 100, 200, 500).  This is the correct solution for those specific k values.  How can the 1st case be corrected or the 2nd case modified to generate P(k= 1 to 100)?

untitled5.mw

 

@Kitonum 

You have a nested seq command?  This seems to work like a nested FOR loop?

@tomleslie 

"As a side observation, your original worksheet uses the term matrix() rather than Matrix(), The former has been depreated for a very long time. Unless you are using a really old version of Maple, I suggest you avoide using deprectaed functions"

Using Matrix removed the problem with the export tool.

Thanks

@tomleslie 

That worked well, but when I right click the matrix the option to export does not appear.  However, if I save, close, & reopen the worksheet I can then right click the matrix & the export tool appears.  If I refresh the worksheet & execute the operations again the export tool does not appear.  I have MAPLE 12.  Is that a BUG or do I need to execute the export matrix via command instead of right click?

@tsunamiBTP 

Reformatted tom leslie file to more familiar style for myself.

numData.mw

@tomleslie 

AHH, I found the Tab delimited option.  I think I am good to go.

 

thnx tom

@tomleslie 

This seems to work better, but how can I now export the data to .csv file or MATLAB?  I tried the Language Conversions tool, but simply got the error:

Error, (in CodeGeneration:-Matlab) invalid input: CodeGeneration:-Translate expects its 1st argument, x, to be of type {boolean, list, `module`, string, algebraic, procedure, moduledefinition, array(algebraic), rtable(algebraic)}, but received Matrix(402, 4, {(1, 1) = t, (1, 2) = terms = 10, (1, 3) = terms = 20, (1, 4) = terms = 50, (2, 1) = 0, (2, 2) = .4047964254, (2, 3) = .4505688679, (2, 4) = .4797423946, (3, 1) = .1, (3, 2) = .4335357093, (3, 3) = .5237749893, (3, 4) = .6845692210, (4, 1) = .2, (4, 2) = .4602981225, (4, 3) = .5903301905, (4, 4) = .8383326989, (5, 1) = .3, (5, 2) = .4847673203, (5, 3) = .6477263105, (5, 4) = .9157305918,...

Do I need to get rid of the string variables or is there an easy way to export to a .csv file?

 

@Kitonum 

This seems to work to some extent, but I cannot seem to access the data for op([1,2],P).  See attached:

untitled4.mw

Is the plotsdisplay not supported by the command op?

I evaluated the roots of the resulting equation, and they pretty much coincide with roots z(1,1), z(1,2),z(2,1),z(2,2),z(3,1), & z(3,2) unless K becomes excessively large.  If the equation is manipulated to solve for K then an equation appears describing the possible trajectories of s about the z loci to satisfy a specific K.  Is this the same thing as a NICHOLS plot?

Greatly appreciate additional insight

@Carl Love I seem to have it working OK given your input

First 7 8 9 10 11 12 Page 9 of 12