Rouben Rostamian

MaplePrimes Activity


These are replies submitted by Rouben Rostamian

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

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

First 94 95 96 97 98 99 Page 96 of 99