Group Abstract Group Abstract

Message Boards Message Boards

2
|
11.2K Views
|
6 Replies
|
8 Total Likes
View groups...
Share
Share this post:

Help with NDSolve`FiniteDifferenceDerivative

Posted 11 years ago
POSTED BY: Alan Lewis
6 Replies
POSTED BY: Daniel Lichtblau
Posted 11 years ago

Thanks, Daniel. Is there a simple way to map your output to an fdd matrix?

POSTED BY: Alan Lewis
POSTED BY: Daniel Lichtblau
Posted 11 years ago

Thanks, Daniel -- that's perfect and solves my problem.

POSTED BY: Alan Lewis

You can use (for whatever dimension you like) where for 2D, h = {hx,hy}, n = {nx,ny}

zeroBoundaryLaplaceMatrix[h_List, n_List] /;  Length[h] == Length[n] := 
Module[{d = Length[h], fdd, coords},
    coords = MapThread[(#1 Range[0, #2]) &, {h, n}];
    Total[Table[
        fdd = NDSolve`FiniteDifferenceDerivative[2 UnitVector[d, i], coords, "DifferenceOrder" -> 2, "PeriodicInterpolation" -> True];
        fdd["DifferentiationMatrix"], {i, d}]]]

The zero boundary points in each dimension are at 0 and h*(n + 1)

POSTED BY: Rob Knapp
Posted 11 years ago
POSTED BY: Alan Lewis
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard