1. Computer Algebra System: What is computer algebra system (symbolic computing)?
Symbolic computation is computation with symbols representing mathematical objects such as integers, real and complex, polynomials, derivatives, integrals, systems of equations, and series expansions of functions.
2.What are the differences between symbolic computing and numerical computing?
-Symbolic computation is computation with symbols representing many mathematical objects and numerical computation is computation with numbers and numeric values alone.
-Symbolic computation uses rational number representations and numerical computation uses floating point representations.
-Rational numbers (symbolic computing) allow number of significant digits and maximum size number far exceed common floating point representation in numerical computing.
-Symbolic computing can obtain closed form and exact results of calculations while numerical computing results most not exact since floating point approximations (lead to errors and word length problem) is used.
3.What are the advantages of symbolic computing compared to the numerical computing?
-Symbolic computation results in more exact and closed form of solutions while the numerical computation most often produce not exact results.
-Symbolic computation does not lead to word length problem in computing exponents and any errors caused by the floating point representions since numerical computation does.
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:
> | 12+45*5-7; |
-Multiply (*) operation is carried out first, and then followed by sum (+) and substract (-) operations. They are calculated from left to right direction. For plus and substract operations, they have same priority and it does matter to calculate either one firstly.
Example 2:
> | (3/5)^(4+5)*(2/7); |
-Numbers that enclosed in the bracket are carried first than other operations. Multiply and division ( / ) have equal priority and they can be firstly performed either one. Exponent ( ^ ) operation precedes the operation of multiply and division. The direction of calculation is from left to right.
Example 3:
> | 6*evalf(Pi)-(45/5)+12; |
-Multiply operation is performed first, and then followed by sum and substract operations.
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 :
i) f:=3*x^2+4*X^2-2*x+8;
ii) restart;with(Units):
-For example i sign of ; is used as end of expression to tell Maple that's the input expression is prepared for the answer of calculation(output). For example ii sign of : can be used along with the command restart and with(units) to cancel the Natural environment invoked at the beginning and to hide the output on the worksheet Maple.
b) = and :=
i) GetUnits(dimension=electric_current);
ii) f:=1/(3*x^(2/3));
-For example i equal sign, = is used to specify dimension to Maple in which we want the units of electric current by using GetUnits function.It is a local command. For example ii sign of := is used to make Maple capable to define that there has been an expression input and this command is global.
c) ? and ???
i) ?plot;
ii) ???plot;
-For example i,the topic will open and all its sections under the topic will expand while for example ii, the topic will open with its Examples section open and other sections contracted.
d) Expression and function.
i) f:=x^3+x^2-x+5;
> | x:=2; |
> | f; |
ii) f:=x->x^3+x^2-x+5;
> | f(2); |
-For example i is expression in Maple while example ii is function in Maple. Both expression and function are defined differently by Maple.
e) sum and add.
> | evalf(sum(k^2,k=0..n)); |
> | evalf(add(i^2,i=12..45)); |
-The sum command is for ``symbolic'' summation. It is used to compute a formula for an indefinite or definite sum.The add function is used to add up an explicit sequence of values.
6. Use of Help facilities 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.
eulermac - Euler-Maclaurin summation
-The forms eulermac(expr, x) and eulermac(expr, x, n) compute asymptotic approximations to sum(expr, x) .The order of the approximation is specified by n , and defaults to Order - 1. The forms eulermac(expr, x=a..b) and eulermac(expr, x=a..b, n) compute n th degree Euler-Maclaurin summation formulas for expr (thus n terms of the expansion are given). If n is not specified, it is assumed to be Order - 1. For example:
> | restart; |
> | eulermac(1/x^3,x=1..5,5); |
harmonic - The Harmonic Function
harmonic(x) = Psi(x+1) + gamma
harmonic(n) = sum( 1/i, i=1..n )
For example:
> | evalf(harmonic(20)); |
rationalize - rationalize denominator
-The function rationalize attempts to rationalize the given expression, removing all roots from the denominator. rationalize does not operate inside transcendental functions, such as exp and sin . Radical expressions that are arguments to such functions within expr will not be rationalized.For example:
> | restart; |
> | 3+(2*sqrt(8))/(3^(1/2)); |
> | rationalize(%); |
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).
> | restart:with(Units[Natural]):with(ScientificConstants): |
Problem 1
Calculate the rate constant k using t=120s in the following equation.
> | k:=ln(2)/t; |
> | t:=120; |
> | k:=evalf(ln(2))/(%*s); |
> | evalf(k); |
This equation is used to find out the rate constant k value in the decomposition of certain chemicals. t is half-life for certain compound which is given as 120s.Maple gives accurate answer along with appropriate units.
Problem 2
How much charge is represented by 4,600 electrons if one electron represents -1.602X10^-19 C? Charge is represented as q.
> | Q:=ne; |
> | n:=4600; |
> | Constant(e); |
> | evalf(%); |
> | Q:=n*%*C; |
If one electron represents e=-1.602X10^-19 coulombs(electric charge), 4600 electrons should be multiplied by this electric charge value to obtain a total value of charge(Q). Maple gives accurate answer along with the appropriate units.
Problem 3
Calculate the energy, in joules per photon, of violet light that has a frequency of 6.15X10^14 /s.
> | E:=hv; |
> | v:=6.15*10^14; |
> | Constant(h); |
> | evalf(%); |
> | E:=(%*J*s/photon)*v/s; |
The formula, E=hv is used to explain photoelectric effect. h is known as Planck's constant which its value as shown above. Maple gives accurate final answer along with the appropriate units.
8. Find out the dimensions of three different physical properties using Maple.
> | restart:with(Units):with(ScientificConstants): |
> | GetDimension(volume_flow); |
> | GetDimension(angular_acceleration); |
> | GetDimension(illuminance); |
9. Calculate the volume occupied by 1 kg of mercury at 25 C.
> | restart:with(Units[Natural]):with(ScientificConstants): |
> | GetElement(Hg,density); |
> | mass:=1*kg; |
> | density:=13.5336*g/cm^3; |
> | volume:=mass/density; |
10. Use Maple to calculate the number of water molecules in 1 g of liquid water.
The chemical formula for water is H2O.
> | restart:with(Units):with(ScientificConstants): |
> | waterMole:=2*Element(H,atomicweight)+Element(O,atomicweight); |
> | evalf(waterMole); |
> | convert(%,units,kg,amu); |
This is the mass per mole. To determine the number of moles in 1 g of liqiud water,
> | 1*g/(%*g/mol); |
> | %*evalf(Constant(N['A'])); |
The answer obtained is the number of water molecules in 1 g of liquid water. The obtain this answer, the number of moles must be multiplied by Avogadro's constant.
11. Determine whether ((y+8)/(x-2))=x+6 is linear nor not? (Hint: solve for y, and comment).
> | restart; |
> | ((y+8)/(x-2))=x+6; |
> | solve(%,y); |
> | y:=%; |
The equation will result in non-linear graph when plotted since this is a quadratic equation.
12. Show that z=1, y=2, x=3 are the solutions for x+2y-3z = 4. (Hint: use subs.)
> | restart; |
> | x+2*y-3*z =4; |
> | subs({x=3,y=2,z=1},%); |
The substitution results in the correct final answer. This shows that values of z=1, y=2, and x=3 are the solutions for the equation.
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?
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?
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?
Graph a)
> | restart; |
> | y:=x+3;y:=(3-x)/2; |
> | plot([x+3,(3-x)/2],x=-5..5,color=[red,blue]); |
Yes, these graphs do cross each other. The point of intersection means that at the same value of x, these two graphs have same value of variable y.
Graph b)
> | y:=-x-3;y:=-x+2; |
> | plot([-x-3,-x+2],x=-5..5,color=[red,blue]); |
These set of equation exist as parallel graphs when both are plotted on the same plot.
Graph c)
> | y:=1-x;y:=(2-2*x)/2; |
> | plot([1-x,1-x],x=-5..5); |
The set of equation actually consists of the same individual equation. Thus in the same range of x values, the solution values of y are of course to be the same too. This will yield both same equations resulting in a single linear plot.
14. Solve the equations: 2x + y - 2z = 8, 3x + 2y - 4z = 15 and 5x + 4y - z = 1.
> | restart; |
> | eq1:=2*x+y-2*z=8;eq2:=3*x+2*y-4*z=15;eq3:=5*x+4*y-z=1; |
> | solve({eq1,eq2,eq3},{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.
> | restart; |
> | eq1:=(x+2*y+2*z)*(4*x-10*y-12)(x^2-y^2+2*(Z^2)); |
> | expand(%); |
> | factor(%); |
> | simplify(%); |
16. Write any equation with three variables (x, y and z) and solve it using Maple.
> | restart; |
> | eq1:=7*x+2*y-Z=15; |
> | solve(eq1,{x,y,z}); |
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.