From: Serdar GOKHAN on
Hi. Again
Thank you very much for your valuable comments. When I run the below code, on the coomand window

>> S=solve('Ip0*gamma1+alpha_p*Ip0+gb/K*Ip0*Is0*exp(kappa*L)=0', '-Is0*kappa*exp(-kappa*z)-alpha_s*Is0*exp(-kappa*z)+gb/K*Ip0*exp(gamma1*z)*Is0*exp(-kappa*z)=0')

The output is,

S =

kappa: [1x1 sym]
z: [1x1 sym]

>> S.kappa

ans =

log(-K*(gamma1+alpha_p)/gb/Is0)/L


>> S.z

ans =

log(K*(log(-K*(gamma1+alpha_p)/gb/Is0)+alpha_s*L)/gb/Ip0/L)/gamma1

Therefore,
=========================================
kappa=log(-K*(gamma1+alpha_p)/gb/Is0)/L and
z=log(K*(log(-K*(gamma1+alpha_p)/gb/Is0)+alpha_s*L)/gb/Ip0/L)/gamma1
=========================================
So from the above equations, How can get "gamma" and "kappa"
Thank you for your valuable replies.
Regards
Serdar
From: Walter Roberson on
Sean wrote:
> Walter Roberson <roberson(a)hushmail.com> wrote in message
> <1qGZn.10985$Hw.4661(a)newsfe10.iad>...
>> Serdar GOKHAN wrote:
>> > Hi All,
>> > > How can we get analytical expressions of "kappa" and "gamma" from
>> the > below two equations by using Symbolic toolbox? Any kind of help
>> is > appreciated.
>> > Regards
>> > Serdar
>> > > 1.st equation
>> > Ip0*gamma+alpha_p*Ip0+gb/K*Ip0*Is0*exp(kappa*L)
>> > > 2.nd equation
>> > >
>> -Is0*kappa*exp(-kappa*z)-alpha_s*Is0*exp(-kappa*z)+gb/K*Ip0*exp(gamma*z)*Is0*exp(-kappa*z)
>>
>> If those two formula are to be equated to zero and then the pair
>> solved for gamma and kappa, then I do not believe there is an
>> analytical formula for them. Isolating the two variables in terms of
>> the others involves finding the root of something of the form
>>
>> c0 + c1 * x + c2 * exp(c3 + c4 * exp(x))
>>
>> If the term inside the first exp() only involved x linearly and not
>> exp(x), then the root could be determined analytically using the
>> LambertW function, but I do not know of any equivalent function that
>> can be used when there is an x + exp(exp(x)) form.
>
>
> In addition to this, if you run just the first equation and solve for
> both variables you'll see:
>>> vars = solve('Ip0*gamma1+alpha_p*Ip0+gb/K*Ip0*Is0*exp(kappa*L)=0',...
> 'gamma1','kappa');
>>> vars.kappa
> ans = z %meaning that kappa is equivalent to z.
>
> I'm not sure if this is what you meant for and could be a typo in your
> equation.

I think you are misinterpreting, Sean. The z there cannot be the same as
the z of the second equation because the first equation does not include
a z. The z returned is thus probably an indication of "any arbitrary
value", and vars.gamma1 would probably be expressed in terms of that
arbitrary z . This is to be expected when you solve a single equation in
terms of two variables, that the solver will allow one of the variables
to "run free" and express the second in terms of the value of the first.
From: Walter Roberson on
Serdar GOKHAN wrote:
> Hi. Again
> Thank you very much for your valuable comments. When I run the below
> code, on the coomand window
>
>>> S=solve('Ip0*gamma1+alpha_p*Ip0+gb/K*Ip0*Is0*exp(kappa*L)=0',
>>> '-Is0*kappa*exp(-kappa*z)-alpha_s*Is0*exp(-kappa*z)+gb/K*Ip0*exp(gamma1*z)*Is0*exp(-kappa*z)=0')

Don't do that. Explicitly specify the variables to solve for.

If it then says there is no closed-form solution, it is because there
*is* no closed form solution, as per my previous posting that mentioned
Lambert's W function.
From: Serdar GOKHAN on
Thank you Sir.
You did your best. The solution seems to be a function of Lambert's W function.
Regards.
Serdar
From: Walter Roberson on
Serdar GOKHAN wrote:

> You did your best. The solution seems to be a function of Lambert's W
> function. Regards.

What solution did you come up with? Lambert's W function is good for solving
u*x = exp(v*x)
but it is not appropriate for solving
u*x = exp(v*exp(x))

Even if you have exact values for all of the constants, it does not appear to
me that you can find an _analytic_ solution for gamma and kappa as per your
original request. If you _do_ have all of the constants, it is still difficult
to solve numerically as the values involved can be very small (or large.)

Testing out some values, it appears that kappa might be very close to alpha_s
and that gamma1 might be very close to alpha_p . However, if you substitute
those in exactly and toss in some constants, cross-checking will show one of
the expressions coming out as about 1E-368 and the other coming out as about
1E54 if you operate with standard precision; it appears you have to operate
with over 100 digits to start getting more reasonable evaluations of the
equations.