use poisolv with numerical matrix for the right hand side

10 vues (au cours des 30 derniers jours)
Luc Rébillout
Luc Rébillout le 30 Juil 2015
Hello,
I'm trying to solve a problem in a way that is very similar of the example given in the documentation : Poisson's Equation on Rectangular Domain Using a Fast Poisson Solver
My problem is very similar and I managed to complete all the steps but instead of an analytical expression (3*x.^2 in the example) for the forced term f I would like to use a numerical matrix obtained from experimental data.
I tried passing it to poisolv directly but I get an error 'Matrix dimensions must agree'.
How can I specify my own right-hand side of the equation matrix ?
Thank you for your help

Réponses (1)

Luc Rébillout
Luc Rébillout le 30 Juil 2015
I eventually found an answer myself. A function forcing(x,y) has to be written and whatever variable containing the numerical values has to be set as a global variable. Then the MxN numerical matrix has to be transformed into a NumberofNodes-1 array where each line is the value (or interpolated value) of the numerical data at each node.
HOWEVER : I still have difficulties to pass an array of numerical values as Neumann Boundary conditions.. any ideas ?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by