Skip to main content
1-Visitor
November 27, 2020
Solved

Plotting / Calculating probability distributions

  • November 27, 2020
  • 2 replies
  • 3523 views
Hi,
Iร‚ยดm currently using MathCad_Prime6.0 trial version as I need to edit some of my old scipts calculating statistic methods from my former studies. So I use those scripts as I set them up 5 months ago, calculating probability distributions and convolutions of them.
Trying to plot them in a diagram, identically according to e.g. >>https://support.ptc.com/help/mathcad/r6.0/de/PTC_Mathcad_Help/example_prob_dens_and_cum_prob_dist.html#<<, plotting does not work graphically (there is only a single point in the plot depending on the diagram type, for instance), nor is an error message displayed. When changing the diagram type, the scaling, the variables or the functions nothing happens either. So is this connected to the trial version licence or am I missing something else? Unfortunately I cannot add a screenshot, but its excactly the typing of the example shown in the link. Maybe you can give me a short support. Thanks a lot in advance! Marco
    Best answer by LucMeekes

    You're using the dnorm() function, which PTC marks as a 'premium function'. This means it is not available in Prime express (the free edition of Prime).

    If you've set this up more than a month ago, shortly after you started using the trial version, then you've now run out of the 30-day period where the trial will give you access to all functionality of Prime.

    But don't despair. The dnorm() function can fairly easily be built, and is available through:

    https://community.ptc.com/t5/PTC-Mathcad/Prime-Express-A-joke/m-p/604216#M185378

     

    Success!
    Luc

     

    PS. I see that in your 'convolution', the definition of fA_1, you multiply fB_1(x) with an integral.

    The result of that integral is NOT a function of x.

    So when calculating PA_1, where you essentially integrate fA_1 over the range 0 to tau.max, you might as well put the integral involving fF(x) out of that integral. See:

    LucMeekes_0-1606492194685.png

    I suspect that is not what you intended to do, so i suggest you review your convolution formula...

     

     

     

    2 replies

    23-Emerald IV
    November 27, 2020

    It's generally not necessary to attach a screenshot, even though that should be simple to do.

    More important is that you attach your Prime worksheet.

    That'll surely help to solve your problem.

     

    Success!
    Luc

    25-Diamond I
    November 27, 2020

    I can only agree with Luc and strongly recommend that you attach the worksheet.

     

    As you just see one point, chances are that you have assigned a value to variable x somewhere above the plot. That way x can't be used for a quickplot.

    Solutions would be to either

    1) redefine x as a range (above the plot), like x:=-4,-3.99 .. 6

    or

    2) Use a different variable name for plotting, like xx. Note that you have to change every x in the plot for xx if you chose this option.

    or

    3) Write clear(x) somewhere above the plot in case you no longer need the value of the variable x that you assigned earlier.

     

     

    1-Visitor
    November 27, 2020

    Many thanks for the quick response LucMeekes and Werner!

    Please find attached the worksheet.

     

    This is basically the function fA_1 which does not plot. I once scriptted it working, but currently there are no error messages, like complex numbers or NaNs for instance - and Iยดm wondering if this contains any trail-version-blocked funtion ๐Ÿ˜•

     

    Many thanks for the help, I appreciate it!

    LucMeekes23-Emerald IVAnswer
    23-Emerald IV
    November 27, 2020

    You're using the dnorm() function, which PTC marks as a 'premium function'. This means it is not available in Prime express (the free edition of Prime).

    If you've set this up more than a month ago, shortly after you started using the trial version, then you've now run out of the 30-day period where the trial will give you access to all functionality of Prime.

    But don't despair. The dnorm() function can fairly easily be built, and is available through:

    https://community.ptc.com/t5/PTC-Mathcad/Prime-Express-A-joke/m-p/604216#M185378

     

    Success!
    Luc

     

    PS. I see that in your 'convolution', the definition of fA_1, you multiply fB_1(x) with an integral.

    The result of that integral is NOT a function of x.

    So when calculating PA_1, where you essentially integrate fA_1 over the range 0 to tau.max, you might as well put the integral involving fF(x) out of that integral. See:

    LucMeekes_0-1606492194685.png

    I suspect that is not what you intended to do, so i suggest you review your convolution formula...