ParaMagic Stuck in 'Solution in Progress'

Discussions about ParaMagic functionalities

Moderator: Moderators

ParaMagic Stuck in 'Solution in Progress'

Postby phathom.a.donald@lmco.com » Thu Jul 21, 2016 7:18 am

Hi,

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);
title('Availability')
xlabel('Theta')
ylabel('Power')

saveas(figure1, 'OrbitalPlot.png');
exit


---------------------

Code: Select all
function m = Average(list)

m = mean(list);

save('AverageOutput.txt','m','-ASCII')

exit
phathom.a.donald@lmco.com
Forum Beginner
Forum Beginner
 
Posts: 62
Posts Rating:1
Joined: Fri May 13, 2016 7:09 am

Re: ParaMagic Stuck in 'Solution in Progress'

Postby rose.yntema@intercax.com » Tue Jul 26, 2016 5:34 pm

Hi,

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!

Regards,
Rose Yntema
rose.yntema@intercax.com
Forum Newbie
Forum Newbie
 
Posts: 8
Posts Rating:1
Joined: Tue Mar 17, 2015 12:13 pm

Re: ParaMagic Stuck in 'Solution in Progress'

Postby phathom.a.donald@lmco.com » 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!
phathom.a.donald@lmco.com
Forum Beginner
Forum Beginner
 
Posts: 62
Posts Rating:1
Joined: Fri May 13, 2016 7:09 am


Return to ParaMagic

Who is online

Users browsing this forum: No registered users and 0 guests

cron