help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave not finding updated edited files


From: Lalu Mansinha
Subject: Re: Octave not finding updated edited files
Date: Wed, 18 Mar 2009 06:20:55 -0400

Jim:

I notice that one line is missing (edited out?) from mmjam.m

dqadt = dqadt';        %Octave wants a column vector

I tried to run your program (with the above line) in matlab.  Got error messages on too many iterations.  Haven't looked at it too closely.  Will try again later.

Lalu


At 05:52 AM 18/03/2009, Jim Maas wrote:
Thanks, questions answered within text below.

Ben Abbott wrote:
> On Tuesday, March 17, 2009, at 02:02PM, "Jim Maas" <address@hidden> wrote:
>  
>> This is a new one for me. I've been running octave 3.01 from the command
>> line on a Linux pc. Usually when debugging most programmes I run them,
>> then go and edit the file, and try running it again. I discovered that
>> octave was not finding the newly edited file after I made some changes
>> using Emacs. I had to exit octave and restart it again for it to find
>> the newly edited version of the .m file that I gave it a command to execute.
>>
>> Is this as it is supposed to be? Is there a way I can tell octave to
>> reload the most recently edited file before attempting to run the script
>> again from within octave?
>>
>> Thanks
>>
>> Jim
>>    
>
> What files did you edit?
>  
Two files, mmjam0.m script file and mmjam.m which is ode specification
file, listed at bottom of this post
> Where did you save them?
>  
Was just working in a specific linux directory.

> Are they in your path?
>  
I doubt it but Octave found them.  I start octave from the same
directory the files are in and then type "mmjam0.m" and it executed,
giving some errors.  Without exiting octave, I stared emacs in another
terminal and edited and saved this same .m file, then went back to
octave and issued same mmjam0.m command and got same errors.  Only
figured out later that octave was not finding/loading the newly edited
version but seemed to have one in storage somewhere and ran the same one
again.

> If the file you edited was foo.m, what do you get when you type "which foo"?
>  
?
> Does Octave find the file edited and saved or the unedited version?
>
>  
If I quit octave and start it again it finds the newly edit file.

Thanks for any advice, relative newbie here!
-------------------------------------------
%-----------------------------------------------------------------------
% File mmjam0.m, main script file
% Demonstrate how to single pool model using  ODE
% Call ODE45
% Dr. Jim Maas
% 18/03/09
%-----------------------------------------------------------------------
 
% Make rate constants available to subroutines
      global vmax km size qin
 
% Program header -------------------------------------------------------
      disp('Simulate one Pool Dynamic Model      ')
      disp('                                     ')
      disp('        ---------                    ')
      disp('       | qa      |                   ') 
      disp('       |     --- |-->qaout           ')
      disp(' qin---|-->      |                   ')
      disp('       |         |                   ')
      disp('        ---------                    ')
      disp(' qaout = vmax / (1 + ( km / ca))     ')
      disp(' ca =  qa / size of a                ')
      disp('                                     ')
      disp('where qa=quantity of substrate in a  ')
      disp('      Size=size of pool              ')
      disp('      ca=concentration of sub in pool')
      disp('      qin=constant influx to pool    ')
      disp('      qaout=efflux dependent on conc ')
      disp(' ')
 
% Read/assign model parameters -----------------------------------------
      vmax = 36.79;
      km   = 0.22;
      size = 115.0;
      qin  = 18.63;
%      ca   = 0.22;
 
% Initial values -------------------------------------------------------
      qa0=25.0;
 
% Call a routine to solve ODE ------------------------------------------
 
     [t, y]=ode45(@mmjam, [0:0.1:10], qa0);            %Octave
 
% print/plot results ---------------------------------------------------
      plot(t,y);
      xlabel('TIME'); ylabel('QUANTITY');

--------------------------------------------------------------------------------------------------
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 Maas


_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave


reply via email to

[Prev in Thread] Current Thread [Next in Thread]