KOS 1110 Computers in Science
Assignment 4 - Questions in Introduction to Maple 

1. Computer Algebra System: What is computer algebra system (symbolic computing)?
-Computer Algebra System or Symbolic Computation is the computation with symbols representing mathematical objects including:- a) integers, real and complex numbers. b) polynomials. c) derivatives and integrals. d) system of quation, series expansion of function.

2. What are the differences between symbolic computing and numerical computing?
-a) Symbolic Computing
     ~ the objective is to obtain closed form, exact solutions
     ~ there are thousands of built in functions
     ~ have many options for simplifying expressions
     ~ internal representation for rational numbers is different from floating points representations
     ~ for rational numbers, number of significant digits and maximum number far exceeds typical floating point representation in         
        numerical computation.
-b) Numerical Computing
     ~ have word length problem which the allowable values for exponent depend on computer, computing language or 
        calculator.
     ~ floating point representations leads to representation or truncation error, try to represent irrational numbers, and 
        propagation errors where accumulated errors arising from a sequence of calculations.

3. What are the advantages of symbolic computing compared to the numerical computing?
- The symbolic computing advantages are to obtain closed and exact form of solutions, to build thousands of functions and to 
  give greatest option for simplifying expressions.

4. Hierarchy of arithmetic operations: Use your own examples (at least three examples and execute them in maple) to prove which arithmetic operations are carried out first in Maple and if they are of equal priority, in which directions they are carried?   
- Example 1

> 3*3-8+4/9;

- The answers obtained were based on hieraarchy of arithmetic which give priority beginning with parentheses, exponents, 
   multiplication and division, addition and substraction.
- From the equation, multiplication is the first arithmetic operation to be solved, followed by division, substraction and addition.

- Example 2

> 6-8*3+19;

- From the equation, multiplication is thee first arithmetic operation to be solved, followed by substraction and division from left 
   to right.

- Example 3

> 49*6/4-13+21;

- From the equation, multiplication is thee first arithmetic operation to be solved, followed by division, substraction and addition. 
   The operation was carried out from left to right.

5. 	Using your own examples (one example each and execute them in maple) clearly bring out all the differences between the following maple symbols and commands:
a) ; and :
- Example	

> restart;
> with(ScientificConstants):
> with(ScientificConstants):
- If we use the (;), it will execute and display the command.
- If we use the (:), it only execute the command but fail to display.

b) = and :=
- Example
> restart;
> f1:=m/n+n/p+p/q;

> f1=m/n+n/p+p/q;

- (=) and (:=) are used to assign the stattement. Maple will keep remember the value which assign by (:=) in all calculation but 
   the (=) is on the other side.

c) ? and ???
- Example
- ?     := when we execute, we get the general explanation about the topic.
- ???  := when we execute, we get spesific explanation of the topic including the examples section (if any) and all other 
              contracted.

d) expression and function
- Example
> restart;
> f:=x->x^8-5*x;

> f:=x^8-5*x;

- The first equation is a function which rrepresents a function call or application of a procedures to arguments. In this expression, we refer the entire expression f(x) as being of the type, while the expression f is typically not itself of type function. The operands of a function expression are the arguments.
- The second equation is an expression. Expression is only represent the arguments.

e) sum and add
- Example
> Sum ('t/(t+3)', 't'=0..n)=sum ('t/(t+3)', 't'=0..n);

> add(g^2,g=1..7);

> add(n[i]*t^i,i=0..5);

- Sum= definite and indefinite summation
- The sum command is for symbolic summation. It is used to compute a formula for an indefinite or definite sum. If maple cannot compute a closed form, Maple returns the sum unevaluated.
- Add= add up a sequence of values.
- To add affinite sequence of values, rather than compute a formula, use the add command.

6. Use of Help facilties in Maple:  Use the help commands in Maple and explain the use of three Maple commands (not discussed in the class) with your own examples.
- a) The GetElement('names') command get the elements needed from the ScintificConstants package with full information about the elements. 
- b) The GetConstants( 'names' ) command returns an expression sequence containing the full names of the physical constants in the ScientificConstants package. 
- c) The GetIsotopes() command returns an expression sequence containing selected isotopes of elements of the periodic table in the ScientificConstants package. 
> restart;
> with(ScientificConstants):
> GetElement(carbon);

> GetConstant(M[Earth]);

> GetIsotopes(element=Cl);

7. Use of units and Scientific Constants: Select any three problems involving different types of units from your textbooks and carry out the complete calculations including the units using Maple.  State the problem fully and comment whether Maple gives the correct final answer along with appropriate units.  (Refer, but don't reuse the examples discussed in the class or in the help menu)
-a) Decay activity for a sample of iodine-131.
     The expression for the activity is defined as A where A0 is the initial activity, is the mean lifetime of the isotope and the t is 
     the elapsed time.
> restart;
> with(ScientificConstants):
Warning, the name GetUnit has been rebound

> A:=A0*exp(-lambda*t);

The mean lifetime is related to the halflife by lambda = 0.693/H
> lambda:=0.693/evalf(Element(I[131],halflife));

-b) How far you travel in 35 minutes going 55 miles per hour? Express answer in meters.
> restart;
> with(Units):

> d:=55*mph*35*minutes;

-c) What is the mass of an electron,E?
> mass:=9.11e-31*kg;

> c:=3.00e8*m/s;

> E:=mass*c^2;

8. Find out the dimensions of three different physical properties using Maple.
-a) acceleration
> restart;
> with(Units):
Warning, the name GetUnit has been rebound

> GetDimension(acceleration);

-b) radians
> convert(10,units,degrees,radians);

-c) energy
> convert(3.3729e2,units,J/mol(carbon12),kg/mol(carbon13),energy);

9. Calculate the volume occupied by 1 kg of mercury at 25 C.
> restart;
> with(ScientificConstants):
> GetElement(Hg);

> density:=13.5336*g/cm^3;

> mass:=1*kg;

> convert(1,units,kg,g);

> mass:=%;

> volume:=mass/density;

10. Use Maple to calculate the number of water molecules in 1 g of liquid water.
> restart;
> with(ScientificConstants):
> GetElements:
> 2*Element(H,atomicweight)+Element(O,atomicweight):
> evalf(%);

> convert(%,units,kg,amu);

> 1./%;

> %*evalf(Constant(N['A']));

11. Determine whether y+8/x-2= x+6 is linear nor not? (Hint: solve for y, and comment)
> solve({(y+8)/(x-2)=(x+6)},y);

Comment: This function is not linear but it is a quadratic function because of the existence of x^2(square).

12. Show that z=1, y=2, x=3 are the solutions for x+2y-3z = 4.  (Hint: use subs)
> x+2*y-3*z;

> subs(x=3,y=2,z=1,%);

- The answer that have been given by calculation in Maple is the same as given. So, z=1,y=2 and x=3 are definite solutions for x+2y-3z=4.

13. a) Solve the equations:  x - y = -3 and x + 2y = 3.  Plot these equations in the same graph.  Do these graphs cross each other?  What is the meaning of the point of intersection? 
> restart;
> with(plots):
> solve({x-y=-3},y);

> solve({x+2*y=3},y);

> a1:=plot(x+3,x=-7..7):
> a1;

> a2:=plot((-x/2)+(3/2),x=-7..7):
> a2;

> display(a1,a2);

- Yes, they do cross each other at point (-1,2) and this point is called the intersection point.

b) Plot the equations: y = -x - 3 and y = -x + 2.  From the graphs what can you say about the existence of solutions for this set of equation?

> y:=-x-3;

> y:=-x+2;

> b1:=plot(-x-3,x=-5..5):
> b1;

> b2:=plot(-x+2,x=-5..5):
> b2;

- From the graph we can say that the solution of these 2 graphs are having the same slope which value is -1.

c) Plot the equations: x + y = 1 and 2x + 2y = 2.  From the graphs what can you say about the existence of solutions for this set of equation?
> restart;with(plots):
Warning, the name changecoords has been redefined

> solve({x+y=1},y);

> solve({2*x+2*y=2},y);

> c1:=plot(-x+1,x=-5..5):
> c1;

> c2:=plot(-x+1,x=-5..5):
> c2;

- We can see clearly that both equation are actually give the same set of solutions.

14. 	Solve the equations: 2x + y - 2z = 8, 3x + 2y - 4z = 15 and 5x + 4y - z = 1.
> restart;
> e7:=2*x+y-2*z=8; e8:=3*x+2*y-4*z=15; e9:=5*x+4*y-z=1;

> solve({e7,e8,e9},{x,y,z});

15. Write any equation of your own and expand it using Maple.  Factorize and simply the result and show that it gives back the starting equation.
- Expand
> k1:=(m+3)/7*(m+1*y)/6*(5*m-4*m)/4*(2*n+m)/3;

> expand(%);

- Simplify
> simplify(%);

- Factorize
> factor(%);

16. Write any equation with three variables (x, y and z) and solve it using Maple.
> e1:=4*x+2*y-z=98;

> e2:=x-y+26*z=84;

> e3:=-4*x+2*z=-26;

> solve({e1,e2,e3},{x,y,z});

> eval({e1,e2},%);

> eval({e2,e3},%);

> eval({e1,e3},%);

17. Download any VRML picture from the internet and build a web page using this picture along with a paragraph describing this object and acknowledging the website from where you downloaded this picture.  Upload this web page in your web site.  Include the printout of this webpage with your assignment.
- Please view it at my web page, www.geocities.com/tun_teja_2000