Message Boards Message Boards

0
|
6745 Views
|
5 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How would I go about solving this?

Posted 11 years ago
g(c)=a * e^bc + d
g(0) = 0;

so a - d = 0

g(0.1) = 1

g(1) = 100

As you can see all I have is mostly the desired results I want. The author of the problem managed to use Mathematica to find real values for the abd members. Can someone tell me how should I go about doing that?
POSTED BY: Turda Alexander
5 Replies
Hello Turda,
I believe that a numerical solution is the only way to go with this one.

Here is a method with the correct syntax (it should be a good excercise for you to figure out the what the syntax is doing from the results). I've put in several steps here so you can see what is going on.  It will more instructive if you evaluate this one statement at a time.
 gc = a Exp[b c] - a
 
 eqs = {1 == gc /. c -> 1/10, 100 ==  gc /. c -> 100 }
 
 Simplify[eqs[[2]] /. Solve[eqs[[1]], a]]
 
 Plot[100 - (-1 + Exp[100 b])/(-1 + Exp[b/10]), {b, -0.2, -0.05}, PlotRange -> {-1, 1}]
 
 FindRoot[100 - (-1 + E^(100 b))/(-1 + E^(b/10)), {b, -0.1}]

(*{b -> -0.100499}*)
You can find the value of a by using the rule: b -> -0.100499

Because the function changes so rapidly around values of b=0, it is helpful to plot the function so that you can give the numerical root finding technique a bit of help.
POSTED BY: W. Craig Carter
Solve should be able to handle this, e.g.
g[c_] = a E^(b c) + d;
Solve[{g[0] == 0, g[0.1] == 1, g[1] == 100}, {a, b, d}, Reals]
POSTED BY: Ilian Gachevski
If you replace the 0.1 with 1/10 in Illian's expression, you probably will have a more symbolic expression: 


This is to say that the Mathematica knows this expression requires a root of a 10th degree polynomial. Use N[...] to turn the Root object into numerics. 
POSTED BY: Shenghui Yang
@ Shenghui: I hope, that it's not necessary for an M-newbie to understand, why and how -M- does this, after changing 0.1 to 1/10
@ W. Craig: obviously you've done something completely different ...

I wish all of you a happy new year!, Peter
POSTED BY: Peter Bischet
Oh, palm slap to forehead. I flubbed the original question: I was using g[100]==100.

I obviously gave up on Solve too quickly! 
 root = (100 - (-1 + E^(100 b))/(-1 + E^(b/10))) /. Exp[b val_] -> expB^val
 
 Timing[sol = Solve[root == 0, expB, Reals];]
 
 (*{29.136395, Null}*)
 
 Log[expB /. N[sol]]
 
 -0.100499
POSTED BY: W. Craig Carter
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract