Help with Undergraduate Math, Algebra & PDE Implicit Scheming

In summary, the conversation discusses the implementation of an implicite method for solving a PDE system. The user needs help with programming the method and is seeking advice on efficient algorithms for solving systems of linear equations. They also mention a need for a library for sparse matrices to avoid reinventing the wheel.
  • #1
kriss2
2
0
Hi
a want to code implicite scheme for PDEs
u_t =a laplace u + L p_t
p_t = laplace p + u

pls help
I made a classical FEM discretization, but i don't know how to programe it.

(u(n+1)ij - un)/t = a ((u(n+1)(i-1j) -2 u(n+1)(ij) +u(n+1)(i+1 j))
/x2 + (u(n+1)(i j-1)-2u(n+1)(ij) + u(n+1)( i j+1 )/y2) +L (p(n+1)
-pn)/t

(p(n+1)ij - pn)/t = ((p(n+1)(i-1j) -2 p(n+1)(ij) +p(n+1)(i+1 j))
/x2 + p(n+1)(i j-1)-2p(n+1)(ij) + p(n+1)( i j+1 )/y2) + un
 
Physics news on Phys.org
  • #2


Well, it's not simple. What kind of help are you looking for? "i don't know how to programe it" is pretty broad. Do you want to know how to program a computer? Or are you asking how to efficiently solve a banded system of linear equations? Or what?
 
  • #3


I have explicite method and I need something similar for implicite metod

k=1:T
Pold=P;
Uold=U;
i=2:X-1;
j=2:Y-1;
P(i,j)=Pold(i,j) ...
+ ((Pold(i-1,j)-2*Pold(i,j)+Pold(i+1,j))/X^2 ...
+ (Pold(i,j-1)-2*Pold(i,j)+Pold(i,j+1))/Y^2)*tau ...
+ Uold(i,j)


U(i,j)=Uold(i,j)+ ...
a *( (Uold(i-1,j)-2*Uold(i,j)+Uold(i+1,j))/X^2 ...
+ (Uold(i,j-1)-2*Uold(i,j)+Uold(i,j+1))/Y^2) ...
+ L*(P(i,j) - Pold(i,j));


figure(1)
Pcolor(U)
caxis([0 1.2])
colorbar

end
 
  • #4


OK. For every i,j, you have an equation relating uij and pij at time n+1 to their values at time n. Let's suppose you have an m x m grid -- then these, together with the boundary conditions, give you 2m^2 equations in 2m^2 unknowns. You need to solve that big system of linear equations.

There are a few different algorithms for solving systems of linear equations. Good programming practice forbids re-inventing the wheel, and at this point you should find a library available for your software environment and use it. In particular, you want algorithms and libraries for "sparse" or "banded" matrices. Systems like this give very big matrices (e.g., if you're working on a 30 x 30 grid, you'll have an 1800 x 1800 matrix), most of whose elements are 0. A sparse matrix library will represent this matrix compactly (i.e., without using up 3240000 reals in your memory) and will solve it efficiently. Solving a general system of linear equations is O(n^3), but algorithms designed for sparse systems will do it in O(N), where N is the number of non-zero elements. This is a big deal for practical applications.
 
Last edited:
  • #5
(n+1) - un(n)

As a scientist, my expertise may not be in the specific area of undergraduate math and PDEs, but I can offer some general advice and suggestions.

Firstly, it is important to have a good understanding of the underlying mathematical concepts and principles behind the problem you are trying to solve. In this case, it seems like you are dealing with a system of partial differential equations (PDEs) and are trying to code an implicit scheme for solving them. Implicit schemes are numerical methods used to approximate solutions to PDEs, and they can be quite complex to code.

My first recommendation would be to seek out resources that can help you better understand the theory and principles behind implicit schemes for PDEs. There are many textbooks, online courses, and tutorials available that can provide a solid foundation for your coding efforts.

In addition, it would be helpful to have a good understanding of the programming language you are using. Make sure you are familiar with the syntax and have a good grasp of the tools and libraries available to help with numerical computations.

As for the specific code you have provided, it looks like you are attempting to use a finite element method (FEM) for discretization. This is a common approach for solving PDEs numerically. However, it may be beneficial to consult with a mathematics or engineering professor or colleague who has experience with FEM to ensure your implementation is correct.

Overall, my advice would be to continue learning and seeking out resources to improve your understanding of the underlying mathematics and coding principles involved. With persistence and dedication, you will be able to successfully code an implicit scheme for your PDEs. Good luck!
 

Related to Help with Undergraduate Math, Algebra & PDE Implicit Scheming

1. What is an undergraduate math course like?

An undergraduate math course typically covers topics such as algebra, geometry, calculus, and statistics. It involves both theoretical concepts and practical problem-solving skills.

2. What is the difference between algebra and PDE implicit scheming?

Algebra is a branch of mathematics that deals with symbols and the rules for manipulating those symbols to solve equations. PDE implicit scheming, or Partial Differential Equation Implicit Scheming, is a method for solving partial differential equations, which are equations that involve multiple variables.

3. Why do I need to learn algebra before taking PDE implicit scheming?

Algebra is the foundation for many mathematical concepts, including PDE implicit scheming. It teaches you how to manipulate symbols and solve equations, which are essential skills for solving more complex problems like PDEs.

4. What resources can I use to improve my understanding of undergraduate math, algebra, and PDE implicit scheming?

There are many resources available, such as textbooks, online courses, practice problems, and tutoring services. It is also helpful to attend lectures and seek help from your professor or classmates.

5. How can I prepare for success in my undergraduate math courses?

To succeed in undergraduate math courses, it is important to stay organized, attend class regularly, and practice consistently. You should also seek help when needed and ask questions to clarify any confusion. Additionally, developing good study habits and time management skills can greatly improve your performance in math courses.

Similar threads

Replies
1
Views
1K
  • Differential Equations
Replies
1
Views
2K
  • Differential Equations
Replies
2
Views
2K
  • Differential Equations
Replies
1
Views
2K
Replies
4
Views
1K
  • Differential Equations
Replies
6
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
3K
Replies
1
Views
691
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Math Proof Training and Practice
2
Replies
61
Views
9K
Back
Top