﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4748	OM will pass values from a multiple-output function to “parameters”	ali.shirazi@…	Adrian Pop	"Hello,

I have come across an issue in relation to calling a function with multiple outputs and assigning the outputs to multiple “parameters” – not variables. To demonstrate this, I made 3 test cases as below. In the first one (i.e. TestFuncMulti_1.mo), the variables n_req, n_ub and C_cap are defined as “variables”. This way using the following command line (in the “equation section”) I can call the function C_V() and get the outputs and pass them to the above variables.  
{{{
(n_req, n_ub, C_cap) = C_V(V_req);
}}}

So far so good! However, what I really want is to declare n_req, n_ub and  C_cap as parameters not variables. This way their values will not need to be calculated at every time-step. Apparently, the above command line will not work when the above terms are defined as parameters. I have shown this in the second test case i.e. TestFuncMulti_2.mo.

I found a workaround though by defining a vector of size 3 as the output of the function, and used the following lines to pass its value to  n_req, n_ub, C_cap parameters as shown in TestFuncMulti_3.mo:
{{{
parameter Real outs[3] = C_V(V_req);

parameter Integer n_req = integer(outs[1]);
parameter Integer n_ub = integer(outs[2]);
parameter Real C_cap = outs[3];
}}}
Surely, this is not the best workaround for this issue. Hence, I wanted to know if there is a proper way to do it for parameters like what I have shown in the first test case for variables??

Thanks,
Ali Shirazi"	defect	closed	high	1.13.0	Frontend	v1.13.0-dev-nightly	invalid		john.pye@…
