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

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

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

RT
pkg load symbolic

f0=20; t0=0;
f1=200; t1=2;
syms alpha A B

sol = 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 by
f = A + B(1 − exp(−αt))

We need to solve for the values of A , B and α . Let's assume you want an initial frequency of
20 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 substitute
t = ∞ 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 the
frequency to be at 95 of the final frequency i.e. f = .95 × 200 = 190 then we can substitute
these 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.445

To 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
Reply | Threaded
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'

Doug Stewart-4


On Sun, Jul 23, 2017 at 2:12 PM, RT <[hidden email]> wrote:
pkg load symbolic

f0=20; t0=0;
f1=200; t1=2;
syms alpha A B

sol = 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 by
f = A + B(1 − exp(−αt))

We need to solve for the values of A , B and α . Let's assume you want an initial frequency of
20 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 substitute
t = ∞ 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 the
frequency to be at 95 of the final frequency i.e. f = .95 × 200 = 190 then we can substitute
these 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.445

To 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 choice

B = (sym)

       2⋅α
  180⋅ℯ
  ────────
   2⋅α
  ℯ    - 1


therefore you can't print this out as a double.

 


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
RT
Reply | Threaded
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'

RT
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 <[hidden email]> wrote:


On Sun, Jul 23, 2017 at 2:12 PM, RT <[hidden email]> wrote:
pkg load symbolic

f0=20; t0=0;
f1=200; t1=2;
syms alpha A B

sol = 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 by
f = A + B(1 − exp(−αt))

We need to solve for the values of A , B and α . Let's assume you want an initial frequency of
20 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 substitute
t = ∞ 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 the
frequency to be at 95 of the final frequency i.e. f = .95 × 200 = 190 then we can substitute
these 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.445

To 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 choice

B = (sym)

       2⋅α
  180⋅ℯ
  ────────
   2⋅α
  ℯ    - 1


therefore you can't print this out as a double.

 



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