Message Boards Message Boards

1
|
10377 Views
|
4 Replies
|
7 Total Likes
View groups...
Share
Share this post:

[SOLVED] Solve for Iterative Variable, 'What If --> 'Goal Seek' in Excel

Posted 10 years ago

Hi,

How could I solve for a variable that generates another set value? I'll write a specific example with a known solution as an example.

"Solving for:" unknownVariable = ?

"Setup:"
beginningValue = 1;
endingValue = 0.03;
increments = 9;

intermediateValue1 = beginningValue * unknownVariable;
intermediateValue2 = intermediateValue1 * unknownVariable;
"..."
endingValue = intermediateValue8 * unknownVariable;

"Solution to be solved for:" unknownVariable = 0.68

Thanks,

Greg

POSTED BY: Greg
4 Replies

One could recast this in Mathematica as below.

f[1] = 1;
f[n_] := f[n - 1]*x
Solve[f[10] == .03 && x > 0, x]

(* Out[234]= {{x -> 0.677315868387}} *)

Or just take (.3)^(1/9).

POSTED BY: Daniel Lichtblau
Posted 10 years ago

That's exactly what I needed- thanks!

POSTED BY: Greg

I don't know much about Excel, but the simplest type of thing would be to use Solve or Reduce e.g.

Solve[ 24*x==96, x]

Note some differences in syntax, especially use "==" for Equal as "=" is reserved for Set. Note that you can use natural language inputs, e.g. in Wolfram Alpha, if you find this easier.

Wolfram Language is pretty powerful in solving equations, and on the other hand there are more choices for how to solve something. Sometimes there is no answer (like a real x with x^2==-1) and you can then use minimization to get the closest possibility. Since solving equations can become arbitrarily hard I would guess that solving is better done in Wolfram Language than in Excel.

The idea of searching for a value is an important one in Wolfram's way of doing things. For example, find the smallest elementary cellular automaton that displays random behavior from a single black cell? Sounds hard. You don't need to understand what this is, just make a table of graphics and pick out the answer.

Table[ArrayPlot[CellularAutomaton[rule, {{1},0},{100,All}],PlotLabel->rule],{rule,0,255}]

(See Stephen Wolfram's A New Kind of Science )

POSTED BY: Todd Rowland
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