# Equation Problem

 Register Blogs Members List Search Today's Posts Mark Forums Read

 September 26, 2007, 09:36 Equation Problem #1 Velan Guest   Posts: n/a Hi I am having the data which containing x,y,z coordinates for different i,j,k. My problem is i want to find the distance between two points and find the total distance along one direction(i or j or z direction). for example i am adding all the values of "i" and store it in "a" a=0 do i=1,50 a=a+i enddo Now "a" will have the total value of all "i" Like above example i written a equation for calculating total distance. In my case V1=x,V2=y,V3=z {distance}=SQRT((V1(i+1,j,k)-V1(i,j,k))**2+(V2(i+1,j,k)-V2(i,j,k))**2+V3(i+1,j,k)-V3(i,j,k))**2) But it not working well. Can you help me to sort it out ? Velan

 September 26, 2007, 16:30 Re: Equation Problem #2 Ananda Himansu Guest   Posts: n/a I take it you are approximating arc length in i, j or k directions. Your expression lacks a left parenthesis before the V3(i+1,j,k) term, but other than that, everything looks okay. Why do you say it is not working well?

 September 27, 2007, 07:54 Re: Equation Problem #3 Velan Guest   Posts: n/a can you please check the below link(Zoom it for clear vision) http://homepages.iitb.ac.in/~vadivel...nline-skel.jpg Above figure shows my geomety, where i and k are constants, and j varying from "a" to "e". http://homepages.iitb.ac.in/~vadivel...ine-z-temp.jpg Above figure shows the plot between z-axis VS temperature. Then i added the equation {distance}=SQRT((V1(i,j+1,k)-V1(i,j,k))**2+(V2(i,j+1,k)-V2(i,j,k))**2+(V3(i,j+1,k)-V3(i,j,k))**2) http://homepages.iitb.ac.in/~vadivel...tance-temp.jpg Above figure shows the plot between distance VS temperature. In this figure line should come almost straight. But here its coming strange. I not able to figure it out where the problem is ? Thanks Velan

 September 27, 2007, 12:32 Re: Equation Problem #4 Ananda Himansu Guest   Posts: n/a Sorry, but I am unable to view those jpg files. My browser reports some "Invalid Gateway" error. Could be some firewall/security related issue. Perhaps someone else would be able to view your files and help.

 September 27, 2007, 13:36 Re: Equation Problem #5 Velan Guest   Posts: n/a Hi Himansu, Due to some technical reason, today our homepage server was down. It will be bootup soon. I will intimate you after boot or i will try someother way(can you give me ur mail id. I will send that picture) Thanks Velan

 September 27, 2007, 17:10 Re: Equation Problem #6 Ananda Himansu Guest   Posts: n/a I will try your links again tomorrow. I prefer not to use e-mail, thanks.

 September 27, 2007, 22:25 Re: Equation Problem #7 Velan Guest   Posts: n/a Hi Its working now. Can you please check it !

 September 27, 2007, 22:26 Re: Equation Problem #8 Velan Guest   Posts: n/a Hi I am sorry still its not working

 October 1, 2007, 11:39 Re: Equation Problem #9 Ananda Himansu Guest   Posts: n/a okay, I can see the jpg files now, the server appears to be up now. You are probably just missing the "accumulator" variable 'a' that you mentioned in your first post. Your equation should be distance = 0 do j = 1, jmax-1 dssq = (x(j+1)-x(j))**2 + (y(j+1)-y(j))**2 + (z(j+1)-z(j))**2 distance = distance + SQRT(dssq) end do From your second jpg plot, the distance should vary from 0 to at least 0.3, whereas your final jpg plot (of T2 vs distance) shows T2 in the right range, but distance ranging only from 0 to about 0.015 (which is more the order of magnitude of the increments in arc length than their sum), and T2 appears a multivalued function of "distance", which leads to my diagnosis of probable cause.

 October 1, 2007, 21:32 Re: Equation Problem #10 Velan Guest   Posts: n/a Yes, you are correct. But how can i write equation for that formula in tecplot. I though earlier about the accumulator. But i dont know how to write it in tecplot.

 October 2, 2007, 17:14 Re: Equation Problem #11 Ananda Himansu Guest   Posts: n/a Quite difficult to do in Tecplot. If it can be done at all in Tecplot, it would be using a macro with a loop and loop-dependent equation LHS range specification and equation RHS loop-dependent value-blanking. Would also be computationally highly inefficient. It is intimidating even thinking about it. Why not write the data out to a file, add a new distance variable using simple Fortran loops, and read it back in to Tecplot for display?

 October 2, 2007, 17:20 Re: Equation Problem #12 Ananda Himansu Guest   Posts: n/a Alternatively, Tecplot will allow you to "Extract Data" along a polyline. You could extract along a polyline that approximates the line you have in mind, and specify that Tecplot include a "distance" variable when extracting the data into a line zone. This option pops up in a dialog box when you extract data.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Jeff67 Main CFD Forum 0 March 27, 2011 11:23 alundilong OpenFOAM Programming & Development 0 December 23, 2010 14:53 Frank Main CFD Forum 5 March 14, 2007 11:56 Francisco Main CFD Forum 4 August 5, 2004 20:04 Reza Main CFD Forum 0 August 27, 2003 13:09

All times are GMT -4. The time now is 23:18.