[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Octave not finding updated edited files
From: |
Ben Abbott |
Subject: |
Re: Octave not finding updated edited files |
Date: |
Wed, 18 Mar 2009 11:14:35 -0400 |
On Wednesday, March 18, 2009, at 08:54AM, "Jim Maas" <address@hidden> wrote:
>
>Ben Abbott wrote:
>>
>> On Mar 18, 2009, at 5:52 PM, Jim Maas wrote:
>>
>>> --------------------------------------------------------------------------------------------------
>>>
>>>
>>> function dqadt = mmjam(t,y)
>>> %-----------------------------------------------------------------------
>>> % Specify the ODE (dynamic Michaelis-Menten expression)
>>> % file mmjam.m called from mmjam0.m
>>> % Dr. Jim Maas
>>> % 18/03/09
>>> %-----------------------------------------------------------------------
>>> % Get rate constants from outside this function
>>> global vmax km size qin
>>> % Work in a more comprehensible set of variables
>>> qa = y;
>>> % Subsidiary equations--------------------------------------------------
>>> ca = qa / size;
>>> qaout = vmax / ( 1 + ( km / ca));
>>> % Dynamic equations--------------------------------------------------
>>> % dqadt(1) = qin - qaout; % dqa/dt
>>> dqadt = qin - qaout; % dqa/dt
>>
>> Jim, I don't see where the input "t" is being used.
>>
>> It that an error, or intentional?
>>
>> In any event, you should be able to skip creating of function file for
>> mmjam entirely, by defining the function as ...
>>
>> dqadt = @(t,y) [qin - vmax/(1+km/(y/sz))]
>>
>> You can do that in mmjam0.m. This also allows you to delete the
>> "global" variables. I've attached a modification of your example that
>> works for me (I'm running Octave 3.0.3).
>
>Thanks Ben,
>
>That certainly is much simpler! I was just following a couple of
>examples I found that had a separate function file but this does look
>cleaner. No idea why t was in the inputs .... just copied blindly!
>
>The example you send works well but the models I need to build will get
>much more complex, i.e. many state variables (pools) and therefore many
>(> 30 individual fluxes) fluxes. It would be nice to specify the
>individual flux equations somewhere separately from the individual
>derivative equations as I've done in this example. The problem is that
>now "y" is unspecified and gives the following error. Is there a way to
>specify the form of the equation outside the derivative equation statement?
>
>octave:24> mmsinglefile
>error: `y' undefined near line 20 column 26
>error: evaluating binary operator `/' near line 20, column 27
>error: evaluating binary operator `/' near line 20, column 24
>
>
>Thanks a bunch
>
>Jim
I'm not following you. What is in "mmsinglefile"?
Ben