## How to get merge list of lists?...

So given a list [ [ [1,2], [2,1] ], [ [3,4], [4,3] ], [ [5] ] ],

I would like to produce a list

[ [1,2,3,4,5], [1,2,4,3,5], [2,1,3,4,5], [2,1,4,3,5] ]

so it makes a combination of sublist of every lists in the given list

is there a way to do it ?

Thanks,

## Minimization under several conditions ...

Hi all

Assume that we have a cost functional, namely J, which we want to be minimized but we have to set of constraint CC1 and CC2.

what should we do it?

The code which I have written is attached(Minimize J under CC1[i]=0 and CC2[i]=0)

any suggestion or guide is

Ph.D Candidate

Applied Mathematics Department

## Unterminated loop in procedure ...

Dear all,

I'm having trouble defining a Maple procedure containing for loops. I have one outer for loop which I terminate at the end and two separate for loops of which the first one get's terminated before the second one starts. Nethertheless Maple complains, that my outer loop doesn't get terminated and points to to a point before the second inner for loop starts. I based this procedure on a procedure I defined in another worksheet and the latter one is working just fine, although the structure ist the same in both procedures. As far as I can see, the structure is

for n from 0 to T do
for i from 1 to J do
....
end do;
for i from J-2 to 1 by -1 do
end do;

end do;

I have several if statements in the procedure, too, but as far as I can see, everything is terminated fine. Perhaps there is something else wrong with my procedure and I'm just getting a strange error? I would really appreciateit, if somebody could take a short look at the problem. Since the procedure takes up several pages I'm uploading my Maple work sheet. The relevant procedure is the one defined just after the red comment "#  actual code" which is about 60% through the work sheet.

Thank you all.

BD_collapse_2.mw.

## Wrong calculations of the results...

Dear Collagues

I wrote a code to solve a system of ode numerically. When the equations have been solved, I want to find the value of MTE which is in integral form. I check and see that the value of MTE is calculated wrong. I dont know why?

I calculated the values of MTE twice (another variable is masst below res1). Two different answers!!

I would be most grateful if you could help me.

Thank you

Here is my code

restart:
EPSILONE:=1:
#Digits:=10:

a[mu1]:=39.11:
b[mu1]:=533.9:
a[k1]:=7.47:
b[k1]:=0:

rhop:=5180:
rhobf:=998.2:
#gama1:=0.2;
mu1[bf]:=9.93/10000:
k1[bf]:=0.597:

rhost(eta):=1-phi(eta)+phi(eta)*rhop/rhobf;
#mu:=unapply(mu1[bf]/(1-phi(eta))^2.5,eta);
mu:=unapply(mu1[bf]*(1+a[mu1]*phi(eta)+b[mu1]*phi(eta)^2),eta);
#mu1[bf]:=9.93/10000:
k:=unapply(k1[bf]*(1+a[k1]*phi(eta)+b[k1]*phi(eta)^2),eta);
mu(eta)/mu1[bf];

#eq1:=diff((mu(eta)/mu1[bf])*diff(u(eta),eta),eta)+rhost(eta)-Ha^2*u(eta);
eq1:=(a[mu1]*(diff(phi(eta), eta))+2*b[mu1]*phi(eta)*(diff(phi(eta), eta)))*(diff(u(eta), eta))+(1+a[mu1]*phi(eta)+b[mu1]*phi(eta)^2)*(diff(u(eta), eta, eta))+rhost(eta)-Ha^2*u(eta);
eq2:=diff((k(eta)/k1[bf])*diff(T(eta),eta),eta);
eq3:=diff(phi(eta),eta)+phi(eta)/(N_bt*(1+gama1*T(eta))^2)*diff(T(eta),eta):
eq2:=subs(phi(0)=phi0,eq2);
eq3:=subs(phi(0)=phi0,eq3);

eval(dsolve({eq3,phi(1)=phiv},phi(eta)),(T)(1)=1);
Phi:=normal(combine(%));
Teq:=isolate(eval(eq2,Phi),diff(T(eta),eta));
ueq1:=eval(eq1,Phi)=0:
ueq2:=subs(Teq,ueq1):

Agama1:=<<0.1>,<0.2>,<0.3>>:
ANBT:=<<0.2>,<1>,<10>>:
Aphiv:=<<0.02>,<0.06>,<0.1>>:
lambda:=0;
Ha:=0;
#NBT:=0.5:
N_bt:=cc*NBT+(1-cc)*10;
#phiv:=0.02:

kratio:=k1[p]/k1[bf];

eq1;
eq2;
eq3;

res1 := dsolve(subs(NBT=1,gama1=0.3,phiv=0.06,{eq1,eq2,eq3,u(0)=lambda*D(u)(0),D(u)(1)=0,T(0)=0,phi(1)=phiv,T(1)=1}), numeric,method=bvp[midrich],output=listprocedure,continuation=cc):
G0,G1,G2:=op(subs(subs(res1),[phi(eta),u(eta),diff(T(eta),eta)])):

masst:=evalf(int((1-G0(eta)+G0(eta)*rhop/rhobf)*G1(eta), eta = 0..1));
heatt:=(1+a[k1]*G0(0)+b[k1]*G0(0)^2)*G2(0);

for iNBT from 1 to 3 do

for iphi from 1 to 3 do

for igamma from 1 to 3 do

res := dsolve(subs(NBT=ANBT(iNBT),gama1=Agama1(igamma),phiv=Aphiv(iphi),{eq1,eq2,eq3,u(0)=lambda*D(u)(0),D(u)(1)=0,T(0)=0,phi(1)=phiv,T(1)=1}), numeric,method=bvp[midrich],output=listprocedure,continuation=cc):
F0,F1,F2:=op(subs(subs(res),[phi(eta),u(eta),diff(T(eta),eta)])):
MTE[iNBT,iphi,igamma]:=evalf(Int((1-F0(eta)+F0(eta)*rhop/rhobf)*F1(eta), eta = 0..1)):
HTC[iNBT,iphi,igamma]:=(1+a[k1]*F0(0)+b[k1]*F0(0)^2)*F2(0):

end do;

end do;

end do;

for iNBT from 1 to 3 do

for iphi from 1 to 3 do

for igamma from 1 to 3 do

print (convert(HTC[iNBT,iphi,igamma],float,9));

end do;

end do;

end do;
for iNBT from 1 to 3 do

for iphi from 1 to 3 do

for igamma from 1 to 3 do

print (convert(MTE[iNBT,iphi,igamma],float,9));

end do;

end do;

end do;

Amir

## Adding text to the left of the vertical axis...

I want to add text to the left of the vertical axis so I need more background space such that the full text fits to the left

As it is now it will appear truncated. I do not want to change the graph itself but I want to increase the background area around the axes so I can enter a text block using the drawing tools.

## How to make constants?...

_C1, _C2, _C3 are constant, how to set them constant, to make diff(_C2) = 0 etc

eval(simplify(subs(a=_C1,subs(b=1/(diff(c(t), t)),subs(c=_C2+_C3*exp(-t),eq2)))));

(diff(_C2(t), t)+(diff(_C3(t), t))*(exp(-t))(t)+_C3(t)*(diff((exp(-t))(t), t)))*(-(diff(_C1(t), t))*(diff(diff((c(t))(t), t), t))/(diff((c(t))(t), t))^2+(diff(s(t), t))/(diff((c(t))(t), t)))
a

## How to check input in Maple TA?...

Assume the inequality xA,2+xB,2+xC,2 ≤ 110 has to be entered as "symbolic entry only".

How can I check that in Maple T.A.?

It seems that there are type conversions necessary. I attempted to use the MathML package without any luck.

1. Tried to transform \$ANSWER within the answer field using MathML[ExportPresentation]( x[A,2]+x[B,2]+x[C,2] <= 110) and compare it with evalb((\$ANSWER)=(\$RESPONSE)) in the grading code field
2. Tried to transform \$RESPONSE in the grading code: evalb((\$ANSWER)=( MathML[ImportContent] (\$RESPONSE)))

What’s the format of a symbolic entry? Is it really MathML!?

What is the correct way to do it?

3. expression type: Maple syntax?!
4. Text/Symbolic entry: Symbolic entry only

## Analytic solution of dsolve...

Dear Collegues

I have a system of odes as follows

restart:
#gama1:=0.2:

#rhop:=5180:
#rhobf:=998.2:
#a[mu1]:=39.11:
#b[mu1]:=533.9:
#a[k1]:=7.47:
#b[k1]:=0:

Teq := N_bt*T(eta)^2*(exp(-(T(eta)-1)/(N_bt*(1+gama1)*(1+gama1*T(eta)))))^2*(diff(T(eta), eta, eta))*gama1^2*b[k1]+N_bt*T(eta)^2*exp(-(T(eta)-1)/(N_bt*(1+gama1)*(1+gama1*T(eta))))*(diff(T(eta), eta, eta))*gama1^2*a[k1]+2*N_bt*T(eta)*(exp(-(T(eta)-1)/(N_bt*(1+gama1)*(1+gama1*T(eta)))))^2*(diff(T(eta), eta, eta))*gama1*b[k1]+N_bt*T(eta)^2*(diff(T(eta), eta, eta))*gama1^2;

UEQ:=(a[mu1]*(-(diff(T(eta), eta))/(N_bt*(1+gama1)*(1+gama1*T(eta)))+(T(eta)-1)*gama1*(diff(T(eta), eta))/(N_bt*(1+gama1)*(1+gama1*T(eta))^2))*exp(-(T(eta)-1)/(N_bt*(1+gama1)*(1+gama1*T(eta))))+2*b[mu1]*(exp(-(T(eta)-1)/(N_bt*(1+gama1)*(1+gama1*T(eta)))))^2*(-(diff(T(eta), eta))/(N_bt*(1+gama1)*(1+gama1*T(eta)))+(T(eta)-1)*gama1*(diff(T(eta), eta))/(N_bt*(1+gama1)*(1+gama1*T(eta))^2)))*(diff(u(eta), eta))+(1+a[mu1]*exp(-(T(eta)-1)/(N_bt*(1+gama1)*(1+gama1*T(eta))))+b[mu1]*(exp(-(T(eta)-1)/(N_bt*(1+gama1)*(1+gama1*T(eta)))))^2)*(diff(u(eta), eta, eta))+1-exp(-(T(eta)-1)/(N_bt*(1+gama1)*(1+gama1*T(eta))))+exp(-(T(eta)-1)/(N_bt*(1+gama1)*(1+gama1*T(eta))))*rhop/rhobf;

I want to solve them with the following boundary conditions

T(0)=0, T(1)=1

u(0)=L*D(u)(0), D(u)(1)=0

However I tried, I cannot find the solution in a closed form. I want to know that is there a closed form solution for the above odes?

Thank you

Amir

## If statement within sequence or list creation...

Hi I am not very used to Maple since I used mathematica previously.

So is there way to put an if statement within sequecne definition? that is,

id = 1;

seq(if(i>2, idx += 1), idx+i , i=1..10)

something like this where if statement runs and then idx+i is added to the sequence, as if I am running a loop.

Thanks

## How to enlarge number of variables?...

1.

with(RegularChains):
with(ConstructibleSetTools):
source1 := PolynomialRing([a,b,c]);
target1 := PolynomialRing([e1,e2,e3,e4]);
source1list := [eq2a, eq3a,eq4a];
target1list := [eq2b, eq3b, eq4b,eq5b];
cs := PolynomialMapPreimage(target1list, source1list, source1, target1);

Error, (in RegularChains:-ConstructibleSetTools:-PolynomialMapPreimage) number of map functions is different from number of variables in target space

in maple 15 do not have error, however now it has error for the code below

with(RegularChains): with(RegularChains): with(ConstructibleSetTools):

source1 := PolynomialRing([e1, e2, e3]);
target1 := PolynomialRing([a, b, c]);
source1list := [-1*e1+2*e2+*e3, -1*e1+2*e2+*e3, -1*e1+2*e2+*e3];
target1list := [.....]; cs :=
PolynomialMapPreimage(target1list, source1list, source1, target1);

Error, invalid product/quotient

## How to generate list of permutations? ...

I'm trying to implement a function that gets list1 and list2 to return a list of permutations that permute list1 to list2.

Is there any good way to do this?

## How to show what group is? ...

http://www.maplesoft.com/support/help/Maple/view.aspx?path=GroupTheory/SylowSubgroup

P2:=SylowSubgroup(2,G);

P2;

in above example, it can show a permutation group

G:=AlternatingGroup(5);

P2:=SylowSubgroup(3,G);

a permutation group on .... letters

but in some example such as above, it only show a statement a permutation group on .... letters

how to show what it is?

## How to find what was updated?...

Hello;

I had Maple 2015.1 running. I did Tools->check for update. It said that there is an update available! then I did ok, go and update. Maple downloaded about 60 MB of stuff, asked me to close Maple to finish the update. I close Maple, and it finished the update with no problem.

When I open Maple, I still see it saying 2015.1, so what was the update for?

It will be nice if Maple tells the users what the update is going to be for. Like saying something to the effect that version XX.XX is available or something. It just said update available.

How can one find what was updated, and why did the version number not get changed? Is there a log file or some command one can use that shows the updates made to current version one is using?

Help->About still says 2015.1, is it possible Maple update just forgot to change the version number? What is the current and latest version number of Maple?

When I do check for update now, it says no update is available. So I must be running the latest version. But this what what I had before I updated?

kernelopts(version)
Maple 2015.1, X86 64 WINDOWS, Jun 3 2015, Build ID 1049007

I am on windows 7, 64 bits.