And I THINK it would be easier if you include the derating equation in the same custom resistor block. You shouldn't have two resistors of value R as you now have in your model.
- I don't see anything obviously wrong with your R_ele_variable module. At least if I remove the switch, your model runs OK.
- Both the switch and the resistor are now contributing to a resistance of R.
- One real problem: your equations for closed swith is OK, but the open switch one needs more work. There is no equation on how the voltage or current should behave. And you are specifying an equation for Inputs and parameters. There is nothing to solve!! Inputs and parameters are externally prescribed values. The equation must have some "variables" to solve for.
- Another (maybe) real problem: how should things behave when it's melt? cut the current I suppose? You have a current source in the circuit right now. It will force the prescribed current through the network. If you force the i=0 at the component, you will get an error like making 1==0. Need to think about this more carefully to set up the problem right.
Hope this helps. Happy modeling!