Rouben Rostamian

MaplePrimes Activity

These are replies submitted by Rouben Rostamian

What is the Iterative Projection Theorem? I haven't heard of it, and from the lack of responses here, it appears that no one else has heard of it either. Perhaps it's known by some other name?

Suggestion: Explain to us what you mean by the Iterative Projection Theorem.

In fact, by forcing yourself to explain what that theorem says, you may find the solution yourself without help from anyone. But, if you still need help with this homework problem, show what you have done so far, and point out where you need help.

@erik10 Maple's string handling is not kind to non-ASCII characters. Fortunately, Maple offers an interface to Python which handles non-ASCII with ease. The do_Danish() proc defined below selects only characters a-z and the three extra Danish characters from the given string.


Removes all characters other than a-z and å, æ, ø from the string str.

do_Danish := proc(str)
        uses Python;
        sprintf("re.split(\"[^a-zåæø]*\", %a)", str);
        remove(has, %, "");
        convert~(%, symbol);
        Matrix(5,5, %);
end proc:

S0 := "This is a Dånish tæxtø";

"This is a Dånish tæxtø"


Matrix(5, 5, {(1, 1) = h, (1, 2) = i, (1, 3) = s, (1, 4) = i, (1, 5) = s, (2, 1) = a, (2, 2) = å, (2, 3) = n, (2, 4) = i, (2, 5) = s, (3, 1) = h, (3, 2) = t, (3, 3) = æ, (3, 4) = x, (3, 5) = t, (4, 1) = ø, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0})


@Kitonum That's excellent. Thanks. I didn't know about phaseamp. That can be quite useful in other occasions as well.

@vv That's an interesting observation. I had not noticed that. But now that you have pointed out, I see that the polynomial is actually symmetric about t=1. After replacing t by t+1 it simplifies to a cubic in t^2:

9*t^6 - 87*t^4 + 51*t^2 - 5

@vv Yes, that's the correct solution. The answer may be slightly simplified by combining the sine and cosine terms. I don't know how to get Maple to do that. I calculated the simplified version by hand:

alpha__max__1 := Pi - Pi*sqrt(29 - 4*sqrt(43)*cos(arctan((9*sqrt(191))/1121)/3) - 4*sqrt(3)*sqrt(43)*sin(arctan((9*sqrt(191))/1121)/3))/3;


alpha__max__2 := Pi - Pi*sqrt(29 - 8*sqrt(43)*cos(Pi/3 - arctan((9*sqrt(191))/1121)/3))/3;


simplify(alpha__max__1 - alpha__max__2);



There is an interesting symmetry-breaking in this problem. Since the values of the two volumes are symmetric about α = π, one would think that the maximum will occur at α = π, but that's not so as we see in the solution presented. In fact, α = π corresponds to a local minimum!

@JAMET I made that animation based on what you had proposed, but come to think of it, it's likely that a practical motorcycle engine will be configured to distribute power symmetrically over one revolution, as in this modified version.

The power distribution is still not quite symmetric, but it can be made symmetric by adding two more pistons, making it a 4-cylinder engine.


@nm In my earlier reply I wrote: "The format of the font specification is defined in ?plot,options under the "font" entry. ".  Did you look?

A font specification is expected to be a list of the form [A,B,C] where A is the font family (e.g., Helvetica), B is the fine style (e.g., Bold), and C is the font size (e.g., 18).  B or C may be omitted, but not A. Saying axisfont=[12,12] or axisfont=12 makes no sense.

@Kevin Dragnet As Carl noted, the use of dchange in this context is an overkill, but for whatever it's worth, here it is:

sys := { diff(x(t),t) = y(t), diff(y(t),t) = -x(t) };
Tr := {x(t) = r(t)*cos(theta(t)), y(t)=r(t)*sin(theta(t))};
PDEtools:-dchange(Tr, sys, {r(t), theta(t)});
solve(%, {diff(r(t),t), diff(theta(t),t)});

The line that defines Tr in the code above may be obtained alternatively through the method that Carl proposed, as in:

Tr := [x(t), y(t)] =~ changecoords([x(t),y(t)], [x(t),y(t)], polar, [r(t), theta(t)]);

but in my view that's also an overkill.

Simultaneous access to multiple help pages will be a welcome enhancement. But I would rather have the multiple pages displayed as tabbed panels within a single help window (as it's done in web browsers and maple worksheets) rather than multiple help windows cluttering my screen.

@mmcdara That's a clever idea!

@Pets71 For the record, I am running Maple 2021 on Ubuntu 20.04 LTS installed on a 10 year old laptop with 4GB of memory. I use it just about every day in my classes for teaching, without a single problem.

I agree with Thomas Richard that what you have described smells very much like a bad RAM in your laptop. That's a hardware problem and has nothing to do with Maple.

See on how to test your RAM in Ubuntu.


Isn't it more natural to name your variables S[i,j] rather than Sij?  If you do the former, then you may do

local S;


It will be good if you showed some attempt toward solving this homework problem.  You don't want someone else to do your homework for you, do you?

@rlopez My original example required a symbolic solution (x(p) and y(p)). Should a symbolic solution be unattainable, we may resort to a numerical solution, which turns out to be even simpler than the symbolic, as illustrated in the following worksheet.



Here is a family of function of x defined in terms of a parameter p.

f := (x,p) -> (x-p)^2 + cos(p);

proc (x, p) options operator, arrow; (x-p)^2+cos(p) end proc

The family's envelope is obtained by solving the system
f(x, p) = y

diff(f(x, p), p) = 0.``

Here are two options:


Option 1. We solve the system for x and y in terms of p, we obtain a

parametric representation x(p), y(p)of the envelope.


Option 2. For a given x, we solve the second equation for p and obtain
p(x).  Then evaluate y = f(x, p(x)), thus obtaining a mapping from
x to y of the points on the envelope.


I followed Option 1 in my original post.  That option works best if we

are able to solve the system symbolically.


Option 2 works best if the system is not solvable symbolically and we

need to resort to numerical calculations.


Here I will solve the original problem numerically to show that we

obtain the same result.NULL


Option 2 is implemented in the following proc.  It receives x and
returns y so that (x,y) is on the envelope.

elim := proc(x) option remember;
        if not type (x, realcons) then return 'procname'(args) end if;
        y = f(x,p), D[2](f)(x,p) = 0;
        eval(y, %);
end proc:

Here is the plot of the envelope. It agrees with the result of the previous

symbolic calculation.

plot(elim(x), x=-8..8, color="Blue");

As before, we calculate the area between the central arch of

that graph and the x axis.  The arch's rightmost endpoint is at x = L, where

L := fsolve(elim(x), x=0..2);


Therefore, the area under the arch is

A := int(elim(x), x=-L..L, numeric);


which agrees with the previous result.




@mmcdara As rlopez has noted, the method of lines (MoL) is unrelated to the method of characteristics. When a PDE has both space and time variables, in MoL we discretize space through finite differences, while treating the time variable as continuous.  Thus, the PDE is approximated by a system of ODEs.

About a year ago, I illustrated the MoL in the post by applying it to the equation of the deflection of a multispan Euler beam.

1 2 3 4 5 6 7 Last Page 1 of 74