필터 지우기
필터 지우기

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 CenterFile Exchange에서 Chemistry에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by