find the largest time step dtm that satisfies this condition xabs(xm)< 0.027 s. in matlab

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.m
dtm = 0.027 / max(abs(xm));
28 chars
2 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.

related categories

gistlibby LogSnag