私はODEのシステムを解こうとしています。入力励起は時間の関数です。時間依存入力のODE、補間を使用せずにスピードアップするには?
私はinterp1
をインテグレーション機能の中で使っていますが、これは非常に効率的な方法ではありません。関数内でinterp1
呼び出しを必要としないsin
関数への入力励振を変更すると、はるかに高速な結果が得られるため、これはそうではないことが分かります。しかし、1ステップごとに補間を行うと、収束するのに10〜20倍の時間がかかります。ですから、補間や他のトリックを必要とせずに、任意の時間依存励起のODEを解決するより良い方法がありますか?
私はちょうどここsimple example from The MathWorksの修正版をコピーしています:
入力励起はgradually increasing sin
関数であるが、いくつかの時間後に、後でそれがconstant amplitude sin
関数となります。私は徐々に増加sin
機能のためのシステムを解決されて上記の私の問題の最初の部分のみを、説明し
Dt = 0.01; % sampling time step
Amp0 = 2; % Final Amplitude of signal
Dur_G = 10; % Duration of gradually increasing part of signal
Dur_tot = 25; % Duration of total signal
t_G = 0 : Dt : Dur_G; % time of gradual part
A = linspace(0, Amp0, length(t_G));
carrier_1 = sin(5*t_G); % Unit Normal Signal
carrier_A0 = Amp0*sin(5*t_G);
out_G = A.*carrier_1; % Gradually Increasing Signal
% Total Signal with Gradual Constant Amplitude Parts
t_C = Dur_G+Dt:Dt:Dur_tot; % time of constant part
out_C = Amp0*sin(5*t_C); % Signal of constant part
ft = [t_G t_C]; % total time
f = [out_G out_C]; % total signal
figure; plot(ft, f, '-b'); % input excitation
function dydt = myode(t,y,ft,f)
f = interp1(ft,f,t); % Interpolate the data set (ft,f) at time t
g = 2; % a constant
dydt = -f.*y + g; % Evaluate ODE at time t
tspan = [1 5]; ic = 1;
opts = odeset('RelTol',1e-2,'AbsTol',1e-4);
[t,y] = ode45(@(t,y) myode(t,y,ft,f), tspan, ic, opts);
figure;
plot(t,y);
注意。 2番目の部分では、任意の入力励起(たとえば、地上加速度入力)のためにそれを解決する必要があります。
ありがとうございますHorchler。私はこの問題の詳細を説明する必要がありますが、このコメントエリアは言葉の点で制限があるので、回答として投稿する必要がありますか?オハイオ州オハイオ州私は私の質問を編集します...あなたはそれを確認していただけますか? –
@IsmailBahadirKuzucu:私は今あなたの更新された質問を見る時間がありません。私は今週/週末の後に時間があるかもしれません。 – horchler
私はHorchlerを理解しています。私はあなたの洞察を得ることを楽しみにしています。あなたの時間をありがとう。 –