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!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/234763/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/234764/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/234765/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/234766/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/234767/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/234768/image.png)
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!