フィルターのクリア

solving Diffrential equation one parameter related to another one

1 回表示 (過去 30 日間)
pooya Zehtab Jahedi
pooya Zehtab Jahedi 2021 年 5 月 8 日
回答済み: Alan Stevens 2021 年 5 月 9 日
Hello every body
I am trying to solve a diffrential equation but in a two days I cannot solve it. My parameters related to each other which method should I use to get answer my answer should be a matrix with 360 numbers?
%% Input Parameters
Rs = 200;
Rr = 180;
Phi = 180;
t = 0:1:360;
e = Rs - Rr;
%% Calculation
B = [e*cosd(Phi-t)]+[(Rs)^2-(e^2)*(sind(Phi-t).^2)].^0.5;
dx/dt = (B^2)-(Rr^2)

回答 (1 件)

Alan Stevens
Alan Stevens 2021 年 5 月 9 日
Like this?
%% Input Parameters
Rs = 200;
Rr = 180;
Phi = 180;
t = 0:1:359;
e = Rs - Rr;
%% Calculation
B = @(t) e*cosd(Phi-t)+(Rs^2-e^2*sind(Phi-t).^2).^0.5;
dxdt = @(t,x) B(t)^2 - Rr^2;
x0 = 0; %%%% needs an initial value for x
[~,x] = ode45(dxdt, t, x0);
plot(t,x),grid
xlabel('t'),ylabel('x')

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by