Question: has anyone tried to use Peter Fritzone's book with maplesim

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;

Please Wait...