Skip to main content
Post Undeleted by xzczd
added 1478 characters in body
Source Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489
(* Definition of ft isn't included in this post, 
   please find it in the link above. *)

eq = -(D[u[x, y], {x, 2}] + 2 D[u[x, y], {y, 2}]) == - DiracDelta[x - m] DiracDelta[y - n];

rule = HoldPattern@FourierTransform[a_, __] :> a;

teq = ft[eq, x, w1] /. rule /. u -> (U@#2 &)

tteq = ft[teq, y, w2] /. rule /. U[y] -> υ

ttsol = Solve[tteq, υ] // Values // Flatten // First

sol = InverseFourierTransform[ttsol, {w2, w1}, {y, x}]

The output is a bit long so I'd like to omit it here.

Notice u -> (U@#2 &) and U[y] -> υ aren't actually necessary, they're just to make the code more readable.

The sol is a bit lengthy and not that easy to simplify, so I'd like to show another way to calculate the inverse Fourier transform that produces a simpler result. We know inverse Fourier transform is essentially an integral, but in this case the generic function has involved in so we can't use Integrate to calculate the inverse transform directly, nevertheless, utilizing the differentiation property of Fourier transform:

FourierTransform[f'[t], t, ω]
(* -I ω FourierTransform[f[t], t, ω] *)

we can calculate derivative of the fundamental solution:

dsol = -(1/Sqrt[2 Pi])^2 Integrate[
   Exp[-I ( w1 x + w2 y)] ttsol w1 w2, {w1, -Infinity, Infinity}, {w2, -Infinity, 
    Infinity}, Assumptions -> (x | y | m | n) ∈ Reals]

(* ConditionalExpression[(
 Sqrt[2] (m - x) Abs[n - y] Sign[n - y])/(π (2 (m - x)^2 + (n - y)^2)^2), n != y] *)

Finally integrate with respect to $x$ annd $y$:

solalter = 
 Integrate[dsol, x, y, Assumptions -> (x | y | m | n) ∈ Reals && n != y] // 
  FullSimplify
(* -(Log[2 (m - x)^2 + (n - y)^2]/(4 Sqrt[2] π)) *)

"Wait, haven't you ignored the constant? " Indeed, but it doesn't hurt because fundamental solution is not unique. Actually it's not hard to show by numeric tests that:

sol - solalter == (-2 EulerGamma + Log[2])/(4 Sqrt[2] π)

Sadly, this method doesn't seem to be easy to generalize to cases like D[u[x, y], {x, 2}] + x^2 D[u[x, y], {y, 2}] == - DiracDelta[x - m] DiracDelta[y - n] as asked in comment.

(* Definition of ft isn't included in this post, 
   please find it in the link above. *)

eq = -(D[u[x, y], {x, 2}] + 2 D[u[x, y], {y, 2}]) == DiracDelta[x - m] DiracDelta[y - n];

rule = HoldPattern@FourierTransform[a_, __] :> a;

teq = ft[eq, x, w1] /. rule /. u -> (U@#2 &)

tteq = ft[teq, y, w2] /. rule /. U[y] -> υ

ttsol = Solve[tteq, υ] // Values // Flatten // First

sol = InverseFourierTransform[ttsol, {w2, w1}, {y, x}]

The output is a bit long so I'd like to omit it here.

Notice u -> (U@#2 &) and U[y] -> υ aren't actually necessary, they're just to make the code more readable.

(* Definition of ft isn't included in this post, 
   please find it in the link above. *)

eq = D[u[x, y], {x, 2}] + 2 D[u[x, y], {y, 2}] == - DiracDelta[x - m] DiracDelta[y - n];

rule = HoldPattern@FourierTransform[a_, __] :> a;

teq = ft[eq, x, w1] /. rule /. u -> (U@#2 &)

tteq = ft[teq, y, w2] /. rule /. U[y] -> υ

ttsol = Solve[tteq, υ] // Values // Flatten // First

sol = InverseFourierTransform[ttsol, {w2, w1}, {y, x}]

Notice u -> (U@#2 &) and U[y] -> υ aren't actually necessary, they're just to make the code more readable.

The sol is a bit lengthy and not that easy to simplify, so I'd like to show another way to calculate the inverse Fourier transform that produces a simpler result. We know inverse Fourier transform is essentially an integral, but in this case the generic function has involved in so we can't use Integrate to calculate the inverse transform directly, nevertheless, utilizing the differentiation property of Fourier transform:

FourierTransform[f'[t], t, ω]
(* -I ω FourierTransform[f[t], t, ω] *)

we can calculate derivative of the fundamental solution:

dsol = -(1/Sqrt[2 Pi])^2 Integrate[
   Exp[-I ( w1 x + w2 y)] ttsol w1 w2, {w1, -Infinity, Infinity}, {w2, -Infinity, 
    Infinity}, Assumptions -> (x | y | m | n) ∈ Reals]

(* ConditionalExpression[(
 Sqrt[2] (m - x) Abs[n - y] Sign[n - y])/(π (2 (m - x)^2 + (n - y)^2)^2), n != y] *)

Finally integrate with respect to $x$ annd $y$:

solalter = 
 Integrate[dsol, x, y, Assumptions -> (x | y | m | n) ∈ Reals && n != y] // 
  FullSimplify
(* -(Log[2 (m - x)^2 + (n - y)^2]/(4 Sqrt[2] π)) *)

"Wait, haven't you ignored the constant? " Indeed, but it doesn't hurt because fundamental solution is not unique. Actually it's not hard to show by numeric tests that:

sol - solalter == (-2 EulerGamma + Log[2])/(4 Sqrt[2] π)

Sadly, this method doesn't seem to be easy to generalize to cases like D[u[x, y], {x, 2}] + x^2 D[u[x, y], {y, 2}] == - DiracDelta[x - m] DiracDelta[y - n] as asked in comment.

Post Deleted by xzczd
added 3 characters in body
Source Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489

As a new introduced function, GreenFunction is still fragile in my view. (The post linked by Ulrich in the comment is another example. ) As to your specific problem, the only work-around I can think out at the moment is to directly solve the PDE with Fourier transform, I'll use ft to facilitate coding:

(* Definition of ft isn't included in this post, 
   please find it in the link above. *)

eq = -(D[u[x, y], {x, 2}] + 2 D[u[x, y], {y, 2}]) == DiracDelta[x - m] DiracDelta[y - n];

rule = HoldPattern@FourierTransform[a_, __] :> a;

teq = ft[eq, x, w1] /. rule /. u -> (U@#2 &)

tteq = ft[teq, y, w2] /. rule /. U[y] -> υ

ttsol = Solve[tteq, υ] // Values // Flatten // First

sol = InverseFourierTransform[ttsol, {w2, w1}, {y, x}]

The output is a bit long so I'd like to omit it here.

Notice u -> (U@#2 &) and U[y] -> υ aren't actually necessary, they're just to make the code more readable.

As a new introduced function, GreenFunction is still fragile in my view. (The post linked by Ulrich in the comment is another example. ) As to your specific problem, the only work-around I can think out at the moment is to directly solve the PDE with Fourier transform, I'll use ft to facilitate coding:

(* Definition of ft isn't included in this post, 
   please find it in the link above. *)

eq = D[u[x, y], {x, 2}] + 2 D[u[x, y], {y, 2}] == DiracDelta[x - m] DiracDelta[y - n];

rule = HoldPattern@FourierTransform[a_, __] :> a;

teq = ft[eq, x, w1] /. rule /. u -> (U@#2 &)

tteq = ft[teq, y, w2] /. rule /. U[y] -> υ

ttsol = Solve[tteq, υ] // Values // Flatten // First

sol = InverseFourierTransform[ttsol, {w2, w1}, {y, x}]

The output is a bit long so I'd like to omit it here.

Notice u -> (U@#2 &) and U[y] -> υ aren't actually necessary, they're just to make the code more readable.

As a new introduced function, GreenFunction is still fragile in my view. (The post linked by Ulrich in the comment is another example. ) As to your specific problem, the only work-around I can think out at the moment is to directly solve the PDE with Fourier transform, I'll use ft to facilitate coding:

(* Definition of ft isn't included in this post, 
   please find it in the link above. *)

eq = -(D[u[x, y], {x, 2}] + 2 D[u[x, y], {y, 2}]) == DiracDelta[x - m] DiracDelta[y - n];

rule = HoldPattern@FourierTransform[a_, __] :> a;

teq = ft[eq, x, w1] /. rule /. u -> (U@#2 &)

tteq = ft[teq, y, w2] /. rule /. U[y] -> υ

ttsol = Solve[tteq, υ] // Values // Flatten // First

sol = InverseFourierTransform[ttsol, {w2, w1}, {y, x}]

The output is a bit long so I'd like to omit it here.

Notice u -> (U@#2 &) and U[y] -> υ aren't actually necessary, they're just to make the code more readable.

added 203 characters in body
Source Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489

As a new introduced function, GreenFunction is still fragile in my view. (The post linked by Ulrich in the comment is another example. ) As to your specific problem, the only work-around I can think out at the moment is to introducedirectly solve the change of variable $y=\sqrt Y$.PDE with Fourier transform, I'll use DChange for the taskft to facilitate coding:

eq = D[u[x, y], {x, 2}] + 2 D[u[x, y], {y, 2}];
(* Definition of DChangeft isn't included in this post, 
   please referfind toit in the link above. *)
neweq
eq = DChange[eqD[u[x, yy], =={x, Sqrt[2]2}] Y,+ y2 D[u[x, Yy], u[x{y, y]]2}] == DiracDelta[x - m] DiracDelta[y - n];

newsolrule = GreenFunction[neweqHoldPattern@FourierTransform[a_, u[x,__] Y]:> a;

teq = ft[eq, {x, Y}w1] /. FullRegion[2],rule {m,/. n}]u -> (U@#2 &)

soltteq = newsolft[teq, y, w2] /. Yrule /. U[y] -> y/Sqrt[2]υ
(* Log[(-m
ttsol += x)^2Solve[tteq, +υ] (-n// +Values y/Sqrt[2])^2]/(4 π)Flatten *)// First

(*sol Alternatively:= *)
DChange[newsolInverseFourierTransform[ttsol, y == Sqrt[2] Y{w2, Yw1}, {y, u[x, Y]]x}]

The output is a bit long so I'd like to omit it here.

Notice u -> (U@#2 &) and U[y] -> υ aren't actually necessary, they're just to make the code more readable.

As a new introduced function, GreenFunction is still fragile in my view. (The post linked by Ulrich in the comment is another example. ) As to your specific problem, the only work-around I can think out at the moment is to introduce the change of variable $y=\sqrt Y$. I'll use DChange for the task:

eq = D[u[x, y], {x, 2}] + 2 D[u[x, y], {y, 2}];
(* Definition of DChange isn't included in this post, 
   please refer to the link above. *)
neweq = DChange[eq, y == Sqrt[2] Y, y, Y, u[x, y]]

newsol = GreenFunction[neweq, u[x, Y], {x, Y}  FullRegion[2], {m, n}]

sol = newsol /. Y -> y/Sqrt[2]
(* Log[(-m + x)^2 + (-n + y/Sqrt[2])^2]/(4 π) *)

(* Alternatively: *)
DChange[newsol, y == Sqrt[2] Y, Y, y, u[x, Y]]

As a new introduced function, GreenFunction is still fragile in my view. (The post linked by Ulrich in the comment is another example. ) As to your specific problem, the only work-around I can think out at the moment is to directly solve the PDE with Fourier transform, I'll use ft to facilitate coding:

(* Definition of ft isn't included in this post, 
   please find it in the link above. *)

eq = D[u[x, y], {x, 2}] + 2 D[u[x, y], {y, 2}] == DiracDelta[x - m] DiracDelta[y - n];

rule = HoldPattern@FourierTransform[a_, __] :> a;

teq = ft[eq, x, w1] /. rule /. u -> (U@#2 &)

tteq = ft[teq, y, w2] /. rule /. U[y] -> υ

ttsol = Solve[tteq, υ] // Values // Flatten // First

sol = InverseFourierTransform[ttsol, {w2, w1}, {y, x}]

The output is a bit long so I'd like to omit it here.

Notice u -> (U@#2 &) and U[y] -> υ aren't actually necessary, they're just to make the code more readable.

Source Link
xzczd
  • 68.4k
  • 9
  • 174
  • 489
Loading