using Battery Voltage in Algebraic Loops
2 次查看(过去 30 天)
显示 更早的评论
I'd like to study the dis/charging characteristics of MATLAB/Simulink/Battery model in some condition I want.
dis/charging current is calculated by dividing reference power by battery voltage.
but i received below message
Algebraic state in algebraic loop containing 'file name' computed at time 0.0 is Inf or NaN. There may be a singularity in the solution. If the model is correct, try reduction the step size (either by reducing the fixed step size or by tightening the error tolerances)
how can i use the value without any error? plz, help.
0 个评论
回答(1 个)
A Jenkins
2013-11-19
You most likely have an algebraic loop because you are trying to use the value of the battery voltage in a calculation for the current, but the battery voltage cannot be calculated until the value of the current is known.
The simplest (but maybe not the best) way to get around this for now would be to calculate the current using the "old" value of battery voltage. To do this, you can put a memory block right before your use of voltage in your current calculation. Then it will use the previous value of battery voltage to calculate the new current, and then use the new current to calculate the new battery voltage, etc.
To give any better advice, I think we would need to see your model.
社区
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!