-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReadMe.txt
More file actions
77 lines (57 loc) · 2.95 KB
/
ReadMe.txt
File metadata and controls
77 lines (57 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
=====================================================
MATLAB 1D Time-Dependent PDE Solver
=====================================================
This project is written in MATLAB and provides a solver for 1D time-dependent linear equations. It supports two types of shape functions: P2 and P3. The solver includes validation scripts and the ability to perform both time and space convergence analysis.
-----------------------------------------------------
FILES
-----------------------------------------------------
- main.m : Contains the main validation script.
- main.txt : Contains a validation test using both time and space refinement. Errors are saved into Excel files.
- rapport.pdf : Describes the equation being solved and provides details about the numerical method.
- commands.txt : Lists the commands and parameters used to run the solver.
- [P2/P3 Scripts]: Located in the project folder, each script corresponds to a specific shape function.
-----------------------------------------------------
HOW TO USE THE SOLVER
-----------------------------------------------------
Boundary Conditions:
- cl1: Left-side boundary condition (vector of two values)
- First value: 0 for Dirichlet, 1 for Neumann
- Second value: Value of u(0) or u'(0)
- cl2: Right-side boundary condition (vector of two values)
- First value: 0 for Dirichlet, 1 for Neumann
- Second value: Value of u(L) or u'(L)
Solver Function:
Solver1D_P2_Ref_T_EDP_a(a, b, h, t0, tf, ht, u, mrf, gordre, alpha)
Parameters:
- a : Left boundary node
- b : Right boundary node
- h : Space step size
- t0 : Initial time
- tf : Final time
- ht : Time step size
- u : Exact solution (function handle)
- mrf : Use reference element technique (1) or not (0)
- gordre : Gauss quadrature order
- alpha : Coefficient of the PDE (α * du/dt)
Example:
sll = Solver1D_P2_Ref_T_EDP_a(0, 4, 0.01, 0, 1, 0.01, u, 1, 5, 1);
Object Methods:
sll = sll.CLS(cl1, cl2)
→ Store boundary conditions for later use.
sll = sll.initialize(u0)
→ Initialize the first time step with the initial condition.
sll = sll.LoopTime()
→ Loop over time steps:
- Assemble local and global matrices
- Apply boundary conditions
- Solve the system
sll = sll.erreur()
→ Compute the error in space and time.
→ Result stored in: sll.er
-----------------------------------------------------
NOTES
-----------------------------------------------------
- The project includes comments in the MATLAB code to explain each section.
- Error data is saved in Excel format for both time and space validations.
- Make sure to define the exact solution function `u(t, x)` and initial condition `u0` before running the solver.
-----------------------------------------------------