Page 1 of 1

ParaMagic Stuck in 'Solution in Progress'

PostPosted: Thu Jul 21, 2016 7:18 am

I redid the Orbital tutorial to use MATLAB instead of Mathematica to solve for c, the effective budgets, and the average windows (see the code below). The functions work, but ParaMagic will not write the values back to the SysML model, it just stays stuck in 'Solution in Progress'. Though the plotOrbital function is called successfully, as indicated by the creation of the plot image, the value of 'c' is not written back into the SysML model. Also, 'AverageOutput.txt' doesn't get created either. Can anyone help? Thanks.

Code: Select all
function c = plotOrbital(theta,powerUsage,xmitUsage)

figure1 = figure; %Create new figure window
axes1 = axes('Parent',figure1); %Create the axes in the figure specified by parent
hold(axes1,'all'); %Retains plots in current axes so new plots don't delete existing plots

c = plot(theta,powerUsage,theta,xmitUsage);

saveas(figure1, 'OrbitalPlot.png');


Code: Select all
function m = Average(list)

m = mean(list);



Re: ParaMagic Stuck in 'Solution in Progress'

PostPosted: Tue Jul 26, 2016 5:34 pm

I apologize for the late reply, but at this time the ParaMagic - MATLAB Connection has a limitation that all outputs must be written to a file named 'output.txt' as described in the User Guide Section 8.3.2 (Using MATLAB functions) on page 83. So for the Average function you'll just need to change the name of the output file in the save command.

On the other hand, for the plotOrbital function you will need to include a similar line to write some output, as each parametric constraint must have exactly one output. For the Mathematica implementation in the tutorial, this was a simple flag (0 or 1) to indicate whether a plot was successfully written or not. You'll need to get some kind of output that you can write to the ASCII file without errors for ParaMagic to work.

I know it seems counter-intuitive to write an 'output.txt' file for two different functions, but ParaMagic just runs each functions one at a time in a causal fashion, and requires a value from output.txt to move on.

Let me know if you need any more help in this exercise, it's a very interesting one!

Rose Yntema

Re: ParaMagic Stuck in 'Solution in Progress'

PostPosted: Thu Aug 18, 2016 1:44 pm
Hi Rose,

After finally getting ParaMagic to work again, I was able to try it again, this time naming the output file "output.txt", and it worked! Thanks a lot!