필터 지우기
필터 지우기

How can i solve this eqaution in matlab?

조회 수: 2 (최근 30일)
SUBHAM HALDAR
SUBHAM HALDAR 2024년 6월 11일
편집: Torsten 2024년 6월 12일
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 ?
SUBHAM HALDAR
SUBHAM HALDAR 2024년 6월 11일
yes

댓글을 달려면 로그인하십시오.

채택된 답변

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 = 
SUBHAM HALDAR
SUBHAM HALDAR 2024년 6월 11일
thank you. for your help.

댓글을 달려면 로그인하십시오.

카테고리

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