help-octave
[Top][All Lists]
Advanced

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

Re: lsode problem


From: Doug Stewart
Subject: Re: lsode problem
Date: Mon, 10 Sep 2012 09:03:48 -0400



On Mon, Sep 10, 2012 at 2:05 AM, sassir <address@hidden> wrote:
@marco atzeri-2:
hm...
well i attached a new version
http://octave.1599824.n4.nabble.com/file/n4643925/fn.m fn.m
I meant that (T_amb = Tamb, both represent the same variable) it was just a
typing mistake!

And i still have a problem in understanding Doug's remark so please what
should the function call look like to plot a nice solution? Because i
mentioned in the few examples i just called the function by typing "f" or
what ever the function name was in the console and that's it!
So in my case the call of "fn" still says 'T2' is undefined. Maybe I'm a big
big headed ;-)

Well i use emacs at the moment, but i don't like it that much, because maybe
i need to check a code 10 times to correct some errors and wrong entries.
Maybe i should try out other linux-editors ;-)



--
View this message in context: http://octave.1599824.n4.nabble.com/lsode-problem-tp4643805p4643925.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave




OK, I am going to try a lead you through what I think is the best way for you to get this working.


Take the first part (shown below) and put it in one file called fn.m


function xdot = fn(T2,t) % Given Parameters c = 6017.895; Tamb = 293; T1 = 357.0662 + Tamb; z = 0.1; u = z; % u in [0,22] a = 16.8501; b = 132245.6157; xdot = (b -a*T2-u*(T1-Tamb))/c; endfunction


and now take the second part and put it in a second file called fnrun.m (or any other name.m you choose)


% Set ODE solver options
% lsode_options("integration method","stiff");
% lsode_options("maximum step size",10);
t=[0:0.1:10]; 
%linspace(0,20,200);
T0=273+50;
y=lsode( "fn",T0 , t);
plot(t,y)




Now from an octave prompt type 
fnrun     and enter.

Let us know what happens.

Doug


--
DAS

https://linuxcounter.net/user/206392.html

reply via email to

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