Azzera filtri
Azzera filtri

solving Diffrential equation one parameter related to another one

1 visualizzazione (ultimi 30 giorni)
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)

Risposte (1)

Alan Stevens
Alan Stevens il 9 Mag 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')

Categorie

Scopri di più su Chemistry in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by