Joe Riel

9530 Reputation

23 Badges

20 years, 28 days

MaplePrimes Activity


These are answers submitted by Joe Riel

You can use print, as in print(f).  However, why not just return the polynomial instead of printing it.

Use Format -> Manage Style Sheets to make the style of the current worksheet the default. The operation is not difficult, but also is not obvious. There are help pages that describe how to do so, but there really should be a link from the dialog to those help pages, I'll submit that as an SCR

.

 

It is possible to get this to work, see these examples, (none precisely address your question, but the large example I gave uses readline to pipe stuff through maple) however, this generally is not the easy way to go and I do not see any compelling reason here for doing so.  Using readline and shell passing in maple, at least for me, has always been tricky.

Terminate the print command with a colon.  That will prevent the empty list/set, which is the result of mapping print over a list/set, from being printed.

Use the ?try statement

For example

ignore := proc(x)
   try
       1/x;
   catch:
   end try;
   x;
end proc:
ignore(0);
                     0

I didn't see mention of the ?member procedure, which takes an optional third argument that, if the element is found, is assigned the index of the first matching position.  The help page suggests that that only works for sets, lists, and modules, but testing indicates that it works with other structures as well.  For example,

(**) M := <1,2;3,4;5,6> ;            
                                      [1    2]
                                      [      ]
                                 M := [3    4]
                                      [      ]
                                      [5    6]

(**) member(3,M,'pos');
                                     true

(**) pos;
                                     2, 1

 

Not rigorous, but assume we start at t=0 and n events occur at t1, t2, ..., tn The mean arrival rate is, I believe, n/tn.

The mean inter-arrival time is 1/n*(t1-0 + t2-t1 + t3-t2 + ... + tn-t(n-1)) = 1/n*tn.  There may have been some fudging with the end points, but you get the idea

You don't really need Maple for this, the computation is straightforward. However, it is easily done with Maple. 

sqrt(sum(int((x1[k]-x2[k])^2, x1[k]=0..1, x2[k]=0..1), k=1..n));
                                    1/2  1/2
                                   6    n
                                   ---------
                                       6

where n is the number of dimensions.

@Alec Mihailovs I like your suggestion; it fits and is humorous.  I'm not anticipating it being used by the moderators: "Due the reaction of some of the more unruly MaplePrimates, we have dropped the thumbs-down button."  That would add a certain levity, but probably wouldn't be appreciated by all.

Just ran into the bug where the content of my response was deleted, so am retyping. I can now see the response to which I'm responding; that is a welcome improvement.

I believe that the cooling term should be a boundary condition, it only applies to the end of the beam.  Following are the two lines I modified

pde := (rho*c/k) * diff(T(x,t),t) = diff(T(x,t),x,x):

ibc:=T(0,t)=200+273.15 , T(x,0)=200+273.15 , D[1](T)(2,t) = -(h*p/(k*A) ) * (T(2,t) - T2) :

If you increase the simulation time to, say, 1000 seconds, you can see the entire bar cooling down.

One problem is that Feq is not assigned anything.

In 2D math you can use prime notation, which by default uses x as the independent variable and, if applied to a name, makes the name a function of x.  Thus f'' might do what you want and is easy to enter.

It differentiated only half of it because of the way you entered the expression, that is, you have a product consisting of the derivative of exp(t/2) with the term cos(5*t).  Simpler, and possibly more useful, might be to do

y := exp(t/2)*cos(5*t)  

then take the derivative of y with respect to t. If you want to plot both y and its derivative with respect to t, you might assign the derivative to a separate variable and then plot them both:

dy := diff(y,t);

plot([y,dy], t=0..5);

You can type those in just as I've shown, or you can use the 2D notation, in which case your document might look like

f := x -> sin(x):
plot([f,D(f)], 0..3);

Because the DE has a singularity when y=0---so an integrator is going to fail there---you might as well remove the absolute value and lump the sign of the initial value of y into the parameter b.  Maple is then able to solve the DE symbolically.

First 54 55 56 57 58 59 60 Last Page 56 of 114