Where is the error?

Hi... I have the model that i show in the image: http://img51.imageshack.us/img51/5766/modelkq.png
I need that, after i know the value of SOC have:
if SOC > 0.95
g=0;
else
g=1;
end
In other words, if SOC>0.95 the battery don´t charged else the battery charged, but in this case the battery charged always. What is my error?

답변 (2개)

Paulo Silva
Paulo Silva 2011년 7월 1일

0 개 추천

Just guessing:
  1. g should be a logic value
  2. SOC is a vector
  3. SOC changes very quickly
  4. Put the SOC value in a scope and see if it's what you expect
  5. Put the g value in a scope and see if it's what you expect

댓글 수: 5

Nuno
Nuno 2011년 7월 1일
The SOC value is not what I expect, because g it is always g=0...
Paulo Silva
Paulo Silva 2011년 7월 1일
So the error comes up before the code you provided turning your question details totally irrelevant?!
Nuno
Nuno 2011년 7월 1일
Sorry! In this case why i scope g?
Paulo Silva
Paulo Silva 2011년 7월 1일
just to be sure it never changes value
Nuno
Nuno 2011년 7월 1일
Sorry again... how i scope g?

댓글을 달려면 로그인하십시오.

Nuno
Nuno 2011년 7월 4일

0 개 추천

I already see, and the block control works successfully... How i know that Switch are openned or closed?

카테고리

도움말 센터File Exchange에서 Energy Storage에 대해 자세히 알아보기

제품

태그

질문:

2011년 7월 1일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by