## 195 Reputation

12 years, 133 days

Amir

## Improve Algorithm Dsolve...

Maple 16

Hi,

I have the following code which solves a system od ode (3 ode) with constraint parameter. actually, this algorithm is time consuming and is not effective as I see that some people solve this odes with matlab in an efficient (qucik) way. So, I ask you if it is possible help me to improve the efficiency of the following code

thanks

restart:
eq1 := diff(u(eta), eta, eta)+diff(u(eta), eta)/ (eta+zet)+Gr*Pr*T(eta)-Nr*phi(eta)+sigma1;
eq2 := diff(T(eta), eta, eta)+diff(T(eta), eta)/(eta+zet)+Nb*diff(T(eta), eta)*diff(phi(eta), eta)+Nt*diff(T(eta), eta)^2-u(eta);
eq3 := diff(phi(eta), eta,eta)+diff(phi(eta), eta,eta)/(eta+zet)+ Nt/Nb*(diff(T(eta), eta, eta)+diff(T(eta), eta)/(eta+zet))-Le*u(eta);
zet:=0.1:
Nt:=0.05;
Nb:=0.05;
Le:=10;
Pr:=1;
Gr:=5;
Nr:=0.1;
Ree:=5;
#sigma:=2;

p:=proc(pp2) option remember; global res,F0,F1,F2;
if not type([pp2],list(numeric)) then return 'procname(_passed)' end if:
res := dsolve({subs(sigma1=pp2,eq1)=0,eq2=0,eq3=0,u(0)=0,u(1-zet)=0,phi(0)=0,phi(1-zet)=0,T(0)=0,T(1-zet)=0}, numeric,output=listprocedure);
F0,F1,F2:=op(subs(res,[u(eta),phi(eta),T(eta)]));
evalf((2/(1-zet^2))*Int(F0(eta)*(eta+zet),eta=0..1-zet))-Ree*Pr;
end proc;

fsolve(p(pp2)=0,pp2=(-80)..(80));   # I dont know what exactly this parameter has
#res := dsolve({eq1=0,eq2=0,eq3=0,u(0)=0,u(1-zet)=0,phi(0)=0,phi(1-zet)=0,T(0)=0,T(1-zet)=0}, numeric);

sigma1:=%;

res := dsolve({eq1=0,eq2=0,eq3=0,u(0)=0,u(1-zet)=0,phi(0)=0,phi(1-zet)=0,T(0)=0,T(1-zet)=0}, numeric);
with(plots):
odeplot(res,[[eta,u(eta)],[eta,phi(eta)],[eta,T(eta)]],0..1-zet);

## BVP with constraining integrals...

Maple 16

Hi,

i wrote the following code

restart:
zet:=0.5:
rhop:=3880;
rhobf:=998.2;
cp:=773;
cbf:=4182;

eq1 := diff(u(eta), eta, eta)+0.133762025280e-2/(0.993000000000e-3+0.388362300000e-1*phi(eta)+.530162700000*phi(eta)^2)+(1/(eta-1)+(0.388362300000e-1+1.06032540000*phi(eta))*(diff(phi(eta), eta))/(0.993000000000e-3+0.388362300000e-1*phi(eta)+.530162700000*phi(eta)^2))*(diff(u(eta), eta));
eq2 := diff(T(eta), eta, eta)+(.63267672*((2.66666666666*(-1.1752324*10^6*phi(eta)+4.1744724*10^6))*u(eta)/p2+7.04876575828*(diff(phi(eta), eta))-(1.58058605349*(.597+4.45959*phi(eta)))*(diff(T(eta), eta))/(1-eta)))/(.597+4.45959*phi(eta));
eq3 := diff(phi(eta), eta)-5.00000000000*phi(eta)*(diff(T(eta), eta));
p:=proc(pp2) if not type([pp2],list(numeric)) then return 'procname(_passed)' end if:

res := dsolve({eq1=0,subs(p2=pp2,eq2)=0,eq3=0,u(0)=0,u(1-zet)=0,phi(0)=0.008,T(0)=0,D(T)(0)=1}, numeric);
F0,F1,F2:=op(subs(res,[u(eta),phi(eta),T(eta)]));
res(parameters=[pp2]);
evalf(2/(1-zet^2)*Int((1-eta)*(F1(eta)*rhop+(1-F1(eta))*rhobf)*( F1(eta)*rhop*cp+(1-F1(eta))*rhobf*cbf )/(F1(eta)*rhop+(1-F1(eta))*rhobf)*F0(eta),eta=0..1-zet))-pp2
end proc;

fsolve(p(pp2)=0,pp2=(20000)..(8000000));

thanks

## solve an especial ode...

hi,

how can i solve the following ode

u'' + 3.4/ (u(0.25)*2+u(0.16)+2) + uu'=0

boundary conditions   u(0)=a  , u(0.5)=b

a and b are constants. for example a=0.1 and b=1

## Solving Integro differential equation...

Maple 16

hi

diff(u(eta), eta, eta)+.5699919300/(0.9930000000e-3+0.3883623000e-1*phi(eta)+.5301627000*phi(eta)^2)+1/(eta-1)+(0.3883623000e-1+1.060325400*phi(eta))*(diff(phi(eta), eta))*(diff(u(eta), eta))/(0.9930000000e-3+0.3883623000e-1*phi(eta)+.5301627000*phi(eta)^2) = 0;

diff(T(eta), eta, eta)+(5.05659*((-1.1752324*10^6*phi(eta)+4.1744724*10^6)*u(eta)/(int((1-eta)*(-1.1752324*10^6*phi(eta)+4.1744724*10^6)*u(eta), eta = 0 .. .5))+7.47*(diff(phi(eta), eta))/(1+7.47*phi[0])-(.1977617327*(.597+4.45959*phi(eta)))*(diff(T(eta), eta))/(1-eta)))/(.597+4.45959*phi(eta))=0;

diff(phi(eta), eta)-5.000000000*phi(eta)*(diff(T(eta), eta)) = 0;

with following boundary condition

u(0)=0,u(0.5)=0,phi(0)=1,T(0)=0,D(T)(0)=0

## unknown number of parameters...

Maple 16

Hi

i want to minimizez the "Eq1(h[1],h[2],...h[n])" for all the h[i] in the ranges of -1<h[i]<1.  "n" (number of unknown variables) can be determined during the code and was not know before. how can i do this?

It must be stated that when i have Eq1 and two unknown variables such as h[1] and h[2], i wrote the following code and it works good, but i dont know how can i write mentioned command for unknown number of variables.

NLPSolve(Eq1,h[1]=-1..1,h[2]=-1..1);