0

I am solving two problems simultaneously in which the variable x is defined. To the left of the image, i'm solving shape functions and matrix operations. But to the right i'm solving Green's function.

Notice the 'x' variable values are being used from left notebook to the right notebook which yields wrong solution.

But even when I open a new notebook the variable is carried over and being used.To the left I'm doing shape function calculations, To the right I'm evaluating the Green's function

To this i've tried doing this

Format -> Option Inspector -> Cell Options -> Evaluation Options

There I changed "CellContext" from "Global" to "Notebook". But It is still using it as global variable.

How do I restrict the usage such that when I define a variable it is used within that notebook only?

  • Have you choosen "Selected notebook" drop-down item in the Options Inspector? – Alexey Popkov Nov 10 '19 at 01:45
  • Under the Evaluation menu, Kernel Configuration Options you can add kernels and then use a different one for each notebook under Notebook's kernel – Bill Watts Nov 10 '19 at 02:33
  • https://mathematica.stackexchange.com/q/22032/363 – Chris Degnen Nov 10 '19 at 09:50
  • You probably forgot to change the dropdown menu on top, titled 'Show option values', from 'Selection' to 'Selected Notebook' (as Alexey Popkov said) or 'Global Preferences'. Bill Watts' method is easier if you want to apply it to a specific notebook. Choose 'Global Preferences' if you want it to be the default setting. –  Nov 10 '19 at 11:39
  • 1
    The standard approach is from the menu: Evaluation/Notebook Default Context/Unique to this Notebook – Dominic Nov 10 '19 at 11:49

0 Answers0