D-89 Subject: Re: is this solvable? The only function I know with its derivative proportional to itself is the exponential. Therefore, I think the solution is trivial if p1 and p2 are constants. a[t] = a0*Exp[-p1*t] and b[t] = b0*Exp[-p2*t] I know this isn't using Mathematica to get the solution, but the problem seems trivial if what you want is the solution and not a method in Mathematica. Dennis > a'[t] + b'[t]== -p1 a[t] - p2 b[t] > where {a[0]== a0, b[0]== b0} > is this solvable in Mathematica? If so, how will I go about doing so? > let's assume a[0]== a0, and b[0]==b0 > if symbolic solution isn't possible, then intial conditions of > a[0]== 1, and b[0]==0.5 couild be used...(or any other numbers for that > matter) === Subject: Re: is this solvable? > The only function I know with its derivative proportional to itself is > the exponential. Therefore, I think the solution is trivial if p1 and > p2 are constants. > a[t] = a0*Exp[-p1*t] and b[t] = b0*Exp[-p2*t] > I know this isn't using Mathematica to get the solution, but the > problem seems trivial if what you want is the solution and not a method > in Mathematica. > Dennis >>a'[t] + b'[t]== -p1 a[t] - p2 b[t] >>where {a[0]== a0, b[0]== b0} >>is this solvable in Mathematica? If so, how will I go about doing so? >>let's assume a[0]== a0, and b[0]==b0 >>if symbolic solution isn't possible, then intial conditions of >>a[0]== 1, and b[0]==0.5 couild be used...(or any other numbers for > that >>matter) Hi Dennis, it is indeed very simple to find _one_ possible solution. On the other hand we can add (nearly) every possible equation. For example: Simplify[ DSolve[{eq, a[0] == Pi} /. {b -> (Cos[a[#1]] - a[#1] & ), p1 | p2 -> 1}, a[t], t]] will give us {{a[t] -> ArcCos[-Exp[-t]]}} -- Peter Pein Berlin === Subject: Re: Re: something like dB The dB measurement, as you are most likely aware, comes from the logarithm of a ratio. One of the terms in the ratio might be a standard (20 micro Pascal, or whatever). You could try keeping that definition in your calculations. Try using the Notation package. Maybe something like (pseudo code .. don't forget to use the palette): Notation[x_ dB <==> dB[x_]] then, assuming you're not working with equations... just expressions (again, pseudo code): >It is only sloppyness to say that something is x dB. (Maybe I'll >hear differently from other responders.) In any case, if you use >0.0 dB then the 0.0 will be retained, but if you write exact 0 >anything Mathematica always returns 0. > No, it isn't just sloppyness to use dB. For example, it is perfectly logical to talk of an attenuation or gain of say 3 dB which would mean for attenuation half of the input power is lost. Linear amplifiers increase power by a fixed ratio for a given setting and attenuators decrease power by a fixed ratio. > This is made even more useful by measuring power levels in units like dBm. Here the m tells me the power level is referenced to 1 mW. So, 0 dBm would be 1 mW of power. And with an input of 0 dBm and an amplifer with a gain of 30 dB, I can easily determine the output power is 30 dBm or equivalently 1 Watt. > -- > To reply via email subtract one hundred and four -- Chris Chiasson http://chrischiasson.com Kettering University Mechanical Engineering Graduate Student 1 810 265 3161 === Subject: links to files in file menu in the file menu of mathematica 5.1 there is a history list of the last 5 opened notebooks. i wish if i can increase this to about 10 history links. there is no reference in the options inspector for this, could this be changeable or not? konstant === Subject: Re: Re: Working with huge text files with mathematica No, Do[] does not return a value, thus no formating is required due to Do[] yehuda > I have found that the Front-End formatter can be the bottle neck on > large expressions. Does a semicolon after the Do[] statement help? > Vince Virgilio === Subject: Re: GridLines and ImplicitPlot Needs[Graphics`ImplicitPlot`] ImplicitPlot[x^2 + y^2 == 1, {x, -2, 2}, GridLines -> Automatic] does not work ? Jens Steven Jonak schrieb im Newsbeitrag >I can't seem to be able to use the >GridLines->Automatic command with > ImplicitPlot. The help browser says that > ImplicitPlot accepts all the > usual Plot options. Any ideas? > S Jonak > Maintain an even strain. === Subject: Re: GridLines and ImplicitPlot Hi Steven, ImplicitPlot returns a ContourGraphics object that has no GridLines option. << Graphics`ImplicitPlot`; Head[ImplicitPlot[x^2 + y^2 == 1, { x, -2, 2}, {y, -2, 2}, DisplayFunction -> Identity]] and this returns ContourGraphics and if you carefully check the options of ContourGraphics you will find that the GridLines options is not there yehuda > I can't seem to be able to use the GridLines->Automatic command with > ImplicitPlot. The help browser says that ImplicitPlot accepts all the > usual Plot options. Any ideas? > S Jonak > Maintain an even strain. === Subject: Re: GridLines and ImplicitPlot $Version 5.1 for Mac OS X (January 27, 2005) Needs[Graphics`]; This works fine on my macine ImplicitPlot[x^2+2 y^2==3,{x,-2,2}, GridLines->Automatic]; If your version doesn't support Gridlines as an option to Plot, you could try Show[ ImplicitPlot[x^2+2 y^2==3,{x,-2,2}, DisplayFunction->Identity], GridLines->Automatic, DisplayFunction->$DisplayFunction]; or DisplayTogether[ ImplicitPlot[x^2+2 y^2==3,{x,-2,2}], GridLines->Automatic]; Bob Hanlon === > Subject: GridLines and ImplicitPlot > I can't seem to be able to use the GridLines->Automatic command with > ImplicitPlot. The help browser says that ImplicitPlot accepts all the > usual Plot options. Any ideas? > S Jonak > Maintain an even strain. === Subject: Re: Summation problem Hi! > Sum[I^n/n,{n,1,Infinity}] On Math4 it gives: -Log[1 - I] > Sum[I^(n+1)/n,{n,1,Infinity}] On Math4 it gives: -I Log[1 - I] > Jaroslaw Piskorski ~Scout~ === Subject: Re: Summation problem (Knowing that statetments like this don't really help) I cannot spot the problem In[1]:= Sum[I^n/n, {n, 1, Infinity}] Out[1]= -Log[1 - I] In[2]:= Sum[I^(n + 1)/n, {n, 1, Infinity}] Out[2]= -I*Log[1 - I] In[3]:= $Version Out[3]= 4.0 for Microsoft Windows (April 21, 1999) Wolfgang > Why can't Mathematica sum: > Sum[I^n/n,{n,1,Infinity}] > and gives the (incorrect) answer, that this is divergent while it can do: > Sum[I^(n+1)/n,{n,1,Infinity}] > correctly? > Jaroslaw Piskorski === Subject: Re: Re: Slow performance on OS X? I'm using Mathematica 5.1.1 on OS X 10.4 (just installed), and see no problems such as you described. I don't recall seeing any slowdowns with 10.3.x either. The app takes longer than some others to load, but nowhere near as long as you report. I'm using a 17 inch G4 PowerBook. george >> I have the exact same machine you describe and I have never seen >> problems like this (at least 5.0 & 5.1, I don't have 4.1.5 or 4.2 >> handy). Try quitting & moving your ~/Library/Mathematica folder to >> your desktop to see if the problem still happens. >> Look at the CPU usage with the 'top' command or >> /Applications/Utilities/ActivityMonitor.app. Does Mathematica use >> excessive amounts of CPU time? > No. CPU usage remains minimal. It takes 45-60 seconds for > Mathematica to > start, during which time Activity Monitor frequently shows the > process as > hung. Opening a short, 3-line Mathematica file takes about 20 > seconds. > This is on a nearly new system. I don't have slow-downs with any > other apps. > Ken Bowman === Subject: Re: Keeping Further Examples Open In Help Browser It turns out that there is no need for CellGroupData[{...}, Open]if ExampleSection is replaced. To achieve the same display style (example function Abs), for the default code ... Cell[Further Examples, ExampleSection, CellTags->Abs], substitute this new code ... Cell[TextData[StyleBox[Further Examples, SubsubsectionIcon, FontColor->GrayLevel[0]]], ExampleText, CellFrame->{{0, 0}, {0, 0.5}}, CellTags->Abs], Mathematica will do the rest. -Harold === Subject: [Newbie] Interpreting output Hi everybody.... I'm having troubles in interpreting the output of Mathematica. My problem is to define a function F(x,y,z) such that: F = (whatever) if x>c F=(whatever) if x<=c I achievied this using /; When I derive F with respect to one of the variables, the result is a mess. Just an example with 1 variable: f=x/;x>0; f=-x^2/;x<0; D[f,x]=-2Condition(1,0)[x^2,x<0]+Condition(1,0)[x^2,x<0]Less(1,0)[x,0] Even in this very simple case, the result is a real mess: I really do not know how should I read that...and I'm wondering if I have defined the function in the right way. Anybody so kind to explain me what's goung on? === Subject: Re: [Newbie] Interpreting output > Hi everybody.... > I'm having troubles in interpreting the output of Mathematica. > My problem is to define a function F(x,y,z) such that: > F = (whatever) if x>c > F=(whatever) if x<=c > I achievied this using /; > When I derive F with respect to one of the variables, the result is a mess. > Just an example with 1 variable: > f=x/;x>0; > f=-x^2/;x<0; This is not a function. > D[f,x]=-2Condition(1,0)[x^2,x<0]+Condition(1,0)[x^2,x<0]Less(1,0)[x,0] > Even in this very simple case, the result is a real mess: > I really do not know how should I read that...and I'm wondering if > I have defined the function in the right way. > Anybody so kind to explain me what's goung on? If you want a function: In[1]:= f[x_]:=Piecewise[{{x,x>0},{-x^2,x<0}},0]; f'[x]//InputForm Out[2]//InputForm= Piecewise[{{-2*x, x < 0}, {1, x > 0}}, Indeterminate] looks nice without InputForm. Piecewise is new in version 5.1. For older versions: In[3]:= f4[x_]:=Which[x<0,-x^2,x>0,x]; f4'[x] Out[4]= Which[x<0,-2 x,x>0,1] -- Peter Pein Berlin === Subject: Re: [Newbie] Interpreting output You really can't expect to take the derivative of a function defined by an arbitrary definition like that! D is meant to be used on algebraic expressions. However, you can define functions using Piecewise to do what you want. For example: f[x_,c_]=Piecewise[{{x,x c}, {x, x <= c}}] and D[f[x],x] gives Piecewise[{{2*x, c - x < 0}, {1, c - x >= 0}}, 0] as expected Jens MC schrieb im > Hi everybody.... > I'm having troubles in interpreting the output > of Mathematica. > My problem is to define a function F(x,y,z) such > that: > F = (whatever) if x>c > F=(whatever) if x<=c > I achievied this using /; > When I derive F with respect to one of the > variables, the result is a mess. > Just an example with 1 variable: > f=x/;x>0; > f=-x^2/;x<0; > D[f,x]=-2Condition(1,0)[x^2,x<0]+Condition(1,0)[x^2,x<0]Less(1,0)[x,0] > Even in this very simple case, the result is a > real mess: > I really do not know how should I read > that...and I'm wondering if > I have defined the function in the right way. > Anybody so kind to explain me what's goung on? === Subject: Re: Not getting numeric answer to simple division Most, if not all, suggestions to getting approximate answers suggested or recommended using N, e.g., 3/7 //N I've gotten into a habit of using a period when I want an approximation, e.g., 3./7 Is this OK or a bad habit to get into - I ask because none of the more seasoned users recommended it. Steven Shippee > Does anyone know how to get a numeric answer to a simple division problem? > Even if I have a very complex problem, the moment I place the division > symbol '/' into the equation, my answer always comes out as a/b in > some form. > Paul === Subject: Re: Re: something like dB Bill, I know that it is commonly used, but just because something is commonly used doesn't mean that it is not sloppy, or that it doesn't cause headaches to many people. The original poster claimed dB was a Unit, and it certainly isn't. It is a function or mapping. You can't get the Units package to convert 30 dBm to Watts because dBm isn't a Unit that has a conversion factor to Watts. If you had a function f[x_]:= x^2 would it make sense to write 3 f? I suppose you could state it as a new notation, but this has an existing meaning in Mathematica. But 3//f would have the intended meaning so maybe one could do something like the following. Needs[Miscellaneous`Units`] dBm = Milli Watt 10^(#/10) & 30 // dBm 1000 Milli Watt But we need the // and and expression like 30 dBm will never work usefully in Mathematica and that's why I say the original notation is sloppy. David Park djmp@earthlink.net http://home.earthlink.net/~djmp/ >It is only sloppyness to say that something is x dB. (Maybe I'll >hear differently from other responders.) In any case, if you use >0.0 dB then the 0.0 will be retained, but if you write exact 0 >anything Mathematica always returns 0. No, it isn't just sloppyness to use dB. For example, it is perfectly logical to talk of an attenuation or gain of say 3 dB which would mean for attenuation half of the input power is lost. Linear amplifiers increase power by a fixed ratio for a given setting and attenuators decrease power by a fixed ratio. This is made even more useful by measuring power levels in units like dBm. Here the m tells me the power level is referenced to 1 mW. So, 0 dBm would be 1 mW of power. And with an input of 0 dBm and an amplifer with a gain of 30 dB, I can easily determine the output power is 30 dBm or equivalently 1 Watt. -- To reply via email subtract one hundred and four === Subject: Re: something like dB >I know that it is commonly used, but just because something is >commonly used doesn't mean that it is not sloppy, or that it >doesn't cause headaches to many people. I can't really agree with your statement above. I do agree people often use useful things in a sloppy manner. And I agree sloppyness does cause problems (headaches) for others. >The original poster claimed dB was a Unit, and it certainly isn't. This is clearly debatable. It makes a lot of sense to measure gain and attenuation in dB since gain and attenuation are ratios of input to output. If I tell you the gain of an amplifier is 30 dB, I given you some useful information. But simply telling you either the input power or output power of an amplifier doesn't say much at all. And from the standpoint of computing losses or gains in a system, dB behaves like any other unit. >It is a function or mapping. You could make the same claim of radian. >You can't get the Units package to convert 30 dBm to Watts because >dBm isn't a Unit that has a conversion factor to Watts. Simply because there isn't a linear relationship between dBm and watts doesn't mean a package could not be constructed to do the conversion. >But we need the // and and expression like 30 dBm will never work >usefully in Mathematica and that's why I say the original notation >is sloppy. Even if I agree an expression like 30 dBm cannot be made to work usefully in Mathematica does, it doesn't follow the notation is sloppy. In fact, calling a notation sloppy doesn't make sense. If a notation has well defined meaning and is useful (as is the case with dB), the notation isn't sloppy. But a given usage of the notation might well be sloppy. -- To reply via email subtract one hundred and four === Subject: Laguerre Gaussian Quadrature for 2D Is there a Laguerre Gaussian Quadrature for 2D? === Subject: Re: Laguerre Gaussian Quadrature for 2D the cartesian product of the 1d version ??? Jens Miguel Bandres schrieb im > Is there a Laguerre Gaussian Quadrature for 2D? === Subject: Re: GridLines and ImplicitPlot Hi Bob, No, the problem still exists but now I recall that I used <Automatic] and it didn't work. In the help it is written that when defining the ranges for both x and y it uses a ContourGraphics method and the problem is there. So, none of the tricks you (and I) tried is working when defining the ranges for both x and y yehuda === Subject: Re: GridLines and ImplicitPlot Steven, Well, that is an interesting question! It appears that you have uncovered a bug in that ContourGraphics does not include GridLines as an Option. Needs[Graphics`ImplicitPlot`] The following works... ImplicitPlot[y == x^2, {x, -1, 1}, Frame -> True, GridLines -> Automatic] -Graphics- The following does not work... plot1 = ImplicitPlot[y == x^2, {x, -1, 1}, {y, 0, 1}, Frame -> True, GridLines -> Automatic] -ContourGraphics- Notice that the two iterator form of ImplicitPlot gives ContourGraphics while the one iterator form gives Graphics. If we try to sneak GridLines in with a Show statement we obtain... Show[plot1, GridLines -> Automatic] ContourGraphics::optx: Unknown option GridLines in -ContourGraphics- And, indeed, GridLines is not an option in ContourGraphics. Options[ContourGraphics] // TableForm (GridLines missing) The unintuitive way to get the GridLines is to convert to Graphics. Show[Graphics[plot1], GridLines -> Automatic] On the otherhand, with the DrawGraphics package from my web site the output is automatically converted to Graphics so there is no suprise. Needs[DrawGraphics`DrawingMaster`] Draw2D[ {ImplicitDraw[y == x^2, {x, -1, 1}, {y, 0, 1}]}, Frame -> True, GridLines -> Automatic] David Park djmp@earthlink.net http://home.earthlink.net/~djmp/ I can't seem to be able to use the GridLines->Automatic command with ImplicitPlot. The help browser says that ImplicitPlot accepts all the usual Plot options. Any ideas? S Jonak Maintain an even strain. === Subject: Re: Interpreting output > Hi everybody.... > I'm having troubles in interpreting the output of Mathematica. > My problem is to define a function F(x,y,z) such that: > F = (whatever) if x>c > F=(whatever) if x<=c > I achievied this using /; > When I derive F with respect to one of the variables, the result is a > mess. > Just an example with 1 variable: > f=x/;x>0; > f=-x^2/;x<0; > D[f,x]=-2Condition(1,0)[x^2,x<0]+Condition(1,0)[x^2,x<0]Less(1,0)[x,0] > Even in this very simple case, the result is a real mess: > I really do not know how should I read that...and I'm wondering if > I have defined the function in the right way. > Anybody so kind to explain me what's goung on? What is going on is simply that you that Mathematica's notion of derivative does not work with piecewise functions defined by means of pattern matching. (Actually, there is nothing in the documentation that suggests that it might.) In order for differentiation to be possible you have to construct a piecewise function using a construction that understands the notion of a derivative. In Mathematica 5.1 this is easy: f[x_] := Piecewise[{{x^2, x < 2}, {x^3, x >= 2}}] f'[1] 2 f'[3] 27 f'[2] Indeterminate In earlier version you could try doing this by means of the UnitStep function: g[x_] := x^2*UnitStep[2 - x] + x^3*UnitStep[x - 2] this will work almost the same except for the singular value g'[1] 2 g'[3] 27 g'[1] 2 g'[3] 27 g'[2] 4*DiracDelta[0] + 16 Note also that both approaches work well when you construct a differentiable everywhere piecewise function: f[x_] := Piecewise[{{(x-1)^2, x < 1}, {(x-1)^3, x >= 1}}] f'[1] 0 g[x_]:=(x-1)^2*UnitStep[1-x]+(x-1)^3*UnitStep[x-1] g'[1] 0 However, this is achieved in a quite different way, which we can see from f'[x] Piecewise[{{2*(x - 1), x < 1}, {0, x == 1}}, 3*(x - 1)^2] and g'[x] DiracDelta[x - 2]*(x - 2)^3 - DiracDelta[x - 2]* (x - 2)^2 + 3*UnitStep[x - 2]*(x - 2)^2 + 2*UnitStep[2 - x]*(x - 2) The second answer is given as a generalized function and although it seems correct I would not rely on this type of use of generalised functions (distributions) in anything but the most simple types of situations. The Piecewise approach looks more promising. Andrzej Kozlowski Chiba, Japan http://www.akikoz.net/andrzej/index.html http://www.mimuw.edu.pl/~akoz/ === Subject: Re: Interpreting output Remember that the Set ( = )commands are really just continually applied rules, sometimes with (possibly conditional) patterns. They aren't too smart when it comes to conditional derivatives. You can tell Mathematica exactly what you want it to do though: f[x_/;x>0]=x; f[x_/;x<0]=-x^2; Plot[f[x],{x,-2,2}] Derivative[1][f][x_/;x>0]=D[x,x]; Derivative[1][f][x_/;x<0]=D[-x^2,x]; Plot[f'[x],{x,-2,2}] > Hi everybody.... > I'm having troubles in interpreting the output of Mathematica. > My problem is to define a function F(x,y,z) such that: > F = (whatever) if x>c > F=(whatever) if x<=c > I achievied this using /; > When I derive F with respect to one of the variables, the result is a mess. > Just an example with 1 variable: > f=x/;x>0; > f=-x^2/;x<0; > D[f,x]=-2Condition(1,0)[x^2,x<0]+Condition(1,0)[x^2,x<0]Less(1,0)[x,0] > Even in this very simple case, the result is a real mess: > I really do not know how should I read that...and I'm wondering if > I have defined the function in the right way. > Anybody so kind to explain me what's goung on? -- Chris Chiasson http://chrischiasson.com Kettering University Mechanical Engineering Graduate Student 1 810 265 3161 === Subject: Re: mathematics of search engines Sorry, my insanity temporarily took over... I don't think the linked > The full text source ( > is applying for actually shows some of the mathematics behind search > algorithms. > -- > Chris Chiasson > http://chrischiasson.com > Kettering University > Mechanical Engineering > Graduate Student > 1 810 265 3161 -- Chris Chiasson http://chrischiasson.com Kettering University Mechanical Engineering Graduate Student 1 810 265 3161 === Subject: mathematics of search engines The full text source ( is applying for actually shows some of the mathematics behind search algorithms. -- Chris Chiasson http://chrischiasson.com Kettering University Mechanical Engineering Graduate Student 1 810 265 3161 === Subject: Re: ndsolve error message Ack! Apparently the formatting for the script N and the chi character were messed up as part of the email transmission process... Here is the input with those characters replaced by NN and XX, respectively: NDSolve[NNA[z, t][Equal](NNA[z,t]+NNB[z,t]+NNC[z,t])* XXA[z,t]-(0.0003610152163600286* Derivative[1,0][XXA][z, t])/((0.3040465336986682*XXC[z,t])/(XXA[z,t]+ XXB[z,t])+(0.39170805107300855*XXB[z,t])/(XXA[z,t]+ XXC[z,t]))&& NNB[z,t][Equal](NNA[z,t]+NNB[z,t]+NNC[z,t])* XXA[z,t]-(0.0003610152163600286* Derivative[1,0][XXB][z, t])/((0.2905456429313062*XXC[z,t])/(XXA[z,t]+ XXB[z,t])+(0.39170805107300855*XXA[z,t])/(XXB[z,t]+ XXC[z,t]))&& NNC[z,t][Equal](NNA[z,t]+NNB[z,t]+NNC[z,t])* XXA[z,t]-(0.0003610152163600286* Derivative[1,0][XXC][z, t])/((0.2905456429313062*XXB[z,t])/(XXA[z,t]+ XXC[z,t])+(0.3040465336986682*XXA[z,t])/(XXB[z,t]+ XXC[z,t]))&& 0.0003610152163600286*(XXA[z,t]*Derivative[0,1][P][z,t]+ P[z,t]*Derivative[0,1][XXA][z,t]+2769.9663468* Derivative[1,0][NNA][z,t])[Equal]0&& 0.0003610152163600286*(XXB[z,t]*Derivative[0,1][P][z,t]+ P[z,t]*Derivative[0,1][XXB][z,t]+2769.9663468* Derivative[1,0][NNB][z,t])[Equal]0&& 0.0003610152163600286*(XXC[z,t]*Derivative[0,1][P][z,t]+ P[z,t]*Derivative[0,1][XXC][z,t]+2769.9663468* Derivative[1,0][NNC][z,t])[Equal]0&& XXA[z,t]+XXB[z,t]+XXC[z,t][Equal]1&& XXA[z,0][Equal]XXA[0,t][Equal]0.13238383827902114&& XXB[z,0][Equal]XXB[0,t][Equal]0.6681373176389893&& XXC[z,0][Equal]XXC[0,t][Equal]0.1994788440819895&& P[z,0][Equal]P[0,t][Equal]100000&& NNA[1/4000,t][Equal]0.011156006364769414&&NNB[1/4000,t][Equal]0&& NNC[1/4000,t][Equal]0,{P,NNA,NNB,NNC,XXA,XXB,XXC},{z,0,1/4000},{t,0,2}] Sorry about the multiple emails, > Hi MathGroup gurus, > I get the following error from my input to NDSolve, but I am not sure > if I am actually violating the rule it says I am: > Boundary values may only be specified for one independent variable. > Initial values may only be specified at one value of the other > independent variable. > ***Do you think I have violated the rule? What should I change?*** > the input was as follows: (copy it into Mathematica and hit > ctrl+shift+n to get a more readable form) > NDSolve[[ScriptCapitalN]A[z, t] == ([ScriptCapitalN]A[z, t] + > [ScriptCapitalN]B[z, t] + [ScriptCapitalN]C[z, t])*ÖA[z, t] - > (0.0003610152163600286*Derivative[1, 0][ÖA][z, t])/ > ((0.3040465336986682*ÖC[z, t])/(ÖA[z, t] + ÖB[z, t]) + > (0.39170805107300855*ÖB[z, t])/(ÖA[z, t] + ÖC[z, t])) && > [ScriptCapitalN]B[z, t] == ([ScriptCapitalN]A[z, t] + > [ScriptCapitalN]B[z, t] + [ScriptCapitalN]C[z, t])*ÖA[z, t] - > (0.0003610152163600286*Derivative[1, 0][ÖB][z, t])/ > ((0.2905456429313062*ÖC[z, t])/(ÖA[z, t] + ÖB[z, t]) + > (0.39170805107300855*ÖA[z, t])/(ÖB[z, t] + ÖC[z, t])) && > [ScriptCapitalN]C[z, t] == ([ScriptCapitalN]A[z, t] + > [ScriptCapitalN]B[z, t] + [ScriptCapitalN]C[z, t])*ÖA[z, t] - > (0.0003610152163600286*Derivative[1, 0][ÖC][z, t])/ > ((0.2905456429313062*ÖB[z, t])/(ÖA[z, t] + ÖC[z, t]) + > (0.3040465336986682*ÖA[z, t])/(ÖB[z, t] + ÖC[z, t])) && > 0.0003610152163600286*(ÖA[z, t]*Derivative[0, 1][P][z, t] + > P[z, t]*Derivative[0, 1][ÖA][z, t] + > 2769.9663468*Derivative[1, 0][[ScriptCapitalN]A][z, t]) == 0 && > 0.0003610152163600286*(ÖB[z, t]*Derivative[0, 1][P][z, t] + > P[z, t]*Derivative[0, 1][ÖB][z, t] + > 2769.9663468*Derivative[1, 0][[ScriptCapitalN]B][z, t]) == 0 && > 0.0003610152163600286*(ÖC[z, t]*Derivative[0, 1][P][z, t] + > P[z, t]*Derivative[0, 1][ÖC][z, t] + > 2769.9663468*Derivative[1, 0][[ScriptCapitalN]C][z, t]) == 0 && > ÖA[z, t] + ÖB[z, t] + ÖC[z, t] == 1 && > ÖA[z, 0] == ÖA[0, t] == 0.13238383827902114 && > ÖB[z, 0] == ÖB[0, t] == 0.6681373176389893 && > ÖC[z, 0] == ÖC[0, t] == 0.1994788440819895 && > P[z, 0] == P[0, t] == 100000 && [ScriptCapitalN]A[1/4000, t] == > 0.011156006364769414 && [ScriptCapitalN]B[1/4000, t] == 0 && > [ScriptCapitalN]C[1/4000, t] == 0, > {P, [ScriptCapitalN]A, [ScriptCapitalN]B, [ScriptCapitalN]C, ÖA, > ÖB, ÖC}, {z, 0, 1/4000}, {t, 0, 2}] > -- > Chris Chiasson > http://chrischiasson.com > Kettering University > Mechanical Engineering > Graduate Student > 1 810 265 3161 -- Chris Chiasson http://chrischiasson.com Kettering University Mechanical Engineering Graduate Student 1 810 265 3161 === Subject: ndsolve error message Hi MathGroup gurus, I get the following error from my input to NDSolve, but I am not sure if I am actually violating the rule it says I am: Boundary values may only be specified for one independent variable. Initial values may only be specified at one value of the other independent variable. ***Do you think I have violated the rule? What should I change?*** the input was as follows: (copy it into Mathematica and hit ctrl+shift+n to get a more readable form) NDSolve[[ScriptCapitalN]A[z, t] == ([ScriptCapitalN]A[z, t] + [ScriptCapitalN]B[z, t] + [ScriptCapitalN]C[z, t])*ÖA[z, t] - (0.0003610152163600286*Derivative[1, 0][ÖA][z, t])/ ((0.3040465336986682*ÖC[z, t])/(ÖA[z, t] + ÖB[z, t]) + (0.39170805107300855*ÖB[z, t])/(ÖA[z, t] + ÖC[z, t])) && [ScriptCapitalN]B[z, t] == ([ScriptCapitalN]A[z, t] + [ScriptCapitalN]B[z, t] + [ScriptCapitalN]C[z, t])*ÖA[z, t] - (0.0003610152163600286*Derivative[1, 0][ÖB][z, t])/ ((0.2905456429313062*ÖC[z, t])/(ÖA[z, t] + ÖB[z, t]) + (0.39170805107300855*ÖA[z, t])/(ÖB[z, t] + ÖC[z, t])) && [ScriptCapitalN]C[z, t] == ([ScriptCapitalN]A[z, t] + [ScriptCapitalN]B[z, t] + [ScriptCapitalN]C[z, t])*ÖA[z, t] - (0.0003610152163600286*Derivative[1, 0][ÖC][z, t])/ ((0.2905456429313062*ÖB[z, t])/(ÖA[z, t] + ÖC[z, t]) + (0.3040465336986682*ÖA[z, t])/(ÖB[z, t] + ÖC[z, t])) && 0.0003610152163600286*(ÖA[z, t]*Derivative[0, 1][P][z, t] + P[z, t]*Derivative[0, 1][ÖA][z, t] + 2769.9663468*Derivative[1, 0][[ScriptCapitalN]A][z, t]) == 0 && 0.0003610152163600286*(ÖB[z, t]*Derivative[0, 1][P][z, t] + P[z, t]*Derivative[0, 1][ÖB][z, t] + 2769.9663468*Derivative[1, 0][[ScriptCapitalN]B][z, t]) == 0 && 0.0003610152163600286*(ÖC[z, t]*Derivative[0, 1][P][z, t] + P[z, t]*Derivative[0, 1][ÖC][z, t] + 2769.9663468*Derivative[1, 0][[ScriptCapitalN]C][z, t]) == 0 && ÖA[z, t] + ÖB[z, t] + ÖC[z, t] == 1 && ÖA[z, 0] == ÖA[0, t] == 0.13238383827902114 && ÖB[z, 0] == ÖB[0, t] == 0.6681373176389893 && ÖC[z, 0] == ÖC[0, t] == 0.1994788440819895 && P[z, 0] == P[0, t] == 100000 && [ScriptCapitalN]A[1/4000, t] == 0.011156006364769414 && [ScriptCapitalN]B[1/4000, t] == 0 && [ScriptCapitalN]C[1/4000, t] == 0, {P, [ScriptCapitalN]A, [ScriptCapitalN]B, [ScriptCapitalN]C, ÖA, ÖB, ÖC}, {z, 0, 1/4000}, {t, 0, 2}] -- Chris Chiasson http://chrischiasson.com Kettering University Mechanical Engineering Graduate Student 1 810 265 3161 === Subject: Re: books on writing packages Packages are pretty easy to write in Mathematica but there are several ways of doing it. I don't think there is one perfect book for learning to write packages but the best book is probably 'Programming in Mathematica: Second Edition' by Roman Maeder. The book is good on details, but is a bit old and doesn't actually show the easy way to write a package. The easiest way to write a package is to write an ordinary Mathematica notebook with the package statements, BeginPackage etc., make the cells Initialization cells (Select the whole notebook and use Ctrl C R I) and then save the notebook. When you first save the notebook, Mathematica will ask if you want to create an AutoSave Package. Answer yes. Then not only will the notebook be saved, but the .m package notebook will also be created and file will also be updated. At the end of this email I have pasted a notebook expression for a toy package. Copy the expression and paste it into an new empty notebook. Save the resulting notebook into an appropriate folder and you will have the package. The next question, often confusing to package writers, is where to put the notebook and package. This also relates to how the BeginPackage statement is written. There are a number of places it could be put, but the best place is to evaluate: $BaseDirectory or $UserBaseDirectory in Mathematica 5.0 or later. ($AddOnsDirectory in Version 4). The advantage of using this is that if you update Mathematica, the update won't interfere with these folders so everything gets carried over. This will give you a folder and if you look in that folder you should find an Applications folder. For our ToyPackage, you will then want to create an Algebra folder in the Applications folder. And you want to put the package in that Algebra folder. So you will have $BaseDirectory/Applications/Algebra/ ToyPackage.nb ToyPackage.m (after you open and save ToyPackage.nb) (The other places you could put packages are in the Wolfram files ExtraPackages or Applications.) Mathematica automatically looks in $BaseDirectory/Applications (and a few other places also) when asked to load a package. Notice that the package started with BeginPackage[Algebra`ToyPackage`] and the 'Algebra' in the statement corresponds to the Algebra folder that you created. Obviously you could change both of these to any other name. The package can then be loaded with Needs[Algebra`ToyPackage] or <])], Input, InitializationCell->True], Cell[BoxData[ ((Algebra`ToyPackage::usage = ;))], Input, InitializationCell->True], Cell[BoxData[ ((SquareTheQuantity::usage = ;))], Input, InitializationCell->True], Cell[BoxData[ (Begin[<`Private`>])], Input, InitializationCell->True], Cell[BoxData[ (SquareTheQuantity[x_] := x^2)], Input, InitializationCell->True], Cell[BoxData[ (End[])], Input, InitializationCell->True], Cell[BoxData[ ((Protect[Evaluate[$Context <> <*>]];))], Input, InitializationCell->True], Cell[BoxData[ (EndPackage[])], Input, InitializationCell->True] }, Open ]] }, FrontEndVersion->5.0 for Microsoft Windows, ScreenRectangle->{{0, 1280}, {0, 941}}, AutoGeneratedPackage->Automatic, WindowSize->{494, 740}, WindowMargins->{{1, Automatic}, {Automatic, 1}} ] === Subject: Creating forms for user input in Mathematica Can anyone help me (or point me to an example) of a form in Mathematica that takes user input and then passes that input to a function for evaluation. I have a module which takes about 20 or arguments and ideally I'd like to have a simple form that I can use to query users for input. -Mark === Subject: Re: Can't Get a numric answer for this I have sent an email to each of you with a Word file attachment that shows the output that I get from Mathematica. The book says the answer should be 2. === Subject: Plot3D attempt. I have a differential equation of motion (for a simple trebuchet). I have managed to solve and plot it ok (with help from you guys!)along with plots for velocity and range. Now i have moved just the equations to a different nb. I'm trying to do a 3D plot of ran[t] for values t,0,5 and also varying L. I'm obviously going wildly wrong so if anyone can help out it'd be great. My .nb files are here: bruce1711.150m.com/mathematicanbs.zip. Any help would be greatfully received!