Joe Riel

9530 Reputation

23 Badges

20 years, 25 days

MaplePrimes Activity


These are answers submitted by Joe Riel

There are undefined terms in eq:

remove(type,eq,equation);
       [PropAgua, PropGases, CoefConvAgua, CoefConvGases]

solve(y*log(x) = y + x*log(x), {y});
                                     x ln(x)
                               {y = ---------}
                                    ln(x) - 1

There isn't necessarily a solution.  Are the known matrices, A and E, numeric?  If so, I'd try the following (assuming A and E are assigned)

R := Matrix(12, symbol=r):
eqs := convert(E.R.R^(%T).E^(%T) - A, set):
fsolve(eqs);

If you used ?add to implement the function, then the function is well defined for non-integer x, F(x) = F(floor(x)). Err, no.  I read the x that appeared in the cos term as a multiplication.  Regardless, add is well defined with non-integer range values.

I know nothing about pile foundations, but this sounds readily doable in MapleSim.  What do you model?  Vertical movement?  Lateral movement? If the latter, then do you also have to model bending of the pile?

It would be helpful if you had uploaded the worksheet (with the green arrow), or included text that could be copy pasted.

First off, there is a minor problem with the conditional as presented.  The second condition (elif) is pointless; if it is true, then the first conditon must be true, so the elif condition is never seen.

Second, to avoid singularities at zero, it is better to formulate the first condition as nar(t) >= 2*nch4(t).

Currently, the custom component template code expects that the equations are actually equations.  As such, you will need to reformulate the conditonal statement to be an equation.  You can try using the Maple ?piecewise function to express the condition.  For example,

 piecewise(nar(t)>=2*nch4(t), nco(t), no2(t)) = 0

That, however, may not necessarily result in valid Modelica code. Try it and see what happens.

One way is to replace the plot command with

   plt[M] := plot(IQ,DT);

and then, outside the loop, do

plots:-display(entries(plt, 'nolist'));

Your system of differential equations  has the form

x' = A*x + B,

with A and B constant matrices.  As such, it has the solution

x = A^(-1).(exp(A*t).(A.x(0)+B) - B)

You can directly extract A from the system of equations, then use LinearAlgebra:-MatrixExponential to compute exp(A*t). Solve for B by plugging in the given boundary conditions.

Use sys2:-a to access the A matrix, sys2:-b to access the B Matrix, etc.

?Linearize returns a sequence of four elements; the DynamicSystems object is the first element in the sequence. Try

PrintSystem(sol2[1]);

 

 

There is no requirement that a specific region has to be colored. You can customize them however you like.

If you hadn't noticed that the recurrence can be directly summed, you could use ?rsolve:

eq := a(n) = a(n-1) + sqrt(3)/12*(2/3)^(2*n-2):
An := rsolve({eq, a(0)=sqrt(3)/4}, a(n));
                                  1/2      1/2      n
                               2 3      3 3    (4/9)
                         An := ------ - -------------
                                 5           20

limit(An, n=infinity);
                                       1/2
                                    2 3
                                    ------
                                      5

 

The reason your approach fails is that you defined a as a recursive procedure, then called it with a symbolic argument.  Actually, even if you called it with a numeric argument it would fail, unless a(0) is assigned after a(n).  For example,

a := n -> a(n-1) + sqrt(3)/12*(2/3)^(2*n-2):
a(0) := sqrt(3)/4: # this directly assigns a value to the remember table of a
a(10);
                                           1/2
                                464852158 3
                                --------------
                                  1162261467

User ?ifactors, rather than ?ifactor, to generate the factorization.  Its output structure is straightforward to parse.

(**) f := ifactors(135);
                                f := [1, [[3, 3], [5, 1]]]

(**) map(`$`@op, f[2]);
                                       [3, 3, 3, 5]

That was a test of your Maple syntactical knowledge.  More understandable is

map(L->(L[1]$L[2]), f[2]);
                                       [3, 3, 3, 5]

Be wary of that hint.  You almost certainly do not want to use ?has.  Rather, consider using ?member.

The major problem is the way MyMapleLibrary is written; the assignments for the exports (and locals, if there were any) go inside the body of the module.  So it should look like

MyMapleLibrary := module()
export MyPower, MySum;
option package;
    MyPower := proc(a,b) ... end proc;
    MySum := proc() ... end proc;
end module:

Of course, the ... in the above stand for the body of the procedures.

First 36 37 38 39 40 41 42 Last Page 38 of 114