power_fuel​_cellで負荷側の​条件を時間変化させる​方法

2 Ansichten (letzte 30 Tage)
健 篠崎
健 篠崎 am 7 Dez. 2020
Beantwortet: 源樹 上林 am 12 Dez. 2020
power_fuel_cellモデルを使って、SOFCの水素供給量を計算しています。
負荷側のRL素子を、時間変化させた計算を実行したいと考えています。
デフォルト条件は6kWですが、この値を0~100秒までは3kW 、101秒~200秒までは5kW、201秒~は6kWといったような変化を計算したいです。

Akzeptierte Antwort

源樹 上林
源樹 上林 am 12 Dez. 2020
 どういうデータ構造なのかがわからないのでとても答えづらいですが、仮にこんな構造だったらこうするというやり方で回答しておきます。
data = [ (1:300)', rand( 300, 2 ) ];
time = data( :, 1 );
idx_3kw = and( 0 < time, time <= 100 );
idx_other = not( idx_3kw );
plot( time(idx_3kw ), data( idx_3kw, 2:end ) ); hold on
plot( time(idx_other), data( idx_other, 2:end ) + 20 )
 データさえ取り出せれば、計算はできますね。logical 配列の使い方は、MATLAB 入門 のオンラインチュートリアルで説明されているので大丈夫だと思います。四則演算出来るのは出てきてたかな?覚えてません。
 尚、コピペの誘惑に負けてしまうと良くないと思ったので、追加と修正が2行ほど必要です。あ、plot 入れたら3行か。ともかく101秒~200秒の分です。頑張ってください。

Weitere Antworten (0)

Kategorien

Mehr zu Simscape Electrical finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!