I got error :”Derivative is infinite or NaN” when i use 'Fixed step'. What should I do?

That’s correct. Your model isn’t configured with the RT Box target so I assumed you were performing an offline simulation.

This battery model is taken from another PLECS demo model and one should understand its implementation when applying it to other applications. Looking under the mask of the battery model, you can see that the 1e-9 low pass filter is used to break the algebraic loop associated with the current measurement. The current measurement is used to determine the current direction when modeling the polarizing resistance. However, you have the polarizing resistance disabled in your mask commands, therefore you can simply remove the entire signal chain. If you want to include polarizing resistance, then for a discrete time model one can simply use a one-sample delay using the current from the last time step. This assumes the current direction does not frequently change from positive to negative.

Also, modeling with a fixed-step solver is not the same as the code that will run on the RT Box. See this recent forum post for a brief discussion on the topic.