PDE Iteration with cross product

  • Thread starter Quakerbrat
  • Start date
  • #1
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
 

Answers and Replies

  • #2
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:

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

Here is the iteration:
[tex]
$\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)}$
[/tex]

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:

Related Threads on PDE Iteration with cross product

Replies
7
Views
10K
  • Last Post
Replies
2
Views
852
  • Last Post
Replies
2
Views
774
  • Last Post
Replies
3
Views
3K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
1
Views
4K
  • Last Post
Replies
7
Views
4K
  • Last Post
Replies
4
Views
16K
  • Last Post
Replies
5
Views
14K
  • Last Post
Replies
1
Views
1K
Top