Mathematica Plotting arbitrary constants in mathematica

AI Thread Summary
To plot functions with arbitrary constants in Mathematica, use the Manipulate function to create interactive plots. For example, the expression r(psi) = a(1 - eCos(psi)) can be plotted by defining a dimensionless variable, s = r/a, while keeping e as a constant. This allows for the constants to be adjusted dynamically within specified ranges. The Manipulate function enables users to visualize how changes in constants affect the plot without directly plotting arbitrary constants. This method effectively simplifies the plotting process while maintaining the integrity of the mathematical representation.
kraigandrews
Messages
105
Reaction score
0
How do you plot arbitrary constants in mathematica? for example r(psi)=a(1-eCos(psi)), where a and e are some constant.

Thanks in advance for the help.
 
Physics news on Phys.org
Well, you cannot plot a function with arbitrary constants. Where would the computer draw the line? However, what you can do is do a Plot inside a Manipulate, like this:

Manipulate[Plot[a (1 - e Cos[psi]), {psi, -1, 1}], {{a, 1}, -2, 2}, {{e, 1}, -2, 2}]
 
OK thanks.
 
Some constants can be absorbed into variables by defining dimensionless variables.
This basically treats the constant as the "natural scale" for that dimension.

In your example, you can define the dimensionless, s = r/a
But e is dimensionless and can't really be absorbed anywhere.

So

Manipulate[ Plot[ 1 - e Cos[psi], {psi, -1, 1}, AxesLabel->{"psi","s=r/a"}], {{e,1}, -2, 2}]
 

Similar threads

Back
Top