Assuming that xm
is the maximum numerical solution and xabs
is the absolute value of the numerical solution, we can use the following formula in MATLAB to find the largest time step dtm
that satisfies the given condition:
main.m28 chars2 lines
Here, we divide 0.027 seconds by the maximum absolute value of the solution xm
to get the largest possible time step dtm
that satisfies the given condition. The max
function finds the maximum value in the solution vector.
Note: This formula assumes that the numerical solution has already been computed and stored in the vector xm
.
gistlibby LogSnag