Rouben Rostamian

MaplePrimes Activity


These are replies submitted by Rouben Rostamian

Edgardo, thank you very much for your wonderfully quick reaction to this reported issue.  With this kind of immediate turnaround, Maple sets an enviable standard in the software world.

@Dmitrii Fitting a function to numerical data is called Interpolation. This forms a significant part of the typical introductory course in Numerical Analysis where one studies very many different ways of interpolating data, and the strengths and weaknesses of each.  Splines are a particular class of interpolating functions.

Maple provides all sorts of data interpolation functions.  Look up interpolation in Maple's help.

 

@Dmitrii The help page on Spline has a lot of examples and options.  If the x and y data are presented separately, you may do:

xdata :=[0,1,2,3,4,5];
ydata := [0,2,4,6,8,10];
u(x,0) = CurveFitting:-Spline(xdata, ydata, x, degree=1);

 

@Dmitrii Ah, I see.  I didn't pick up on that part of the question.

You may construct a formula for your numerical initial data by passing a spline curve through the data.  For instance, if your initial data consists of the points [[0,0],[1,1],[2,4],[3,3]], you may define the initial data for pdsolve through:

u(x,0) = CurveFitting:-Spline([[0,0],[1,1],[2,4],[3,3]], x, degree=1);

Change degree=1 to degree=3 if you want a smooth fit.

 

@tomleslie I suppose that the need to delete such copyrighted code is to satisfy Maplesoft's lawyer.  How a lawyer's mind operates is beyond me.

That said, I wish that Maplesoft's technical staff were as quick in reading and fixing bugs reported on MaplePrimes.

The problem lies in a shortcoming (or bad design) of convert(f, elsymfun).  Compare that to the behavior of type(f, symmfunc), which requires the names of the polynomial's variables as argument:

u := a*(x+y) + b*(x^2+y^2) + a*b*(x^3+y^3);
type(u, symmfunc(x,y));

                                                    true

With a proper redesign of convert(f, elsymfun) we should be able to do:

convert(u, elsymfun(x,y));

 

You need to be a little more specific.  What do you know of the surface?  Is it given by an equation like z=f(x,y)?  Or is it defined parametrically?  What do you mean by a projection?  Will you be happy if we map the entire plane to a single point on the surface?  If not, then what would you wish to have?

@fairuzalwani Your equation is:
    y:=y[t+1] +e(x[t]) mod N
but in your explanation you write:
    y[1] congruent to y[0]+e(x[0]) mod 8=6-1 mod 8=5
Where does that y[0] come from? How do you get there from y[t+1]?

Things may make better sense if you change your first equation to
    y:=y[t] +e(x[t]) mod N
although even then I am not happy with the clumsy formulation.  I assume that what you really have in mind is:
    y[i+1] = y[i] + e(x[i]) mod N
    x[i+1] = x[i] + y[i+1] mod N

I have made a worksheet in accordance with this latter formulation.  I will post it on this page as an Answer.

I don't understand the meaning of the iteration
y:=y[t+1] +e(x[t]) mod N
x:=x[t]+y[t+1] mod N

Pick an N, let's say N=8.  Pick initial data, let's say x[0]=5, y[0]=6.  Can you show me how you calculate x[1] and y[1]?  I mean by hand, not by Maple.

 

@mehdi jafari Your stated goal of "fitting the answer to a specific diagram" is too vague, making it difficult to provide a good advice. If you post the data that you have in mind, then perhaps some people may have a go at it.

 

I don't know about you, but I would hate to wade through the sort of worksheet that you have presented because I find it totally unreadable.

Advice: Your interface is set for 1-D input which is good.  It is set to Document Mode, which is bad.  Try the Worksheet Mode instead.  You will find it under Tools->Options->Interface.  Change it, then click on Save Globally to make it the default.

It is too late to rescue your existing worksheet.  Fix the interface as above, exit Maple, restart, create a new worksheet from scratch, and type your program there.  Do not copy/paste from your previous worksheet because that will import the mess into the new one.

One last thing:  Enter each statement in its own execution group.  Do not put several statements in one execution group because that appears to be your downfall.

See the attached sample worksheet (based on your own work) to see what things should really look like.

sample-worksheet.mw

 

@Kitonum and @vv, thanks for your answers to my question. These do more than I had expected can be done with the available tools.

I must note that your two solutions are effectively the same because min(a,b) is by definition piecewise(a<b, a, b).

@Carl Love I didn't know about InertForm:-Parse.  Thanks for pointing it out.

@vv I like your approach very much.  It's very clever and insightful.

In your procedure I think the definition of c may be shortened to
c := 1/eval(F, [X,Y]);
because the proc is fundamentally based on the identity
F(x,y) = F(a,y)*F(x,b)/F(a,b)
which holds for any function F(x,y)=f(x)*g(y), and any a and b.

It's a pity that sometimes the user needs to supply very special a and b values to produce the simplest results.  I am still impressed by Mathematica's Simplify which does not require such a hint.

@Kitonum I have no idea at all how Mathematica figures that out.  It is very impressive that a machine can be so clever.

First 63 64 65 66 67 68 69 Last Page 65 of 91