Error when using symbolic two solve for function given two points

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
RT
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error when using symbolic two solve for function given two points

RT
pkg load symbolic
syms a b

assume(a, 'positive')
assume(b, 'positive')
pt1=[0,3591]  %could place all pts in one array
pt2=[66342,.01]

x1=pt1(1,1);y1=pt1(1,2)
x2=pt2(1,1);y2=pt2(1,2)

sol = solve (y1==a*b^x1, y2==a*b^x2, a, b); %creates a structure
a_val=double(sol.a) %converts structure to double
b_val=double(sol.b)


The error I get is:

warning: Using rat() heuristics for double-precision input (is this what you wanted?)
warning: called from
    sym at line 221 column 7
    binop_helper at line 54 column 5
    ineq_helper at line 35 column 5
    eq at line 53 column 5
    test_symbolic at line 28 column 5
Waiting.....................


I tried it with geogebra and it came back with an answer and a plot is this a bug?
http://storage2.static.itmages.com/i/17/0712/h_1499885162_7988333_4ba02e452b.png

I'm using symbolic 2.2.4 and Ubuntu 16.04 64bit Octave 4.0

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error when using symbolic two solve for function given two points

Doug Stewart-4


On Wed, Jul 12, 2017 at 2:51 PM, RT <[hidden email]> wrote:
pkg load symbolic
syms a b

assume(a, 'positive')
assume(b, 'positive')
pt1=[0,3591]  %could place all pts in one array
pt2=[66342,.01]

x1=pt1(1,1);y1=pt1(1,2)
x2=pt2(1,1);y2=pt2(1,2)

sol = solve (y1==a*b^x1, y2==a*b^x2, a, b); %creates a structure
a_val=double(sol.a) %converts structure to double
b_val=double(sol.b)


The error I get is:

warning: Using rat() heuristics for double-precision input (is this what you wanted?)
warning: called from
    sym at line 221 column 7
    binop_helper at line 54 column 5
    ineq_helper at line 35 column 5
    eq at line 53 column 5
    test_symbolic at line 28 column 5
Waiting.....................


I tried it with geogebra and it came back with an answer and a plot is this a bug?
http://storage2.static.itmages.com/i/17/0712/h_1499885162_7988333_4ba02e452b.png

I'm using symbolic 2.2.4 and Ubuntu 16.04 64bit Octave 4.0





the symbolic pkg seems to have problems solving this problem, But you don't need the symbolic
pkg for this problem. I changed some of your numbers.

pkg load symbolic
syms a b

assume(a, 'positive')
assume(b, 'positive')
pt1=[0.001,3591]  %could place all pts in one array
pt2=[.01,66342]

x1=pt1(1,1);y1=pt1(1,2);
x2=pt2(1,1);y2=pt2(1,2);


bb=(y2/y1)^(1/(x2-x1));
aa=y2/(bb^x2);
sola=solve(y2==a*bb^x2,a)
a1=double(sola)
aa
bb



_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Loading...