필터 지우기
필터 지우기

Need help while defining ode function for bvp4c/bvp5c/ode45 solve

조회 수: 4 (최근 30일)
Md Sojib
Md Sojib 2024년 6월 6일
댓글: Torsten 2024년 6월 6일
I wanted to define system of ode functions for my higher order problems. I have differential equations are :
x=cosy
z=siny
y'=sqrt((lambda*f*p*siny/x)+(siny^2/x^2)-(2/lambda^2)+(2*cosy/lambda)-(3*a*p^2*lambda^2/2))
y"=(-y'*x'/lambda*x)-(cosy/x)-(f*p'/4)-(f*x'*p/4*x)+(y'*cosy/x)+(siny/lambda)+(lambda*f*p*cosy/4*x)+(siny*cosy/x^2)+(mu_1*(sin(y) - mu_2*cos(y)) / (2 * x^2)
where, y,x,p are functions of s. and f,lambda and a are constants.
while defining ode function for my bvp solve, I write the code as
function dydx = odefun2(t, y, params)
lambda = params.lambda;
a = params.a;
f = params.f;
mu_1=params.mu_1;
mu_2=params.mu_2;
y1 = y(1); % y
y2 = y(2); % x
y3 = y(3); % z
y4 = y(4); % p
y5 = y(5); % p_dot
y6 = cos(y1); %x_dot
y7 = sin(y1); %z_dot
ydot = sqrt((lambda * f * y4 * sin(y1) / y2) + (sin(y1)^2 / y2^2) - (2 / lambda^2) + (2 * cos(y1) / lambda) - (3 * a * (y4^2) * lambda^2)/2);
yddot = -((ydot * cos(y1) / (lambda * y2))) - (cos(y1) / y2) - (0.5 * y5 / 4) - (0.5 *cos(y1) * y4 / (4 * y2)) + (ydot * cos(y1) / y2) + (sin(y1) / lambda) + (0.5 * lambda * y4 * cos(y1) / (4 * y2)) + (sin(y1) * cos(y1) / y2^2) + (mu_1*(sin(y1) - mu_2*cos(y1)) / (2 * y2));
dydx = [y5; y6; y7; ydot; yddot];
end
But I have no equation for p'. And I am not sure that how can I relate x and z with x' and z' respectively. Also I don't have any differential equation for p'. how I should relate p and p'?
need some suggestions.
  댓글 수: 11
Md Sojib
Md Sojib 2024년 6월 6일
편집: Md Sojib 2024년 6월 6일
I don't have any separate equation for p or p'. But after derivation, differential equations contains these two terms.
Torsten
Torsten 2024년 6월 6일
Then you will have to dive into the derivation of the equations again. If you don't know the equation for a function within your problem formulation, how do you want to solve it ?

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by