A Comparative Investigation of Thermal and Tribological Properties of Thermoplastic and Thermosetting Polyimides with Similar Structural Formulae