A model for ionic polymer metal composites as sensors