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

3 vues (au cours des 30 derniers jours)
健 篠崎
健 篠崎 le 7 Déc 2020
power_fuel_cellモデルを使って、SOFCの水素供給量を計算しています。
負荷側のRL素子を、時間変化させた計算を実行したいと考えています。
デフォルト条件は6kWですが、この値を0~100秒までは3kW 、101秒~200秒までは5kW、201秒~は6kWといったような変化を計算したいです。

Réponse acceptée

源樹 上林
源樹 上林 le 12 Déc 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秒の分です。頑張ってください。

Plus de réponses (0)

Catégories

En savoir plus sur Simscape Electrical dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!