# Solving 2 nonlinear equations and using symbolic package error: structure has no member 'alpha'

3 messages
Open this post in threaded view
|
Report Content as Inappropriate

## Solving 2 nonlinear equations and using symbolic package error: structure has no member 'alpha'

 pkg load symbolicf0=20; t0=0;f1=200; t1=2;syms alpha A Bsol = solve( f0==A+B*(1-exp(-alpha*t0)), f1==A+B*(1-exp(-alpha*t1)),alpha, A, B)aa=double(sol.A)bb=double(sol.B)cc=double(sol.alpha)I get and error "error: structure has no member 'alpha'"  and I'm not sure why.I'm working a problem to see if I can solve it using Octave the problem I'm working is below:The general formula for the exponential rise in frequency is given byf = A + B(1 − exp(−αt))We need to solve for the values of A , B and α . Let's assume you want an initial frequency of20 at time t = 0 , and an asymptotic frequency of 200 Hz at time t = ∞ .Substituting t = 0 and f = 20 into the above equation we find A = 20. If we substitutet = ∞ and f = 200 we find that B = 180 . For α you really have a free choice - it controls how fast the frequency rises. If you have another control point say at time t = 2 we want thefrequency to be at 95 of the final frequency i.e. f = .95 × 200 = 190 then we can substitutethese into the above equation (Since we know what A , and B are).190 = 20 + 180(1 − exp(−2α))Solving gives α = −0.5 ln(10/180) choose a larger value of α . If you want a faster rise then you'll need to = −1.445To find the expression for phase we simply integrate with respect to time to giveφ = 2π (At + Bt +(B/α)*exp(−αt))Thanks _______________________________________________ Help-octave mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/help-octave
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Solving 2 nonlinear equations and using symbolic package error: structure has no member 'alpha'

 On Sun, Jul 23, 2017 at 2:12 PM, RT wrote:pkg load symbolicf0=20; t0=0;f1=200; t1=2;syms alpha A Bsol = solve( f0==A+B*(1-exp(-alpha*t0)), f1==A+B*(1-exp(-alpha*t1)),alpha, A, B)aa=double(sol.A)bb=double(sol.B)cc=double(sol.alpha)I get and error "error: structure has no member 'alpha'"  and I'm not sure why.I'm working a problem to see if I can solve it using Octave the problem I'm working is below:The general formula for the exponential rise in frequency is given byf = A + B(1 − exp(−αt))We need to solve for the values of A , B and α . Let's assume you want an initial frequency of20 at time t = 0 , and an asymptotic frequency of 200 Hz at time t = ∞ .Substituting t = 0 and f = 20 into the above equation we find A = 20. If we substitutet = ∞ and f = 200 we find that B = 180 . For α you really have a free choice - it controls how fast the frequency rises. If you have another control point say at time t = 2 we want thefrequency to be at 95 of the final frequency i.e. f = .95 × 200 = 190 then we can substitutethese into the above equation (Since we know what A , and B are).190 = 20 + 180(1 − exp(−2α))Solving gives α = −0.5 ln(10/180) choose a larger value of α . If you want a faster rise then you'll need to = −1.445To find the expression for phase we simply integrate with respect to time to giveφ = 2π (At + Bt +(B/α)*exp(−αt))Thanks as you say for alpha you have a free choice so the symbolic pkg leaves it as a free choiceB = (sym)       2⋅α  180⋅ℯ  ────────   2⋅α  ℯ    - 1therefore you can't print this out as a double.  _______________________________________________ Help-octave mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/help-octave
Open this post in threaded view
|
Report Content as Inappropriate

## Re: Solving 2 nonlinear equations and using symbolic package error: structure has no member 'alpha'

 How does one set t = ∞ by setting "t = ∞ and f = 200 we find that B = 180" Is this possible? On Sun, Jul 23, 2017 at 2:39 PM, Doug Stewart wrote:On Sun, Jul 23, 2017 at 2:12 PM, RT wrote:pkg load symbolicf0=20; t0=0;f1=200; t1=2;syms alpha A Bsol = solve( f0==A+B*(1-exp(-alpha*t0)), f1==A+B*(1-exp(-alpha*t1)),alpha, A, B)aa=double(sol.A)bb=double(sol.B)cc=double(sol.alpha)I get and error "error: structure has no member 'alpha'"  and I'm not sure why.I'm working a problem to see if I can solve it using Octave the problem I'm working is below:The general formula for the exponential rise in frequency is given byf = A + B(1 − exp(−αt))We need to solve for the values of A , B and α . Let's assume you want an initial frequency of20 at time t = 0 , and an asymptotic frequency of 200 Hz at time t = ∞ .Substituting t = 0 and f = 20 into the above equation we find A = 20. If we substitutet = ∞ and f = 200 we find that B = 180 . For α you really have a free choice - it controls how fast the frequency rises. If you have another control point say at time t = 2 we want thefrequency to be at 95 of the final frequency i.e. f = .95 × 200 = 190 then we can substitutethese into the above equation (Since we know what A , and B are).190 = 20 + 180(1 − exp(−2α))Solving gives α = −0.5 ln(10/180) choose a larger value of α . If you want a faster rise then you'll need to = −1.445To find the expression for phase we simply integrate with respect to time to giveφ = 2π (At + Bt +(B/α)*exp(−αt))Thanks as you say for alpha you have a free choice so the symbolic pkg leaves it as a free choiceB = (sym)       2⋅α  180⋅ℯ  ────────   2⋅α  ℯ    - 1therefore you can't print this out as a double.  _______________________________________________ Help-octave mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/help-octave