Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'grid cells, ray paths and matrices' topicStudent Support Forum > General > Archives > "grid cells, ray paths and matrices"

Next Comment >Help | Reply To Topic
Author Comment/Response
05/02/12 07:48am

I'm working on a borehole problem for seismology. As an example, I have a 70x80 meter grid through which a few rays travel, and each grid cell is 10x10 meters. I'm told at which depth each shot is fired in one borehole and at which depth the receiver picks up the ray data in the other borehole. My final result should be a 7x8 matrix for each ray, which tells me the length of the ray in each respective cell and produces a zero for any cell that the ray doesn't go through.

Ideally, I'd like to set up a grid in Mathematica and program it to evaluate two line equations (z=mx+b and x=(z-b)/m ) along the x and z grid lines for each cell to determine the coordinates that the line goes through. Then I need to tell it to calculate the length between each coordinate in such a way that it propagates the cell above or to the left of the second coordinate with that length (eg: If I have a 7x8 grid, and the line goes through (10,21) and (15,30), Mathematica should put length 10.3 in cell #16, and that also means cell #22 would be zero).

The first issue I have is that I don't even know where to begin with the grid cells. In early versions of this problem, I ended up using a lot of brute force (copying and pasting, plugging zeros in myself, etc) to solve the problem for 5 rays in a 7x8 matrix or 4 rays in a 4x4 matrix. I've attached the code I put together for one of the early assignments as an example of my brute-force method. But now we have to do this for 81 rays, and multiple grid cell sizes, so I have to automate it better. That leads to my second problem. I'm working with a long list of shot/receiver data now, so I need Mathematica to be able to solve the two line equations using lists for calculating the slope, and as the range for solving for x coordinates (eg: This is an equation I've been trying to run, but I can't get mathematica to recognize that it needs to run through iterations of the equation using a range of elements from two lists as input for z...

p[z_] = (z + Subscript[C, zs])/((Subscript[C, zs] - Subscript[C, zr])/
N[Table[p[z], {z, Subscript[C, zr], Subscript[C, zs], 30}]] )

Again, an example of my brute-force method is attached. The ultimate goal is to take all the ray paths and create the G matrix toward the end of the attachment. If someone can help me automate this better, then I don't need to worry about the grid above, but I have a feeling it's easier to create the grid cells (I just don't have a clue how). Regardless, if anyone can help me get this working you will have my undying gratitude and be my hero forever. I cannot begin to tell you how many weeks (and maybe months) I've lost pouring over Mathematica tutorials trying to figure all of this out.

Thank you!!!

PS. Please let me know if you need clarification. Also, for what it's worth, the G matrix that I'm requesting help with is necessary for doing my assignment, but it is not the assignment itself.

Attachment: HMWK4_#1.nb, URL: ,

Subject (listing for 'grid cells, ray paths and matrices')
Author Date Posted
grid cells, ray paths and matrices aconn31 05/02/12 07:48am
Re: grid cells, ray paths and matrices Bill Simpson 05/03/12 8:43pm
Re: grid cells, ray paths and matrices toen 05/04/12 09:58am
Re: Re: grid cells, ray paths and matrices aconn31 05/04/12 6:19pm
Re: Re: grid cells, ray paths and matrices aconn31 05/05/12 3:59pm
Re: Re: Re: grid cells, ray paths and matrices toen 05/07/12 03:05am
Next Comment >Help | Reply To Topic