Modeling of electron-cyclotron-resonance ion source and scaling laws