Is it possible to call a Mathematica function from a SystemModeler component?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
7
down vote

favorite












Is it possible to call Mathematica 11.3 functions from a SystemModeler 5.1 component?



I see that Mathematica can run a SystemModeler simulation. Are there any examples of this?



It would be very useful to be able to create custom SystemModeler blocks that call Mathematica functions.



It appears that the Mathematica may make calls the SystemModeler. Can SystemModeler call Mathematica?










share|improve this question























  • You can at least write numerical functions in Mathematica and compile them down to C. Thus you can use Mathematica to write exogenous functions for Modelica models.
    – gwr
    7 mins ago














up vote
7
down vote

favorite












Is it possible to call Mathematica 11.3 functions from a SystemModeler 5.1 component?



I see that Mathematica can run a SystemModeler simulation. Are there any examples of this?



It would be very useful to be able to create custom SystemModeler blocks that call Mathematica functions.



It appears that the Mathematica may make calls the SystemModeler. Can SystemModeler call Mathematica?










share|improve this question























  • You can at least write numerical functions in Mathematica and compile them down to C. Thus you can use Mathematica to write exogenous functions for Modelica models.
    – gwr
    7 mins ago












up vote
7
down vote

favorite









up vote
7
down vote

favorite











Is it possible to call Mathematica 11.3 functions from a SystemModeler 5.1 component?



I see that Mathematica can run a SystemModeler simulation. Are there any examples of this?



It would be very useful to be able to create custom SystemModeler blocks that call Mathematica functions.



It appears that the Mathematica may make calls the SystemModeler. Can SystemModeler call Mathematica?










share|improve this question















Is it possible to call Mathematica 11.3 functions from a SystemModeler 5.1 component?



I see that Mathematica can run a SystemModeler simulation. Are there any examples of this?



It would be very useful to be able to create custom SystemModeler blocks that call Mathematica functions.



It appears that the Mathematica may make calls the SystemModeler. Can SystemModeler call Mathematica?







system-modeler






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 8 hours ago

























asked 8 hours ago









Doug Kimzey

819515




819515











  • You can at least write numerical functions in Mathematica and compile them down to C. Thus you can use Mathematica to write exogenous functions for Modelica models.
    – gwr
    7 mins ago
















  • You can at least write numerical functions in Mathematica and compile them down to C. Thus you can use Mathematica to write exogenous functions for Modelica models.
    – gwr
    7 mins ago















You can at least write numerical functions in Mathematica and compile them down to C. Thus you can use Mathematica to write exogenous functions for Modelica models.
– gwr
7 mins ago




You can at least write numerical functions in Mathematica and compile them down to C. Thus you can use Mathematica to write exogenous functions for Modelica models.
– gwr
7 mins ago










1 Answer
1






active

oldest

votes

















up vote
5
down vote













It is not in general possible (at this point) to call WL functions from SystemModeler components.



I (as a member of the SystemModeler development team) agree that it would be a great feature to have.



What you can currently do is use functions that are simple enough to be converted to Modelica (the language used by SystemModeler models) in CreateSystemModel:



model = CreateSystemModel[Unevaluated[Function[#1 + Sin[#2]]][1, 
u[t]] == u'[t], t]


The Scope section of the CreateSystemModel reference page has an overview of what is currently supported.






share|improve this answer




















  • We are talking calls to Mma functions before compilation of a model though, aren‘t we? Wouldn‘t these functions have to be embedded (thus in C) in the compiled model?
    – gwr
    2 mins ago










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182673%2fis-it-possible-to-call-a-mathematica-function-from-a-systemmodeler-component%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
5
down vote













It is not in general possible (at this point) to call WL functions from SystemModeler components.



I (as a member of the SystemModeler development team) agree that it would be a great feature to have.



What you can currently do is use functions that are simple enough to be converted to Modelica (the language used by SystemModeler models) in CreateSystemModel:



model = CreateSystemModel[Unevaluated[Function[#1 + Sin[#2]]][1, 
u[t]] == u'[t], t]


The Scope section of the CreateSystemModel reference page has an overview of what is currently supported.






share|improve this answer




















  • We are talking calls to Mma functions before compilation of a model though, aren‘t we? Wouldn‘t these functions have to be embedded (thus in C) in the compiled model?
    – gwr
    2 mins ago














up vote
5
down vote













It is not in general possible (at this point) to call WL functions from SystemModeler components.



I (as a member of the SystemModeler development team) agree that it would be a great feature to have.



What you can currently do is use functions that are simple enough to be converted to Modelica (the language used by SystemModeler models) in CreateSystemModel:



model = CreateSystemModel[Unevaluated[Function[#1 + Sin[#2]]][1, 
u[t]] == u'[t], t]


The Scope section of the CreateSystemModel reference page has an overview of what is currently supported.






share|improve this answer




















  • We are talking calls to Mma functions before compilation of a model though, aren‘t we? Wouldn‘t these functions have to be embedded (thus in C) in the compiled model?
    – gwr
    2 mins ago












up vote
5
down vote










up vote
5
down vote









It is not in general possible (at this point) to call WL functions from SystemModeler components.



I (as a member of the SystemModeler development team) agree that it would be a great feature to have.



What you can currently do is use functions that are simple enough to be converted to Modelica (the language used by SystemModeler models) in CreateSystemModel:



model = CreateSystemModel[Unevaluated[Function[#1 + Sin[#2]]][1, 
u[t]] == u'[t], t]


The Scope section of the CreateSystemModel reference page has an overview of what is currently supported.






share|improve this answer












It is not in general possible (at this point) to call WL functions from SystemModeler components.



I (as a member of the SystemModeler development team) agree that it would be a great feature to have.



What you can currently do is use functions that are simple enough to be converted to Modelica (the language used by SystemModeler models) in CreateSystemModel:



model = CreateSystemModel[Unevaluated[Function[#1 + Sin[#2]]][1, 
u[t]] == u'[t], t]


The Scope section of the CreateSystemModel reference page has an overview of what is currently supported.







share|improve this answer












share|improve this answer



share|improve this answer










answered 42 mins ago









Malte Lenz

2,0831118




2,0831118











  • We are talking calls to Mma functions before compilation of a model though, aren‘t we? Wouldn‘t these functions have to be embedded (thus in C) in the compiled model?
    – gwr
    2 mins ago
















  • We are talking calls to Mma functions before compilation of a model though, aren‘t we? Wouldn‘t these functions have to be embedded (thus in C) in the compiled model?
    – gwr
    2 mins ago















We are talking calls to Mma functions before compilation of a model though, aren‘t we? Wouldn‘t these functions have to be embedded (thus in C) in the compiled model?
– gwr
2 mins ago




We are talking calls to Mma functions before compilation of a model though, aren‘t we? Wouldn‘t these functions have to be embedded (thus in C) in the compiled model?
– gwr
2 mins ago

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182673%2fis-it-possible-to-call-a-mathematica-function-from-a-systemmodeler-component%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

List of Gilmore Girls characters

Confectionery