Problem in Matlab (solved)

4 ビュー (過去 30 日間)
Eugen Syrkin
Eugen Syrkin 2019 年 12 月 26 日
編集済み: Eugen Syrkin 2020 年 1 月 4 日
So I want to do the following:
(removed)
How should I start? What (ode functions) should I use? They are quite confusing.
Thank you for your help in advance!

採用された回答

Abhisek Pradhan
Abhisek Pradhan 2020 年 1 月 2 日
System of differential equations can be solved in multiple ways. On the ways is to use dsolve function from Symbolic Math Toolbox.
Another way is to use ODE solvers:
Considering this example, y''+y'+y = sin(5*t) with ICs: y(0)=3, y'(0)=-2, follow the following steps to solve the equation.
Ys=@(t,y)([y(2);-(y(2)+3*y(1))+sin(5*t)]); % Define function
ICs = [3, -2]; % Define ICs
timespan = 0: pi/100:2*pi; % Define timespan
options_ODE = odeset('RelTol', 1e-6, 'AbsTol', 1e-8); % ODE Options
[t, y_ODE45]=ode45(Ys, timeSPAN, ICs, options_ODE); % Solve
Refer the following link for to know more about how to choose an ODE Solver.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by