Joe Riel

9530 Reputation

23 Badges

20 years, 20 days

MaplePrimes Activity


These are answers submitted by Joe Riel

While your integral is unreadable, the signum and csgn functions in the output are maple's way of handling missing information about e and a. To avoid them, you need to tell give maple more information, say, e and a are both positive. You can do this using assuming: int( your_integrand, ...) assuming a::positive, e::positive; Look up ?signum and ?csgn to see what they do.
I'm not sure what you want, but will guess that you want to plot three points, with time on the horizontal axis. The only difficulty is converting a general timestamp into a value. I thought Maple had a function for doing this, i.e. generating the epoch from an arbitrary date/time, but couldn't find it, so I rolled my own. It's crude; it ignores subtleties like leap years. restart; toepoch := proc(timestamp::string) local dt; description "convert timestamp to seconds (crudely)"; uses StringTools; dt := ParseTime("%b %e %Y %T", timestamp); dt:-second + 60*(dt:-minute + 60*(dt:-hour + (24*(dt:-yearDay + 365*dt:-year)))) end proc: data := [NULL ,[43.69, "Apr 08 2004 10:41:45 PDT"] ,[40, "Apr 07 2004 22:48:47 PDT"] ,[32.5, "Apr 06 2004 06:13:30 PDT"] ]: pts := map(d -> [toepoch(d[2]),d[1]], data); plot(pts, s_tyle=point, symbol=BOX); The s_tyle should be style, however, the pre tag won't accept the word styleThe horizontal axis is not particularly useful (being in seconds, scaled from two millenia ago).
First, you need to define what you mean by, say, [a,b] < [c,d]. Does that mean (a < c) and (b < d)? Assuming so, you could try something like
# This isn't particularly efficient

ListInequality := proc(f,v1::list,v2::list)::truefalse;
    evalb(foldl(`and`, zip(f, v1, v2)[]))
end proc:

`&<` := proc(v1,v2) ListInequality(`<`,v1,v2) end proc:

vf := v -> piecewise((3*v) &< [6,1] and v &< [-2,5],  [3,4] + 3*v
                     ,(2*v) &< [8,-4] and (-v) &< [2,-5], [1,9] + 2*v
                     ,(-3*v) &< [-6,-1] and (-2*v) &< [-8,4], [9,5]
                     ,'whatever'
                    ):

vf([-3,0]);
              [-6, 4]
The usual technique would be to use fprintf. For example,
restart;
deq1 := (t+1)^2*diff(y(t),t,t) + (t+1)*diff(y(t),t) 
        + ((t+1)^2-0.25)*y(t) = 0:
ic1 := (y(0) = 0.6713967071418030
        ,D(y)(0) = 0.09540051444747446):
dsol1 := dsolve({deq1,ic1}, numeric, range=0..1):

file := "data.txt":
try
    fd := fopen(file,'WRITE','TEXT');
    for tt from 0 to 1 by 0.1 do
        fprintf(fd,"%a %a %a\n"
                ,eval([t,y(t),diff(y(t),t)],dsol1(tt))[])
    od;
finally close(file)
end try:
Another way to input the symbol, particularly useful for those of us who prefer maple input format, is to just type `∂`. Note the ampersand and semicolon in the backquotes, they delimit the base name and are displayed as a single symbol in the Standard GUI. You can extend this technique to string together symbols. For example, if you want to create `∂𝔅` type `PartialD;𝔅`, where `𝔅` is the Fraktur "B" (`𝔅`). As a side note, to print `∂𝔅` in this forum, use the <maple> tag: <maple>`∂𝔅`</maple>. Use lprint to find the name of a particular symbol. For example, in maple input mode, go to an empty input line, type ctrl-R (enter 2D math mode), select the symbol of interest from a palette, then hit return. The symbol is displayed. Next, type lprint(%);. That prints the character version of the symbol.
First 112 113 114 Page 114 of 114