You cannot vary the inertia value of an Inertia block during a simulation. However, you can model a time-varying inertia indirectly with a Variable Ratio Transmission block. The Inertia block interacts with the rest of the system, including any applied torque, only through the gear with the time-varying gear ratio.
Place a Variable Ratio Transmission between a shaft and an Inertia.
Connect this constant Inertia to the Transmission base (B) or follower (F) port.
Vary the gear ratio g(t) of the Variable Ratio Transmission with an incoming physical signal.
By changing the gear ratio, you change the effective inertia Ieff on the shaft from the constant Inertia (value I). Ieff is the effective inertia presented to the rest of the system as torque is applied, through the variable ratio gearbox, on the Inertia.
If the B port is connected to the constant Inertia, Ieff = I·[g(t)]2
If the F port is connected to the constant Inertia, Ieff = I/[g(t)]2
In this diagram, the Variable Ratio Transmission is contained within the Variable Ratio Gear subsystem.
Effective Variable Inertia with a Variable Ratio Gearbox
Realistic driveshafts experience damping from viscous friction, which is proportional to the driveshaft angular velocity. You can model such damping with the Rotational Damper and, if necessary, build complex damping subsystems from this block.