polysim
Polymer structure generator and physical property simulator written in Rust.
Given a BigSMILES string, polysim generates concrete polymer chains (as SMILES) and computes physical/chemical properties such as glass transition temperature, molecular weight, and more.
Features
| Status | Feature |
|---|---|
| ✅ | Linear homopolymer generation |
| 🔜 | Random / alternating / block copolymers |
| 🔜 | Branched polymers, graft copolymers, macromonomers |
| ✅ | Chain length by repeat count |
| ✅ | Chain length by target Mn (ByTargetMn) |
| ✅ | Chain length by monoisotopic mass (ByExactMass) |
| ✅ | Average molecular weight (IUPAC standard atomic weights) |
| ✅ | Monoisotopic mass (most abundant isotope per element) |
| ✅ | Tg estimation — Fox equation |
| 🔜 | Tg estimation — Van Krevelen group contributions |
| 🔜 | Crystallisation tendency |
| 🔜 | Hildebrand solubility parameter |
| 🔜 | Melting temperature Tm |
Quick start
# Cargo.toml
[]
= "0.1"
Build a chain and read its molecular weight
use ;
// Polyéthylène — 100 unités répétées
let bs = parse.unwrap;
let chain = new
.homopolymer
.unwrap;
println!; // 100
println!; // 1410.7 g/mol
println!;
Target a specific Mn
use ;
// Polypropylène — viser Mn ≈ 10 000 g/mol
let bs = parse.unwrap;
let chain = new
.homopolymer
.unwrap;
println!; // ≈ 237
println!; // ≈ 9 996 g/mol
Compute masses independently
use ;
let bs = parse.unwrap; // polystyrène
let chain = new
.homopolymer
.unwrap;
println!;
println!;
Glass transition temperature
use tg_fox;
// Tg d'un mélange 70/30 PS/PMMA (PS : 373 K, PMMA : 378 K)
let tg = tg_fox;
println!;
Build strategies
Après construction, chain.mn contient toujours la masse moléculaire moyenne calculée,
quelle que soit la stratégie utilisée.
Polymer architectures
| Architecture | Builder | Statut |
|---|---|---|
| Homopolymer | LinearBuilder::homopolymer |
✅ |
| Random copolymer | LinearBuilder::random_copolymer |
🔜 |
| Alternating copolymer | LinearBuilder::alternating_copolymer |
🔜 |
| Block copolymer | LinearBuilder::block_copolymer |
🔜 |
| Comb / branched | BranchedBuilder::comb_polymer |
🔜 |
| Graft copolymer | BranchedBuilder::graft_copolymer |
🔜 |
| Macromonomer | BranchedBuilder::macromonomer |
🔜 |
Workspace layout
polysim/
├── crates/
│ ├── polysim-core/ # library (published to crates.io)
│ │ └── src/
│ │ ├── builder/ # chain generators
│ │ ├── polymer/ # PolymerChain type
│ │ └── properties/ # Tg, MW, …
│ └── polysim-cli/ # command-line tool (not yet published)
Development
Prerequisites
- Rust stable (≥ 1.70)
make(optional, for convenience targets)
Setup
# Install git hooks (pre-commit: fmt+clippy, pre-push: tests)
# or: make install-hooks
Common commands
References
- Lin, T.-S. et al. (2019). BigSMILES: A Structurally-Based Line Notation for Describing Macromolecules. ACS Central Science 5, 1523–1531. doi:10.1021/acscentsci.9b00476
- Fox, T. G. (1956). Influence of diluent and of copolymer composition on the glass temperature of a polymer system. Bull. Am. Phys. Soc. 1, 123.
- Van Krevelen, D. W. & te Nijenhuis, K. (2009). Properties of Polymers, 4th ed. Elsevier.
License
MIT — see LICENSE.