Joe Riel

9530 Reputation

23 Badges

20 years, 28 days

MaplePrimes Activity


These are answers submitted by Joe Riel

Here's one approach

restart;
p[A] := [0, 0, 0]:
p[B] := [0, y[B], 0]:
p[C] := [x[C], y[C], 0]:
p[E] := [x[E], y[E], 0]:
p[S] := [x[S], y[S], z[S]]:

delta := (p, q) -> sqrt(add((p[i]-q[i])^2, i = 1 .. 3)):
L:=(a,b)->delta(p[a],p[b]);

Delta := (a,b,v)-> (delta(p[a], p[b])-v)^2:
T := Delta(A, B, .9)+Delta(B, C, 4.43)+Delta(C, E, 5.10)+Delta(E, A, 5.2)
    +Delta(A, C, 2.29)+Delta(B, E, 3.17)
    +Delta(S, A, 3.77)+Delta(S, B, 4.27)+Delta(S, C, 3.66)+Delta(S, E, 4.36):

# Alas,
Optimization:-Minimize(T);

# returns an error.  Instead, I'll compute the exterior
# derivative and then use fsolve to solve for a minimum.

vars := indets(T, name);
with(difforms);

defform(map(`=`,vars,0)[]);
dT := d(T):
eqs := map2(coeff,dT,d~(vars)):

xsol := fsolve(eqs);
eval([L(A,B),L(B,C),L(C,E),L(E,A)],xsol);
eval([L(A,S),L(B,S),L(C,S),L(E,S)],xsol);

While not the most efficient technique, you could do

iver := proc(e) if e :: {constant,relation(constant)} then if e then 1 else 0 fi else 'procname'(e) fi end: 
Sum(f(i)*iver(i::odd), i=1..n);                                                      
                                                     n
                                                   -----
                                                    \
                                                     )   f(i) iver(i::odd)
                                                    /
                                                   -----
                                                   i = 1

(**) value(eval(%,n=10));                                                                 
                                              f(1) + f(3) + f(5) + f(7) + f(9)



What is a "gradator"?  Do you mean gyrator?  I don't consider that a power electronics device, though occasionally they are used to simulate magnetics, however, with MapleSim there are better ways to do that.

Why do you say it should result in [0,0,0,1]?  The bitwise anding of [0,0,1,0] and [1,1,0,0] is [0,0,0,0]. 

Adding a multiplication symbol between the 2 and the 'cos', and 2 and 'sin' is a good idea.  Did you call

with(plots):

The animate procedure is exported by the plots package, so you either need to 'with' it, or use plots:-animate.

Not sure what you mean.  A typical Maple procedure looks like

myproc := proc( x, y)
     if x > y then
          return x;
     else
          return 2*y;
     end if
end proc:
myproc(1,2);
                             4
myproc(2,1);
                              2

You can do this without an index variable

cat('a', 1..40) := (5$40):

I'm not sure when Maple allowed cat on the left side of an assignment.

You presumably don't want B(...), but instead B*(...). With that an another typo fixed, the following works

ode := diff(f(x),x,x,x)+f(x)*diff(f(x),x,x)+B*(1-diff(f(x),x))^2=0;
bcs:= f(0)=0, D(f)(0)=0, D(f)(5)=1;
sys := {bcs, ode};

for b in [-.199,-.18,0,.3] do
    sys0 := eval(sys, B=b);
    dsn := dsolve(sys0, numeric ):
    print(plots:-odeplot(dsn, [x,f(x)], 0..5));
end do:

The first problem is that your points are entered incorrectly, you close the list after the first pair (note the ]]). Change that to a single ].

The next problem is that polynomial interpolation requires distinct independent values; here the x-coordinate 3.43799 is repeated. 

You can sum the terms inside the do loop, say

rtot := 0:
for z in w do
    tot := select(has,z,phi);
    r := 2*tot;
    rtot := rtot + r;
end do:

Simpler is to just do

  2*select(has,w,phi);
select(has, [t], beta);

I don't understand what you want.  You aren't taking alternate terms, that would be

[ [1,1,1,1,1], [], [1,1,1,1,1], [], [1,1], [], ??? ]

One way is to assign the functions to return the cumulative distance. For example,

tom := n -> add(1/k, k=1..n):
jerry := n -> add(2^(2-k), k=1..n):

I used ?add rather than ?sum because it is intended for definite summation, that is, when the limits are known.

Now use ?plots[pointplot] to generate a discrete plot for each snail.

ptom := plots:-pointplot([seq([n,tom(n)], n=1..10)], color=red):
pjer := plots:-pointplot([seq([n,jerry(n)], n=1..10)], color=blue):

Finally, call ?plots[display] to display both plots on the same graph

plots:-display(ptom,pjer);

Connect the sensor between one frame and the prismatic joint.

Look at the ?binomial function. 

Edit: I misinterpreted your question.  Dang, I cannot see the question when editing, so now again am in the dark. Will have to reedit.

After

convert( . , Sum, x);

do

convert(%, binomial);
First 55 56 57 58 59 60 61 Last Page 57 of 114