MaplePrimes Questions

I have to make a plot for experimental data where x corresponds to time and y is the concentration. So I loaded the values in two lists, ran fit to least squares and got the best fitting curve (it's linear). However, the line has to start at (0,0). How can I Maple to do that for me?

Due to the seemingly persistent tabbing-problem, I would like to learn how to work with Maple using an external editor: If I could recreate my packages using an external editor, thereby avoiding both the tabbing-issue and the blowup associated with what I call the 'XML-contamination of documents', and from them create the associated libraries, then I would be satisfied. For then I would use only a single document in Maple worksheet mode as a front end. Therefore:

Can anyone point me to some information concerning 1.) choice of an editor, and 2.) how to use an external editor to create packages and libraries in Maple?

hi, I have tried to run this program unfortunately the program give some errors.

 

 

anneal < -function(fun, N, rho, t, theta)

{y=NULL  

theta.old=theta repea {  

s=0  for k from 1 to N  

{

f.old=fun(theta.old)

 theta.new=runif(1,-1,1)+theta.old

 f.new=fun(theta.new)  

if(f.new<f.old){

 theta.star=theta.new  

s=s+1

}

 else  

{

u=runif(1)

 b=(u<=exp(-(f.new-f.old)/(t)))

 theta.star=theta.new*b+theta.old*(1-b)

 s=s+b  

}  

theta.old=theta.star

 y=c(y,theta.star)  

}  

write(y,file="anneal.result",ncol=1,append=T)

y=NULL

 if(s==0)break

 t=rho*t  

if(t<0.1)break  }

 return(y)  

}

cauchy.1=function(alpha){x=c(-4.20,-2.85,-2.30,-1.02,0.70,0.98,2.72,3.50)  return(sum(log(0.01+(x-alpha)^(2))))}

x=seq(-6,6,,300)

y=sapply(as.list(x),cauchy.1)

plot(x, y, type = "1", ylab = "cauchy.1(beta=.1,alpha)", xlab = "alpha")

anneal.result=anneal(cauchy.1,300,.95,10,4)

plot(x, y, type = "1", ylab = "cauchy.1(beta=.1,alpha)", xlab = "alpha")

anneal.result=anneal(cauchy.1,300,.95,10,4)

x = scan("anneal.result")

plot(1:length(x),x,type="1"

 

can anyone help me on this? can i do something about it

Many thanks.

Hi everyone,

I have been  trying to solve a coupled system of 2 differencial equations, 1 PDEs with 1 ODE.

The code is below.

> restart;

> with(linalg):with(plots):
> PDE:=[diff(x(z,t),t)=(a/Pe)*diff(x(z,t),z$2)-a*diff(x(z,t),z)-(1-epsilon)/epsilon*3*Bi*(x(z,t)-1)/(1-Bi*(1-1/ksi(z,t)))]:
> a=2:Pe=3:Bi=5:epsilon=0.85:

> ODE := [diff(ksi(z,t),t) = (b*Bi*x(z,t)-1)/ksi(z,t)^2/(1-Bi*(1-1/ksi(z,t)))]:
> IC1:=c(z,0)=0:
> IC2:=ksi(z,0)=1:
> bc2:=diff(x(z,t),z):
> bc1:=x(z,t)-1/pe*diff(x(z,t),z):
> N:=10:
> L:=1:
> dyduf:=1/2*(-x[2](t)-3*x[0](t)+4*x[1](t))/h:
> dydub:=1/2*(-x[N-1](t)+3*x[N+1](t)+4*x[N](t))/h:
> dydu:=1/2/h*(x[m+1](t)-x[m-1](t)):
> d2ydu2:=1/h^2*(x[m-1](t)-2*x[m](t)+x[m+1](t)):
> bc1:=subs(diff(x(z,t),z)=dyduf,x(z,t)=x[0](t),z=1,bc1):
> bc2:=subs(x(z,t)-1/pe*diff(x(z,t),z)=dydub,x(z,t)=x[N+1](t),t=0,bc2):
> eq[0]:=bc1:
> eq[N+1]:=bc2:
> eq[m]:=subs(diff(x(z,t),z$2)=d2ydu2,diff(x(z,t),z)=dydu,diff(x(z,t),t)=dydu,x(z,t)=x[m](t),z=m*h,PDE):
> for i from 1 to N do eq[i]:=subs (m=i,eq[m]);od:
> x[0](t):=(solve(eq[0],x[0](t)));

> x[N+1](t):=solve(eq[N+1],x[N+1](t));

> for i from 1 to N do eq[i]:=eval(eq[i]);od:
> eqs:=[seq((eq[i]),i=1..N)]:
> Y:=[seq(x[i](t),i=1..N)];

> A:=genmatrix(eqs,Y,'B1'):
Error, (in linalg:-genmatrix) equations are not linear

> evalm(B1);

[B1[1], B1[2], B1[3], B1[4], B1[5], B1[6], B1[7], B1[8], B1[9],

B1[10]]

> B:=matrix(N,1):for i to N do B[i,1]:=B1[i]:od:evalm(B);

> h:=eval(L/(N+1));

 

> A:=map(eval,A);

 

> if N > 10 then A:=map(evalf,A);end:
> evalm(A);

 

> mat:=exponential(A,t);
Error, (in linalg:-matfunc) input must be a matrix

> mat:=map(evalf,mat):
> Y0:=matrix(N,1):for i from 1 to N do
> Y0[i,1]:=evalf(subs(x=i*h,rhs(IC)));od:evalm(Y0);
Error, invalid input: rhs received IC, which is not valid for its 1st argument, expr

 

> s1:=evalm(Y0+inverse(A)&*b):
Error, (in linalg:-inverse) expecting a matrix

> Y:=evalm(mat&*s1-inverse(A)&*b):
Error, (in linalg:-inverse) expecting a matrix

> Y:=map(simplify,Y):
> Digits:=5;

Digits := 5

> for i from 1 to N do x[i](t):=evalf((Y[i,1]));od:
Error, invalid subscript selector

> for i from 0 to N+1 do x[i](t):=eval(x[i](t));od;

 

> setcolors(["Red", "Blue", "LimeGreen", "Goldenrod", "maroon",
> "DarkTurquoise", "coral", "aquamarine", "magenta", "khaki", "sienna",
> "orange", "yellow", "gray"]);

["Red", "LimeGreen", "Goldenrod", "Blue", "MediumOrchid",

"DarkTurquoise"]

> pp:=plot([seq(x[i](t),i=0..N+1)],t=0..10,thickness=4);pt:=textplot([[0.28,0.15,typeset("Follow the arrow: ",x[0],"(t), ..., ",
> x[N+1],"(t).")]]):
Warning, unable to evaluate the functions to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct


pp := PLOT(THICKNESS(4), AXESLABELS(t, ""),

VIEW(0. .. 10., DEFAULT))

> display([pp,pt,arw],title="Figure 5.13",axes=boxed,labels=[t,"x"]);
Error, (in plots:-display) expecting plot structures but received: [arw]

 

In advance, thanks for the time of reading it!

Regards

Ozlem

How to group action on vector space in maple

team-iterator.mw
sample.xls

Howdy

I'm trying to import data from this spreadsheet into this program authored by C.Love.http://www.mapleprimes.com/questions/200480-Product-Grouping

Both files are in the same directory. it imports the data (to some degree), but has problems with order, when decimal points are introducing, also duplicates . see my annotations on the mw file.

 

 

Hi to you,

Lets do this;

.1234567891*10^10 +.5 - 1234567892;
                                                   0.

the result is -0.5 and not 0.

I'm new in Maple ... can you help to understand the problem?

Thanks in advance.

I have a TextArea component on the worksheet. Is it possible to create on the worksheet some number of Sliders, where the number of sliders is defined by the number entered in the TextArea?

Some three and a half years ago, after having upgraded from Maple 9.5 to Maple 11, I had to abandon the latter and return to the former, the problem being that the GUI did not allow me something as completely trivial as to go to the very end of a line by pressing END on my keyboard, see I declare defeat: rolling back to Maple 9.5.

With Microsoft phasing out updates for Windows XP as of April 2014, I decided to run Windows 7 instead of XP. According to MapleSoft, Maple 9.5 does not run under either 32 bit or 64 bit Windows 7, and thus I was forced to upgrade Maple.

Having installed Maple 17 an hour or so ago, I decided to open a Maple 9.5 document to see how it was rendered. To my complete surprise I found again that I was not able to move to the very end of a line using END on my keyboard. Can that really be true? This seems completely mad to me.

Hello, I am trying to solve 2 equations, and write the solution in a matrix form. How do I do it? This is what i did:

knn:=Matrix(10,1):

for m from 1 to 10 do
P:=fsolve({y=1/kn,y=-tan(kn)},{kn=(m-1)*Pi..m*Pi,y=0..5});
knn[m,1]:=P[1];
end do:

knn[3,1];

Answer is kn=9.317...

How to I get knn[3,1]=9.317...? without the "kn="

I would like to have a matrix of 10x1 with just the values of kn. Thank you.

Hello, how can i solve these equations

eq[1]:=a'[1](t)*p[1](x)+b*a[1](t)*p[1](x)

eq[2]:=a'[2](t)*p[2](x)+b*a[2](t)*p[2](x)

eq[3]:=a'[3](t)*p[3](x)+b*a[3](t)*p[3](x)

eq[4]:=c[1]*a[1](t)+c[2]a[2](t)+c[3]a[3](t)-q(t)

eq[5]:=d[1]*a[1](t)+d[2]a[2](t)+d[3]a[3](t)-p(t),

where p[i](x) , c[i] , d[i] , q(t) and p(t) are known functions?

Why does the following statement not evaluate, or better yet, how can I make it do so?

 

A:=value(floor(p)) assuming p>0,p<1,p::real;

or

A:=simplify(floor(p)) assuming p>0,p<1,p::real;

or any one of a lot of different attempts along the above lines, all of which seem (to me) that they should yield

A:=0

rather than

A:=floor(p)

which is what I get.

Thanks in advance

I write this system but I have 2 error

 

restart; params := [z = 0,

Omega = 2.2758,

tau = 13.8, T2 = 200,

omega0 = 1,

r = .7071,

s = 2.2758,

omega = .5]

 

sys1 := {diff(q(t), t) = -2*Omega*v(t)-s*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(k*z-omega*t)*(y(t)-x(t))-q(t)/T2,

diff(v(t), t) = Omega*q(t)-v(t)/T2,

diff(x(t), t) = 2*s*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(k*z-omega*t)*q(t)+y(t)/T1,

diff(y(t), t) = -2*s*exp(-r^2/omega0^2-t^2*1.177^2/tau^2)*cos(k*z-omega*t)*q(t)-y(t)/T1};

ICs1 := {q(-20) = 0, v(-20) = 0, x(-20) = 1, y(-20) = 0}

 

 

ans1 := dsolve(`union`(eval(sys1, params), ICs1), numeric, output = listprocedure); plots:-odeplot(ans1, [[t, x(t)], [t, y(t)], [t, q(t)], [t, v(t)]], t = -20 .. 20, legend = [x, y, q, v])

 

Error, invalid input: eval received params, which is not valid for its 2nd argument, eqns
Error, (in plots/odeplot) input is not a valid dsolve/numeric solution

The following integral is solved easily via a substitution. Why does Maple not evaluate it?


int(tan(x)^(1/3)*sec(x)^2, x)

int(tan(x)^(1/3)*sec(x)^2, x)

(1)

int(surd(tan(x), 3)*sec(x)^2, x)

int(surd(tan(x), 3)*sec(x)^2, x)

(2)

``


Download intsub.mw

First 1486 1487 1488 1489 1490 1491 1492 Last Page 1488 of 2426