AmusingYeti

140 Reputation

8 Badges

6 years, 164 days

MaplePrimes Activity


These are answers submitted by AmusingYeti

I will get you started on each one. These exercises are best done by yourself for practice though:

Q1:

restart:

f:=(1+(0.5/n))^n:

seq(f,n=1..25);

Q2:

Centred at x=0, the taylor series will give (Easily converted to Sigma form):

8*x^3 - 32*x^6 + (512*x^9)/3 + ...

Q3:

The question asks for "plot" rather than "project" so I assume this is a standard plot, rather than a projection of the surface onto the plane

restart:

f:=(x,y)->x^2/4+y^2/8+1:

plot3d(f,-1..3,-1..3);

Q4:

restart:

lim1:=sqrt(1-x^2):
int1:=int(int(3*sqrt(1-x^2-y^2),y=0..lim1),x=-1..1);

-Yeti

Save the SignExpAlg.mw as SignExpAlg.mpl

MPL files (MaPle Language files) can be executed from within Maple using the read statement.

-Yeti

Depending on what you are looking for, if it is a question then just uploading the Maple worksheet (greenarrow) will be the best option.

I am not sure about others on here but I much prefer to work with the Maple syntax rather than the "pretty" printed formatting.

Using the "insert code snippet" option on here for a simple differential equation with boundary conditions copy and pasted from Maple:

restart:

pde:=diff(u(x,t),t,t)=c^2*(diff(u(x,t),x,x));

bc:=u(0,t)=0,u(l,t)=0:

pdsolve([pde,bc]) assuming l>0, x<=l;

-Yeti

ignore this answer, I misread your question and thought you were doing something else.

-Yeti

 


As you are wanting to use numerical integration everything in your integrand aside from the integration variable must be defined. You have not defined Jo, q and T. I set these quantities to equal 1 and it evaulated to give 0.6057055096 for both methods.

Numerical integration requires the integrand to be completely defined in order for approximate methods to work. It is not like the usual analytical route where you keep things undefined in the hope of finding a completely general answer to the integration.

restart:

f:=(x)-> 2*x^2-4*x:  ## Function definition

plot({f(x),2*f(x),4*f(x),-f(x),-4*f(x)},x=0..5);

 

I just set the plotting range to 0..5 but this can be changed to anything you want. They can also be plotted individually as well by giving them their own plot commands.

- Yeti

I was able to export your plot and open in preview/adobe reader with no issues on my Mac using both Maple 17 and Maple 2015. How are you exporting the images? Is it by right clicking the image or with the use of ImageTools[Export] ?

You could always use imagemagick in the terminal to change the filetype and see if it will then open in your viewer. Maybe convert it to a .png?

convert file.eps file.png

-Yeti

Why not also put print commands before? As an example:
 

print("Currently calculating process x"):

process_x:=....:

print("Process_x completed, moving onto Process_y"):

process_y:=...:

It might not be elegant, but it is simple and does the trick.

-Yeti

Maple has a lot of useful commands for plotting and visualising vector fields. Here is a small example of visualising the divergence of a field (think Gauss' law, Maxwell's first):

restart:

with(VectorCalculus):
with(plots):

SetCoordinates('cartesian'[x,y]): ## This sets the coordinate system you wish to use

F:=VectorField(<-y*x^2,x^2-y>): ## This is where you can specify the field equation

Fplot:=fieldplot(F,x=-2..2,y=-2..2,arrows=THICK): ## Build the plot of the field

P:=Divergence(F): ## Finds the divergence of F

Pplot:=contourplot(P,x=-2..2,y=-2..2,contours=10,coloring=[green,red],thickness=3): ## Build the contour plot

display(Fplot,Pplot); ## Plots the desired results

This produces the following:

 

There are a lot of useful commands for a large variety of similar calculations involving divergence and curl etc... These can be found here:

http://fr.maplesoft.com/support/help/Maple/view.aspx?path=VectorCalculus

As you have not specified a field to be manipulated by Maxwell's equations, you can use the small example above as well as the links (and many sublinks found within) to plot your fields.

- Yeti

I do not believe there is a solution to this problem which uses a nice script or command line tool. If you open up a .mw worksheet in a text editor it will display it in its xml format and thus trying to export this is pointless.

You can use the File -> export tool in Maple and export them as either .txt or .mpl files but I know this is not what you were looking for as requires repeated actions on each .mw file. I tried to call a .mw file within another .mw file and that did not work, so unless somone has a  good bash script to find and replace out all the xml code for a user to then piece together, I think you are stuck doing it the hard way.

-Yeti

I use a few Linux distros (Ubuntu mainly) and I am not familiar with the ones you mention but have used Mint before. here are some ideas to potentially work out what is happening:

1) Are you mixing 32 and 64 bit Linux operating systems with 32 and 64 bit Maple installations? Make sure the Maple installation is compatible with the OS type.

2) Some Linux distros require installation of additional Maple components. Ensure the lsb-base and lsb-core packages are installed.

3) You can contact Maple support with this issue if it persists at support@maplesoft.com. Tell them the issue and operating system/maple version.

-Yeti

1. I would go about this in a few ways:

  • First write your simultaneous equations in a matrix and go about solving the standard way by multiplying both sides by the inverse matrix (although I dislike finding inverse matrices as I find them computational inefficient.)
  • Use the Maple fsolve command:
    https://www.maplesoft.com/support/help/Maple/view.aspx?path=fsolve
    I am not sure of the efficiency of this as the number of equations will increase. As you have not stated the form of your equations you will need to find this out yourself.
  • These sorts of problems are best suited to parallel programming, so that could be an option.

I would definately try the matrix method first as 1000 equations is not that large (although this depends on what form they have) If computational efficiency is too low in Maple then you might try the Eigen or Elemental libraries instead which I have used and rate as very effective.

2.  You might find this paper of relevence for the Thomas algorithm:

http://www.scirp.org/journal/PaperInformation.aspx?PaperID=42747

- Yeti

More details would be useful in order to answer the question. There are various ways in which to simplify expressions in Maple:

https://www.maplesoft.com/support/help/Maple/view.aspx?path=simplify
 

Let's say we have an expression:

F:= "lots of maths here":

In order to simplify this you can do:

simplify(F):

Caution must be used with this approach as you are giving Maple a blanket simplify command and this is not efficient as the size of your function increases. As you say your expression is long you should give Maple more information, and a good start is to use the simplify size option:

simplify(F,size):

Maple will look to shorten the length of the expression as best it can. There are various other options available for the simplify command and their usage will very much be dependent on what your expression actually contains and what you want to do with it (for instance are any coefficients floating point or can they be represented as exact rationals?).

Here is the help page with more details and the list of available options:

https://www.maplesoft.com/support/help/Maple/view.aspx?path=simplify/details

Another page which may be useful is the combine command:

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

Also the convert command:

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

These can all be used together to simplify a large variety of expressions.

- Yeti

More details would be useful in order to answer the question. There are various ways in which to simplify expressions in Maple:

https://www.maplesoft.com/support/help/Maple/view.aspx?path=simplify

Let's say we have an expression:

F:= "lots of maths here":

In order to simplify this you can do:

simplify(F):

Caution must be used with this approach as you are giving Maple a blanket simplify command and this is not efficient as the size of your function increases. As you say your expression is long you should give Maple more information, and a good start is to use the simplify size option:

simplify(F,size):

Maple will look to shorten the length of the expression as best it can. There are various other options available for the simplify command and their usage will very much be dependent on what your expression actually contains and what you want to do with it (for instance are any coefficients floating point or can they be represented as exact rationals). Here is a the help page with more details and the list of available options:

https://www.maplesoft.com/support/help/Maple/view.aspx?path=simplify/details

- Yeti

These look like homework problems, but just to show you how simply these can be done in Maple, lets do Question 1 (using the exact form you have given for the function S, but I believe from when I have used it before that it should be (i + j)!/(i!*j!) as the elements should be binomial coefficients if I remember correctly).

restart:
S:=(i,j)-> (i + j)!/i!*j!:
Matrix(8,S);

That is it. Have a go at doing the others yourself; as you will be surprised just how valuable doing these sorts of problems yourself is, and with Maple it makes doing them very simple. The Maple help pages for particular functions are invaluable. For instance for Q3 look here:

Matrix Inverse

Q4 look here:

Jordan Form

- Yeti

1 2 3 Page 2 of 3