Hi.
I'm trying to simulate a solution containing surfactants (n_mol_surf is the number of such molecules) and copolymers (n_mol_cop is the number of such molecules). The surfactants are n_monomers_surf in length and the copolymers are n_monomers_cop in length. To insert the surfactants I use:
for { set i 0 } { $i < $n_mol_surf } { incr i } {
set posx [expr $boxl*[t_random]]
set posy [expr $boxl*[t_random]]
set posz [expr $boxl*[t_random]]
polymer 1 $n_monomers_surf $sig_monomer_surf start [expr $i*$n_monomers_surf] pos $posx $posy $posz
mode PSAW charge $head_charge \
distance $n_monomers_surf type [expr $monomer_surf + $i] $head_surf FENE $fene
set molid $i
for { set j 0 } { $j < $n_monomers_surf } { incr j } {
part [expr $j + $i*$n_monomers_surf] mol $molid
}
}