




























Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Prepare-se para as provas
Estude fácil! Tem muito documento disponível na Docsity
Prepare-se para as provas com trabalhos de outros alunos como você, aqui na Docsity
Encontra documentos específicos para os exames da tua universidade
Prepare-se com as videoaulas e exercícios resolvidos criados a partir da grade da sua Universidade
Responda perguntas de provas passadas e avalie sua preparação.
Ganhe pontos para baixar
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
chapter 1 book Maxima
Tipologia: Manuais, Projetos, Pesquisas
1 / 36
Esta página não é visível na pré-visualização
Não perca as partes importantes!





























Maxima is a symbolic-based mathematical software providing a number of functions for algebraic manipulation, calculus operations, matrix and linear algebra, and other mathematical calculations. Maxima web page The Maxima web page is located at: http://maxima.sourceforge.net/ Read the description of Maxima shown in this page. The page also includes a number of links including a Download link. Download and install Maxima in your computer as indicated in the download page. The Maxima web page also includes a Documentation link with a number of tutorials on the use of Maxima. xMaxima and wxMaxima The figure below shows the listing of programs and documents available for Maxima 5.14. in a Windows Vista installation. You will notice that there are two possible instances of Maxima called XMaxima and wxMaxima. While both allow the user access to the Maxima commands, the difference is in the graphic user interface (GUI) used to communicate with Maxima. XMaxima An example of the XMaxima interface is shown in Figure 1.1. The top of the GUI is the input window for Maxima commands. The lower part is a display of a Maxima Primer document providing the user with some information about getting started with Maxima. In between the top and lower part of the display you will find buttons labeled File , Back ,
Forward , Edit , Options , and Url : The last button refers to the file specification shown in the field immediately to its right. In this case, the file specification reads: file:/C:/PROGRA~/MAXIMA~1.0/share/maxima/514~1.0/xmaxima/INTRO~1.HTM The full reference to this file should be: file:/C:/Program Files/Maxima-5.14.0/share/maxima/5.14.0/xmaxima/intro.html The X M axima GUI abbreviates some of the sub-folders in the first file specification producing the reference shown above, which could be a bit confusing. The full file specification shows the location of the file being shown in the bottom window of the X M axima GUI. This html file is located in the Maxima installation as indicated above. Figure 1.1. XMaxima starting GUI
in the Maxima Primer , we activated the input without copying it to the top window. The result, however, is available in the top window as output 1 (%o1). Also, notice that XMaxima presents the result of the integral as closely as possible as a two-dimensional mathematical expression, i.e., 2 x - 1 2 atan(-------) log(x - x + 1) sqrt(3) log(x + 1) (%o1) - --------------- + ------------- + ---------- 6 sqrt(3) 3 as opposite to a one-dimensional mathematical entry, i.e., -log(x^2-x+1)/6+ atan((2*x-1)/sqrt(3))/sqrt(3) + log(x+1)/. The full mathematical operation calculated in this example can be, on paper, written as
dx 1 x
ln x 2 − x 1 6
tan − 1
2 ∗ x − 1
log x 1 3
The user is invited to continue reading the Maxima Primer document and double-click on the different examples listed to learn the basic operation of Maxima. Following those exercises, one may notice, for example, that in the XMaxima interface, the mathematical constant π (the ratio of the length of a circumference to its diameter) is referred to as %pi. Also, infinity (∞) is referred to as inf. The Maxima Primer examples include also plots that are produced in their own separate graphics window, e.g., the commands ● plot2d(sin(x),[x,0,2*%pi]) ● plot3d(x^2-y^2,[x,-2,2],[y,-2,2],[grid,12,12]) produce, respectively, the two-dimensional and a three-dimensional graphs shown below.
Click-off the graphical windows before continuing with the other commands in the Maxima Primer. wxMaxima wxMaxima uses an interface as shown in Figure 1.2, below. Figure 1.2. The wxMaxima GUI. This interface is more sophisticated than that of XMaxima for the following reasons: ● wxMaxima produces true two-dimensional mathematical output ● wxMaxima provides most Maxima commands in menus (e.g., Equations, Algebra, etc. ) ● Some commands can be activated by using the buttons shown at the bottom of the interface, e.g., Simplify, Factor, etc. ● wxMaxima provides dialogues to enter parameters of selected commands. ● wxMaxima maintains a command line history buffer where previously used commands can be accessed, repeated, or edited. ● wxMaxima allows mixing text with mathematical expressions to produce printable documents. ● The current version of wxMaxima supports simple animations (to see the current version use the menu item Help > About ).
moment of typing this book, showed Maxima version 5.14.0 and wxMaxima version 0.7.4. Remember that Maxima is the computer program that performs the mathematical calculations, while wxMaxima is the graphics user interface (GUI). wxMaxima tool bar The wxMaxima GUI provides a tool bar with the following buttons: (1) Open session (2) Save session (3) Print document (4) Configure wxMaxima (5) Copy selection (6) Delete selection (7) Insert text (8) Insert input group (9) Interrupt current computation (10) Show Maxima help (same as menu item Help > Maxima help ) Using the INPUT line The INPUT line in the wxMaxima interface can be used for a variety of purposes such as: ● To perform a calculation, e.g., sqrt(1+3.5^2)/sin(%pi/6); ● To define one or more variables, e.g., a:2; b:2; ● To define a function, e.g., f(x):=sqrt(1+x^2); ● To evaluate a function, e.g., f(2/3); ● To produce a plot, e.g., plot2d(f(x),[x,-2,2]); ● To enter other type of operations, e.g., a derivative: diff(t^2*sin(t), t); Here are some observations from the examples shown above: ● To enter the value of a variable use a colon (:) ● To define a function use a colon followed by the equal sign (:=) ● Maxima expressions end with a semi-colon. If you forget to enter the semi-colon in the INPUT line, wxMaxima will enter it for you. This is additional information useful when entering expressions: ● Variable or function names must start with a letter, and may include letters, numbers, and undersign, e.g., vx:2; x2:3; y_2:5; Initial_Velocity:-2.5;
● The following are reserved words in Maxima and cannot be used as variable names: integrate next from diff in at limit sum for and elseif then else do or if unless product while thru step Some pre-defined functions: Some of the common pre-defined functions in Maxima include: sqrt square root sin sine cos cosine tan tangent cot cotangent sec secant csc cosecant asin inverse sine acos inverse cosine atan inverse tangent acot inverse cotangent asec inverse secant acsc inverse cosecant exp exponential log natural logarithm sinh hyperbolic sine cosh hyperbolic cosine tanh hyperbolic tangent asinh hyperbolic asin acosh hyperbolic acos atanh hyperbolic atan floor integer below ceiling integer above fix integer part float conver to floating point abs absolute value Maxima does not have a logarithm-base-10 function. Instead, use: log 10 x = log x log 10 Here are some examples you can try: sin(2.5%e);float(sin(2.5%e)); floor(%pi);ceiling(%pi); log(5);float(log(5)); k:float(log(3)/log(10)); float(10^k);abs(-2);fix(3.3);fix(-3.2); Notice that Maxima will tend to give symbolic results (i.e., results including fractions, square roots, unevaluated trigonometric, exponential, or logarithmic functions) rather than floating-point (or numerical) results. Use function float, as in the examples above, to get floating-point solutions. Automatic parentheses. Whenever you enter an opening parenthesis in the INPUT line, a closing parenthesis is added automatically. If you are not used to this feature, you may end up entering more closing parentheses than needed. This situation will result in an error that is easy to spot.
Using the button panel The bottom of the xwMaxima GUI contains 12 buttons that can be used for common operations. The collection of buttons is shown in the figure below, with the Maxima commands associated with them. Buttons (1) through (4), and (7) through (10) operate on an expression typed in the INPUT line before pressing the corresponding button. Buttons (5), (6), (11), and (12) trigger dialogues to performed the associated operations. The operation of the buttons, with appropriate examples, is shown next. (1) Simplify: simplifies algebraic operations, e.g., (x+2)(x-2); [Simplify] (2) Simplify(r): simplifies expressions containing logs, exponentials, and radicals, e.g., (%e^x-1)/(%e^(x/2)+1); [Simplify(r)] (3) Factor: factors an algebraic expression, e.g., x^2+y^2-2xy; [simplify(r)] (4) Expand: expands an algebraic expression, e.g., (x+1)(x-1)*(x^2+1); [Expand] (5) Solve...: solves an equation, e.g., (6) Plot 2D...: produces an x-y (two dimensional) plot, e.g.,
(7) Simplify(tr): trigonometric simplification in terms of sin and cos ,e.g., tan(x) [Simplify (tr)] (8) Expand(tr): expands a trigonometric expression, e.g., sin(x+y) [Expand(tr)] (9) Reduce(tr): convert powers of trigonometric functions to those of multiples of the angle, e.g., x+3cos(x)^2-sin(x)^2; [Reduce(tr)] (10)Rectform: produces the rectangular form of a complex number, e.g., 1/(2+3%i); [Rectform] (11)Solve ODE...: solves a 1 st order or 2 nd order ordinary differential equation, e.g., Note: Derivatives are written using 'diff(y,x,n) to represent d n^ y dx n.
Select the option Full in the Button panel drop-down menu to activate the Full button panel, and press [ OK ]. wxMaxima will respond with the following message: Press [ OK ] in this message form, and then [ OK ] again in the wxMaxima configuration window, and click off wxMaxima. The Full button panel will not be active until you re-start wxMaxima. When you re-start wxMaxima , the bottom part of the interface will show the Full button panel: which now includes 20 buttons, instead of the 12 buttons of the Basic button panel. The new buttons are shown in the following figure, labeled (13) to (20), with labels shown in boldface letters (no all the buttons are shown): The operation of buttons (13) through (20) is described below:
(13) sum : allows setting up and calculating a summation, e.g., (14) product : allows setting up and calculating a product, e.g., (15) diff : calculates a derivative, e.g.,
(18) taylor : calculates a Taylor series for an expression: (19) subst : substitute an expression into a variable name (20) map : maps a function to a list
Using Greek letters In order to write Greek letters in Maxima you need to have the font SPIonic installed in your computer. You can download this font from: http://www.drshirley.org/fonts/SPIonic.ttf After installing the font in your computer, you need to select it to show Greek characters in your wxMaxima interface. Proceed as follows: ● Select the menu option Edit>Configure ● Click on the Style tab ● Check-off the Use greek font entry, and select SPIonic ● Press OK To enter Greek letters type the English name of the letter in an expression, or precede the name with the percentage symbol (%), e.g., factor(beta^2-1); rectform(1/(%alpha+%beta%i); expand((alpa-1)(beta+gamma)); expand((%alpha-1)(%beta+%gamma)); Notice the difference between typing gamma and %gamma in the last two examples. Typing gamma (without %) produces the upper-case Greek letter Γ which represents the Gamma function from mathematics, whereas, %gamma produces Euler constant γ, defined, as the limit as n , of the quantity ∑ k = 1 n 1 k − ln n . To illustrate the use of the Gamma function try the following exercises in wxMaxima : gamma(2.5); plot2d(gamma(x),[x,0.5,3.0]); Examples from the Equations menu In this section we present some examples of applications from the Equations menu. We use it to illustrate the use of menus such as Equations, Algebra, Calculus, etc. A listing of the available applications in the Equations menu is shown below: Try the following examples by selecting entries from this menu: ● Solve ... same as: solve([x^2+32x-160=0], [x]);
● Solve algebraic system ... equivalent to algsys([xy^2+2xy = 1200, (x+y)(x-y)=200], [x,y]); ● Eliminate variable ... See the example available in the Maxima Manual by selecting the menu option Help > Example... , and type eliminate : ● Solve ODE... This is the same as pressing the button [Solve ODE...]. Equivalent to: ode2('diff(y,x,2)+y=sin(x), y, x); ● Initial value problem (1) ... Initial value problem for first-order ODE. Uses two steps, first Solve ODE ... , then Initial value problem (1). Equivalent to:
● Initial value problem (2) ... Initial value problem for second-order ODE. Uses two steps: first Solve ODE ... , then Initial value problem (2). Equivalent to: ode2('diff(y,x)+y=x,y,x); ic1(%,x=0,y=1); ● Boundary value problem ... Boundary value problem for second-order ODE. Uses two steps: first Solve ODE ... , then Boundary value problem. Equivalent to: ode2('diff(x,t,2)+x=sin(t),x,t); ic2(%,t=0,x=1,'diff(x,t)=-1);