Preben Alsholm

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@Chrissieh18 You could upload a worksheet.

Actually I strongly suspect that you are missing a multiplication sign between r and t in the exponential function. That is also the reason for the way I formulated my answer.

@ilods I don't know how you modified my code to make it eat 4 giga.

I tried myself and have uploaded the result. The time used for different a's on my machine is between 2 and 3 minutes.

MaplePrimes12-09-21.mw

##############

Sept.24: Here is yet another version, which computes a plot at the average of 1 minute.

MaplePrimes12-09-21C.mw

@ilods I don't know how you modified my code to make it eat 4 giga.

I tried myself and have uploaded the result. The time used for different a's on my machine is between 2 and 3 minutes.

MaplePrimes12-09-21.mw

##############

Sept.24: Here is yet another version, which computes a plot at the average of 1 minute.

MaplePrimes12-09-21C.mw

@ilods odeplot uses adaptive plotting when you use the refine option. However, if you don't it seems to have equal spacing between the t-values. The following example seems to support this claim.

#First without range and refine:
restart;
res:=dsolve({diff(y(t),t)=x(t)^2,diff(x(t),t)=-y(t),x(0)=0,y(0)=1},numeric):
p:=plots:-odeplot(res,[x(t),y(t)],0..3.2):
plottools:-getdata(p):
M:=%[-1];
plots:-odeplot(res,[t,t],0..3.2): #To see the t-values
plottools:-getdata(%);
Mt:=%[-1];
op(1,Mt)[1];
#The spacings are the same:
{seq(Mt[i,1]-Mt[i-1,1],i=2..op(1,Mt)[1])};
3.2/200;
#Now with range and refine:
restart;
res:=dsolve({diff(y(t),t)=x(t)^2,diff(x(t),t)=-y(t),x(0)=0,y(0)=1},numeric,range=0..3.2):
p:=plots:-odeplot(res,[x(t),y(t)],0..3.2,refine=1):
plottools:-getdata(p):
M:=%[-1];
plots:-odeplot(res,[t,t],0..3.2,refine=1):
plottools:-getdata(%);
Mt:=%[-1];
op(1,Mt)[1];
#The spacings are quite different:
evalf[4]({seq(Mt[i,1]-Mt[i-1,1],i=2..op(1,Mt)[1])});
####################################
#Finally, you also have the possibility of using output=Array as in the following:
restart;
res:=dsolve({diff(y(t),t)=x(t)^2,diff(x(t),t)=-y(t),x(0)=0,y(0)=1},
numeric,output=Array([seq(3.2/200*i,i=0..200)]));
plots:-odeplot(res,[x(t),y(t)],0..3.2);
res[1,1];
TXY:=res[2,1];
TXY[1..10,1];


@ilods odeplot uses adaptive plotting when you use the refine option. However, if you don't it seems to have equal spacing between the t-values. The following example seems to support this claim.

#First without range and refine:
restart;
res:=dsolve({diff(y(t),t)=x(t)^2,diff(x(t),t)=-y(t),x(0)=0,y(0)=1},numeric):
p:=plots:-odeplot(res,[x(t),y(t)],0..3.2):
plottools:-getdata(p):
M:=%[-1];
plots:-odeplot(res,[t,t],0..3.2): #To see the t-values
plottools:-getdata(%);
Mt:=%[-1];
op(1,Mt)[1];
#The spacings are the same:
{seq(Mt[i,1]-Mt[i-1,1],i=2..op(1,Mt)[1])};
3.2/200;
#Now with range and refine:
restart;
res:=dsolve({diff(y(t),t)=x(t)^2,diff(x(t),t)=-y(t),x(0)=0,y(0)=1},numeric,range=0..3.2):
p:=plots:-odeplot(res,[x(t),y(t)],0..3.2,refine=1):
plottools:-getdata(p):
M:=%[-1];
plots:-odeplot(res,[t,t],0..3.2,refine=1):
plottools:-getdata(%);
Mt:=%[-1];
op(1,Mt)[1];
#The spacings are quite different:
evalf[4]({seq(Mt[i,1]-Mt[i-1,1],i=2..op(1,Mt)[1])});
####################################
#Finally, you also have the possibility of using output=Array as in the following:
restart;
res:=dsolve({diff(y(t),t)=x(t)^2,diff(x(t),t)=-y(t),x(0)=0,y(0)=1},
numeric,output=Array([seq(3.2/200*i,i=0..200)]));
plots:-odeplot(res,[x(t),y(t)],0..3.2);
res[1,1];
TXY:=res[2,1];
TXY[1..10,1];


What is Eq75 and what is Z2? Is Eq75 really the same as Sol?

First: Data about Ti is missing.

But apart from that you clearly get results (with any reasonable Ti) and with h=1. So what is the requirement that should enable you to determine h, i.e. the temperature dependence of the heat transfer coefficient?
Do you mean to insert h as a function of the surface temperature, like h=f(Theta(rb,t)) where f is known?

First: Data about Ti is missing.

But apart from that you clearly get results (with any reasonable Ti) and with h=1. So what is the requirement that should enable you to determine h, i.e. the temperature dependence of the heat transfer coefficient?
Do you mean to insert h as a function of the surface temperature, like h=f(Theta(rb,t)) where f is known?

Could we have the data? So we could see what is going on?

Variables := ExcelTools:-Import("C:\\Users\\Documents\\Maple\\MAPLE - MARCH 2011\\InputVariables.xls", "InputVariables", "D5:D25");


@marram When defining phi at the end you make it a function of (n,t,x), but no t appears in the expression. Also in Gterm there appears lambda(j)*t. But what is lambda?

@marram When defining phi at the end you make it a function of (n,t,x), but no t appears in the expression. Also in Gterm there appears lambda(j)*t. But what is lambda?

It works for me in Maple 15 and Maple 16. The elementwise operations of a function f on a container A (list,set Vector, Matrix, Array) works by appending a tilde onto f:   f~(A);

This was introduced in Maple 13.

It works for me in Maple 15 and Maple 16. The elementwise operations of a function f on a container A (list,set Vector, Matrix, Array) works by appending a tilde onto f:   f~(A);

This was introduced in Maple 13.

@marram You write vterm := int(D[2](Gterm)(n,1,x,t-tau),tau=0..t);

but Gterm is a function of 5 variables j,n,x,y,t.

@marram You write vterm := int(D[2](Gterm)(n,1,x,t-tau),tau=0..t);

but Gterm is a function of 5 variables j,n,x,y,t.

First 194 195 196 197 198 199 200 Last Page 196 of 231