Mathematica How Can Mathematica Extract and Reuse Output Values for Further Computations?

AI Thread Summary
The discussion centers around using Mathematica to solve equations and plot functions. A specific command is highlighted for solving the equation involving the sine function, yielding solutions at -π/2 and π/2. Participants inquire about extracting numerical values from output boxes and defining functions for plotting. A common issue arises with variable definitions, particularly with the error message indicating an invalid variable. A solution is proposed to define a differentiated function symbolically using the Evaluate function, allowing for proper plotting without manual data copying. The conversation emphasizes the need for effective symbolic manipulation and plotting in Mathematica.
Orion1
Messages
961
Reaction score
3

\text{In}[1]:=\text{Solve}\left[\partial _{\theta } \text{Sin}[\theta ]==0,\theta \right]

\text{Out}[1]:=\left\{\left\{\theta \to -\frac{\pi }{2}\right\},\left\{\theta \to \frac{\pi }{2}\right\}\right\}

Is there a Mathematica source code command that can read a specific numerical value from the output box data?

y_1[\text{x$\_$}]\text{:=}x^2
y_2[\text{x$\_$}]\text{:=}\partial_x x^2
\text{Plot}\left[y_1[x],\{x,0,1\}\right]
\text{Plot}\left[y_2[x],\{x,0,1\}\right]
[/Color]
ivar: ... is not a valid variable.
[/Color]
Is there a symbolic source code solution that will alloy me to define and plot a recently differentiated function?

I can plot the function by manually copying the output box data in immediate mode and pasting it back into the function definition.
[/Color]
 
Last edited:
Physics news on Phys.org
Orion1 said:
y_2[\text{x$\_$}]\text{:=}\partial_x x^2
...
Is there a symbolic source code solution that will alloy me to define and plot a recently differentiated function?
Try:
y_2[\text{x$\_$}]\text{:=Evaluate[}\partial_x x^2\text{]}
 

Similar threads

Replies
1
Views
2K
Replies
1
Views
2K
Replies
6
Views
7K
Replies
3
Views
2K
Replies
1
Views
2K
Replies
3
Views
3K
Replies
2
Views
1K
Back
Top