How Do You Compute the Frechet Derivative and Formal Adjoint for PDEs?

  • Context: Mathematica 
  • Thread starter Thread starter Anthony
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
SUMMARY

This discussion focuses on computing the Frechet derivative and its formal adjoint for partial differential equations (PDEs) using Mathematica. The user, Ant, successfully implements the Frechet derivative function but encounters issues with the AdjointFrechetD function, which only returns the transpose of the Frechet derivative matrix. The code provided is derived from a book, indicating a potential source of reference for further learning. Ant seeks assistance in troubleshooting the adjoint computation and improving Mathematica skills.

PREREQUISITES
  • Understanding of Frechet derivatives in the context of PDEs
  • Familiarity with Mathematica 6 programming
  • Knowledge of matrix operations and transposition
  • Basic concepts of functional analysis related to adjoint operators
NEXT STEPS
  • Research "Mathematica 6 programming techniques" for improved coding skills
  • Study "Frechet derivatives in functional analysis" for theoretical background
  • Explore "adjoint operators in PDEs" to understand their properties and applications
  • Learn about "debugging techniques in Mathematica" to troubleshoot code effectively
USEFUL FOR

Mathematicians, physicists, and engineers working with partial differential equations, as well as students seeking to enhance their Mathematica programming skills.

Anthony
Messages
83
Reaction score
0
Hi all,

I'm currently trying to implement some code to compute the Frechet derivative of a system of PDEs, and the associated formal adjoint. The code I'm using to compute derivative is:

Code:
FrechetD[support_List, dependVar_List,
independVar_List, testfunction_List] :=
Block[{indep, frechet, deriv, \[Epsilon], r0, x1, x2},
r0 = Function[indep, x1 + \[Epsilon] x2];
frechet = {}; Do[deriv = {};
Do[AppendTo[deriv, \!\(
\*SubscriptBox[\(\[PartialD]\), \(\[Epsilon]\)]\ \((support[[
j]] /. \[IndentingNewLine]dependVar[[
i]] -> \((r0 /. \[IndentingNewLine]{indep ->
independVar, \[IndentingNewLine]x1 ->
dependVar[[i]] @@ independVar, \[IndentingNewLine]x2 ->
testfunction[[i]] @@
independVar})\))\)\) /. \[Epsilon] -> 0],
{i, 1, Length[support]}];
AppendTo[frechet, deriv],
{j, 1, Length[support]}];
frechet]

This works an absolute charm. Then to compute the associated adjoint, I use:

Code:
AdjointFrechetD[support_List, dependVar_List,
independVar_List, testfunction_List] :=
Block[{subrule, $testf, frechet, n, b},
subrule = b_. ($testf^(n__)) @@ independVar :>
(-1)^Plus @@ {n} \!\(
\*SubscriptBox[\(\[PartialD]\), \(Delete[Thread[{independVar, {n}}],
0]\)]\((b\ $testf @@ independVar)\)\);
frechet = FrechetD[support, dependVar,
independVar , testfunction];
Do[frechet =
frechet /.
(subrule /. $testf -> testfunction[[i]]),
{i, 1, Length[testfunction]}];
frechet = Transpose[frechet]]

This doesn't work, sadly. All it seems to do is give me the transpose of the original Frechet derivative matrix. The code originally came from a book I've looked at, so it can't be too far wrong. Sadly, my mathematica skills are pretty much non-existent, so I haven't a clue what the problem is! If anyone could give me some pointers it would be much appreciated!

Many thanks,
Ant
 
Physics news on Phys.org
Ant, I wish I could help you but I'm a novice myself. While I look forward to a response to this, if anyone would advise me on the best book to purchase to learn Mathematica 6, any opinions would be appreciated.

Jeff
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
5K