Items tagged with maple maple Tagged Items Feed

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:
#http://www.mapleprimes.com/questions/201626-Order-Of-Curves-In-A-Plot
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:
#http://www.mapleprimes.com/posts/119554-Data-Interpolation
#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));
end:

#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)]]
end:
nthRows:=proc(v_m, v_n)
  v_m[[seq(i, i=1..rtable_size(v_m)[1], v_n)],..]
end:


#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));
    print(plots[display](v_p));
    Threads[Sleep](2):
    fclose(v_fileName):
    plotsetup(default);
end:

 

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

seq(a[i],i=1..3)

but how could I get a  aij

seq(a[i_j],i=1..3);

and

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

>rightsum:=RiemannSum(1/x^2,x=50..75,partition=25,method=right,output=plot);


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.

eithne

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?

Thanks

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?

diff(y(x),x)=3*y(x)^(2/3)

 

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 :)

ISPC3.mw

``

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

(1)

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

(2)

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

(3)

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

(4)

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

(5)

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

(6)

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

(7)

L := [0.1e-2];

[0.1e-2]

(8)

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

 

R

R

(9)

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

[YP1(0)]

(10)

``

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

 

plots:-display([P1]);

 

``

``


Download ISPC3.mw

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?

Hello People in Mapleprimes,

 

I have a question about the codes in the help page of assign.

Please tell me about this.

The folliowing codes were written there:

code (A)

assign(a,c):

assign(a=d,b=2):

a,b,c;

 

The output of these was 

d,2,d

 

I think that assign(a,c) means assign(a=c) or a:=c, not c:=a.

If what I wrote was true, the output of the above code should be

d,2,c.

And, if I changed assign(a,c) to assign(c,a), the output was d,2,d, which is the output written on the helppage 

of the assign. On the other hand, the output of code A was surely d,2,d.

Why does assign(a,c) have the same meaning as assign(c,a)?

 

Best wishes

 

taro

Happy New Year! Now that 2014 is behind us, I thought it would be interesting to look back on the year and recap our most popular webinars. I’ve gathered together a list of the top 10 academic webinars from 2014 below. All these webinars are available on-demand, and you can watch the recording by clicking on the webinar titles below.

-----------------------------------------------

See What’s New in Maple 18 for Educators

In this webinar, an expert from Maplesoft will explore new features in Maple 18, including improved tools for developing quizzes, enhanced tools for visualizations, updated user interface, and more.

Introduction to Teaching Calculus with Maple: A Complete Kit

During this webinar you will learn how to boost student engagement with highly interactive lectures, reinforce concepts with built-in “what-if” explorations, consolidate learning with carefully-constructed homework questions, and more.

Maplesoft Solutions for Math Education

In this webinar, you will learn how Maple, The Möbius Project, and Maplesoft’s testing and assessment solutions are redefining mathematics education.

Teaching Concepts with Maple

This webinar will demonstrate the Teaching Concepts with Maple section of our website, including why it exists and how to use it to help students learn concepts more quickly and with greater insight and understanding.

Revised Calculus Study Guide - A Clickable-Calculus Manual

This webinar will provide an overview of the Revised Calculus Study Guide, the most complete guide to how Maple can be used in teaching and learning calculus without first having to learn any commands.

Clickable Engineering Math: Interactive Engineering Problem Solving

In this webinar, general engineering problem-solving methods are presented using clickable techniques in the application areas of mechanics, circuits, control, and more.

Hollywood Math 2

In this second installment of the Hollywood Math webinar series, we will present some more examples of mathematics being used in Hollywood films and popular hit TV series.

Robotics Design in Maple and MapleSim

In this webinar, learn how to quickly create multi-link robots by simply defining DH parameters in MapleSim. After a model is created, learn to extract the kinematic and dynamic equations symbolically in Maple.

Introduction to Maple T.A. 10

This webinar will demonstrate the key features of Maple T.A. from both the instructor and student viewpoint, including new features in Maple T.A. 10.

The Möbius Project: Bringing STEM Courses Online

View this presentation to better understand the challenges that exist today when moving a STEM course online and to find out how the Maplesoft Teaching Solutions Group can help you realize your online course vision.

-----------------------------------------------

Are there any topics you’d like to see us present in 2015? Make sure to leave us a comment with your ideas!

Kim

3 4 5 6 7 8 9 Last Page 5 of 270