Simulations across multiple sheets not calculated correctly

22 views
Skip to first unread message

Mark Neal

unread,
Oct 30, 2014, 9:39:29 PM10/30/14
to yasai-si...@googlegroups.com
I have a very simple model over two sheets.

I have an output (Simoutput) on each sheet, and a input variable (GenNormal) on each sheet.

If I do a manual recalcualtion (ie f9), both input variables work as expected to produce changes in the "Profit"

Unfortunately the YASAI simulation only calculates results (profit) for the simoutput and distribution on the worksheet that is active when you press simulate (ie only half the models inputs are monte carlo sampled).

Could this be fixed by sticking a recalculate command in the Visual Basic code? Where??

(Obviously this example could be fixed by shifting it all to one sheet. I have other legacy spreadsheets to "retrofit" with monte carlo where this would be inconvenient)

Cheers,

Monte Carlo Example.xlsx

Jonathan Eckstein

unread,
Oct 31, 2014, 8:05:30 AM10/31/14
to yasai-si...@googlegroups.com
Hello,

We often have situations in which students would keep multiple exercises
in the same homework assignment in the same file, one per sheet.
Computing the entire workbook in a single simulation causes havoc in
this situation, hence we default to only looking at the active sheet.
We should probably add a checkbox option for looking at the whole workbook.

There are two quick solutions I can think of:

1. Use YASAIw, which recomputes the whole workbook

2. Enter the Visual Basic editor (after activating the the "Developer"
tab, if necessary), and go to the modYASAI module under "Modules" in the
YASAI_Param project. In the "Simulate" routine, replace the line
"simWorksheet.Calculate" with "Application.Calculate". I have not
tested this, but I believe it should have the desired effect.

Prof. Eckstein
> --
> You received this message because you are subscribed to the Google
> Groups "yasai-simulation" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to yasai-simulati...@googlegroups.com
> <mailto:yasai-simulati...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Mark Neal

unread,
Nov 2, 2014, 3:26:31 PM11/2/14
to yasai-si...@googlegroups.com

Thanks Prof, Option 2 working nicely. 

re: Option 1, YASAIw, links seem to be down (ie unable to download).

Cheers,


Jonathan Eckstein

unread,
Nov 2, 2014, 4:28:48 PM11/2/14
to yasai-si...@googlegroups.com
Glad to hear it. It's on my list for options to add.

Prof. Eckstein
> > an email to yasai-simulati...@googlegroups.com <javascript:>
> > <mailto:yasai-simulati...@googlegroups.com
> <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "yasai-simulation" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to yasai-simulati...@googlegroups.com
> <mailto:yasai-simulati...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages