Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

I will give a sketch of what needs to be done and leave it to you to code it in Maple.

Consider the rectangle R = { 0 < x < X,  0 < t < T } in the x-t plane.  According to Green's Theorem, for any two functions M(x,t) and L(x,t), the following two integrals are equal:

    P = the integral of (L dx + M dt) on R's boundary;
    Q = the double integral of (dM/dx - dL/dt) over R.

Let's pick L=0, and M=dC/dx. Then we have:
    P = the integral of (dC/dx)dt on R's boundary;
    Q = the double integral of d^2C/dx^2 over R.

  1. Let us calculate P
    R's boundary consists of four segments -- two with x constant, and two with t constant.  The segments with t constant do not contribute to the P integral because dt is zero along them.  On the segment with x = 0 we have the boundary condition BC1, that is, dC/dx=0, and therefore that segment does not contribute to the P integral either.  We are left with the segment with x=X.  We conclude that:
        P = the integral of dC/dx (at x=X) from t=0 to t=T.
  2. Let us calculate Q
    The PDE in DE1 says that d^C/dx^2 equals dC/dt. (I am taking the diffusion constant to be 1 to simplify my typing, but you may take it anything you wish.)  Then we see that
        Q = the double integral of dC/dt over R
           = int(int(dC/dt, t=0..T), x=0..X)
           = int(C(x,T) - C(x,0), x=0..X).
    This latter integral you can calculate since C(x,0) is the given initial condition, and C(x,T) is calculated by Maple.

We conclude that
    the integral of dC/dx (at x=X) from t=0 to t=T
    =
    int(C(x,T) - C(x,0), x=0..X).

 

It is not clear what you mean by "Can someone please help me with solving this?".

If you need to test for n=0 or n>0, you already know how to write "if ... then ... end if".  If you need to do something else, then you need to be more specific.

By the way, posting screenshot images is not the best idea.  To help people to answer your questions, please post the actual maple worksheet.  Click on the big fat green arrow in the window where you compose your question in order to upload a worksheet.

 

It's not clear to me what you are attempting to do (mathematically).  It appears that you have a set of three equations

sys := y = p*x,  x = 100*z/(p*r+r),  z = x*a+y*(1-b) ;

and you want to solve these for x, y, z.  If so, then we do

solve({sys}, {x,y,z});

which produces {x=0, y=0, z=0}.

If you want nonzero solutions, then the coefficients a, b, p, and r cannot be arbitrary.  You will need a relationship like -100*b*p-p*r+100*a+100*p-r = 0.

Enter this in your worksheet:

doit := proc(n::integer)
  local ans;
  if type(n, even) then
    ans := n/2;
  else
    ans := 3*n+1;
  end if;
  return ans;
end proc;

Then doit(4) should evaluate to 2, and doit(5) should evaluate to 16.

 

These class notes that I wrote some time ago may be of interest to you: inverted-pendulum-notes.pdf

The equation of motion is derived in this Maple worksheet: inverted-pendulum1.mw.
Sorry, I don't have Maple Sim.

Here is an animation of the stabilized inverted pendulum extracted from that worksheet.

This boundary value problem has an exact solution in terms of elementary functions, therefore there is no need for dsolve/numeric.

Details are given in interesting-bvp.mw.

Here is the graph of the solution:

Doing a proc for this is an overkill.  All you need is to multiply the list of the coordinates by Pi/180.  For instance:

L := [36.9,102.04,37.345,101.6104];
Pi/180.*L;

produces [.6440264940, 1.780933969, .6517932092, 1.773436034].

Or even a one-liner:

Pi/180.*[36.9,102.04,37.345,101.6104];

which does the same thing.

Added later:

Or if you want to assign the results to variables, you may do something like:

a,b,c,d := op(Pi/180.*[36.9,102.04,37.34,101.6104]);

After which, a will be 0.6440264940, etc.

I don't know what a "parametric matrix" is but perhaps this will help:

Your reference to xkill leads me to believe that your operating system is linux, and if so, then probably you launch Maple from the commandline.

Maple can freeze when its (undocumented?) JAVAHEAP parameter is too small to handle excessive graphics output. Try increasing it by specifying it on the commandline, as in

maple -x -j 4096

The default JAVAHEAP value is 512. 

The short answer to your question is that yes, if the initial angular velocity is large enough, then the disks will lose contact with the floor.

I have written down the calculations in two-disks-ver2.mw.  You may experiment with the model by varying the parameters.

The diagrams below, extracted from that worksheet, depict the vertical contact force as a function of time in two cases: In the first case the disk rolls somewhat slowly and therefore the contact force remains positive throughout.  In the second case the disk rolls faster and the contact force occasionally becomes negative (which means that the disk detaches from the floor).

Applying the ratio test from calculus we see that the series diverges for all nonzero x, therefore your "unknown" is defined for x=0 only.  There is not much to plot there.

I don't know how to rebind keys, but Ctrl-End takes you to the end of the worksheet on linux.

As I said my previous post, obtaining the optimal path of the boat is a calculus of variations problem.  It turns out that although the problem is doable in principle, the calculations would be quite difficult without the help of a symbolic computational software such as Maple.  This is a good illustration of the non-trivial use of a modern CAS.

The problem's statement and solution are given in detail in the attached worksheet.  A brief version is this.  We have a river represented by the strip 0 < x < 1,   -∞ < y < ∞ in the Cartesian x-y plane.  The water velocity is <0, V(x)>.  A boat travels from (0,0) to (1,0) with a constant speed S relative to the water.  What path to take to minimize travel time?

Here is the shape of the optimal path corresponding to V(x) = 3*x*(1-x) and S=1.  The travel time turns out to be T=1.15.

Here is the worksheet: boat2.mw

Added later: I found and corrected a few typos in the previous worksheet's comments (not the math). Here is the corrected version: boat2-ver2.mw

 

Earl, now I am able to read your worksheet.  I haven't examined it carefully because while I was waiting for it, I made a worksheet of my own which appears to be quite similar to yours.  Here it is:

boat.mw

In this worksheet the river is the vertical strip 0 < x < 1 in the x-y Cartesian plane and the water flows in the positive y direction with a velocity which is a linear function of the distance from its mid point to either bank, although any other velocity profile may be substituted for it.  The worksheet has a more detailed description of the problem and its assumptions.

The boat goes from (1,0) to (0,0) while pointing toward the destination (0,0) at all times. The following animation, extracted from that worksheet, shows the boat's path:

This answers only one of your two questions.  The other is to find the fastest path between the two destinations. That appears to be quite closely related to the brachistochrone problem from the calculus of variations.  If I find some time, I will work it out and post, unless someone else with more free time on their hands beats me to it.

The code you have posted is not quite readable.  You wouldn't want to read someone else's code that looks like that, would you?

Try to help people who you want to help you.  Format your code as best as you can when you post it.

OK, I did go through the trouble of formatting your code, and simplified it.  Here is what it does.

restart;
pde := diff(u(x,y,z,t),t) + 6*u(x,y,z,t)*diff(u(x,y,z,t),x)
       + diff(u(x,y,z,t),x,y,z) = 0;

Apply the following change of variables:

tr := {t = T/a^beta, x = X/a^alpha, y = Y/a^mu, z = Z/a^nu,
       u(x, y, z, t) = U(X, Y, Z, T)/a^Zeta};
PDEtools:-dchange(tr, pde, [X, Y, Z, T, U]);

Divide the result by the coefficient of diff(U(X,Y,Z,T), T) and simplify

coeff(lhs(%), diff(U(X, Y, Z, T), T));
simplify(%%/%);

We arrive at:

You want this to be in the same form as the original equation.  You don't want a=1, so we need the exponents to be zero, that is:
eq1 := -Zeta-beta+alpha = 0;
eq2 := -beta+alpha+mu+nu = 0;

This is a system of two equations in five unknowns. You may pick three of the values arbitrarily and calculate the other two.

 

First 37 38 39 40 41 42 43 Last Page 39 of 53