sr1.setName("reactant1");
sr1.setStoichiometry(1d);
SpeciesReference sr2 = r1.createProduct("sr2", s2);
sr2.setName("product1");
sr2.setStoichiometry(1d);
ModifierSpeciesReference msr1 = r1.createModifier("msr1", s3);
msr1.setName("modifier");
Reaction r2 = m.createReaction("r2");
r2.setName("reaction2");
r2.setCompartment(c);
SpeciesReference sr3 = r2.createReactant("sr3", s1);
sr3.setName("reactant2");
sr3.setStoichiometry(2d);
SpeciesReference sr4 = r2.createProduct("sr4", s4);
sr4.setName("product2");
sr4.setStoichiometry(1d);
ModifierSpeciesReference msr2 = r2.createModifier("msr2", s3);
msr2.setName("modifier");
SBMLWriter.write(doc, System.out, ' ', (short) 2);
System.out.println('\n');
}