Mathematica Dynamic Solution for Variable Slider in Mathematica 7 with Cosine Function

  • Thread starter Thread starter button_ger
  • Start date Start date
  • Tags Tags
    Mathematica
AI Thread Summary
To create a dynamic solution using sliders for distance and angle, the initial approach of using Dynamic with distance and Cos[angle] was unsuccessful, resulting in incorrect outputs. The correct implementation involves using Manipulate to dynamically adjust the distance and angle, which successfully resolves the initial problem. However, a new issue arises when attempting to use the dynamic solution in further calculations, such as multiplying it by 2. The challenge is to maintain the dynamic nature of the solution when assigning it to a new variable. The discussion highlights the need for a better understanding of how Dynamic works in this context to achieve the desired functionality.
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
Views
2K
Replies
5
Views
8K
Replies
2
Views
3K
Replies
3
Views
10K
Replies
2
Views
3K
Replies
1
Views
5K
Replies
4
Views
5K
Back
Top