 How to initialize an array of objects? Options Roland May 6 2009, 10:02 AM Post #1 Advanced Member   Group: Members Posts: 30 Joined: 2-January 08 Member No.: 5,272 Hello Daniel,QUOTE(daniel@ka @ Apr 12 2009, 08:42 PM) second_order so(start ((start y0 = i) for i in 1:10)); // (*)I guess, a solution for you would be:CODEsecond_order so(y0(start = {i for i in 1:10}));I hope this works for you.Roland   daniel@ka Apr 12 2009, 07:42 PM Post #2 Member  Group: Members Posts: 23 Joined: 3-June 08 Member No.: 11,399 To make the long story short here is my codepackage math model second_order parameter Real y0 = 1; parameter Real ydot0 = 1; Real x; Real y(start = y0); Real ydot(start = ydot0); equation ydot = der(y); der(ydot) + der(y) + y = x; x = if time < 5 then time else 10-time; end second_order; model test second_order so; //second_order so(each y0 = 1); second_order so(start ((start y0 = i) for i in 1:10)); // (*) end test; end math;I want to perform kind of a sweep over y0, therefor I need somehow topass i value into y0, but I am not sure there is some syntax for this.Is it possible?Thx, danielps: Line marked with (*) is not correct, but shows what my intention is.   2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members: Lo-Fi Version Time is now: 16th July 2019 - 11:19 AM