Effacer les filtres
Effacer les filtres

solving Diffrential equation one parameter related to another one

1 vue (au cours des 30 derniers jours)
pooya Zehtab Jahedi
pooya Zehtab Jahedi le 8 Mai 2021
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)

Réponses (1)

Alan Stevens
Alan Stevens le 9 Mai 2021
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')

Catégories

En savoir plus sur Chemistry dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by