Rouben Rostamian

MaplePrimes Activity


These are replies submitted by Rouben Rostamian

@Alejandro Jakubi So there is nothing new under the sun...  Now that we see that this issue has been encountered so many times, I wonder if it would help to consider changing Maple's behavior so that it always treats a definite integral's variable of integration as a local variable.  I attempted to write a generic proc, such as myInt(expr, var=range) to do that but gave up very quickly since I don't know enough about writing fancy procs in Maple.

@Markiyan Hirnyk  Oh, I see.  You are saying that the product curve is not drawn.  That's easy to do.  Here it is.  The green graph is the product of the blue graphs.  The yellow area is the value h(t) of the convolution.  The graph of h(t) is shown in red.

Here is the code that produced it. It is based on what Carl posted.

restart:
Digits:= 4:
u:= Heaviside:
f:= t-> u(t) - u(t-2):
g:= t-> t*u(t) - (t-4)*u(t-4):
plotg:= plot(g, -6..10, color= blue):
h:= unapply(Int(f(t-q)*g(q), q= -6..t), t):
ploth:= convert(op([1,1], plot(h, -6..9)), listlist):
frames:= seq(
     plots:-display([
          plot(f(t-s)*g(s), s=-6..100, color=green, filled=[color=yellow]),
          plot(f(t-s), s= -6..10, color= blue),
          plot(select(xy-> xy[1] <= t, ploth), color= red, thickness= 3)
     ]), t= -3..9, 0.4
):
plots:-display(
     [plots:-display([frames], insequence), plotg],
     view= [DEFAULT, `..`((min,max)(ploth[..,2]))]
);

Comment:  I have kept the function f as in the original request.  However, the demo would be more interesting if the area under the graph of f were 1 and f were symmetric.  To achieve that effect, in the code above change the defintion of f to

f:= t-> (u(t+1) - u(t-1))/2;

 

@Markiyan Hirnyk I am referring to the animated picture under the heading "Here it is".

@Carl Love Your modified code is orders of mangnitude faster!  Learned a bunch of new tricks by examining it.  Thanks!

@Markiyan Hirnyk Well, there is an interpretation to the animation with the red and blue curves which I posted earlier.  At each instant 't' of the animation sequence,  consider the pointwise product of the two blue graphs.  Then the convolution, h(t), is the area under the graph of that product function.

@Kitonum Sure, that will work.  Thanks.  I was more interested, however, in understanding why F(s) yields the wrong result in my original post.

@Markiyan Hirnyk The yellow area in those wiki pages is an artifact of the boxes having unit heights.  Where will the yellow area be if the boxes were of height 2 each?

@Carl Love  Thanks, that's good!  Motivated by what you have shown, I came up with the following alternative:

> F := proc(t)
    local s;
    return Int(f(t-s), s=0..1);
end proc:

> F(s);

Int(f(s-s), s = 0 .. 1)

> subs(s=q, %);

Int(f(q-s), s = 0 .. 1)

@ANANDMUNAGALA You don't need a different procedure for the inverse interpolation.  What you need is to understand what Neville's inverse interpolation is about (that has nothing to do with Maple) and then apply your existing procedure to do what the inverse interpolation is supposed to do.

@Simon_2604 That 70 kB is much too small.  On Linux I get file of ~2.8MB, as tomleslie does on Windows.  So as you said, you must be getting pretty much an empty file.  I have no idea why that is happening.  As a last resort you may want to contact the Maple Technical Support but I am afraid that the issue may be specific to your machine, in which case they won't be able to help.

As to viewing, tomleslie writes that "it takes ages to load".  That must be a problem with the specific EPS viewer on Windows.  On Linux the image loads in 2 to 3 seconds,  I tried it with three different EPS viewers (gv, evince, display).

 

 

@Simon_2604 I have no problem with exporting your plot as EPS in Maple 18 and viewing it.  I export it by right-clicking the figure and selecting Encapsulated Postscript.

I am doing this on Linux, where there are various EPS viewers.  I viewed the saved graph with gv and evince.  Both show the expected image.

 

@Simon_2604 What is Ysq?  It would be easier to diagnose the problem if you upload your maple worksheet. (Use the large green up-arrow.)

Aside: The following is not the source of your problem, but have a look at the documentation of sphereplot.  You will see that:

Important: The sphereplot command has been deprecated.  Use the superseding calling sequence plot3d(args, coords=spherical), ...

@acer I do sympathize with the sentiments you have expressed.  I do use the F3 and F4 keys to combine/split execution groups in the manner you have described.

I don't know about you, but I have always felt that the behavior of the F4 key is not quite correct.  Ideally, after joining two execution groups with F4, the prompt (>) of the second groups should go away, but it doesn't.  Perhapst the problem that you and the OP have noted stems from that bad design -- that is, Maple gets confused by those spurious prompts.  Redesigning F4's action to remove those out-of-place prompts should make Maple 2015 happy.

 

@Kitonum You have just helped mish1995 to

  1. avoid doing his homework;
  2. help him deceive his teacher by passing your solution as his own;
  3. get credit for work he didn't do.

Is that a good thing to do?

@rightClick The link marked About at the bottom of every Maple Primes page contains a statement of the objectives of this forum.  There is no explicit prohibition there on doing someone else's homework, but most schools do have integrity policies that condemn passing someone else's work as one's own.

I am by no means empowered to enforce guidelines in this forum.  I am merely expressing my opinion.  Specific questions on technical issues regarding Maple, mathematics, programming, or related issues are quite alright in my view.  But saying "if nobody does this for me I will fail, please do this question for me" exceeds the bounds of propriety by any standard.

First 86 87 88 89 90 91 Page 88 of 91