Rouben Rostamian

MaplePrimes Activity

These are replies submitted by Rouben Rostamian

@andmail This proc, which returns the area of any polygon, may be of use to you.


This proc returns the area of an n-gon whose vertices are given
as a list of lists L = [[x__1, y__2], () .. (), [x__n, y__n]] or as a list of vectors

"L=[ <`x__1`,`y__1`>, ..., <`x__n`,`y__n`> ]."  It is assumed that
  the vertices are listed in the counterclockwise order,
  the n-gon does not self-intersect.

polygon_area := proc(L)
  local n := nops(L);
  add(L[i][1]*L[i+1][2] - L[i][2]*L[i+1][1], i=1..n-1)
   + L[n][1]*L[1][2] - L[n][2]*L[1][1];
  return %/2;
end proc:

Example: The area of a rectangle



Example: The area of a regular pentagon

polygon_area([<cos(2*Pi/5*i), sin(2*Pi/5*i)> $i=1..5]):
convert(simplify(%), radical);




@HaHu Do this

plot([x^2, 1-x^2], x=0..1, color=[red,green], legend=[supply, demand]);

@acer I have been interested in coloring spacecurves but I haven't figured out a good way of doing that.  What you have suggested is very helpful.  Additionally, I would like to learn how to colorize a curve based on its parametric representation.  Earlier in this thread you referred to an older discussion where you do that but the illustration there is too complicated for me to grasp the underlying idea.  Would you be able to provide a simpler example of doing that?  For instance, let's take the spacecurve

C := <cos(t), 2*sin(t), t^2/20>;
C1, C2 := diff(C,t), diff(C,t,t);
kappa := Norm(CrossProduct(C1,C2),2) / Norm(C1,2)^3; # curvature

How do we color C over the range 0 < t < 2*Pi according to the curvature kappa? It will be illuminating to see how that is done.


@Earl Yes, normals to two smooth (i.e. differentiable) surfaces at their point of tangency are always collinear.  That's a consequence of the following two definitions.

  1. Definition: Two smooth surfaces are tangent to each other at a common point P if their tangent planes at P coincide. 
  2. Definition: A normal vector to a smooth surface at a point P is a (nonzero) vector which is perpendicular to the tangent plane at P.

Show what you did to get a solution that looks like a step function.

In general, it is a good idea to upload a worksheet to show your work rather than saying something vague like "it didn't work".


People here will be happy to help with you with problems that you encounter in using Maple, but they are not here to do your homework problems for you.

Show what you have done so far, and point out where you need help.


Your calculation shows that KdV_f has a term with the fifth derivative of f with respect to x, but your target equation has at most the fourth derivative.  Are you sure that you are looking at the right thing?


@suvetha2000 I expect that the solution that I have shown to gain all 3 marks on Qs1ci.

As to Qs1Cii, the solution is more of a conceptual type rather than computational.  It is possible to use Maple to express some of the concepts however that use is really superfluous since you will need to work out the answer in your head anyway.



@suvetha2000 If you are asked to take someone's picture and you take a picture of the back of their head, that's not wrong, but that's not quite what is expected. In that same sense, your graphs are not wrong, but they miss the interesting region of activity.  If I were to mark that work, I would give 1 out of 3 points.


There are various ways of building flexibility in an essentially one-dimensional object which would be the curve of descent.  The simplest models are those of the Euler beam (from the 1700s) and the Timoshenko beam (from the early 1900s) each of which leads to a fourth order linear partial differential equation (see their respective entries in Wikipedia).  Neither of these is suitable for the problem that you have posed since they are valid only under infinitesimal displacements.

The theory of finite deformation of one-dimensional structures is called rod theory and is quite complex. Stuart Antman's article, The Theory of Rods, has a detailed exposition.  The equations are heavily nonlinear and I am afraid too involved for an elementary optimization analysis.

Thanks, acer, for this very useful option.  It's good enough to be merged into the future releases of Maple.


@wlferguson19  Change the line
pdsol:-animate(t=0..0.3, frames=40);
pdsol:-animate(t=0..0.3, frames=40, title="time = %f");

Does that do what yiou want?


@wlferguson19 Oh, I see;  I didn't notice that you had written Ux to indicate derivatives.  All's well.

The line
t:= textplot3d([-1.1,1.1,1,typeset(`#mover(mi(` || v ||  `),mo("→"))`)]):
can be entered more succinctly as
t:= textplot3d([-1.1,1.1,1,`#mover(mi("v"),mo("&rarr;"))`]);
and of course this is independent of the Physics package.


@Jjjones98 I can't think of a way for doing that. Perhaps someone else can come up with an idea.


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