Sun 10 Apr 2011 02:19:31 PM UTC, comment #7:
There is no mistake here. "bdf" and "stiff" are the same solver. Likewise "adams" and "non-stiff" are the same solver. We just give people the option of using either name.
|
Sat 09 Apr 2011 07:12:58 PM UTC, comment #6:
I sorry, and thank you for help. I understand you.
I translate Octave doc into russian.
Another mistake, I open the report??
listing (Octave 3.2.4)
>>> lsode_options("integration method")
ans = stiff
>>> lsode_options("integration method","bdf")
>>> lsode_options("integration method")
ans = stiff
>>> lsode_options("integration method","adams")
>>> lsode_options("integration method")
ans = non-stiff
>>> lsode_options("integration method","stiff")
>>> lsode_options("integration method")
ans = stiff
|
Fri 08 Apr 2011 10:47:18 PM UTC, comment #5:
The problem is the order of your arguments in the function which calculates the derivative. According to the lsode documentation ('help lsode'):
In your sample problem you are using Y instead of X as the dependent variable and X instead of T as the independent variable. Therefore, the functional form should be
However, without specific instructions the inline() function orders its inputs alphabetically. For example,
Of course, you can still create a problem with
But, this shouldn't be a surprise because the function that calculates your derivative (y/x) blows up in the neighborhood of x = 0. You can see this by using a range which doesn't go over the discontinuity.
|
Fri 08 Apr 2011 01:56:52 PM UTC, comment #4:
Ok, I'm try following example on 3.2.4
listing
=====================
GNU Octave, version 3.2.4
Copyright (C) 2009 John W. Eaton and others.
octave:1> x=-5:0.1:5;
octave:2> f=inline("y/x");
octave:3> lsode(f,5,x);
octave:4> plot(x,ans) %Ok, it is line!
octave:5> f=inline("-x/y");
octave:6> lsode(f,5,x);
LSODE-- AT T (=R1) AND STEP SIZE H (=R2), THE
CORRECTOR CONVERGENCE FAILED REPEATEDLY
OR WITH ABS(H) = HMIN
In above, R1 = -0.3729451955262-153 R2 = 0.1137126019255-173
error: lsode: repeated convergence failures (t = -3.72945e-154perhaps bad jacobian supplied or wrong choice of integration method or tolerances)
%Where is my Arc???
octave:6> f=inline("-y/x");
octave:7> lsode(f,5,x);
octave:8> plot(x,ans) %plot arc
=====================
|
Thu 07 Apr 2011 11:26:20 PM UTC, comment #3:
The version you are using, 3.3.50, is a point release for developers. It may have errors.
I ran your sample code without problems on the two stable released versions of Octave (3.2.4 and 3.4.0).
I would suggest changing to a stable version of Octave and re-opening this issue if you are still unable to get your code working.
|
Thu 07 Apr 2011 09:08:59 PM UTC, comment #2:
>value of the vector x
x=-5:0.1:5;
solution equation dy/dx=y/x => y=constant*x
solution equation dy/dx=-x/y => y=sqrt(const^2 - x^2) or y=-sqrt(const^2 - x^2)
If I type
x=-5:0.1:5;
f=inline("y/x");
lsode(f,5,x);
Octave make Error
But, if I type
x=-5:0.1:5;
f=inline("x/y");
lsode(f,5,x);
plot(x,ans) %plotting Line y=constant*x
=>LSODE using 1/f function instead f
|
Thu 31 Mar 2011 09:31:07 PM UTC, comment #1:
There isn't enough information here to debug the problem. What is the value of the vector x (the points where you want the function integrated)?
Also, your say that "y/x" is the problem, but your test results show "-x/y" being the problem.
|
Wed 30 Mar 2011 09:28:49 PM UTC, original submission:
Solve Ordinary Differential Equations
dy
-- = f (y, x)
dx
I set inline function
f=inline("y/x")
and lsode make eror
if set f=inline("x/y")
output is correct
TEST:
>>> f=inline("-x/y");
>>> lsode(f,5,x);
error: lsode: repeated convergence failures (t = -3.72945e-154perhaps bad jacob
ian supplied or wrong choice of integration method or tolerances)
>>> f=inline("x/y");
>>> lsode(f,3,x);
>>> plot(x,ans)
>>> f=inline("-y/x")
>>> lsode(f,3,x);
>>> plot(x,ans)
|