How to specify f coefficient function for arbitrarily located point sources within a domain.
1 次查看(过去 30 天)
显示 更早的评论
I'm trying to use the PDE toolbox to model an asymmetric 2D geometry over which to solve Poisson's electrostatic equation, . The problem is, for each simulation, I will generate some number of randomly located charges within my geometry, so the charge distribution will take the form of , where and are the location of the charge, q, and A is the area of the traingular mesh element containing that charge (in general, a function of x and y). All of the documentation about creating an f-coefficient function (i.e. ) seems to only allow coding an f-function with predetermined charge locations. In other words, the f function must be of the form f(location,state), and can take no additional inputs to specify the locations of the charges. This seems like a pretty straightforward problem I'm trying to simulate. Is there an easy way to create an f-coefficient function that models point sources within various mesh traingles? Thank you!
0 个评论
回答(1 个)
Ravi Kumar
2019-8-28
If you want to use addtional arguments in computing f, then wrap the f coefficient function around the actual function that takes additional arguments:
fFcn = @(location,state) actualComputaionFunction(location,state, additionalArg1, additionalArg2)
provide fFcn as input to specify coefficient.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!