# User Portlet Neil Singer
Discussions
Stephane, Use In:= Total[Range] Out= 55 By adding the extra brackets you created a list of a list so the total of this: {{1,2,3,4,5,6,7,8,9,10}} is just the first element -- the inner list. ...
also, when matching flat functions, it is often useful to use Shortest and Longest. For example: In:= foo[aa, bb, cc, dd] /. (foo[Longest[x_], foo[y__]] -> zz[{x, y}]) Out= zz[{foo[aa, bb, cc], dd}] Regards
Or just use set (=) instead of SetDelayed (:=) h[x1_,y1_,z1_,x2_,y2_,z2_] = f Regards
Jesus, This code seems to work for me. What problem are you seeing? g[t] and q[t] are set separately. Since you never hit the case when q[t]==0 and i[t]==0, g[t] is never reset to 0. If you try this code, you will see that the concept works I...
You have a precision issue because your equations have some rapid transients. L = 1000; PDEin := -2.4669065517374813* Derivative[0, 1][Tfin][\[Tau], z] + Derivative[1, 0][Tfin][\[Tau], z] == ...
I really don't understand what you are trying to do. Can you give a simple example? At first I thought you wanted to hit an event and then change some settings and continue. Next you said that you only wanted to do one simulation and stop at the...
Glad I could help. I use the same technique to export other graphics for import into other programs. For example, if you export plots with huge amounts of points and import them into Microsoft Word, you can slow Word and actually crash it. Every...
Mitchell, The answers are the same. The difference is you did not ask Mathematica to solve for the initial condition. Type: DSolve[{x'[t] == k*x[t] (M - x[t]), x == x0}, x, t] and you get the same answer for both. Regards ...
Guillermo, [@Sander Huisman][at0] has a great solution. Another alternative that works on any expression (not just ra[]). mysq[x_Plus] := Map[mysq, x] mysq[x_] := x^2 SetAttributes[mysq, Listable] In:= i = {a, b + c +...
I should have described how this works. I created a local (temporary) function myfun and defined it with the arguments you pass in and set it to the body (evaluated) that you passed in. After this, I define a global function that has the same...