Plot2d Issue



> deltaX(a,b,c,dA):= (a / dA^2) + (b / dA) + c;
> 
> 
> plot2d( [deltaX(C[1],C[2],C[3],Astep),
>          [discrete,[
>                     [dA_1,dX_1],[dA_2,dX_2],[dA_3,dX_3],
>                     [dA_4,dX_4],[dA_5,dX_5],[dA_6,dX_6]
>                    ]
>          ]
>         ],[Astep,dA_1,dA_6],
>         [gnuplot_curve_styles,["with lines", "with points"]]
>       );
> 


Hello Richard,

for better readability I stored the discrete data first:

(%i17) xy: [[dA_1,dX_1],[dA_2,dX_2],[dA_3,dX_3],
                    [dA_4,dX_4],[dA_5,dX_5],[dA_6,dX_6]];
(%o17) [[0.01, 0.2], [0.02, 0.1667], [0.03, 0.1428], [0.05, 0.0714], 
                                                [0.1, 0.02778], [0.2, 0.01515]]

The problem here is, that if you use the range [AStep,dA_1,dA_6] 
the plot2d command expects a function of one variable named AStep.

This is not the case. Two ways out:

1. possibility:
Create a function which has AStep as the only variable:

(%i18) deltaX_Astep(Astep):= deltaX(C[1],C[2],C[3],Astep);
(%o18)         deltaX_Astep(Astep) := deltaX(C , C , C , Astep)
                                              1   2   3
(%i19) plot2d( [[discrete,xy], deltaX_AStep(AStep)],
               [AStep,dA_1,dA_6],
               [gnuplot_curve_styles,["with lines", "with points"]] );
(%o19) 

2. possibility:
Use a lambda expression:

(%i20) plot2d( [[discrete,xy], lambda([AStep], deltaX(C[1],C[2],C[3],AStep))],
               [AStep,dA_1,dA_6],
               [gnuplot_curve_styles,["with lines", "with points"]] );


Both ways work. 

Also you can use the draw package for nice graphics.

HTH

Volker van Nek


Am 11 Nov 2008 um 13:33 hat Richard C. Wagner geschrieben:

> Rich, Volker:
> 
> Thanks so much for your replies.  I've downloaded and installed the latest 
> version of Maxima on my computer.  Unfortunately, I'm still getting the same 
> error message.  The file I'm using is short, so I've included it here. 
> Would you mind trying it and letting me know what you find?
> 
> Thanks,
> 
> Rich Wagner
> Aerospace Engineer
> Radical Novelties
> Montrose, CO, USA
> 
> 
> /* ==================================================================
>    File: STEP AREA MESH SIZING.MAC
> 
>    This file finds an inverse-parabolic curve to fit the dA-dX
>    data generated in our area step tests.
> 
> =====================================================================
> 
>    If we assume an equation of the form:
> 
>    dX = (a/dA^2) + (b/dA) + c
> 
>    We want this equation to pass through three points, (dA1,dX1),
>    (dA2,dX2) and (dA3,dX3).  So,
> 
>    dX1 = (a/dA1^2) + (b/dA1) + c
>    dX2 = (a/dA2^2) + (b/dA2) + c
>    dX3 = (a/dA3^2) + (b/dA3) + c
> 
>    We can write this in matrix form as:
> 
>    [dX] = [dA][C]
> 
>    And we can solve for the coefficient matrix, [C] by,
> 
>    [dA]^-1 [dX] = [C]
> 
> ================================================================== */
> 
> dA_1: 0.01;
> dA_2: 0.02;
> dA_3: 0.03;
> dA_4: 0.05;
> dA_5: 0.1;
> dA_6: 0.2;
> 
> dX_1: 0.2;
> dX_2: 0.1667;
> dX_3: 0.1428;
> dX_4: 0.0714;
> dX_5: 0.02778;
> dX_6: 0.01515;
> 
> P: matrix( [(1 / dA_1^2), (1 / dA_1), 1],
>            [(1 / dA_4^2), (1 / dA_4), 1],
>            [(1 / dA_6^2), (1 / dA_6), 1] );
> 
> S: matrix( [dX_1],
>            [dX_4],
>            [dX_6] );
> 
> C: invert(P) . S;
> 
> 
> deltaX(a,b,c,dA):= (a / dA^2) + (b / dA) + c;
> 
> 
> plot2d( [deltaX(C[1],C[2],C[3],Astep),
>          [discrete,[
>                     [dA_1,dX_1],[dA_2,dX_2],[dA_3,dX_3],
>                     [dA_4,dX_4],[dA_5,dX_5],[dA_6,dX_6]
>                    ]
>          ]
>         ],[Astep,dA_1,dA_6],
>         [gnuplot_curve_styles,["with lines", "with points"]]
>       );
> 
> 
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima