Question: extracting numerical values from an expression of a known form

OK I thought this would be very easy, but after much puzzling I still can not figure this out.

Let's say that I start with some explicit floating-point numbers:

a_num := 1.330 :
b_num := 2.440 :
c_num := 3.660 :

The I construct a function using these values:

func := ( a_num + b_num * x ) * exp( - c_num * x ) :

Now what I need to do is simply the opposite of this: given the function func, and given an explicit known form of the function, assign the values a, b, c. Hypothetically it would look something like this:

(Hypothetical only, not actual maple): get(  ( a,b,c ) from ( func ) where func is of form ( (a + b * x ) * exp( - c * x ) ) :

and of course the result should be that 1.330 is assigned to a, and 2.440 is assigned to b, and so on.

The difficulty is that the "known functional form" is not a polynomial, in fact it might be quite complicated.

(Of course, the idea is that is that it should work for different values of (a,b,c) so for example if func is ((5.1 + 6.2 * x) * exp(- 7.3 x)) then 5.1 should be assigned to a, and so on.)

 

Please Wait...