wswain

235 Reputation

7 Badges

13 years, 143 days

MaplePrimes Activity


These are questions asked by wswain

Does anyone use a windows 10 code editor like, emacs, vim, or other with good textual layout, error and type checking? for building procedure files (libraries)?

 

I am using Maple2019.   I have been using a code region started in a worksheet and then exported to mpl file.   Not sure if I have really seen a debugger with breakpoints, step-in/step-out, type checking?   Am I just not looking in the right area?

 

Best practices from programmers of maple procedures appreciated.

Bill

 

Hello all,   Hope everyone is safe

Does anyone know why a vector of floats as the variable for SignalPlot returnes the error:

Error:  (in SignalProcessing:-SignalPlot) unable to store  ' " " ' when datatype = float[8] 

Accel3  is vector variable reporting back as  "57850 element Vector[column]"

 SampleRate:=50000.0

When called by SignalPlot?   

SignalPlot(Accel3, samplerate = SampleRate)

I have successfully used SignalPlot without a problem before.

Regards,

Bill

Does anyone use MTM toobox and why?

 

I discovered this through the eig help search and found the MATLAB format of [V, D] = eig(Matrix) for eigenvectors and eigenvalues as a single function call with output a nice shortcut vs two calls to LinearAlgebra[Eigenvalues], LinearAlegebra[Eigenvectors]

 

But, is the overhead and overmapping of standard maple functions worth it?   I find very little descriptions about the Maple Toolbox, specifically the MTM package.

has anyone tried to use Peter Fritzone's book with maplesim helloworld modelica??

 

The simple approach from Peter (creating a custom modelica component) is to getting started by running a simple simulation where x_dot(t) = - a*x,  where the normal form is x(t) = x^-a for logarithmic type decay.

plot of x(t) should be a decay curve.  

 

Maple Code

A:-LinkModel = fine, connects

 

SimData := A:-Simulate(outputs = x, returntype = datapoints, tf = 2);

Error, invalid input: Simulate expects value for keyword parameter [outputs, output] to be of type {list(algebraic), list(anyfunc(identical(t)))}, but received x
 

***********

Simcode

 

Model Main;

Imports

public HelloWorld HelloWorld1 annotation(Placement(transformation(origin={100.0,200.0},extent={{-20.0,-20.0},{20.0,20.0}},rotation=0)));
    annotation(
            Diagram(coordinateSystem(preserveAspectRatio=true, extent={{0,0},{200.0,200.0}}),graphics),
            Icon(coordinateSystem(preserveAspectRatio=true, extent={{0,0},{200.0,200.0}}),graphics={Rectangle(extent={{0,0},{200.0,200.0}}, lineColor={0,0,0})}),
            uses(Modelica(version="3.2.3")),
            experiment(
              StartTime = 0,
              StopTime = 2.0,
              __Maplesoft_solver = "ck45",
              __Maplesoft_adaptive = true,
              Tolerance = 0.1e-4,
              __Maplesoft_tolerance_abs = 0.1e-4,
              __Maplesoft_step_size = 0.1e-2,
              __Maplesoft_min_step_size = 0,
              __Maplesoft_max_step_size = 0,
              __Maplesoft_plot_points = 2000,
              __Maplesoft_numeric_jacobian = false,
              __Maplesoft_constraint_iterations = 50,
              __Maplesoft_event_iterations = 100,
              __Maplesoft_algebraic_error_control = false,
              __Maplesoft_algebraic_error_relaxation_factor = 1,
              __Maplesoft_rate_hysteresis = 0.1e-9,
              __Maplesoft_reduce_events = false,
              __Maplesoft_integration_diagnostics = false,
              __Maplesoft_compiler = true,
              __Maplesoft_compiler_optimize = true,
              __Maplesoft_scale_method = "none",
              __Maplesoft_plot_event_points = true
            )
    );

 

end Main;

class HelloWorld
    Real x (start =1);
    parameter Real a = 1;
equation
    der(x) = -a*x;
end HelloWorld;

Good Morning,

 

Can anyone help on an Excel linking problem (and in general DB, non-SQL data sets)  for data lookup.   

 

I have several static data sets stored in flat files like Excel (xls) format. 

 

I understand Maples connectivity via the import function to an array.  I also understand the export and use of Maple from within Excel vi the add-in..

 

When doing data lookups it is not convienet to import the entire database and is memory intensive for large data sets.  As such it is much more convienenit to open/attach like the old ODBC connectivity schemes.   The goal is to open/attach to the data file (xls), search a column and return other column's data as a subset for further analysis in maple.  An example would be a steel properties xls file.

My Maple worksheet is calculating the dynamic loads and stresses of an object.  With that answer of say stress, I want to link to my excel data file and search the Yield strength and return the material name and props for those grades of steel that have yield strength greater than 1.5 times my caclulated answer.

 

This can then be returned into a smaller array for further analysis using Maple with different properties of my retrieved subset.  The link would be closed after getting the subset.

 

I have read all the Maple document Excel help info and the excel add-in info which is the wrong direction.   I can easily code this search into a vlookup within excel - but completely defeats the purpose for using Maple in the first place.   Again, importing is not a method as these data sets are static and come from various sources like "AMS" which need to live outside maple.

 

I have looked into FileTools pakcage and old C type fopen, scanf, etc. without much luck on Maple implementation.   The fopen seems to be for text or csv data sets?   according to the documentation.  But, I'll keep looking while waiting any replies.

 

Any assistance very appreciated.

 

Bill

 

 

 

 

 

 

 

 

3 4 5 6 7 Page 5 of 7