PDE Iteration with cross product

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:
Thread 'Direction Fields and Isoclines'
I sketched the isoclines for $$ m=-1,0,1,2 $$. Since both $$ \frac{dy}{dx} $$ and $$ D_{y} \frac{dy}{dx} $$ are continuous on the square region R defined by $$ -4\leq x \leq 4, -4 \leq y \leq 4 $$ the existence and uniqueness theorem guarantees that if we pick a point in the interior that lies on an isocline there will be a unique differentiable function (solution) passing through that point. I understand that a solution exists but I unsure how to actually sketch it. For example, consider a...

Similar threads

Replies
3
Views
3K
Replies
0
Views
2K
Replies
1
Views
2K
Replies
1
Views
3K
Replies
3
Views
2K
Replies
3
Views
3K
Back
Top