Rouben Rostamian

MaplePrimes Activity


These are answers submitted by Rouben Rostamian

The array d contains the desired coordinates, one point per line.

restart;

c := plots:-spacecurve([cos(t), sin(t), t], t=0..2*Pi);

plottools:-getdata(c):
d := op(3,%);

_rtable[36893628733906276588]

Download mw.mw

Your f,fdiff=... command is equivalent to the simpler:

f, diffs := GenerateMatrix(sys222, var1);

However...

A matrix representation of a system of equations is useful if the system is linear. Your system is nonlinear. What do you expect to get out of a matrix representation of a nonlinear system?

Regarding the symbolic option to simplify(), the help page says:

The result of such an operation is in general not valid over the whole complex plane and can lead to incorrect results if you assume the expressions represent analytical functions.

Thus, the symbolic option should be used only when you really know what you are doing.  Preferably it should not be used at all.  In your worksheet you are comparing two simplifications, one with and one without the symbolic option.  It's not surprising that the result are inconsistent.

restart;
doit := proc(oper)
  local x := 3, y := 4;
  return oper(x,y);
end proc:
doit(`+`);
                               7
doit(`-`);
                               -1
doit(`*`);
                               12
doit(`/`);
                               3/4

 

 

The error message says it all; it doesn't know what to do with d.

In the IBC you have

C(0, t) = 1 + d(1 - cos(varpi*t))

What is d?  If it's a function, then you need to specify it.  If it's a multiplier constant, then you need to provide its value and also don't forget to insert a multiplication sign between d and the adjacent parenthesis.

Regarding the differential equation for theta:

It has A[1] and A[2] in it, but there are no A[1] and A[2] in your expected solution.  Is that an oversight?

By the way, that differential equation is quite trivial to solve by hand.  It's not worth bothering with Maple with it. If you try the manual solution, you will find that a solution exists provided that  - v[1]  - A[1] + A[2] = v[3]. 

Regarding the differential equation for phi:

Express the differential equation in terms of Heaviside() rather than pieceswise(), as in:
 

eq2 := diff(phi(t),t) = -v[1] + v[1]*Heaviside(t-T[1]) + v[3]*Heaviside(t-T[2]);
dsolve({eq2,phi(0)=-v[2]});

That yields the unique solution of that initial value problem, and therefore determines the value of phi(1).  You cannot arbitrarily demand a different value for phi(1).
 

As dharr has correctly pointed out, a nonzero initial velocity obviates the objection that I had expressed in my prevrious message.  Following through with that insight, we end up with a semi-cubic parabolic curve y^3 = - a*x^2 for the particle's path.  The adjustment, relative to dharr's solution, is that the x compoment of the initial vecocity should be zero rather than v0.

restart;

The sum of kinetic and potential energies:

E := 1/2*m*(D(x)(t)^2 + D(y)(t)^2) + m*g*y(t)

(1/2)*m*((D(x))(t)^2+(D(y))(t)^2)+m*g*y(t)

(1)

Conservation of energy

eq := E = eval(E, t=0);

(1/2)*m*((D(x))(t)^2+(D(y))(t)^2)+m*g*y(t) = (1/2)*m*((D(x))(0)^2+(D(y))(0)^2)+m*g*y(0)

(2)

Suppose that the particle starts off at the origin, that is,
x(0) = 0, y(0) = 0, and slides down a curve (to be determined)
under the gravitational pull.  Assume that the vertical component
of the velocity is a constant -V for some V > 0.  Therefore y(t) = -V*t.
Additionally, assume that the particle begins falling vertically,

that is, (D(x))(0) = 0.  Plugging this information into the equation of

conservation of energy we obtain a differential equation for x(t):

de := eval(eq, {x(0)=0, y(0)=0, D(x)(0)=0, y = (t -> -V*t)});

(1/2)*m*((D(x))(t)^2+V^2)-m*g*V*t = (1/2)*m*V^2

(3)

Solve the differential equation

dsol := dsolve({de, x(0)=0});

x(t) = (2/3)*t*2^(1/2)*(g*V*t)^(1/2)

(4)

Therefore the particle's path is given by the parametric curve:

curve := x = rhs(dsol), y = -V*t;

x = (2/3)*t*2^(1/2)*(g*V*t)^(1/2), y = -V*t

(5)

Eliminate t to obtain the equation of the path as a relationship

between x and yNULL. We end up with a semi-cubic of the form y^3 = -a*x^2:

x = subs(t=-y/V, rhs(dsol)):
%^2:
isolate(%, y^3);

y^3 = -(9/8)*x^2*V^2/g

(6)

Here is the graph of the path, with a certain choice of parameters:

subs(curve, g=1, V=1, [x,y,t=0..1]);
plot(%);

[(2/3)*t^(3/2)*2^(1/2), -t, t = 0 .. 1]

 

 
 

 

Download semi-cubic-path.mw

 

I don't think you can do that in Maple.  But you can do it through post-processing with open and free software ImageMagick assuming that you are comfortable with using command-line tools.

Save your Maple graphics in a file, let's say p1.png (or GIF), and then convert it to p2.png:

convert p1.png -transparent white p2.png

Beware that this converts all while pixels, (not just the background!) to transparent.

> exp(Pi*sqrt(163));
                                          1/2
                                exp(Pi 163   )

> evalf[30](%);
                                                         18
                    0.262537412640768743999999999999 x 10

See the YouTube video https://www.youtube.com/watch?v=a9k_QmZbwX8

Why do you set numpoints=10000 in your plotting command?  That's telling Maple to plot the graph on a 100x100 grid, and that results in large EPS file. 

Your graph oscillates a lot in the t direction but it is pretty much a constant in the x direction.  So you need a fine grid in the t direction but a coarse grid in the x direction.  For instance, try the option 
grid=[20,100].  The total number of points now is 2000, which is one fifth of the number of points that you have used, and consequently the EPS file will smaller by a roughly a factor of 1/5.

 

restart;

Assume expr is an algebraic expression in x and y

T := proc(expr)
        local z;
        z := unapply(expr, x, y);
        return z((sqrt(3)*y - x)/2, (-sqrt(3)*y - x)/2);
end proc:

Try me:

T(x^4);
T(x^2*y^2);

((1/2)*3^(1/2)*y-(1/2)*x)^4

((1/2)*3^(1/2)*y-(1/2)*x)^2*(-(1/2)*3^(1/2)*y-(1/2)*x)^2

Basis for V__n:

B := x^4, x^3*y, x^2*y^2, x*y^3, y^4;

x^4, x^3*y, x^2*y^2, x*y^3, y^4

Arbitrary element of V__n:

P := add(c[i]*B[i], i=1..5);

x^4*c[1]+x^3*y*c[2]+x^2*y^2*c[3]+x*y^3*c[4]+y^4*c[5]

Calculate the image of P under T:

Q := collect(T(P), [x,y]);

((1/16)*c[1]+(1/16)*c[2]+(1/16)*c[3]+(1/16)*c[4]+(1/16)*c[5])*x^4+(-(1/4)*3^(1/2)*c[1]-(1/8)*3^(1/2)*c[2]+(1/8)*3^(1/2)*c[4]+(1/4)*3^(1/2)*c[5])*y*x^3+((9/8)*c[1]-(3/8)*c[3]+(9/8)*c[5])*y^2*x^2+(-(3/4)*3^(1/2)*c[1]+(3/8)*3^(1/2)*c[2]-(3/8)*3^(1/2)*c[4]+(3/4)*3^(1/2)*c[5])*y^3*x+((9/16)*c[1]-(9/16)*c[2]+(9/16)*c[3]-(9/16)*c[4]+(9/16)*c[5])*y^4

The matrix representation of T:

PolynomialTools:-CoefficientList(Q, [x,y])[-5..-1]:
A := LinearAlgebra:-GenerateMatrix(%, [c[i] $i=1..5])[1];

Matrix(5, 5, {(1, 1) = 1/16, (1, 2) = 1/16, (1, 3) = 1/16, (1, 4) = 1/16, (1, 5) = 1/16, (2, 1) = -(1/4)*sqrt(3), (2, 2) = -(1/8)*sqrt(3), (2, 3) = 0, (2, 4) = (1/8)*sqrt(3), (2, 5) = (1/4)*sqrt(3), (3, 1) = 9/8, (3, 2) = 0, (3, 3) = -3/8, (3, 4) = 0, (3, 5) = 9/8, (4, 1) = -(3/4)*sqrt(3), (4, 2) = (3/8)*sqrt(3), (4, 3) = 0, (4, 4) = -(3/8)*sqrt(3), (4, 5) = (3/4)*sqrt(3), (5, 1) = 9/16, (5, 2) = -9/16, (5, 3) = 9/16, (5, 4) = -9/16, (5, 5) = 9/16})
 

Download mw.mw

 

There is no automatic way of telling whether a surface is ruled.  A sufficient (but not necessary) condition is that the surface is parametrized as x(u,v) = α(u) + v β(u), where α and β are vector-valued functions. 

As to "dispersion parameter" and "throat line",  its seems that you are referring to what are called the "distribution parameter" and the "striction curve" in English. They are calculated in a straightforward way, but you need to provide a specific x(u,v) in order to carry out the calculations.

It can't tell why you have "differential equation" in the title since the answers to your questions do not involve differential equations.  But perhaps I have misunderstood you.

From the error messages that you have shown, it looks to me that your java is running out of memory.  I recall having encountered that in memory-consuming applications.  For that reason, I have aliased my Maple command to expand to "maple -j 65536"  (the default is "-j 512").  I believe that should solve your problem.

The problem occurs much earlier, in T__v_x .  Your code assumes that T__v_x captures the return value of fsolve and then happily moves ahead with the rest of the calculation.  But what if fsolve returns no solution?

I suggest that you set x__k=1000, as it is what you seem to want to do, then execute the statements of the worksheet one at a time and see where the failure occurs.

 

restart;

with(plots):

with(plottools):

n := 3;  # the number of horizontal intervals,  indexed by i

3

m := 4;  # the number of vertical intervals, indexed by j

4

xmin, xmax := 1, 9;

1, 9

ymin, ymax := 2, 8;

2, 8

# a[i,j] holds the coordinate pair of the node (i,j);

a := Array(0..n+1, 0..m+1, (i,j) -> [ (n-i)/n*xmin + i/n*xmax,  (m-j)/m*ymin + j/m*ymax ] );

`Array(0..4, 0..5, {(0, 2) = [9, 2], (0, 3) = [\`/\`(19, 3), \`/\`(7, 2)], (0, 4) = [\`/\`(11, 3), 5], (0, 5) = [1, \`/\`(13, 2)], (1, 1) = [1, 2], (1, 2) = [\`/\`(35, 3), 2], (1, 3) = [9, \`/\`(7, 2)], (1, 4) = [\`/\`(19, 3), 5], (1, 5) = [\`/\`(11, 3), \`/\`(13, 2)], (2, 1) = [\`/\`(11, 3), 2], (2, 2) = [1, \`/\`(7, 2)], (2, 3) = [\`/\`(35, 3), \`/\`(7, 2)], (2, 4) = [9, 5], (2, 5) = [\`/\`(19, 3), \`/\`(13, 2)], (3, 1) = [\`/\`(19, 3), 2], (3, 2) = [\`/\`(11, 3), \`/\`(7, 2)], (3, 3) = [1, 5], (3, 4) = [\`/\`(35, 3), 5], (3, 5) = [9, \`/\`(13, 2)], (4, 1) = [9, 2], (4, 2) = [\`/\`(19, 3), \`/\`(7, 2)], (4, 3) = [\`/\`(11, 3), 5], (4, 4) = [1, \`/\`(13, 2)], (4, 5) = [\`/\`(35, 3), \`/\`(13, 2)]})`

display(
        seq(line(a[i,0], a[i,m]), i=1..n-1),  # sequence of vertical lines
        seq(line(a[0,j], a[n,j]), j=1..m-1),  # sequence of horizontal lines
        seq(seq(pointplot(a[i,j], symbol=solidcircle, symbolsize=15, color="Blue"), i=0..n), j=0..m),
        seq(seq(textplot([seq(a[i,j]), typeset(a[i,j])], align={above,right}, font=['helvetical', 'bold', 13]), i=0..n), j=0..m),
        rectangle(a[0,0], a[n,m], style=line, color=red),
scaling=constrained, size=[800,600], view=[0..xmax, 0..ymax]);

 

 
 

Download mw.mw

 

First 6 7 8 9 10 11 12 Last Page 8 of 53