ecterrab

14605 Reputation

24 Badges

20 years, 97 days

MaplePrimes Activity


These are answers submitted by ecterrab

> u := sin(x)*sin(th)+sin(x)^2+sin(2x)+sin(th)^2+exp(x)+x > i want to extract for x > > unique functions = {sin(x),sin(2x),exp(x),x} There are various manners, here is a sample of different types of selection # functions sin and exp of x and 2*x > indets(u, specfunc(identical(x, 2*x), [sin,exp])); {sin(x), sin(2 x), exp(x)} # functions sin and exp with arguments of type name (see ?type,name) > indets(u, specfunc(name, [sin,exp])); {sin(x), sin(th), exp(x)} # functions sin and exp of any argument > indets(u, specfunc(anything, [sin,exp])); {sin(x), sin(th), sin(2 x), exp(x)} # This other construction using 'satisfies' is very flexible: > indets(u, And(specfunc(anything, [sin,exp]), satisfies(f -> has(f, th)))); {sin(th)} Edgardo S. Cheb-Terrab Research Fellow, Maplesoft

The solution Maple Equation may look "insane" but that is a consequence of the input, not a problem in itself. Here is a way to obtain what you want, that is the space crossed in a period of time: from t=3.35 to t=4.77 (seconds), also not looking like an insane wall paper.

For comfort (not necessary) I'll use

> PDEtools[declare](v(t),x(t),prime=t);

Maple Equation

Maple Equation

Maple Equation

This is your equation, for Maple Equation, the velocity

> eq1:=diff(v(t),t)+4.646e-4*v(t)^3-7.13e-3*v(t)^2-0.085*v(t)-2.82;

Maple Equation

Transform it into an equation for Maple Equation, the position

> eq2 := eval(eq1,v(t)=diff(x(t),t));

Maple Equation

Now let's put the origin for the x axis (any choice is as good) at the place where the object is at t = 3.35; at that moment, the velocity is, according to your post, 14.77 m/s, so the "initial conditions" for this problem are

> ic := x(3.35)=0, D(x)(3.35)=14.77;

Maple Equation

You can now this exactly, in a rather compact form (note all floats got converted to exact rational numbers);

> sol := dsolve([eq2,ic]);

Maple Equation

In above you see a double integral and a RootOf as one of the integrands. You can request these integrals to be computed but the output is a kind of (unavoidable) wall paper.

Now, because of our choice of origin for the x axis, the space between from x(3.35) and x(14.77) is directly the value of this solution at 4.77

> evalf(eval(sol,t=4.77));

Maple Equation

This value, however, relies on the ability to numerically evaluate the double integral with a RootOf in the integrand - that is difficult in itself. Let's check computing a numerical solution directly:

> nx := dsolve([eq2,ic],numeric);

Maple Equation

> nx(4.77);

Maple Equation

So using direct numerical methods on this problem the value is ~25.

Edgardo S. Cheb-Terrab

Research Fellow, Maplesoft

This post generated using the online HTML conversion tool
Download the original worksheet

The packages for working with DEs in Maple are DEtools and PDEtools. The DEtools[matrixDE] command could be the closer match to what you are looking for. Note however that in Maple "multiplication" and "application" (see ?apply) are rather different operations. You could try to reprogram the Maple non-commutative multiplication operator `.` (see ?overload), in order to make it work as "application" too, but for typical problems this may not be worth. In Maple you can compute the adjoint of a linear equation using the DEtools[adjoint] command, but I guess that in your context the word adjoint has a different meaning (transposing and conjugating?). Perhaps looking at a concrete example, showing the actual input and output you expect, it may be possible to help you more. Edgardo S. Cheb-Terrab Research Fellow, Maplesoft
Hi, Recalling (see ?nspin), in
    > npspin(coord, h, G, curinfo)
h is a Maple rank-2 tensor_type object of character [1,-1] (first index contravariant and second index covariant), representing the tetrad transformation "matrix". Using tensorial notation (to the left) and Maple matrix notation (to the right),
                   a
                  h   = h[compts][a,b]
                    b
where h entering the right-hand-side is the object created using the tensor[create] command, h[compts] is the matrix contents of that rank-2 tensor, and h satisfies (sum over the repeated indice c)
                    c    [  0,  1,  0,  0  ]
              h   h    = [  1,  0,  0,  0  ].
               ac  b     [  0,  0,  0, -1  ]
                         [  0,  0, -1,  0  ]
You can use the tetrad of null 4-vectors you mentioned [l, n, m, \bar{m}], satisfying
              a       a       a    _ _a
           l l  =  n n  =  m m  =  m m  = 0
            a       a       a       a

              a        _a
           l n  =  - m m  = 1
            a         a
to construct h with two covariant indices (so a Maple tensor of rank-2 with character [-1, -1]), via
                                   _
               h   = [ l , n , m , m  ]
                ab      b   b   b   b
and then use the metric tensor to rise the first indice and obtain the object entering the calling sequence of nspin. The formulas to compute the spin coefficients in terms of this tetrad of 4-vectors and the metrics are the standard ones; see for instance (5.5) page 167 of http://projecteuclid.org/Dienst/UI/1.0/Summarize/euclid.cmp/1103840725 Although you already have the tetrad of 4-vectors, you may prefer to compute the spin coefficients directly from the connections using the tensor[convertNP] command. In turn other commands of the tensor package allow you to construct the connections from the metric tensor - see tensor[connexF]. Alternatively, the GRTensor package mentioned by Tom also has a command, nptetrad, which computes the null tetrad of 4-vectors from the the metric tensor - see http://grtensor.phy.queensu.ca/Griihelp/nptetrad.help. As far as I remember the GRTensor does not have a separate command to compute the spin coefficients. Edgardo S. Cheb-Terrab Research Fellow, Maplesoft
First 58 59 60 Page 60 of 60