Dr. Patrick T

2083 Reputation

18 Badges

13 years, 301 days

MaplePrimes Activity

These are answers submitted by PatrickT

These notes contain a summary which probably comes from the textbook by Hull, cited in the bibliography, it shows you how the d1 and d2 come about, maybe this will go some way towards your question:

I thought the answer was in the d1 and d2, but I haven't looked at it carefully to be honest. Here's a more detailed reference, hopefully some of it may be of help:

in particular the formula on page 124

To "find" the parameters A and B, you need data points and a model (least squares fit, polynomial fit, etc.). Do you have data points?

Here's an example from Regression Commands, using the Statistics package

#Define Vectors X and Y, containing values of an independent variable x and a dependent variable y. 
X := Vector([1.2, 2.1, 3.1, 4.0, 5.7, 6.6, 7.2, 7.9, 9.1, 10.3]):
Y := Vector([4.6, 7.7, 11.5, 15.4, 22.2, 33.1, 48.1, 70.6, 109.0, 168.4]):
#Find the values of a and b that minimize the least-squares error when the model function a*t+b*exp(x) is used. 
Fit(a*x+b*exp(x), X, Y, x);

        6.02861839712210212 x + 0.00380375570529786159 exp(x)

#Fit a polynomial of degree 3 through this data. 
PolynomialFit(3, X, Y, x);

  -3.37372868459020214 + 9.90059487215678224 x

                                2                         3
         - 2.79612412098216988 x  + 0.336249676048196222 x

other search keywords: CurveFitting Package, Least Squares


one link I posted above has expired, here's an updated link:

Thanks Robert for taking the time to look at this again with me. You are patience incarnate. I am spending rather a lot of time on this, though thankfully I am also doing other things.

I follow your reasoning right until the last step -- is there a typo?

you write:

diff(Q(t), t) = -(1/14400)*(40*Q(t)-1)*(31+800*Q(t))

and so if

40*Q(t)-1 = 0

or equivalently



diff(Q(t), t) = 0

But you write:

Q = 1/80

the last line, I believe, is a typo.

The variable transform you suggest is something I tried before but I seem to reach a rather different conclusion. The conclusion I reach is that the transformed system has a center manifold representation. The transformed system has zero eigenvalues as opposed to infinite eigenvalues for the original system.

My previous attempts in this respect are summarized here:

Let me summarize this in Maple code using unevaluated parameters. Hopefully this will clarify things. Note that I have used the letter "tau" rather than "t" for the new independent variable, because I was already using "t" for natural time in the original system.



#The Transformed Dynamic System

newxdot := diff(x(tau),tau) = rhs(eval(xdot,t=tau))*rhs(eval(xdot,t=tau)):
newcdot := diff(c(tau),tau) = rhs(eval(cdot,t=tau))*rhs(eval(xdot,t=tau)):

newqdot := diff(q(tau),tau) = rhs(eval(qdot,t=tau))*rhs(eval(xdot,t=tau)):
newsys := {newxdot,newcdot,newqdot};
eval(newsys, {x(tau)=xs,c(tau)=cs}):
select(has,%, diff);

A snapshot of the output of the above code taken from this worksheet:


And therefore we've got

diff(q(tau),tau) = 0

The claim in the title of this post - Q is constant.

The closest I've come to illustrating my intuition that the dynamic system is characterized by a center manifold is with this 2D approximation analysis, itself derived from recommendations you gave me in another mapleprimes post.

Was it a typo above? Have my comments made you change your mind about the existence of a dynamic path starting from below? Is this thing a center manifold?

thanks a bunch,


Thanks for your encouragements acer, but I'm afraid I'm about to give up. It looks like it would take me too long to learn how to use the MmaTranslator / it would take me too long to do it by hand (our code spans dozens of pages). Converting the code to Maple was a pet project I am going to have to leave aside -- after all we already have fully functioning Mathematica and Matlab code.

I was prepared to "translate" the code line by line or paragraph by paragraph, but even that doesn't seem to work.

To give an example, consider the following Mathematica code (the one I have highlighted):


convert(`cFuncPlotBase = 
 cFuncPlot = 
  Plot[cE[\[ScriptM]], {\[ScriptM], 
    0, \[ScriptM]MaxMax}]; TractableBufferStockcFunc = 
 Show[cFuncPlot, cEPFPlot, Degree45
  , Graphics[
   Text[" \[LongLeftArrow] 45 Degree Line ", {0.8` \
cE[\[ScriptM]MaxMax], 0.8` cE[\[ScriptM]MaxMax]}, {-1, 0}]]
  , Graphics[Text["  \[LongLeftArrow] Consumption Function \!\(\*
\[ScriptM]\", \"\[ScriptT]\", \"e\"]\))", {\[ScriptM]E/3, 
     cE[\[ScriptM]E/3]}, {-1, 0}]]
  , Graphics[Text[OverBar[Style["\!\(\*
      Plain]], {(\[ScriptM]MaxMax 3)/4 - 10.3, 
     cEPF[(\[ScriptM]MaxMax 3)/4] + 0.01}, {-1, 0}]]
  , Graphics[Text[Style["\!\(\*
StyleBox[SubsuperscriptBox[\"\[ScriptM]\", \"\[ScriptT]\", \"e\"],\n\
     Plain], {(\[ScriptM]MaxMax 3)/4 - 9, 
     cEPF[(\[ScriptM]MaxMax 3)/4]}, {-1, 0}]]
  , Graphics[
   Text[Style["Perf Foresight", Plain], {(\[ScriptM]MaxMax 3)/4 - 11, 
     cEPF[(\[ScriptM]MaxMax 3)/4]}, {1, 0}]]
  , AxesLabel -{"\!\(\*SubsuperscriptBox[\"\[ScriptM]\", \"\
\[ScriptT]\", \"e\"]\)", 
    "\!\(\*SubsuperscriptBox[\"\[ScriptC]\", \"\[ScriptT]\", \"e\"]\)"}
  , Ticks -None]`, FromMma);

I can't even get the MmaTranslator to convert paragraph by paragraph -- copy-pasting from Mathematica to Maple does not seem to work.

Thanks a lot for your explanations acer,

If I understand correctly it means that the MmaTranslator is not so much a Translator as an Interpreter, i.e. if the MmaTranslator is fed a simple Mathematica notebook it will be able to "execute" it, but it will not produce the equivalent Maple code. Am I understanding correctly?

This is disappointing for several reasons: the MmaTranslator does not "understand" much beyond simple Mathematica commands, and it means that if I want to alter the code and make it evolve I must do that in Mathematica code, in which case there is no point in running it in Maple anyway.

it's quick on my machine, but the output is too large to post


> f := x^2+2*x+1+y;

                        f := x  + 2 x + 1 + y

> collect(f,y,factor);

                             y + (x + 1)

In my experience, copy-pasting uses up a lot of memory when plots are included in the region being copy-pasted. What I do before copy-pasting is :

edit -> remove output

then you can copy-paste the formulae quickly.

not sure if that's the problem you're referring to. I use Maple13/Classic.

Note that plot3d output with maple/standard is poor when exported as postscript. However, you can produce and export a plot3d with maple/classic and get a much better result. This problem has been discussed recently, see e.g.

First 16 17 18 19 20 21 22 Page 18 of 24