Rouben Rostamian

MaplePrimes Activity


These are replies submitted by Rouben Rostamian

Carl, in an attempt to understand the logic of your solution, I did the following two experiments.

Experiment #1:

{ <a,b>, <a,b> };

{Vector(2, {(1) = a, (2) = b})}

 

This works as expected -- a set of two identical items is the same as the set of one of them.

Experiment #2:

<a,b>, <a,b>;

Vector(2, {(1) = a, (2) = b}), Vector(2, {(1) = a, (2) = b})

{ % };

{Vector(2, {(1) = a, (2) = b})}

 

I am puzzled by why this set does not collapse to a single item as in Experiment 1.  Do you know the reason why?

 

Aside: If we replace vectors with lists in these experiments, then the outcomes of the two experiemnts turn out to be the same.  You relied on that in your soluiion.

 

@rlopez Providing a student with a complete solution to a homework assignment is not unlike "helping" a runner who is training for a race by giving him a ride.

I suspect that during your teaching years you would not have been overjoyed if a student presented you with someone else's work as their own.  There is no good reason to do otherwise now.

@Kitonum How is a graph of (w, p(w)) any different from a graph of (w(z), p(w(z))?  Aren't they the same?  What is wrong with doing it in the simple way that I have shown, especially since w and p are functions of z, and the OP seems to be interested in in the range z=0..26?

 

@tomleslie I failed to connect this version of the question to the previous one and the corrections that you had suggested, which in retrospect make very good sense.

@reinhardsiegfried The polynomial method you are proposing merely reinvents the series solution.  If the series solution fails for some reason, then your polynomial solution will fail too because it's the same thing.  Linear or nonlinear does not matter.

@reinhardsiegfried OK, if you want a truncated polynomial approxination, then you may want to try this.

sys := diff(x(t),t) = y(t), diff(y(t),t)=x(t);
ic := x(0)=2, y(0)=1;
dsolve({sys, ic}, {x(t), y(t)}, series);
 

{x(t) = series(2+t+t^2+(1/6)*t^3+(1/12)*t^4+(1/120)*t^5+O(t^6),t,6), y(t) = series(1+2*t+(1/2)*t^2+(1/3)*t^3+(1/24)*t^4+(1/60)*t^5+O(t^6),t,6)}

mathieulibert Perhaps it can help if you explain how you calculate a, b, c in terms of k1, k2, k3 and the three angles.  I don't know how, and I didn't find an explanation in your worksheet.

@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)

First 94 95 96 97 98 99 Page 96 of 99