1
$\begingroup$

I want a work program to compensate for the different values between 0 and 1 in this equation and show results enter image description here

Subscript[R, 1] Subscript[R, 2] Subscript[R, 5] Subscript[R, 6]
     Subscript[R, 11] + 
   Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] Subscript[R, 6]
     Subscript[R, 11] `/. Subscript[R, 1] :> 0.95 /. 
 Subscript[R, 2] :> 0.9 /. Subscript[R, 3] :> 0.85 
/.  Subscript[R, 5] :> 0.75 /. Subscript[R, 6] :> 0.7 /.Subscript[R, 11] :> 0.96`

So I interpreted like enter image description here

But I want to change the values many times and show the results and thus be tired. Is there a suggestion better than that?

>

$\endgroup$
3
  • 2
    $\begingroup$ Well, your images didn't show up correctly, but it doesn't matter anyway: please include your code in your post as typed text, in Mathematica syntax, properly formatted in code blocks, rather than as screenshot images. $\endgroup$
    – march
    Mar 1 '17 at 22:30
  • $\begingroup$ @march I've added code $\endgroup$ Mar 1 '17 at 22:46
  • $\begingroup$ i guess the think you are looking for is Table ? reference.wolfram.com/language/ref/Table.html $\endgroup$
    – george2079
    Mar 1 '17 at 22:58
1
$\begingroup$

Update: full code for a smaller example:

exp = Subscript[R, 1] Subscript[R, 2] Subscript[R, 5] Subscript[R,6] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] Subscript[R, 6] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] 
    Subscript[R, 5] Subscript[R, 6] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 7] Subscript[R, 11]; 

 variables = SortBy[Variables[exp], Last];
 values = Array[Symbol["v" <> ToString[#]] &, Length@Variables[exp]];

 Manipulate[Evaluate[exp /. Thread[variables -> values] // Style[#, 24] &],
 Evaluate[## & @@({{#, .5, ToString[#2, TraditionalForm]}, 0, 1, 
       Appearance -> "Labeled"}& @@@Transpose[{values, variables}])], Alignment -> Center]

Mathematica graphics Mathematica graphics

Original post:

variables = SortBy[Variables[expr], Last];
values = Array[Symbol["v" <> ToString[#]] &, Length@Variables[expr]];

Manipulate[Evaluate[expr /. Thread[variables -> values] // Style[#, 24] &],
 Evaluate[## & @@( {{#, .5, ToString[#2, TraditionalForm]}, 0, 1, 
       Appearance -> "Labeled"} & @@@ Transpose[{values, variables}])]]

Mathematica graphics

where expr is the expression in your posted code before the first ReplaceAll (/.):

expr = Subscript[R, 1] Subscript[R, 2] Subscript[R, 5] Subscript[R, 6] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] Subscript[R, 6] Subscript[R, 11] - ...

Mathematica graphics

Note: you need to evaluate the piece expr = ... before executing the Manipulate code.

Update: Copy/paste/execute the following before Manipulate:

expr = Subscript[R, 1] Subscript[R, 2] Subscript[R, 5] Subscript[R, 6] Subscript[R, 11]+ 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] Subscript[R, 6] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] 
   Subscript[R, 5] Subscript[R, 6] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 7] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 7] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] Subscript[R, 7] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 5] 
    Subscript[R, 6] Subscript[R, 7] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] 
    Subscript[R,6] Subscript[R, 7] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] 
    Subscript[R, 5] Subscript[R, 6] Subscript[R, 7] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 8] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 4] Subscript[R, 8] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 4] Subscript[R,8] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 5]
     Subscript[R, 6] Subscript[R, 8] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 4] 
     Subscript[R, 5] Subscript[R, 6] Subscript[R, 8] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] Subscript[R, 4] 
     Subscript[R, 5] Subscript[R, 6] Subscript[R, 8] Subscript[R,11] - 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 7] Subscript[R, 8] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 4]
     Subscript[R, 7] Subscript[R, 8] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] 
     Subscript[R, 4] Subscript[R, 7] Subscript[R, 8] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] 
     Subscript[R, 6] Subscript[R, 7] Subscript[R, 8] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 4] Subscript[R, 5]
     Subscript[R, 6] Subscript[R, 7] Subscript[R, 8] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] 
    Subscript[R, 4] Subscript[R, 5] Subscript[R, 6] 
       Subscript[R, 7] Subscript[R, 8] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 4] Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 4] 
     Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] 
     Subscript[R, 6] Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 4] Subscript[R, 5]
     Subscript[R, 6] Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] 
     Subscript[R, 4] Subscript[R, 5] Subscript[R, 6] 
        Subscript[R, 9] Subscript[R,  10] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 7] 
     Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 4] Subscript[R, 7] 
     Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] Subscript[R, 4] 
     Subscript[R, 7] Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] Subscript[R, 6] 
     Subscript[R, 7] Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] +
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 4] Subscript[R, 5] 
     Subscript[R, 6] Subscript[R, 7] Subscript[R, 9] 
        Subscript[R,  10] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] Subscript[R, 4] 
     Subscript[R, 5] Subscript[R, 6] Subscript[R, 7] 
        Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 8] Subscript[R, 9] 
     Subscript[R, 10] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 4] Subscript[R, 8] Subscript[R, 9]
     Subscript[R, 10] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 4] Subscript[R,  8] 
     Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] Subscript[R, 6]
     Subscript[R, 8] Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 4] 
     Subscript[R, 5] Subscript[R, 6] Subscript[R, 8] Subscript[R, 9]
       Subscript[R, 10] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] Subscript[R, 4] 
     Subscript[R, 5] Subscript[R, 6] Subscript[R, 8] Subscript[R, 9] 
       Subscript[R, 10] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 7] Subscript[R, 8] 
     Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 4] Subscript[R, 7] 
     Subscript[R, 8] Subscript[R, 9] Subscript[R, 10] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] Subscript[R, 4] 
     Subscript[R, 7] Subscript[R, 8] Subscript[R, 9] 
        Subscript[R,  10]  Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] Subscript[R, 6] 
     Subscript[R, 7] Subscript[R, 8] Subscript[R, 9] 
        Subscript[R, 10] Subscript[R, 11] - 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 4] Subscript[R,5] 
      Subscript[R, 6] Subscript[R, 7] Subscript[R, 8] 
         Subscript[R,  9] Subscript[R, 10] Subscript[R, 11] + 
  Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] Subscript[R, 4] 
     Subscript[R, 5] Subscript[R, 6] Subscript[R, 7] 
     Subscript[R, 8] Subscript[R, 9] Subscript[R, 10] Subscript[R, 11];
$\endgroup$
0
0
$\begingroup$
Table[Replace[a b c d + a f d e, i, {2}], {i, #}] &@
Map[Thread[{a, b, c, d, e, f} -> #] &, {{0.95, 0.9, 0.3, 0.85, 0.1, 
0.3}, {0.9, 0.8, 0.2, 0.65, 0.2, 0.1}}]

(* {0.24225, 0.1053} *)
$\endgroup$
2
  • $\begingroup$ ....But I want the values changed many times $\endgroup$ Mar 1 '17 at 22:48
  • 1
    $\begingroup$ @Emadkareem instead of posting the long code can you just use something simple like a small dummy example (such as in my code) and explain what you need? $\endgroup$
    – Ali Hashmi
    Mar 1 '17 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.