-
Notifications
You must be signed in to change notification settings - Fork 4
support for parameter vectors in Model #4
Comments
It would have been better if you would have provided a complete example illustrating the problem. I successfully tested the following model in my development version:
So I might have misunderstood you. BTW, why do you want to use: It should be possible to use parameter arrays and also change them in the simulate! call without redoing the symbolic transformation (under development, coming to main soon). |
So I created a minimal but complete demonstration:
I marked the relevant bits I was talking about using comments. |
I suppose yo meant: model.p is the root of the parameters. We are supporting changing (merging) parameters in the simulate! call . |
You are right about your first remark (where I mixed up
Furthermore, Also, line
I'm appending a more relevant demonstration below:
|
You are right. I recently changed how parameters are passed. I tested in the branch "development". We want to make some more updates before merging to main. You might want to use development branch in the mean time. Support for indexing was added in ModiaBase 11 days ago, so you might want to update. Note that all TinyModia models can not be simulated directly with DifferentialEquations. The simulate! function of TinyModia is needed. Note that the workflow you indicated is now supported by an additional parameter |
I created a Model that starts like this:
Now in the
equations
section, I cannot access elements of parametersI_w
usingI_w[ind...]
. A tested workaround I found is to usegetindex(I_w, ind...)
instead. However, neither doesI_w
show up in fieldparametersAndConstantVariables
of the instantiated model, nor can I spot its contents in the fieldp
.However I would like to alter
p
after model instantiation (machine learning purposes).Is there any supported and intended way to use and alter parameters in arrays?
The text was updated successfully, but these errors were encountered: