Dynamics of cholesteric liquid crystal with variable pitch