Chemical simulation matlab