How can i solve this eqaution in matlab?

2 次查看(过去 30 天)
How can i solve this eqaution in matlab?
where the X is the propellant length = 0 to 4.5 meters
clc; clear;
global Go A Rho_f P n m a Reg_dot_dt_values Reg_dot_dt_values2
Rho_f = 920; %kg/m^3
Dp = 0.152; % m
m_dot_oxi = 7.95; %kg/s
n = 0.75;
m = -0.15;
a = 2.006e-5;
Rp = Dp/2; % m
A = pi*(Rp^2); % Port area
Go = m_dot_oxi/A; % Oxidizer mass flux
P = 2*pi*Rp; % Perimeter
Reg_dot_dt_values = [];
[x,R] = ode45(@f, [0 10], 0.076);
function Reg_dot_dt = f(x,R)
global Go A Rho_f P n m a Reg_dot_dt_values Reg_dot_dt_values2
Reg_dot_dt = (a*(Go^n)*(x^m))*((1+(((1-n)*Rho_f*P*a*(x^(1+m)))/((1+m)*A*(Go^(1-n)))))^(n/1-n));
Reg_dot_dt2 = a*(Go^n).*(((1+(Rho_f*P/Go*A).*Reg_dot_dt)^(n)).*(x^m));
Reg_dot_dt_values = [Reg_dot_dt_values; Reg_dot_dt];
end
  4 个评论
Torsten
Torsten 2024-6-11
编辑:Torsten 2024-6-11
And you want to get r(x) ? Is the "dot" differentiation with respect to x ?

请先登录,再进行评论。

采纳的回答

Torsten
Torsten 2024-6-11
编辑:Torsten 2024-6-11
Rho_f = 920; %kg/m^3
Dp = 0.152; % m
m_dot_oxi = 7.95; %kg/s
n = 0.75;
m = -0.15;
a = 2.006e-5;
Rp = Dp/2; % m
A = pi*(Rp^2); % Port area
Go = m_dot_oxi/A; % Oxidizer mass flux
P = 2*pi*Rp; % Perimeter
drdx = @(x)a*Go^n*x.^m.*(1+((1-n)*Rho_f*P*a*x.^(1+m))./((1+m)*A*Go^(1-n))).^(n/(1-n));
x = 0:0.1:50;
r = zeros(size(x));
r(1) = 0.076;
for i = 1:numel(x)-1
r(i+1) = r(i) + integral(drdx,x(i),x(i+1));
end
plot(x,[r;drdx(x)])
  3 个评论
Torsten
Torsten 2024-6-11
编辑:Torsten 2024-6-11
You said you want r, not rdot.
And rdot is the derivative with respect to t, not with respect to x as you claimed.
I don't know how t is used in the calculation of rdot in order to get different values for rdot for different values of t.
SUBHAM HALDAR
SUBHAM HALDAR 2024-6-11
sorry if i wasnt able to explain you okey so t is not used in calculsation its just represent port diameter in my code it represented by Rp=diameter /2. and the requirement is to find r_dot with respect to x which ranges from 0 to 4.5m as including zero will take the solution to infinity 0.381 was conisidered.

请先登录,再进行评论。

更多回答(1 个)

Torsten
Torsten 2024-6-11
移动:Torsten 2024-6-11
I still don't understand where you can change t=0.1 s, t=20 s, t=60 s, but here we go:
Rho_f = 920; %kg/m^3
Dp = 0.152; % m
m_dot_oxi = 7.95; %kg/s
n = 0.75;
m = -0.15;
a = 2.006e-5;
Rp = Dp/2; % m
A = pi*(Rp^2); % Port area
Go = m_dot_oxi/A; % Oxidizer mass flux
P = 2*pi*Rp; % Perimeter
rdot = @(x)a*Go^n*x.^m.*(1+((1-n)*Rho_f*P*a*x.^(1+m))./((1+m)*A*Go^(1-n))).^(n/(1-n));
x = 0.381:0.001:4.572;
plot(x,rdot(x)*1e2)
  3 个评论
Torsten
Torsten 2024-6-11
编辑:Torsten 2024-6-12
Maybe you can manually simplify "sol" to get the expression from above.
I don't know why 0^(m+1) appears in the solution although m is assumed to be > -1.
syms intrdot(x)
syms c1 c2 n m real
syms a G0 rhoF P A real
assume(m>-1)
eqn = diff(intrdot,x) == c1*(1+c2*intrdot)^n*x^m;
cond = intrdot(0)==0;
sol = dsolve(eqn,cond);
sol = subs(sol,[c1 c2],[a*G0^n,rhoF*P/(G0*A)])
sol = 

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

产品


版本

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by