Message Boards Message Boards

0
|
299 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

How can I solve ODE system using RKF45 method with shoting technique?

Posted 21 days ago

I tried to solve the ODE system. But I have a initial conditions are variables. So I want to solve this problem using shooting technique and find the initial values...

(*Define constants*)
phi = 0.5; (*example value,replace with actual values*)
rhoF = 1.0; (*example value*)
rhoS = 1.5; (*example value*)
alpha = 30 Degree; (*example value*)
M = 0.1; (*example value*)
kNF = 1.0; (*example value*)
kF = 0.5; (*example value*)
Pr = 0.7; (*example value*)
CpF = 1.0; (*example value*)
CpS = 1.2; (*example value*)

(*Define the equations*)
eq1 = D[f[eta], {eta, 
       3}]/((1 - phi)^2.5*((1 - phi)*rhoF + phi*rhoS)) + (1/2)*
     D[f[eta], {eta, 2}]*f[eta]*Sin[alpha] + (1/2)*
     D[f[eta], {eta, 2}]*eta*Cos[alpha] - 
    M*(D[f[eta], eta] - 1)/((1 - phi)*rhoF + phi*rhoS) == 0;

eq2 = kNF*D[theta[eta], {eta, 2}]/kF + (1/2)*
     Pr*((1 - phi)*rhoF*CpF + phi*rhoS*CpS)*(f[eta]*Sin[alpha] + 
       eta*Cos[alpha])*D[theta[eta], eta] == 0;

(*Convert to first-order system*)
sys = {x1'[eta] == x2[eta], x2'[eta] == x3[eta], 
   x3'[eta] == -((1 - phi)^2.5*((1 - phi)*rhoF + 
         phi*rhoS)*(1/2*
          x3[eta]*(x1[eta]*Sin[alpha] + eta*Cos[alpha]) - 
         M*(x2[eta] - 1))), x4'[eta] == x5[eta], 
   x5'[eta] == -(kF*
       Pr*((1 - phi)*rhoF*CpF + 
         phi*rhoS*CpS)*(1/2*(x1[eta]*Sin[alpha] + eta*Cos[alpha])*
         x5[eta]/kNF))};

(*Initial conditions for the first-order system*)
ics = {x1[0] == 0, x2[0] == 0, 
   x3[0] == a,(*a should be defined with an appropriate value*)
   x4[0] == 1, 
   x5[0] == b  (*b should be defined with an appropriate value*)};
POSTED BY: J Prakash
3 Replies
Posted 20 days ago

@Mariusz Iwaniuk, Thanks for your response. It will be used for my work. One more question. I tried to solve this problem for the parameter values m = 2;

phi = 0.1; 
rho[f_] := 997.1; 
Cp[f_] := 4179; 
k[f_] := 0.613; 
rho[s_] := 5200; 
Cp[s_] := 670; 
k[s_] := 6; 
k[nf_] := k[f]*(k[s]+(m-1)*k[f]-(m-1)*phi*(k[f]-k[s]))/(k[s]+(m-1)*k[f]+phi*(k[f]-k[s]));
alpha = (1/2)*Pi; 
M = 1; 
Pr = 6.2;

But I got an error

POSTED BY: J Prakash

Try this:

POSTED BY: Mariusz Iwaniuk

Maybe this helps.

For RKF45 method see here and how works ParametricNDSolveValue see here.

POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract