2D Parabolic heat equation: How to I detect distance to a circle boundary on rectangular grid?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jonathan Gundorph Jansen
le 29 Jan 2018
Réponse apportée : KSSV
le 29 Jan 2018
I'm having a problem where i want to solve a 2D parabolic heat equation on a rectangular grid with a hole in the middle (circle with curved boundaries).
I have a scheme that applies to the solution of every point on the grid,(see attached file scheme.jpg) but I'm unsure how to detect the distance to the neighboring problematic grid points (For example, when a grid point's neightbor is inside the circle, or on the circle boundary, the distance to the circle boundary would be less than the usual distance of 1).
Please look at my attached picture to see an illustration of the problem. Problematic points are denoted in "red". The "coordinates" for each point is the matrix index for each point of alpha and beta.
So in MATLAB I want to make a code that somehow detects the value of alpha and beta for these problematic grid points next to the circle boundary. Can anybody give me a hint of where to start? I'm unsure how to approach and code this.
Best Jonathan Gundorph
0 commentaires
Réponse acceptée
KSSV
le 29 Jan 2018
Two options:
1. Read about inpolygon. If you have the circle coordinates, you can get the indices of points lying inside the given circle.
2. Read about knnsearch. If you specify the distance i.e radius of circle and it's center..you will get the indices of all the points lying at a given distance.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Mathematics and Optimization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!