Joe Riel

9660 Reputation

23 Badges

20 years, 4 days

MaplePrimes Activity


These are replies submitted by Joe Riel

If the file wasn't saved, then that information doesn't exist. Automatically rerunning a worksheet on opening it is usually not a good idea. You can set selected regions to auto-execute (right-click --> Execution Group --> Autoexecute --> Set).

You are more likely to get a useful and timely response if you upload the worksheet that has the problem.

@Markiyan Hirnyk I see 7 pages (in Recent Questions).  Scrolling through each one, then clicking to the next is too slow.  I want to just see the titles.  Is there a way to do that?  I want to see what appears in the right pane, but with more history.

Followup: Oh, you mean click on the Recent button on the top. That's what I want.  Thanks. I was clicking in the right pane.

 

@acer Normally I'd prefer the arrangement without the dot, however, the small discrepancy in the height of the Matrix compared to the adjacent Vector is more distracting when they are closer.  Nits...

@ecterrab Thanks for posting this, Edgardo. Note that the subs operation in the Collect procedure can now be removed as it does nothing. 

The inert math functions that Edgardo describes can be used, with extended typesetting, to solve all sorts of requests that appear on MaplePrimes. For example

interface(typesetting = extended):
`%+`(1/2, 3/4);

Displays as 1/2 + 3/4, properly typeset. Passing the expression to value evaluates it.

@acer Thanks, Acer. That's what I attempted to create last night, with little success. I was wrapping the output in a call to Typeset that was, apparently, causing me grief.  I see that Edgardo has posted a solution using inert functions (`%.`).  They are easier.

@spalinowy I couldn't find a way to completely eliminate the dot, but the following looks a bit nicer as it removes the use of the empty function. Note that if you evaluate the result the lhs is combined together.

Collect := proc( exs :: list, vars :: listlist)
local dot,ex,v;
uses  LA = LinearAlgebra;
    ex := add(dot(LA:-GenerateMatrix(exs,v)[1], Vector(v)), v = vars);
    subs(dot = ':-`.`', ex);
end proc:

@Carl Love I'm thinking he is mainly interested in how the result looks. It is possible to do this nicely in the worksheet, with 2D, but requires some clever use of the Typesetting package, which is mainly undocumented. I'll try to throw something together tonight.

@spalinowy 

Convert Kitonum's response to a simple procedure

Collect := proc( exs :: list, vars :: listlist)
local v;
uses LA = LinearAlgebra;
    add(LA:-GenerateMatrix(exs,v)[1] . ``(Vector(v)), v = vars);
end proc:

Sys := [NULL
        , m1*(diff(x1(t), t, t))+cv1*(diff(x1(t), t))+(k1+k2+k4)*x1(t)-k2*x2(t)-k4*x3(t) = f1(t)
        , m2*(diff(x2(t), t, t))+cv2*(diff(x2(t), t))-cv2*(diff(x3(t), t))+(k2+k3)*x2(t)-k2*x1(t)-k3*x3(t) = f2(t)
        , m3*(diff(x3(t), t, t))+cv2*(diff(x3(t), t))-cv2*(diff(x2(t), t))+(k3+k4)*x3(t)-k3*x2(t)-k4*x1(t) = f1(t)
       ]:

X := [x1,x2,x3](t):
dX := diff(X,t):
ddX := diff(X,t,t):

(Collect)(lhs~(Sys), [ddX,dX,X]) = Vector(rhs~(Sys));
/                   /  [ 2       ] \\
|                   |  [d        ] ||
|                   |  [--- x1(t)] ||
|                   |  [  2      ] ||   /                        /  [d       ] \\
|                   |  [dt       ] ||   |                        |  [-- x1(t)] ||
|                   |  [         ] ||   |                        |  [dt      ] ||
|[m1    0     0 ]   |  [ 2       ] ||   |[cv1     0       0  ]   |  [        ] ||
|[              ]   |  [d        ] ||   |[                   ]   |  [d       ] ||
|[0     m2    0 ] . | ([--- x2(t)])|| + |[ 0     cv2     -cv2] . | ([-- x2(t)])||
|[              ]   |  [  2      ] ||   |[                   ]   |  [dt      ] ||
|[0     0     m3]   |  [dt       ] ||   |[ 0     -cv2    cv2 ]   |  [        ] ||
|                   |  [         ] ||   |                        |  [d       ] ||
|                   |  [ 2       ] ||   |                        |  [-- x3(t)] ||
|                   |  [d        ] ||   \                        \  [dt      ] //
|                   |  [--- x3(t)] ||
|                   |  [  2      ] ||
\                   \  [dt       ] //

       /[k1 + k2 + k4      -k2        -k4  ]   /  [x1(t)] \\   [f1(t)]
       |[                                  ]   |  [     ] ||   [     ]
     + |[    -k2         k2 + k3      -k3  ] . | ([x2(t)])|| = [f2(t)]
       |[                                  ]   |  [     ] ||   [     ]
       \[    -k4           -k3      k3 + k4]   \  [x3(t)] //   [f1(t)]

It looks nicer in 2D.

I do not believe that that operation is currently supported by Threads:-Task.  It would be a useful feature.

Hard to be sure without seeing the source for cl. I assume it is supposed to shift and print the character it recieves. Have you tried it standalone?   

@Heitor I don't understand how that solves your problem. Maybe I'm missing something, but it seems to me that if you are executing the entire workseet, say with the icon !!! on the toolbar, then that (readstat) will merely temporarily stop the execution; it will resume when you respond to the pop-up dialog. Is that what you want? How is that useful? Or is it the Stop command that you are using? That does allow probing and affecting the subsequent operation via the debugger. An easier way to do that is to just insert DEBUG() where you want to launch the debugger:

for k to 10 do
     if k=5 then DEBUG(); end if;
end do:

@Carl Love Do you still see it in trace? I never did, on either version I tested. Am using tty maple on linux.

I haven't been able to reproduce this. I've tried Maple16 and Maple2016.  I get

Iterate(1.05);
                     {.9257, 1.112}

@Carl Love Consider submitting that as an SCR, maybe with a simple use case. It seems a useful feature.

First 38 39 40 41 42 43 44 Last Page 40 of 195