hi,
For my learning of system modeler i try to do again all examples of system-modeler-getting-started (and translate in french).
But I can not re model chirp and chirpsignal in introductory examples.
when i try to validate class i can see this messages:
Error: No matching function found for Chirp in component
Error: Class Chirp not found in scope ChirpSignal.
Error: Error occured while flattening model ChirpSignal
Check of ChirpSignal failed
and i don’t understand why, does someone can help me?
If you are trying to re-implement the ChirpSignal example you need to copy the Chirp function (in IntroductoryExamples.ExternalFunctions) too. If you look at the ChirpSignal model in text view you will see that the equation references the Chirp function:
block ChirpSignal "A block of an external chirp signal"
parameter Modelica.SIunits.AngularVelocity w_start = 0 "Angular velocity at start time";
parameter Modelica.SIunits.AngularVelocity w_end = 10 "Angular velocity at end time";
parameter Real A = 1 "amplitude of signal";
parameter Real M = 10 "time period for signal";
Modelica.Blocks.Interfaces.RealOutput u annotation(Placement(visible = true, transformation(origin = {140.0, -0.0}, extent = {{-10.0, -10.0}, {10.0, 10.0}}, rotation = 0), iconTransformation(origin = {107.5, 0.0}, extent = {{-7.5, -7.5}, {7.5, 7.5}}, rotation = 0)));
equation
u = IntroductoryExamples.ExternalFunctions.Chirp(w_start, w_end, A, M, time);
end ChirpSignal;
The simplest way would be to copy the entire package and then do your changes there. Please note that you need to update the referenced classes in the text view manually (e.g. changing IntroductoryExamples.ExternalFunctions.Chirp to YourNewPackageName.ExternalFunctions.Chirp).
Also, to get the model running properly you need to copy the Chirp.c file from the IntroductoryExamples folder to the folder where you save your new model or package, so that the WSM Kernel can find it.
Browse to ExternalFunctions package in IntroductoryExamples, right click and select duplicate. This will create a copy on top level of this class. Edit the ChirpSignal model in the top level ExternalFunctions package, changing the function call from IntroductoryExamples.ExternalFunctions.Chirp(…) to ExternalFunctions.Chirp(…). Save the ExternalFunctions package in a folder. Copy the Chirp.c file from the folder where IntroductoryExamples is stored (typically C:\Program Files (x86)\Wolfram Research\SystemModeler 4.0\Libraries\IntroductoryExamples 4.0 on Windows). Create a testmodel, save it in the same folder (this is currently needed to find the Chirp.c file, and may be the reason it failed for you. This is something that will be improved in the future). Now it should work.
Actually if i do as you advocate, the model work.
But if I build the model from the beginning, the same messages appears.
my goal is to “create” from the beginning modeling.
since your last post I tried several method but to no avail ..
is it possible to send you my template so your looking at?