Hello, Lyla Jim;

I am also a complete FiPy newbie, and want to simulate diffusions and examine them at different times. Here's my *very simple* solution, added to the example file in FiPy-2.0.3/examples/diffusion/mesh1D.py. (Obviously getting the values from TSViewer is better, but maybe this is helpful.)

timeSinceStart = 0

def TimePasses(time):
    '''run eqX for the modeled amount of time, print out phi'''

    steps = ceil(time/timeStepDuration)
    for step in xrange(steps):
        eqX.solve(var=phi, boundaryConditions=BCs, dt=timeStepDuration)
globals()['timeSinceStart'] = globals()['timeSinceStart'] + steps*timeStepDuration
    viewer.plot()
    print 'Values of \phi at time ', timeSinceStart, phi


TimePasses(30)
TimePasses(30)
TimePasses(30)



&C
On Apr 9, 2010, at 9 Apr, 2:23 AM, Lyla Jim wrote:


Hi, Daniel Lewis
thank you for discussing that issue with me, i am glad for your comments. as i've mentioned i am quite new for Fipy, it was just my idea but i don't know if it was silly thought of mine. >>Is it possible that you can just run the simulation forward in time and then >analyze the resultant output? For example, at each time step you can print >the "time" the file was generated and all the phi values and the x,y values
>as Jon suggested.

i don't know exaclty if it is possible to run the simulation forword in time and then analyze the result output
but it was exaclty what i want to do

>You can then plot the value of phi at each x,y position as a function of time. >You could then interpolate the values if you didn't get the exact phi or t you
>wanted, yes?
yes that is exactly what i wanted, but i don't know how to get that with correct and good way. maybe that is just few more lines of code to alanysis the o differently that the TSVViewer, as you have suggested, becasue TSVViewer give me numbers about "x.y.phi" but i wanted to have the numbers for time also, i have no idea for how to write the code to print the time together with that ,since i am quite new to fipy i couldn't handdle it.
i also would be happy discuss this more.
thanks again for your comments and thanks in advance for more discussion.
cheers
             Lyla





Reply via email to