Functions > Solving and Optimization > Solve Block Functions > Example: Using pdesolve with Units
Example: Using pdesolve with Units
Use the pdesolve function to solve the heat equation.
1. Create the following input parameters: nTime and nX are the number of grid points.τMax is the upper boundary of the trange, and a is a coefficient.
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
2. Set up the PDE solve block. Use the heat equation and add a set of initial conditions. Use units (m) inside the solve block.
Click to copy this expression
3. To visualize the solution in a 3D plot, use the CreateMesh function.
Click to copy this expression
Click to copy this expression
Click to copy this expression
4. Plot the solution using a 3D plot.
Click to copy this expression
5. Plot the solution using a contour plot.
Click to copy this expression
Was this helpful?