Coactive stresses in MEMS and NEMS based on periodically bent crystals