Christopher2222

MaplePrimes Activity


These are replies submitted by Christopher2222

Thanks acer for the quick refresh.  A while ago in a thread I had written answered or suggested (can't quite remember) something to do with real and imaginary parts of a fourier transform of a signal and I believe there was a reply that suggested I wasn't accounting for the imaginary part.  It was somewhat of a bother that I couldn't exactly remember what it was.  Ultimately I could not find the thread which would satisfy my curiosity.  Thanks acer for some tips. 

The link is no longer available.  The site with which the link is presented above appears no longer to support maple. 

The link is no longer available.  The site with which the link is presented above appears no longer to support maple. 

I cannot see what you have posted.  I cannot see anything but the words "Heat equation" on firefox. 

Yes, I know.  I change it and a checkmark appears on the right however the next time I enter account the old email is still there.  How do I change it so it stays with the new email?

I am without access to Maplesim for the week.  Anyone have any luck with this model?

I am without access to Maplesim for the week.  Anyone have any luck with this model?

Just a small digression.  It would be nice if the numbers on the x-axis could be rotated or angled so it does not look like they collide with each other.  When the numbers reach the 100's or 1000's there will be congestion. 

This is perhaps a suggestion for a future Maple version as the current versions do not support number rotations on the axis.

@ pseudomondo, to answer your question, to be honest I have not worked through the examples given.  I thought my example could be done easily.  Just attach a few springs and away you go but it is not that simple.  It would be good for vibrational analysis and move on to more complex models.  It sounds like you had an easy solution for it, and if so I would like to see it however Joe Riel's reply seems to suggest the solution is much more complex than you might have thought.

It is perhaps something simple.  But I think there aren't many maplesimmers to answer my question.

I use that command a lot for Maple12 (note to maple12 users that where ? exists one must use ?? to work)

Yes StringTools surgery is a neccessity for the nature of this command.  It would indeed make sense to have a command that automatically sorts data into a Table.  Of course it would have to be a new command since HTTP[Get] is not always extracting or getting data from an http address of the same format which is why StringTools surgery is neccessary.

 

Can replies in posts be organized like they are in questions?  Posts are all flatlisted, a property I detest. 

ps. Why did we follow the layout of the stackoverflow website?  It is terrible!
                    |
** edit **   ^
                 /  \
       mapleprimes developers

Question - exactly that

Post - More of a ... I have an application to present to you, here it is ... type of thing. 

       - But also (as the mapleprimes designers also intended it for) a place to invoke a conversation of topics however the primary use of it is for presenting applications.

Some people ask questions in posts which are later converted to questions by senior members where appropriate. 

More insight here http://www.mapleprimes.com/posts/89389-What-Is-The-Difference-Between-A-Post

 

(okay, bit of free time.  Here is what I have). 

The graphs were obtained from gasbuddy.com but originally pulled from the hamiltongasprices.com website.  And sorry it is .bmp file not jpg.

The general idea was to extract the image, set up the grid for the graph, determine points of interest and finally plot.  At the end I decided to plot the errors as the precision of the data is determined by how much of the bmp intervals are visible.  Picking the values to use as markers was a bit tricky, you had to find the pixel color value.  But once that was determined all the graphs were the similar on that particular website and so could be applied again and again.  One would need to determine other values for other graphs but the general idea could be applied.  In fact just now I just thought of a way to do it automatically, unfortunately these days time is hard to come by.  Regardless, here is the worksheet and test graph in the zip link.

1-29.zip


Reverse engineered graph from an image

NULL

All we are doing here is taking an image of a graph where the actual data is unavailable and making an approximation of the point values using Maple.  By no means does it fully replicate the real data but allows us to create a fairly acurate data representation that closely resembles the one presented to us.  

 

Our target graph was the 1-month average retail chart from www.hamiltongasprices.com.  This method will not work on every graph the same way, but the general idea can be applied with some modifications.

 

with(ImageTools); with(ArrayTools)

a := Read("f:/1-29.bmp")

b := ToGrayscale(a)

topcorners := []; bottomcorners := []; for i to Width(b) do for j to Height(b) do if `and`(b[j, i] < 0.9412e-1, b[j, i] > 0.9411e-1) then topcorners := [op(topcorners), [j, i]] end if; if `and`(b[j, i] < 0.3138e-1, b[j, i] > 0.3137e-1) then bottomcorners := [op(bottomcorners), [j, i]] end if end do end do

NULL

na := hfarray(1 .. 202, 1 .. 582)

Copy(b[topcorners[1, 1] .. bottomcorners[1, 1], topcorners[1, 2] .. topcorners[2, 2]], na)

NULL

Gridline intervals (grayscale value of 0.827450980392156698)

vgridlines := []; for i to Width(na) do if `or`(na[2, i] = 0, `and`(na[2, i] > .8274, na[2, i] < .8275)) then vgridlines := [op(vgridlines), i] end if end do

NULL

vgridlinesm := map(`-`, vgridlines, 1)

[0, 21, 41, 61, 81, 101, 121, 141, 161, 181, 201, 221, 241, 261, 281, 301, 321, 341, 361, 381, 401, 421, 441, 461, 481, 501, 521, 541, 561, 581]

(1)

NULL

Using our x points we will scan for our y points

ypoint := []; for i in vgridlines do for j to Height(na) do if `and`(na[j, i] > .2, na[j, i] < .45) then ypoint := [op(ypoint), j]; j := Height(na) end if end do end do

NULL

ypointm := map(`+`, -ypoint, 202)

[3, 16, 69, 66, 74, 54, 55, 42, 43, 64, 63, 61, 44, 35, 67, 106, 134, 131, 138, 141, 129, 141, 146, 146, 147, 146, 154, 161, 183, 192]

(2)

NULL

In our particular graph we read the upper and lower price values

upperprice := 138.9

lowerprice := 123.0

NULL

ypointmprice := map(`*`, ypointm, (upperprice-lowerprice)/Height(na))

gasprice := map(`+`, ypointmprice, lowerprice)

[123.2361386, 124.2594059, 128.4311881, 128.1950495, 128.8247525, 127.2504950, 127.3292079, 126.3059406, 126.3846535, 128.0376238, 127.9589109, 127.8014851, 126.4633663, 125.7549505, 128.2737624, 131.3435644, 133.5475248, 133.3113861, 133.8623762, 134.0985148, 133.1539604, 134.0985148, 134.4920792, 134.4920792, 134.5707921, 134.4920792, 135.1217822, 135.6727723, 137.4044554, 138.1128713]

(3)

with(plots)

listplot(gasprice)

 

``

gasprice2 := zip(`[]`, vgridlinesm, gasprice)

[[0, 123.2361386], [21, 124.2594059], [41, 128.4311881], [61, 128.1950495], [81, 128.8247525], [101, 127.2504950], [121, 127.3292079], [141, 126.3059406], [161, 126.3846535], [181, 128.0376238], [201, 127.9589109], [221, 127.8014851], [241, 126.4633663], [261, 125.7549505], [281, 128.2737624], [301, 131.3435644], [321, 133.5475248], [341, 133.3113861], [361, 133.8623762], [381, 134.0985148], [401, 133.1539604], [421, 134.0985148], [441, 134.4920792], [461, 134.4920792], [481, 134.5707921], [501, 134.4920792], [521, 135.1217822], [541, 135.6727723], [561, 137.4044554], [581, 138.1128713]]

(4)

dualaxisplot(gasprice2, gasprice2, gridlines = true)

 

help("dualaxisplot")

Typesetting:-mrow(Typesetting:-mo("?", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.1111111em", rspace = "0.1111111em"), Typesetting:-mi("error", italic = "true", mathvariant = "italic"))

with(Statistics)

Typesetting:-mrow(Typesetting:-mi("ErrorPlot", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("gasprice", italic = "true", mathvariant = "italic"), Typesetting:-mo(",", mathvariant = "normal", fence = "false", separator = "true", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.3333333em"), Typesetting:-mi("yerrors", italic = "true", mathvariant = "italic"), Typesetting:-mo("=", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mi("seq", italic = "true", mathvariant = "italic"), Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-mn(".07", mathvariant = "normal"), Typesetting:-mo(",", mathvariant = "normal", fence = "false", separator = "true", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.3333333em"), Typesetting:-mi("i", italic = "true", mathvariant = "italic"), Typesetting:-mo("=", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mn("1", mathvariant = "normal"), Typesetting:-mo("..", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2222222em", rspace = "0.0em"), Typesetting:-mn("30", mathvariant = "normal")), mathvariant = "normal")), mathvariant = "normal", open = "[", close = "]"), Typesetting:-mo(",", mathvariant = "normal", fence = "false", separator = "true", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.0em", rspace = "0.3333333em"), Typesetting:-mi("symbol", italic = "true", mathvariant = "italic"), Typesetting:-mo("=", mathvariant = "normal", fence = "false", separator = "false", stretchy = "false", symmetric = "false", largeop = "false", movablelimits = "false", accent = "false", lspace = "0.2777778em", rspace = "0.2777778em"), Typesetting:-mi("point", italic = "true", mathvariant = "italic")), mathvariant = "normal"))

 

nops(gasprice)

30

(5)

gasprice2

[[0, 123.2361386], [21, 124.2594059], [41, 128.4311881], [61, 128.1950495], [81, 128.8247525], [101, 127.2504950], [121, 127.3292079], [141, 126.3059406], [161, 126.3846535], [181, 128.0376238], [201, 127.9589109], [221, 127.8014851], [241, 126.4633663], [261, 125.7549505], [281, 128.2737624], [301, 131.3435644], [321, 133.5475248], [341, 133.3113861], [361, 133.8623762], [381, 134.0985148], [401, 133.1539604], [421, 134.0985148], [441, 134.4920792], [461, 134.4920792], [481, 134.5707921], [501, 134.4920792], [521, 135.1217822], [541, 135.6727723], [561, 137.4044554], [581, 138.1128713]]

(6)

nops(gasprice2)

30

(7)

whattype(gasprice)

list

(8)

NULL

``

NULL


Download reverse_graph_projec.mw

I have worked on such a project.  Getting data from a plot of a jpg graph.  Reverse engineering a graph, I called it.  I vaguely remember posting a question regarding such on mapleprimes (can't seem to find it).  However, will post worksheet shortly.

**edit add** sorry my work did not use the command getdata

First 102 103 104 105 106 107 108 Last Page 104 of 162