rlopez

2530 Reputation

12 Badges

15 years, 175 days

Dr. Robert J. Lopez, Emeritus Professor of Mathematics at the Rose-Hulman Institute of Technology in Terre Haute, Indiana, USA, is an award winning educator in mathematics and is the author of several books including Advanced Engineering Mathematics (Addison-Wesley 2001). For over two decades, Dr. Lopez has also been a visionary figure in the introduction of Maplesoft technology into undergraduate education. Dr. Lopez earned his Ph.D. in mathematics from Purdue University, his MS from the University of Missouri - Rolla, and his BA from Marist College. He has held academic appointments at Rose-Hulman (1985-2003), Memorial University of Newfoundland (1973-1985), and the University of Nebraska - Lincoln (1970-1973). His publication and research history includes manuscripts and papers in a variety of pure and applied mathematics topics. He has received numerous awards for outstanding scholarship and teaching.

MaplePrimes Activity


These are replies submitted by rlopez


The restart command clears Maple's memory of previous assignments.

 

The symbol "cf" is a name, or variable.

The assignment operator is "colon equal" and it is used to assign to the variable cf the value computed to the right.

The number cf is then the conversion factor for going from degrees to radians. Maple works in radians.

Replacing the colon at the end of the line enables you to see the result of the executed command.

 

cf:= 2.0*Pi/360;

0.1745329252e-1

(1)

The name "phasor" is the name of a function that the author is defining. Note the assignment operator that follows the name.

The function phasor will have two arguments, namely, x and y.

The arrow, made with a minus sign and a greater-than sign, represents a mapping, the mathematician's view of what a function does. It maps from one set (the domain) to another (the range).

The rule for the function is Maple's built-in polar command. This command takes two arguments, here represented by the letters x and y. The first argument, x, is the magnitude of a complex number. The second argument is the "angle" for the complex number. Here, it has to be y*cf because y will be given in degrees, but the polar command requires the angle to be in radians. This then represents the complex number in as close to "phasor form" as Maple can manage.

 

phasor:= (x,y)->polar( x, y*cf );

proc (x, y) options operator, arrow; polar(x, y*cf) end proc

(2)

 

sol is a new name, to which is assigned the result of the calculation with phasors that was suggested. Note that the calculation is one phasor divided by the sum of two others. Essentially, one complex number is divided by the sum of two others, where the complex numbers are expressed as "phasors."

The evalc is another built-in Maple command designed to put complex expressions into rectangular (a + b i) form, where the imaginary unit sqrt(-1) in Maple is I. (This can be changed to anything you like, including j, but that is a story for another day.)

 

sol:= evalc( phasor(200,0)/( phasor(100,45)+phasor(100,45) ) );

.7071067812-.7071067812*I

(3)

 

The final line is an "expression sequence" containing two results separated by a comma. The first result is the magnitude of the complex number stored in "sol." It is obtained by applying the built-in  "abs" command that actually stands for "absolute value."  The second member of the sequence is the angle of the rectangular complex number "sol." It is obtained by the built-in "argument" command. But this angle will be in radians. The final division by cf converts radian measure to degrees.

abs(sol), argument(sol)/cf;

1.000000000, -45.00000000

(4)

 

``


Download Explication.mw

Explication.mw@krismalo 

Because I'm going to be gleaning such opportunities for explaining members' responses, I looked at this plea for an explanation of Maple code and realized that I just had to respond. See the details in the attachment.

I think I'll also try to insert the contents of the worksheet.

 

@glnritchie The web post you point to contains many interesting ideas for interpreting eigenpairs. Thanks for calling it to our attention.

acer kindly pointed out a subtlety in the middle explanatory box underneath "fraction" in the evalindets command. The phrase "since all the terms of the equation are fractions" should only be interpreted colloquially. In Maple, "fraction" is a very special type, defined as the ratio of two integers with denominator not 1. Carl wisely used type fraction in his work, and not type rational. Type rational would have caught everyting that colloquially was a "fraction", so that terms like 1/x, interpreted by Maple as x^(-1), or x^2, would have had their exponents converted to floats.

acer suggests that a more accurate phrase would have been "since all the subexpressions that are to be converted to floating-point happen to be of type fraction."

As mentor on this post, I should have caught this, but I was as naive as the co-op in this regard. Indeed, this forum is a great place for learning about Maple!

RJL Maplesoft

@Kitonum How do you determine the accuracy of a process that starts with an interpolation of nonuniform data, then does a spline fit to the equispaced points that result, then does an integration? Strikes me that the initial interpolation is the key to the whole process, but its accuracy hinges on what function the data actually comes from. And that is presumed to be unknown. I'm not trying to start an argument, but merely looking for some insight into what I think is a difficult issue.

@Mac Dude Thanks for the feedback. I'll bring your comment to the attention of the folks here at Maplesoft who are actually implementing this series of blogs.

@Alger 

The function of a matrix is not the same as mapping that function onto the entries of the matrix. Use the square root function to convince yourself of this. The square root of a matrix is a matrix whose product with itself is the original matrix. That will not be the case if you simply map the square root onto the elements of the matrix.

I just ran your three lines of code in Maple, obtaining three solutions: x~-36, 30, 2006. Graphical and numeric investigation shows no solution anywhere near x=94. I suggest you double-check everything, including what Excel is giving. (When I pasted your code into Maple as 1D math, I had to insert explicit multiplication operators to the left of each x in eq2. So, are you working in 1D input or 2D input?)

RJL Maplesoft

@Markiyan Hirnyk

with(Student:-MultivariateCalculus):

P:=Plane([a,b,c],<u,v,w>);

Student:-MultivariateCalculus:-Plane(Vector(3, {(1) = u, (2) = v, (3) = w}), [a, b, c], variables = [x, y, z], id = 1)

(1)

Distance([A,B,C],P);

abs((A-a)*u+(B-b)*v+(C-c)*w)/(abs(u)^2+abs(v)^2+abs(w)^2)^(1/2)

(2)

 

``

 

Download Distance-M18.mw

 

@Markiyan Hirnyk 

Unfortunately, what worked in Maple 18, broke in Maple 2015 and 2015.1. It's been fixed for a later dot-releaase and for the next full version of Maple.

@raymond412 

I received the worksheet attached to an email sent directly to me. For anyone else on this forum who wanted to interact with this question, the worksheet itself is essential. Use the green upward-pointing arrow in the toolbar to upload the worksheet.

In a private email, I corrected the issue with eval, the correction I suggested at the very beginning of this thread.

The expression to be evaluated is called f, and it contains at least five parameters such as delta, and C. The values of these parameters are read from math containers by the Evaluate-at-parameters button. However, the values are assigned to the names themselves so that it is now not possible to use these names in the eval command. My modification was to read in the values, but assign to new names such as Xdelta, and XC. Then, I removed the value command wrapped around the read statements. Finally, I adjusted the eval command to the proper syntax:

eval(f,[delta=Xdelta,...,C=XC])

So, the code ended up looking like this:

Do(f=%MathContainer0);
Do(Xdelta=(%MathContainer1));
Do(Xgamma=(%MathContainer2));
Do(Xalpha=(%MathContainer3));
Do(XG=(%MathContainer4));
Do(XC=(%MathContainer5));

q:=eval(f,[delta=Xdelta,gamma=Xgamma,alpha=Xalpha,G=XG,C=XC]);

So, this is the style in which I would have written the App. If anyone else can see a more efficient way to do all this, have at it. Perhaps we all could learn something about coding.

Please save all of us the trouble of reconstructing the App. Post the worksheet you are using to build the App.

The syntax of the eval command should be fixed: after the expression to be evaluated, use a list of equations, not merely the names.

Thanks.

Unfortunately, the order of output for commands like solve can change. Sometimes repeated execution of the command will cause the change in order, sometimes it takes a new version of Maple to cause the order to change. So, unless the calculation is interactive and to be used just onece, picking out a member of a sequence of solutions by position in the sequence is not necessarily the best way. Selection based on a property of that member is the safest way, even if it is a bit more difficult.

My experience in maintaining the Advanced Engineering Math ebook is what prompts this note. One of the worst offenders against canonical ordering is the dsolve command, but over the years, more and more cases of fickleness in the solve command have had to be corrected with the addition of special code to make the choice of solution unique.

RJL Maplesoft

@UndergradMaths 

Check the recorded demos available on the following page.

http://www.maplesoft.com/teachingconcepts/

There are more recorded demos here:

http://www.maplesoft.com/webinars/recorded/index.aspx

 

 

First, the question asks about rotating about the line "theta-pi/2" but apparently, the minus sign should be taken as an equal sign. At least, that is what was done in the several answers already given.

More important: A volume of revolution is created by rotating a region about an axis that does not intersect the region. If the region is the area bounded by the given cardioid, then the problem is what does it mean to create a solid by rotating the region about an axis that passes through the region? In other words, meaning must be given to the doubling over of such a region on itself when it is rotated. Is the volume to be counted twice? If not, provision has to be taken in the integration to ensure that this doubling of volume is not computed.

RJL Maplesoft

Maple and the Putnam Competition

Philippe Dumas and Bruno Salvy

page 63, MapleTech, Volume 2, Number 2, 1995

 

All 12 problems of the 1993 competition were examined with the conclusion that six fell to the axe of Maple, five did not appear to yield to a computer algebra system, and one could profitably be explored with Maple.

Unfortunately, this Birkhauser publication no longer exists. Perhaps copies can be found on the shelf of an early Maple enthusiast who hasn't yet retired.

RJL Maplesoft

First 8 9 10 11 12 13 14 Page 10 of 15