Dynamic Solution for Variable Slider in Mathematica 7 with Cosine Function

  • Context: Mathematica 
  • Thread starter Thread starter button_ger
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
SUMMARY

The discussion focuses on creating a dynamic solution in Mathematica 7 using sliders for variable inputs. The user successfully implements a solution using the Manipulate function with the cosine function, specifically using Manipulate[distance/Cos[angle], {angle, 0., 90.}, {distance, 0., 1000.}]. However, they encounter issues when trying to use the dynamic result in subsequent calculations, such as solution2 = solution * 2. The user seeks clarification on how to properly define and utilize dynamic variables in Mathematica.

PREREQUISITES
  • Familiarity with Mathematica 7 syntax and functions
  • Understanding of dynamic interactivity in Mathematica
  • Knowledge of trigonometric functions, specifically cosine
  • Basic experience with the Manipulate function in Mathematica
NEXT STEPS
  • Explore the use of DynamicModule in Mathematica for encapsulating dynamic variables
  • Learn about the Manipulate function's advanced features and options
  • Investigate the use of Dynamic in defining and updating variables
  • Study examples of nested dynamic expressions in Mathematica
USEFUL FOR

Mathematica users, educators, and students looking to enhance their understanding of dynamic interactivity and trigonometric applications in computational environments.

button_ger
Messages
10
Reaction score
0
hey.

How can I realize a dynamic solution?

The first variable slider should be simply d and the second a Cos [x degrees]?


Slider[Dynamic[angle], {0., 90.} Degree]
Slider[Dynamic[distance], {0, 1000.}]
Dynamic[distance]/ Cos[Dynamic[angle] ]

... does not work.
The solution will give
830. Sec[1.428] for example.

How can I solve the problem?
 
Physics news on Phys.org
Dynamic[distance/Cos[angle]]

or

Manipulate[distance/Cos[angle], {angle, 0., 90.}, {distance, 0., 1000.}]
 
Great. This solved my problem. Thanks a lot.

But now I have an analogical problem.
When I use "solution = Dynamic[distance/Cos[angle]]" I cannot use solution in the next line dynamicaly like

solution2 = solution * 2

How can I do this?
 
Dynamic[solution=distance/Cos[angle]]

I wish I could give you an explanation why, but I honestly don't understand the details of Dynamic.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 5 ·
Replies
5
Views
8K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
10K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 4 ·
Replies
4
Views
5K
Replies
7
Views
2K