solving Diffrential equation one parameter related to another one

1 visualización (últimos 30 días)
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)

Respuestas (1)

Alan Stevens
Alan Stevens el 9 de Mayo de 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')

Categorías

Más información sobre Chemistry en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by