Items tagged with maple maple Tagged Items Feed

The precise definition is that the distance between any two points of the rigid body remains constant. Although any body is deformed to move, if the deformation is small movement can be approximated by modeling it as a rigid body. Now let's see how Maple is part of the solution.

(in spanish)


Lenin Araujo C.




Hello fellow members. I recently got a new laptop, and installed Maple of course. Everything went smoothly until I attempted to approximate an answer.

I got the error message:

"[5] Error, invalid input: expected evalf[] index to be of type posint but received %ARG1"

Approximation works perfectly on my other computer and old laptop.

Any help?

Hey Everyone:

I was wondering what are your favorite and most useful code snippets that you often use. Maybe ones that are in your initialization code? Maybe ones that speed up something that you often do in maple? Maybe ones that you've seen on this and other websites and adopted for your own purposes?

For fun, I attach my init.mpl (.txt here, as .mpl attachments are not allowed by mapleprimes) here init.txt

Some of the snippets that I use the most are also listed below:

#rearrange curves inside an already created plot, so that certain curves are "on top" of the other ones.
#discussed here:
rearrangeCurves:= proc(
     v_items::specfunc(anything, PLOT),
     v_reorder::list([integer,integer]):= []
local p, curves, rest;
     (curves,rest):= selectremove(type, v_items, specfunc(anything, CURVES));
     curves:= < op(curves) >:         
     for p in v_reorder do
          curves[p]:= curves[p[[2,1]]]
     end do;
     PLOT(convert(curves,list)[], op(rest))
end proc:

#for numerical differentiation
#based on the idea from:
#example use:
#alist:=[seq(i, i=0..10, 0.1)]:
#data:=map(x->evalf(sin(x)), alist):
#plot(alist, data);
#plot([cos(x), 'num_diff(x, LinearAlgebra:-Transpose(Matrix([alist,data])))'], x=1..10, thickness=5, linestyle=[solid, dot], color=[blue, red]);
num_diff:=proc(x, v_data, v_options:=[method=spline, degree=3])
 #v_data is a matrix
 #TODO: let the data be in a more arbitrary format that ArrayInterpolation understands, but keep x as first var
 evalf(D[1](x->CurveFitting:-ArrayInterpolation(v_data, [x],v_options[])[])(x));

#extract nth columns/rows from a matrix
#these only work if have a 2d object... should be updated to also work
#with 1d row/column vectors
#Example use cases
#A := LinearAlgebra:-RandomMatrix(20, 20, outputoptions = [datatype = float[8]]);
#nthColumns(A, 2); #Every other column
#nthRows(A, 10)[.., 1..3]; #Every 10th row, but show only first 3 columns
nthColumns:=proc(v_m, v_n)
  v_m[..,[seq(i, i=1..rtable_size(v_m)[2], v_n)]]
nthRows:=proc(v_m, v_n)
  v_m[[seq(i, i=1..rtable_size(v_m)[1], v_n)],..]

#saves a png plot
savePlot:=proc(v_p, v_fileName, v_w:="800", v_h:="500")
    plotsetup("png", plotoutput=v_fileName, plotoptions=cat("quality=100,portrait,noborder,width=",v_w,",height=",v_h));


we always have subscript variable in the math book, but how could this be natral done in maple

I want to get a seq aaa3


but how could I get a  aij



seq(a[ij],i=1..3);  both was not right

I'm trying to solve some ODE analitically. But Maple gives me an incorrect solution. What am I doing wrong? Thank you.


I recently bought Maple 18 and noticed it was very unpleasant to look at. I saw it was running in low resolution on my Macbook Pro Retina late 2014. Why can I not untick it? This is not acceptable for the price I paid, and the fact I can't get my money back.

Any help would be highly appreciated.

Hi, I installed Maple 17 a while back and was able to work all the commands but recently I reinstalled it
I tried a command which gave me an error that I never got before


Error, (in Student:-Calculus1:-RiemannSum) external linking: error loading external library statshw.dll: The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail.

When I tried to reinstall the only issue was that it had trouble installing Visual C++ 2005 redistribute however I already have it on my computer and I don't intend to uninstall it since it took a long time to actually get my other programs to have it working. Is there anyhting I can do to fix this error? (Plotting other stuff seems to work fine except for Riemann Sums)

We are happy to announce the first results of a partnership between Maplesoft and the University of Waterloo to provide effective, engaging online education for technical courses.

Combining rich course materials developed by the University with Maple T.A. and Maplesoft technology for developing, managing, and displaying dynamic content, the Secondary School Courseware project supports high school students and teachers from around the world in their Precalculus and Calculus courses. The site includes interactive investigations, videos, and self-assessment questions that provide immediate feedback.

Feel free to take a look. The site is free, and no login is required.  

For more information about the project, see Online Mathematical Courseware.


When I open My Maple 18 on my Macbook pro, with all updates on the operating system and on Java, my Maple starts up fine, but when I press 2+2 and the enter, nothing happens.


I have tried reinstalling Maple, without any change of the problem


Per Kirkegaard

Hi I'm new to maple

I wanted to use dsolve to solve and equation but instead of getting an answer, maple returns an integration.

What could the promblem be?


Hello, I am new user of Maple and I have simple problem. I have different results after pasting and typing text. Can you help me?different signs

I am attempting to reproduce the the direction field for the the diferential equation below that I found in a book. I am using the dfieldplot command in the window x=0..3 and y=-1..1 but Maple is only plotting the field above the x-axis. I am aware that this is neither a linear DE nor does it posses a unique solution. Is the type of DE the problem here? Do I need to use a different command?



Dear All,

I am solving 6 ODE equations with boundary conditions using Runge kutta Felbergh 45 (Maple 12). then, i got this problem.. any suggestion??

Thank you :)


restart; with(plots); M := 3; k = .2; blt := 6; r := 2; l := .1; Pr := 6.8; Ec := 2; N := .5; rho := .5; Tv := .5; Tt := .5; c := 1; cm := .1; cp := .1

Eq1 := diff(f(eta), eta, eta, eta)+f(eta)*(diff(f(eta), eta, eta))-(diff(f(eta), eta))^2-M*(diff(f(eta), eta))+B*H(eta)*(F(eta)-(diff(f(eta), eta))) = 0;

diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta))-(diff(f(eta), eta))^2-3*(diff(f(eta), eta))+B*H(eta)*(F(eta)-(diff(f(eta), eta))) = 0


Eq2 := G(eta)*(diff(F(eta), eta))+F(eta)^2+B*(F(eta)-(diff(f(eta), eta))) = 0;

G(eta)*(diff(F(eta), eta))+F(eta)^2+B*(F(eta)-(diff(f(eta), eta))) = 0


Eq3 := G(eta)*(diff(G(eta), eta))+B*(f(eta)+G(eta)) = 0;

G(eta)*(diff(G(eta), eta))+B*(f(eta)+G(eta)) = 0


Eq4 := G(eta)*(diff(H(eta), eta))+H(eta)*(diff(G(eta), eta))+F(eta)*H(eta) = 0;

G(eta)*(diff(H(eta), eta))+H(eta)*(diff(G(eta), eta))+F(eta)*H(eta) = 0


Eq5 := diff(theta(eta), eta, eta)+Pr*(f(eta)*(diff(theta(eta), eta))-2*(diff(f(eta), eta))*theta(eta))+N*Pr*(theta1(eta)-theta(eta))/(rho*c*Tt)+N*Pr*Ec*(F(eta)-(diff(f(eta), eta)))^2/(rho*Tv) = 0;

diff(diff(theta(eta), eta), eta)+6.8*f(eta)*(diff(theta(eta), eta))-13.6*(diff(f(eta), eta))*theta(eta)+13.60000000*theta1(eta)-13.60000000*theta(eta)+27.20000000*(F(eta)-(diff(f(eta), eta)))^2 = 0


Eq6 := 2*F(eta)*theta1(eta)+G(eta)*(diff(theta1(eta), eta))+cp*(theta1(eta)-theta(eta))/(c*cm*Tt) = 0;

2*F(eta)*theta1(eta)+G(eta)*(diff(theta1(eta), eta))+2.000000000*theta1(eta)-2.000000000*theta(eta) = 0


bcs1 := f(0) = r, (D(f))(0) = -1, (D(f))(blt) = 0, F(blt) = 0, G(blt) = -f(blt), H(blt) = k, theta(0) = 1, theta(blt) = 0, theta1(blt) = 0;

f(0) = 2, (D(f))(0) = -1, (D(f))(6) = 0, F(6) = 0, G(6) = -f(6), H(6) = k, theta(0) = 1, theta(6) = 0, theta1(6) = 0


L := [0.1e-2];



for k to 1 do R := dsolve(eval({Eq1, Eq2, Eq3, Eq4, Eq5, Eq6, bcs1}, B = L[k]), [f(eta), F(eta), G(eta), H(eta), theta(eta), theta1(eta)], numeric, output = listprocedure); Y || k := rhs(R[2]); YP || k := rhs(R[3]); YR || k := rhs(R[4]); YQ || k := rhs(R[5]) end do

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging





print([(YP || (1 .. 1))(0)]);




P1 := plot([YP || (1 .. 1)], 0 .. 14, labels = [eta, (D(f))(eta)]):

Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct







restart; with(linalg); with(stats); with(plots); with(Statistics); with(LinearAlgebra); 

s := 1/(273.16+50); s1 := 1/(273.16+145); s3 := 1/(273.16+250); s2 := 1/(273.16+197.5); gamma0 := 0.1e-3; gamma1 := .5; gamma2 := 0.15e-2; beta := -3800;
c := 300; n := 200; tau1 := 99; tau2 := 120;

Delta := solve(1-exp(-(gam0*tau1+(1/2)*gam1*tau1^2)*exp(beta*s1)) = 1-exp(-(gam0*a+(1/2)*gam1*a^2)*exp(beta*s2)), a);
a := Delta[1];

Theta := solve(1-exp(-(gam0*(a+tau2-tau1)+(1/2)*gam1*(a+tau2-tau1)^2)*exp(beta*s2)) = 1-exp(-(gam0*b+(1/2)*gam1*b^2)*exp(beta*s3)), b);
b := Theta[1];

n1 := n*(int((gam1*t+gam0)*exp(beta*s1)*exp(-(gam0*t+(1/2)*gam1*t^2)*exp(beta*s1)), t = 0 .. tau1));
200. - 200. exp(-0.01119474511 gam0 - 0.5541398828 gam1)
n2 := (n-n1)*(int((gam1*t+gam0)*exp(beta*s2)*exp(-(gam0*t+(1/2)*gam1*t^2)*exp(beta*s2)), t = a .. a+tau2-tau1));

g1 := -n1(gam0, gam1)*(int((1/(gam1*t+gam0)-t*exp(beta*s1))*(gamma2*t^2+gamma1*t+gamma0)*exp(beta*s1)*exp(-(gamma0*t+(1/2)*gamma1*t^2+(1/3)*gamma2*t^3)*exp(beta*s1)), t = 0 .. tau1))-evalf(n2(gam0, gam1)*(int((1/(gam0+gam1*(a+t-tau1))-(a+t-tau1)*exp(beta*s2))*(gamma0+gamma1*(a+t-tau1)+gamma2*(a+t-tau1)^2)*exp(beta*s2)*exp(-(gamma0*(a+t-tau1)+(1/2)*gamma1*(a+t-tau1)^2+(1/3)*gamma2*(a+t-tau1)^3)*exp(beta*s2)), t = tau1 .. tau2)))

g2 := -n1*(int((t/(gam1*t+gam0)-(1/2)*t^2*exp(beta*s1))*(gamma2*t^2+gamma1*t+gamma0)*exp(beta*s1)*exp(-(gamma0*t+(1/2)*gamma1*t^2+(1/3)*gamma2*t^3)*exp(beta*s1)), t = 0 .. tau1))-evalf(n2*(int(((a+t-tau1)/(gam0+gam1*(a+t-tau1))-(1/2)*(a+t-tau1)^2*exp(beta*s2))*(gamma0+gamma1*(a+t-tau1)+gamma2*(a+t-tau1)^2)*exp(beta*s2)*exp(-(gamma0*(a+t-tau1)+(1/2)*gamma1*(a+t-tau1)^2+(1/3)*gamma2*(a+t-tau1)^3)*exp(beta*s2)), t = tau1 .. tau2)))

solve({g1 = 0, g2 = 0}, {gam0, gam1})

I want to find the answer of gam0 and gam1. It takes me 20 hours until now...and still evaluating...

Please Help ..

I can't directly copy Maple code into messages but have to insert into Word first, apply some changes that for better readability and copy it from there via Word-paste. Is there a direct way?

1 2 3 4 5 6 7 Last Page 3 of 268