Hello, Jan.
Finally, I've tested the ITERATE() function at work. And now with this function iMath can do really huge calculations, e.g numerical integration of ordinary differential equations, for few seconds. Yes, it works!
You may open my file. It's similar to Euler method v0.39-RC.odt, that was posted earlier, but now it's solved with ITERATE(). On my PC with windows the startup recalculation takes 9-10 sec, then it may take 4-5 sec (was 7 minutes before). That's awesome! On Ubuntu it's twice faster (4-5 and 2-3 sec, maybe this is hardware issue, not OS)! Don't look at results, they are different, because there were another input parameters.
But it needs some improvements to be finished. This is not about ITERATE() itself, though.
Anonymous
4.Would be nice to be able to insert one ITERATE() inside another ITERATE(). Do you remember my example with T_sm, alpha and C_pk? Such system of equations should be somehow solved on every single step:
ITERATE(@1@; @2@; @3@; ITERATE(@T_sm@; @a@; @C_pk@, ...); @4@; @5@...)
But this kind of code will do nothing, because ITERATE() returns a vector of values. Maybe there is some workaround?
Last edit: zeon_account_will_be_deleted 2015-03-04
Hi, Jan.
I continue posting what I've found using ITERATE() in practice here, including things, that seem to be a bug. Just to not forget.
In examples, that I post here, I've hidden a lot of unnecessary text and algorithm. If you want to see it, please check this option: Tools -> Options ->LibreOffece Writer ->Formatting Aids -> Display of ->Hidden text
5.It's impossible to use numeric values of the variables after the ITERATE() in next calculations. Take a look at my comments.
Hi Vladislav,
thank you for testing the ITERATE function.
The work-around would be to define another statement like ITERATE2 which does a nested iteration. This would require a lot of parameters, of course.
Hi, Jan.
%%ii FUNCTION {{none}, h, τ}
%%ii FUNCTION {{none}, ρ_sm, h; τ}
This is necessary to create derivatives, e.g. dh/dτ, which will not turn to 0 after "simplify(..., "diff")".
The meaning of solving an ODE is that we do not know, how exactly all these variables are related (indirectly only). We have no algebraic equations for h(τ) and ρ_sm(h,τ), we can't find their numerical values. In the case of numerical methods we don't even receive algebraic equations at the end. We just solve the list of auxiliary equations n times and receive the numerical values of h1, h2, h3... hn. No FUNCDEF h(τ) -- no VAL(VAL(h(τ))
I've corrected my example, I've added VAL(VAL(...)) to all equations inside the ITERATE(). As I expected, it doesn't help.
Last edit: zeon_account_will_be_deleted 2015-03-09
HI Jan!
Is it possible to implement for ITERATE option to accept vector (actually list of data) as input parameter?
I experimented with graphs and tried to plot a graph of a parametric function F(x,y)=0 that iMath cannot solve to type of y=f(x). So I tried to get values ov x and y using iterations. I've found, that I need one ITERATE string per one pair (x,y) of values. If you enhance ITERATE functionality to accept vectors, this would be much easier to create bulk iterative calculations.
See example.
Should be possible in 2.2.7~beta2
Well... something is going on, but LO is freezing during recalculation. I need to figure out what is wrong.