155k views
3 votes
Use the MATLAB PDE solver to solve numerically the Fisher equation

uₜ = 0.23uₓₓ + 1.7u(1-u), -8≤ x≤8, 0≤t≤4,
subject to the boundary conditions
du/dx(-8,t) = 0, u(8,t) = 0.7

and the initial condition
u(x,0) = {0.2, |x| ≤ 1.1
0.7, |x| > 1.1
​​​​​​​​​​​​​​
Plot the surface of function u(x,t), and plot function u(x,0) in different diagram

User Rag
by
7.3k points

1 Answer

4 votes

Final answer:

To use the MATLAB PDE solver for the Fisher equation, set up the problem using the pdepe function with the appropriate coefficients, boundary conditions, and initial conditions. Then, plot with surf or mesh for the surface of u(x,t) and plot for the initial condition u(x,0).

Step-by-step explanation:

To solve the Fisher equation numerically in MATLAB, implement the finite difference method or use MATLAB's built-in partial differential equation (PDE) solver functions. Set up the PDE using pdepe or similar functions, defining the equations, boundary, and initial conditions based on the given Fisher equation parameters. Here is a step-by-step explanation:

  • Define the spatial domain x and the time vector t.
  • Create an anonymous function for the PDE with coefficients corresponding to 0.23 for diffusion and 1.7 for the reaction term.
  • Specify the boundary conditions as defined.
  • Use an initial condition function that returns 0.2 for |x| ≤ 1 and 0.7 for |x| > 1.
  • Call the pdepe solver with the specified coefficients, boundary conditions, initial conditions, spatial domain, and time vector.
  • Plot the surface of the function u(x,t) using surf or mesh for visualization of the solution over space and time.
  • In a separate plot, display u(x,0) using the function plot.

The surface plot will show how the solution evolves in time, while the separate diagram for u(x,0) will provide the initial condition profile.

User Koby Duck
by
7.5k points