jakubi

1384 Reputation

12 Badges

19 years, 238 days

MaplePrimes Activity


These are answers submitted by jakubi

In smaller size does not look so bad:

For that you should split first the vector equations into components, write explicity the dependences of the functions on the coordinates and probably split real and imaginary parts.

You may try:

with(DifferentialGeometry):DGsetup([x, y, z], M):
R:=(dx &wedge dy) &plus (dy &wedge dz) &minus (2 &mult (dz &wedge dx));

                  R := dx ^ dy + 2 dx ^ dz + dy ^ dz

[seq([1,2,i]=NULL,i=1..3)]:
[seq(subsop(op(op(combinat:-choose(%,2))[i]),R),i=1..3)];

                    [dy ^ dz, 2 dx ^ dz, dx ^ dy]

E.g. for an "A" on a node:

restart:
  with(LinearAlgebra):
  with(plots):
  M:=Matrix(6, 3, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (2, 1) = 2,
 (2, 2) = 1/5, (2, 3) = 0, (3, 1) = 3, (3, 2) = 2/5, (3, 3) = 0, 
 (4, 1) = 4, (4, 2) = 3/5, (4, 3) = 0, (5, 1) = 5, (5, 2) = 4/5, 
 (5, 3) = 0, (6, 1) = 6, (6, 2) = 1, (6, 3) = 0}):
  CElem:=3:
  NbNode:=RowDimension(M):
  p1:=[seq([M[i,2],1],i=1..CElem)]:
  p2:=[seq([M[i,2],1],i=CElem..CElem+1)]:
  p3:=[seq([M[i,2],1],i=CElem+1..NbNode)]:
  P1:=plot(p1,color=blue,thickness=2):
  P2:=plot(p2,color=green,thickness=2):
  P3:=plot(p3,color=blue,thickness=2):
  PP1:=plot(p1,color=red,thickness=4,style=point):
  PP2:=plot(p2,color=red,thickness=4,style=point):
  PP3:=plot(p3,color=red,thickness=4,style=point):
 t1:=textplot([.2,1.1,"A"],align={above,right}):
 display (P1,P2,P3,PP1,PP2,PP3,t1,view=0..2);

This issue of using angles in degree unit for trigonometric functions appears quite frequently and I think that a dedicated (sub)package is needed. It may be useful for students and for some specialities like astrometry and geodesy. And it should handle degrees-minutes-seconds format besides decimal degrees.

The name sin is protected (cf ?protect):

type(sin,protected);
                                 true

So that such an assignment produces an error:

sin := proc(x) :-sin(x*Pi/180);end proc:

Error, attempting to assign to `sin` which is protected

So, you should have done something else.

A trick to produce the desired display form is using the empty function `` (cf. ?emptysymbol) in the exponents:

a*x^``(-1) + b*x^``(-2);
                             (-1)       (-2)
                         a x      + b x

I.e. altering the expression by introducing something in the exponent that typesets similarly to these negative integers, but is not automatically simplified as with them.

Several problems combined. Some of them:

1. You are using the document mode that hides the actual code, making much more difficult to identify the cause of the errors (both yours and Maplesoft ones).

2. For replacing with subs, you need to identify a proper syntactical subexpression as a lhs of the substitution equation. The one that you intend to use is not such a thing.

3. You are using several unnecessary packages, in particular Units, that messes all the expression, and is, in my opinion, badly designed. It generates for the solution this code:

w(z, t) = Units[Standard][`*`](Units[Standard][`+`]
(Units[Standard][`*`](_C1, exp(Units[Standard][`*`]
(Units[Standard][`*`](sqrt(Units[Standard][`+`]
(Units[Standard][`+`](Units[Standard][`*`]
(Units[Standard][`*`](I, c), omega), k), Units[Standard][`-`]
(Units[Standard][`*`](m[1], Units[Standard][`^`](omega, 2))))),
 z), Units[Standard][`/`](Units[Standard][`*`](sqrt(E[p]), 
sqrt(A)))))), Units[Standard][`*`](_C2, exp(Units[Standard]
[`-`](Units[Standard][`*`](Units[Standard][`*`]
(sqrt(Units[Standard][`+`](Units[Standard][`+`]
(Units[Standard][`*`](Units[Standard][`*`](I, c), omega), k), 
Units[Standard][`-`](Units[Standard][`*`](m[1], 
Units[Standard][`^`](omega, 2))))), z), Units[Standard][`/`]
(Units[Standard][`*`](sqrt(E[p]), sqrt(A)))))))), 
exp(Units[Standard][`*`](Units[Standard][`*`](I, omega), t)))

Hardly you will guess the right object to substitute from the typesetting of this stuff!.

4. Painting the backgound with yellow just makes the things worst as it generates new objects like:

`#msub(mi("m",mathbackground = "yellow"),mn("1",mathbackground = "yellow"))`

that do not match the original ones.

So, calculate your solution without loading such packages. and make a right substitution like:

subs((I*c*omega+k-`#msub(mi("m"),mn("1"))`*omega^2)^(1/2) = 
Lambda*`#msub(mi("E"),mi("p"))`^(1/2)*A^(1/2), sol);

w(z, t) = (_C1 exp(Lambda z) + _C2 exp(-Lambda z)) exp(I omega t)

Better yet, if you do not want to hit cryptic problems every two steps, use the worksheet mode and 1D input.

And there are also functional operators and type/operator. This case is nice:

?type/operator

A functional operator in Maple is a special form of a function. See ?operators[functional]

?operators[functional]

 A functional operator in Maple is a special form of a procedure. Functional operators are written using arrow notation.

Error messages also add a quota of confusion. E.g.:

showstat(hastype);
Error, (in showstat) cannot debug built-in functions

proc() options builtin=t;  end proc;
Error, not a built-in function (`t`)

No output from such 'dsolve' call means, in general, that 'dsolve' has not found a solution using default methods. May be that some other method could work.

I find that the usage of the term "function" in the documentation is frequently a bit confusing. Just a pair of examples:

?piecewise

With the piecewise function it is possible to express piecewise-continuous functions.

?ratpoly

In Maple rational functions are created from names, integers, and other Maple values for the coefficients using the arithmetic operators +, -, *, /, and ^. For example:  7+x/(x^4-3*x+1)  creates the rational function

One problem is that you call the procedure inertia with the argument xyzc, which has not been assigned a value. Note that within cog, the variable xyzc is local to this procedure. I.e. the global variable xyzc is not assigned a value by executing  cog. So you can solve this problem assigning to it the output of cog, like:

xyzc := cog(n, `#msub(mi("l"),mi("x"))`, `#msub(mi("l"),mi("y"))`,
 `#msub(mi("l"),mi("z"))`, xa, ya, za, xcomp, ycomp, zcomp);

The other problem is that you write things like `#msub(mi("l"),mi("y"))`^2*[i], namely the i-th element of the list `#msub(mi("l"),mi("y"))` squared, instead of the square of the i-th element of the list `#msub(mi("l"),mi("y"))`.

On the other hand, I think that the word rectangle should be replaced with cuboid.

Better:

eqn:=[seq(i,i=1..5)];
                        eqn := [1, 2, 3, 4, 5]

If you mean batch mode, you can do on the console something like:

maple input-file > output-file
First 7 8 9 10 11 12 13 Last Page 9 of 24