# Manipulate with two outputs?

**URL:** <https://community.wolfram.com/t/manipulate-with-two-outputs/19261>\
**Category:** Questions\
**Tags:** physics, graphics-and-visualization, interface-construction\
**Created:** [December 17, 2021, 9:30am UTC](https://community.wolfram.com/t/manipulate-with-two-outputs/19261 "2021-12-17T09:30:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![corsairembm](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/corsairembm/32/10228_2.png) [@corsairembm](https://community.wolfram.com/u/corsairembm)\
**Post date:** [December 17, 2021, 9:30am UTC](https://community.wolfram.com/t/manipulate-with-two-outputs/19261/1 "2021-12-17T09:30:50Z")

</div>

Hello all,  
please do not fire at me, I am still a learner.  
Suppose I have a “Manipulate calculation” that gives me the wavelength (in nm) of a hydrogen electron passing from one orbital to another.  
The way I have built it is the following:

```
r = 1.097*10^7; (*Rydberg constant*)

h = 6.62607*10^-34; (*Planck constant*)

ev = 1.602176634*10^-19; (*value of 1 eV*)

c = 2.99792458*10^8; (*speed of light in vacuum*)

rh = 13.6; (*Rydberg constant in eV - lowest energy level*)

```

Then:

```
Manipulate[1/(r*((1/m^2) - (1/n^2)))*10^9, {m, 1, 9}, {n, 2, 9}]

```

gives me the wavelength, and:

```
Manipulate[-rh*((1/n^2)), {n, 1, 900}]

```

gives me the energy.

Is there a way that I can build a Manipulate calculation that gives me both in the same time?

Many thanks in advance,  
Mauro B.

[Energy levels hydrogen.nb](https://community.wolfram.com/uploads/short-url/fgrQNnKLjkNsYZRgusJDWpaHXmE.nb) (11.3 KB)

---

<div class="post-metadata">

**Author:** ![hdolhaine](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hdolhaine/32/35924_2.png) [@hdolhaine](https://community.wolfram.com/u/hdolhaine)\
**Post date:** [December 17, 2021, 10:22am UTC](https://community.wolfram.com/t/manipulate-with-two-outputs/19261/2 "2021-12-17T10:22:27Z")

</div>

Like this?

```
r = 1.09710^7;
h = 6.6260710^-34;
ev = 1.60217663410^-19;
c = 2.9979245810^8;
rh = 13.6;

Manipulate[
 wL = 1/(r ((1/m^2) - (1/n^2))) 10^9;
 en = -rh ((1/n^2));
 {wL, en},
 {m, 1, 9}, {n, 2, 9}]

```

---

<div class="post-metadata">

**Author:** ![corsairembm](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/corsairembm/32/10228_2.png) [@corsairembm](https://community.wolfram.com/u/corsairembm)\
**Post date:** [December 17, 2021, 12:06pm UTC](https://community.wolfram.com/t/manipulate-with-two-outputs/19261/3 "2021-12-17T12:06:54Z")

</div>

Brilliant! Thank you Sir !

---

<div class="post-metadata">

**Author:** ![corsairembm](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/corsairembm/32/10228_2.png) [@corsairembm](https://community.wolfram.com/u/corsairembm)\
**Post date:** [December 17, 2021, 12:30pm UTC](https://community.wolfram.com/t/manipulate-with-two-outputs/19261/4 "2021-12-17T12:30:48Z")

</div>

Dear Hans,

what if I want to use one of the inputs of a calculation in Manipulate to express the energy?

Energy (in eV) of an orbital:

```
E = -Rh (1/n^2)

```

that would be :

```
Manipulate[-rh*((1/n^2)), {n, 1, 9, 1}]

```

But what I have in mind is to have a Manipulate that has an output of the wavelength, the different energy, and use that input of n to calculate the energy as above.

Likewise, I wanted to explore the use of the output from the calculation in Manipulate and come out with some other calculation, inside the Manipulate itself.

I am asking these questions because the ref. documentation only holds very simple examples.

Many thanks in advance!  
Mauro B.

---

<div class="post-metadata">

**Author:** ![hdolhaine](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hdolhaine/32/35924_2.png) [@hdolhaine](https://community.wolfram.com/u/hdolhaine)\
**Post date:** [December 17, 2021, 5:31pm UTC](https://community.wolfram.com/t/manipulate-with-two-outputs/19261/5 "2021-12-17T17:31:15Z")

</div>

I am afraid I do not understand what you want to do. I guess it is this?

```
r = 1.09710^7;
h = 6.6260710^-34;
ev = 1.60217663410^-19;
c = 2.9979245810^8;
rh = 13.6;
Dynamic /@ {wL, en}

Manipulate[
 wL = 1/(r ((1/m^2) - (1/n^2))) 10^9;
 en = -rh ((1/n^2));
 {wL, " ", en},
 {m, 1, 9, 1}, {n, 2, 9, 1}]

```

And now do a (here nonsense) calculation with the values achieved in the Manipulate

```
Print[wL]
Print[en]
wL^2/Sin[en]

```

---

<div class="post-metadata">

**Author:** ![hansmilton](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hansmilton/32/8656_2.png) [@hansmilton](https://community.wolfram.com/u/hansmilton)\
**Post date:** [December 17, 2021, 5:51pm UTC](https://community.wolfram.com/t/manipulate-with-two-outputs/19261/6 "2021-12-17T17:51:34Z")

</div>

Or maybe something along these lines?

```
Manipulate[
 	x = a*b;
 	z = x^c;
 	Grid[{
   		{"Product of a and b", x},
   		{"The product raised to c", z}
   	},
  		Alignment -> {{Left, Right}, Automatic}, Spacings -> 2
  	],
 	{{a, 2}, 0, 10, 1, Appearance -> "Labeled"},
 	{{b, 3}, 0, 10, 1, Appearance -> "Labeled"},
 	{{c, 4}, 0, 10, 1, Appearance -> "Labeled"},
 	{x, None},
 	{z, None}
 ]

```

 ![TwooutputManipulate.png](https://global.discourse-cdn.com/wolfram/original/3X/7/a/7ad05fe5d8b498a0298aaf6e4215894a58008048.png)

---

<div class="post-metadata">

**Author:** ![corsairembm](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/corsairembm/32/10228_2.png) [@corsairembm](https://community.wolfram.com/u/corsairembm)\
**Post date:** [December 17, 2021, 5:53pm UTC](https://community.wolfram.com/t/manipulate-with-two-outputs/19261/7 "2021-12-17T17:53:02Z")

</div>

Thank you, Sir !  
This already increases my knowledge on W language.  
I just need to organize some stuff according to your example.  
Thank you so much!
