Rouben Rostamian

MaplePrimes Activity


These are replies submitted by Rouben Rostamian

@Kevin Dragnet As Carl noted, the use of dchange in this context is an overkill, but for whatever it's worth, here it is:

restart;
sys := { diff(x(t),t) = y(t), diff(y(t),t) = -x(t) };
Tr := {x(t) = r(t)*cos(theta(t)), y(t)=r(t)*sin(theta(t))};
PDEtools:-dchange(Tr, sys, {r(t), theta(t)});
solve(%, {diff(r(t),t), diff(theta(t),t)});

The line that defines Tr in the code above may be obtained alternatively through the method that Carl proposed, as in:

Tr := [x(t), y(t)] =~ changecoords([x(t),y(t)], [x(t),y(t)], polar, [r(t), theta(t)]);

but in my view that's also an overkill.

Simultaneous access to multiple help pages will be a welcome enhancement. But I would rather have the multiple pages displayed as tabbed panels within a single help window (as it's done in web browsers and maple worksheets) rather than multiple help windows cluttering my screen.

@mmcdara That's a clever idea!

@Pets71 For the record, I am running Maple 2021 on Ubuntu 20.04 LTS installed on a 10 year old laptop with 4GB of memory. I use it just about every day in my classes for teaching, without a single problem.

I agree with Thomas Richard that what you have described smells very much like a bad RAM in your laptop. That's a hardware problem and has nothing to do with Maple.

See https://linuxhint.com/run_memtest_ubuntu/ on how to test your RAM in Ubuntu.

 

Isn't it more natural to name your variables S[i,j] rather than Sij?  If you do the former, then you may do

local S;
seq(seq(assign(S[i,j]=Vector(datatype=float)),i=1..9),j=1..9);

 

It will be good if you showed some attempt toward solving this homework problem.  You don't want someone else to do your homework for you, do you?

@rlopez My original example required a symbolic solution (x(p) and y(p)). Should a symbolic solution be unattainable, we may resort to a numerical solution, which turns out to be even simpler than the symbolic, as illustrated in the following worksheet.

restart;

with(plots):

Here is a family of function of x defined in terms of a parameter p.

f := (x,p) -> (x-p)^2 + cos(p);

proc (x, p) options operator, arrow; (x-p)^2+cos(p) end proc

The family's envelope is obtained by solving the system
f(x, p) = y

diff(f(x, p), p) = 0.``

Here are two options:

 

Option 1. We solve the system for x and y in terms of p, we obtain a

parametric representation x(p), y(p)of the envelope.

 

Option 2. For a given x, we solve the second equation for p and obtain
p(x).  Then evaluate y = f(x, p(x)), thus obtaining a mapping from
x to y of the points on the envelope.

NULL

I followed Option 1 in my original post.  That option works best if we

are able to solve the system symbolically.

NULL

Option 2 works best if the system is not solvable symbolically and we

need to resort to numerical calculations.

NULL

Here I will solve the original problem numerically to show that we

obtain the same result.NULL

 

Option 2 is implemented in the following proc.  It receives x and
returns y so that (x,y) is on the envelope.

elim := proc(x) option remember;
        if not type (x, realcons) then return 'procname'(args) end if;
        y = f(x,p), D[2](f)(x,p) = 0;
        fsolve({%});
        eval(y, %);
end proc:

Here is the plot of the envelope. It agrees with the result of the previous

symbolic calculation.

plot(elim(x), x=-8..8, color="Blue");

As before, we calculate the area between the central arch of

that graph and the x axis.  The arch's rightmost endpoint is at x = L, where

L := fsolve(elim(x), x=0..2);

1.323245517

Therefore, the area under the arch is

A := int(elim(x), x=-L..L, numeric);

1.586776257

which agrees with the previous result.

 

Download area-under-envelope-numeric.mw

 

@mmcdara As rlopez has noted, the method of lines (MoL) is unrelated to the method of characteristics. When a PDE has both space and time variables, in MoL we discretize space through finite differences, while treating the time variable as continuous.  Thus, the PDE is approximated by a system of ODEs.

About a year ago, I illustrated the MoL in the post https://www.mapleprimes.com/posts/212624-Solving-Multispan-Euler-Beams-With by applying it to the equation of the deflection of a multispan Euler beam.

A wise man once said: "If you don't know how to solve a problem, there is a simpler problem that you don't know how to solve. Try that one first".

In your case, the simpler problem would be the one-dimensional case of the heat equation. Do you know how to do that one?

@vv That's very clever.  Vote up!

Your homework asks you to define a function and then find the optimal solution.  But optimal solution to what? Perhaps you have abbreviated the question too much to be comprehensible.

You attempt to solve f(x,a,b,c)=0 for x.  The x that you would obtain there is called the root of f. In what sense is that related to the optimum of anything?

I can guess what the question is about but that would be only a guess and I don't want to put words in your mouth.  It will be good if you formulate your question in a clearer way.

@C_R Thanks for the data.  I'll see what I can do.

 

@vv That's a very clever construction. I see that the deviation of the answer from a rational in this case is of the order of exp(-10^28)  which is too small to be detected by fsolve().

 

@Mariusz Iwaniuk Thanks for this demo which clearly shows the trend.  If find Ronan's explanation is more insightful.

@Ronan Yes, that's it.  Now that you have pointed this out, it looks so obvious to me.  I have converted your "Reply" to "Answer" in order to give it a Vote Up.

 

First 25 26 27 28 29 30 31 Last Page 27 of 99