Closed dirypan closed 11 months ago
Hi, thanks for trying the package!
For accessing any point in the medium, you can always access as an array the medium variable. The correct way of accessing it should be:
mediumODE = quote
if @mediumInside()
dt(p) = @∂2(1,p) #Diffusion inside
elseif @mediumBorder(1,-1)
p = p[2,j] #Newman (reflective) boundaries on the borders
elseif @mediumBorder(1,1)
p = 0 #Dirichlet (absorvant) boundary
end
end
However, I am seeing there is a bug on the code as it overrides the '[2,i]' indexer. I am correcting it now. I will let you know when it is corrected (hopefully today or tomorrow should be done).
I have solved the bug and updated the documentation @dirypan
I have made a new version of the code that solves that and other problem. Both are tagged in the new release of the program.
Let me know if this have solved your problems.
Thank you @gatocor ! I think it solves the problem, now I can access the neighboring medium array by
p = p[2,i2_]
Thank you again for developing this great tool. Here is the experiment and model I am trying to simulate with the tool, I will refer to this package if I successfully build some new understanding of the model.
In the tutorial of the documentation, Defining an ABM model has a diffusive medium example
I have two questions related to the example since I also want to implement a diffusive system.
where "secrete" is the secretion rate of one agent. This is consistent with units and rescaling of dt,dx,dy.
This doesn't make sense to me, and if I run this code with evolve it will raise an error. I do want to implement a reflective boundary condition, but I don't know how to access neighboring medium grid points so I can manually write down the condition like here