Input values for ode-solver
2 ビュー (過去 30 日間)
古いコメントを表示
Hello everyone, I'm trying to solve an equation with the ode45-solver.
My problem is, that I don't know how to import the values from the variables Theta_D, Theta_p_D and Q_E_D into the function script. Those variables are calculated in the script and they are row-vectors. The calculation of those variables is complex and is omitted here
My function is:
function sdot = DGL_Getriebe(t,s)
sdot = [s(2);
(Q_E_D - 0.5 * Theta_p_D * s(2)^2) / Theta_D];
end
And my script is:
Theta_D = cell2mat(Theta);
Theta_p_D = cell2mat(Theta_p);
Q_E_D = cell2mat(Q_E);
t_span = [0 10];
q0 = [0 0];
[t, state_value] = ode45(@(t,s) DGL_Getriebe(q,s), t_span, q0);
q_an = state_value(:,1);
q_dot = state_value(:,2);
% Plots
Best regards!
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!