PDE Iteration with cross product

Click For Summary
SUMMARY

The discussion focuses on implementing the Buttke scheme, a numerical approximation to the Biot-Savart Law, using MATLAB. The Crank-Nicolson method is employed, which involves a cross product in the partial differential equation (PDE) given by $\displaystyle{\frac{\partial \mathbf{X}}(s,t){\partial t} = \textbf{X}(s,t) \times \frac{\partial ^2 \mathbf{X}(s,t)}{\partial s^2}}$. The user seeks guidance on iterating this scheme within a loop, specifically how to handle the cross product in their MATLAB code. The provided code snippet demonstrates an attempt to calculate the iterative sequence but indicates confusion regarding the cross product implementation.

PREREQUISITES
  • Understanding of partial differential equations (PDEs)
  • Familiarity with the Crank-Nicolson method
  • Proficiency in MATLAB programming
  • Knowledge of vector calculus, particularly cross products
NEXT STEPS
  • Study the implementation of the Crank-Nicolson method in MATLAB
  • Learn about cross products in vector calculus and their application in numerical methods
  • Explore the Buttke scheme and its applications in fluid dynamics
  • Investigate MATLAB functions for matrix determinants and their use in iterative calculations
USEFUL FOR

Mathematics students, numerical analysts, and MATLAB programmers working on fluid dynamics simulations or those interested in implementing numerical methods for PDEs.

Quakerbrat
Messages
3
Reaction score
0
This may be more of a MATLAB question, and if so, I do apologize for posting this in the wrong place.

I am doing a project on the Buttke scheme, which is a numerical approximation to the Biot-Savart Law. I am almost finished, but I am having trouble writing the code.

The scheme is Crank-Nicolson but it involves a cross product.

Here is the PDE:

$\displaystyle{\frac{\partial \mathbf{X}}(s,t){\partial t} = \textbf{X}(s,t) \times \frac{\partial ^2 \mathbf{X}(s,t)}{\partial s^2}}$

Here is the iteration:

$\displaystyle{\Big(\mathbf{X}_j^{n+1} - \mathbf{X}_j^{n}\Big) = \frac{\Delta t}{4(\Delta s)^2}\Big(\mathbf{X}_j^{n+1} + \mathbf{X}_j^{n}\Big) \times \Big(\mathbf{X}_{i+1}^{n} + \mathbf{X}_{i-1}^{n}+ \mathbf{X}_{i+1}^{n+1} + \mathbf{X}_{i-1}^{n+1} \Big)}$

If anyone could give me a hint about how to begin this iteration within a loop, that would be extremely helpful. I have done iterations before, but for some reason the cross product is really throwing me off.

Here is what I have (using the fact that in R2 cross products are really determinants)

r = dt/4*ds^2;

%Calculate Iterative Sequence
for j = 2:dt
for k = 1:tmax
A(k,j) = X(k+1,j)+X(k,j)
B(k,j) = X(k+1,j-1)+X(k,j-1)+X(k+1,j+1)+X(k,j+1)
Y(k+2,j) = X(k,j)+r*det(A,B);
end
end

I really don't need someone to write anything for me, just give me some guidance as to how this could be iterated. I feel like I am missing something simple.

Thanks so much,
Quakerbrat
 
Physics news on Phys.org
Sorry - I forgot to put in the .tex.

This may be more of a MATLAB question, and if so, I do apologize for posting this in the wrong place.

I am doing a project on the Buttke scheme, which is a numerical approximation to the Biot-Savart Law. I am almost finished, but I am having trouble writing the code.

The scheme is Crank-Nicolson but it involves a cross product.

Here is the PDE:

<br /> $\displaystyle{\frac{\partial \mathbf{X}}(s,t){\partial t} = \textbf{X}(s,t) \times \frac{\partial ^2 \mathbf{X}(s,t)}{\partial s^2}}$<br />

Here is the iteration:
<br /> $\displaystyle{\Big(\mathbf{X}_j^{n+1} - \mathbf{X}_j^{n}\Big) = \frac{\Delta t}{4(\Delta s)^2}\Big(\mathbf{X}_j^{n+1} + \mathbf{X}_j^{n}\Big) \times \Big(\mathbf{X}_{i+1}^{n} + \mathbf{X}_{i-1}^{n}+ \mathbf{X}_{i+1}^{n+1} + \mathbf{X}_{i-1}^{n+1} \Big)}$<br />

If anyone could give me a hint about how to begin this iteration within a loop, that would be extremely helpful. I have done iterations before, but for some reason the cross product is really throwing me off.

Here is what I have (using the fact that in R2 cross products are really determinants)

r = dt/4*ds^2;

%Calculate Iterative Sequence
for j = 2:dt
for k = 1:tmax
A(k,j) = X(k+1,j)+X(k,j)
B(k,j) = X(k+1,j-1)+X(k,j-1)+X(k+1,j+1)+X(k,j+1)
Y(k+2,j) = X(k,j)+r*det(A,B);
end
end

I really don't need someone to write anything for me, just give me some guidance as to how this could be iterated. I feel like I am missing something simple.

Thanks so much,
Quakerbrat
 
Last edited:

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
5K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K