Graphing expressions with local variables

Welcome to our Forums Technical Support Support Desk Graphing expressions with local variables

  • This topic has 4 replies, 2 voices, and was last updated 3 years ago by warrennn.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #6374
    warrennn
    Participant

      Hello,

      I am trying to graph a family of curves based upon a fairly simple analytical expression which contains a local variable which is different for each curve. Using the f(x) definition, I can create an expression with a global variable but I don’t know how to use local variables. One can use the boxes on the lower left to create an analytical expression with a local variable, but I haven’t discovered how to graph these functions. For some reason these boxes are called “global variables” but I don’t see the logic of that designation.

      I have been using Octave for of all my formulas and saving files using the -v4 tag. These files can be easily read by DataGraph. I am looking for a way which doesn’t require Octave for very simple functions. Any help appreciated.

      Thanks!

      #6394
      dgteam
      Moderator

        Hello!  There are two built-in local variables, the pen and point that are in the Style settings.  You can create local variables within an Expression variable to calculate a single value.  It sounds like that might be what you are doing.

        All the other single variables that you create at the bottom of the column list are global, in that they can be used in any place you could otherwise use a number, either in an Expression column, or in formatting.

        To drawn a functions you have two options (1) you can use a Function command to draw functions in the form y = f(x).  This is like a built-in graphing calculator, and you can use global variables in these expressions.

        Here is a file that you can get from the on-line examples (search on bessel).  I modified this by adding one global variable and adding that to one of the Function commands to illustrate.

        Bessel

        The second option (2)  – You can also generate a list of x values in one expression column and then use those (along with variables as needed) to calculate your y values in a second expression column.

        Does that help?

        #6397
        warrennn
        Participant

          Yes, it does, though I couldn’t find the example that you mentioned after searching for Bessel. The second way is interesting – I assume one uses indexed values, so if the column is labelled t, one would use t(1), t(2) for the variables?

          #6398
          dgteam
          Moderator

            For using the values for t – DataGraph does allow you to specify row numbers as you described (t(1), …), but if you enter an equation with just “t” the current row number is assumed.  Then your expressions stay looking nice and clean 🙂

            We just added a new example (will be at the top of the list) that generates this graph.  This is using the Expression column to generate these cases.

            Functions

             

            For the Bessel example, see the search bar below in the example files.

            Bessel

            #6399
            warrennn
            Participant

              Thank you for your help. For some reason, this procedure seems extremely complicated and unintuitive to me. For one, I couldn’t find the formula being plotted.

              For things like this, I will stick with Octave, which has a very powerful  and straightforward programing language, and send the data to DataGraph to be plotted.

              So far, I have been able to plot simple functions in DG using the function command. Anything more complicated will use Octave, which is extremely powerful and intuitive.

            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.

            Welcome to our Forums Technical Support Support Desk Graphing expressions with local variables