help-octave
[Top][All Lists]
Advanced

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

RE: Help using odepkg


From: Allen.Windhorn
Subject: RE: Help using odepkg
Date: Wed, 25 Jul 2012 13:15:52 +0000

Carlo,

> -----Original Message-----
> From: c. [mailto:address@hidden
> 
> > ...because they allow me to pass parameters to the function
> > that produces the derivatives.  OK, I could use globals, but
> > really, globals?  Shades of Fortran /COMMON/ blocks.
> 
> You should not use globals for this, the preferred way for
> parametrizing functions is using anonymous functions, e.g...

Thanks for this hint, now I remember seeing it in a different
context.  I will have to think about how it works.

> > Second problem: is there a good way to include a forcing
> > function U(t) without writing it inside the derivative
> > function?  If not, I could just use a piecewise-linear
> > approximation for now.
>
> I don't really understand this question, maybe an example
> would make it clearer.

I think the anonymous function approach may also solve this,
since I can include the function handle as a parameter.

Again, thank you for your thoughtful reply.

Regards,
Allen


reply via email to

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