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

Discussion Overview

The discussion revolves around implementing a dynamic solution in Mathematica 7 using sliders for a cosine function. Participants explore how to set up dynamic variables for angle and distance, and how to manipulate these variables effectively within the software.

Discussion Character

  • Exploratory, Technical explanation, Homework-related

Main Points Raised

  • One participant asks how to create a dynamic solution using sliders for a variable distance and angle, specifically mentioning issues with the expression yielding unexpected results.
  • Another participant suggests using the Dynamic function directly with the distance and angle variables, proposing alternatives such as Manipulate to achieve the desired outcome.
  • A later reply confirms that the suggested solution resolves the initial problem but introduces a new issue regarding the use of a dynamic variable in subsequent calculations.
  • Another participant proposes a method to define the dynamic solution but expresses uncertainty about the underlying mechanics of the Dynamic function.

Areas of Agreement / Disagreement

Participants generally agree on the approach to create dynamic solutions, but there is an unresolved issue regarding the use of dynamic variables in further calculations.

Contextual Notes

Limitations include potential misunderstandings of the Dynamic function's behavior and the specific requirements for using dynamic variables in Mathematica.

Who May Find This Useful

Users of Mathematica interested in dynamic programming, particularly those working with graphical user interfaces and variable manipulation in mathematical contexts.

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