# Questions tagged [initialization]

Questions about the usages of the various initialization files used by Mathematica. The most common ones are the init.m files that can be found in some Mathematica system folders and in a few specific user folders.

91 questions
Filter by
Sorted by
Tagged with
47 views

### Solving system of coupled pdes with Neuman and Drichlet Bc

I am trying to solve a system of coupled PDEs. However, I have issues assigning initial and boundary values to the unknown field. I have checked and initial values satisfy the boundary conditions, and ...
173 views

### Regarding phase space diagram/trajectory

I have a 3D chaotic system and its one 3D phase-space portrait and three 2D phase-space portrait (x-y plane, y-z plane, z-x plane) are given below. ...
• 187
1 vote
137 views

### Nonlinear experimental data fit without initial parameters

I am trying to fit correlation data into a non-linear model but it is not working. My data plot looks like this: The equation I am using for fit is The Mathematica script i am using looks like: <...
• 11
29 views

### InitializationCellEvaluation does not work

I have a notebook with a single cell that I want to start running when I launch open the notebook. I have, formatted the cell as an initialization cell In the Options Inspector, Selected "...
1 vote
95 views

### In a Notebook, How can I set every cell to be an Initialization cell?

At present, I do this by manually setting every cell in a notebook to be Initialization cell. There must be a better way! When I finish work one day and re-open the notebook the next day, I want all ...
• 71
103 views

### differential wave equations [closed]

By seeking a solution of ∂u ∂t = c 2 ∂ 2u ∂x 2 in the form u(x,t) = X(x)T(t), obtain and solve ordinary differential equations satisfied by X(x) and T(t). Hence write down possible solutions for u(x,t)...
• 1
1 vote
86 views

### How to restore LightGray Background to initialization cells?

I am running Mathematica 13.2.1 on a new MacBook Pro M2 with Ventura 13.2.1. I have done something that causes any initialization cells that I create or view to no longer have a LightGray background. ...
1 vote
77 views

### In Manipulate animation I can't have ResetButton and Play buttons

I want to add a separate reset button to this code besides using the bookmark button (Ver:11.2). I've tried everything in "Reset" Button for Manipulate and elsewhere but ResetButton ...
1 vote
36 views

### Hold around SetDelayed with Graphics [duplicate]

Minimum Working Example I've defined my own plot function, which does a lot of stuff to the inputs before passing it into the Graphics function. Because of that, I'...
371 views

### First initialization taking way too long

Pretty much everyday when I first bring up Mathematica, it takes a very long time. Subsequently, if I close it down and reopen, it is very quick. This is on my home computer (version 13.2), but the ...
• 1,225
27 views

### Can I generated an initialization cell using CellPrint?

I want to do exactly what is done in this post, except I would like the generated cell to be an initialization cell. That is, I'd like to have my code automatically generate an input cell with new ...
• 980
1 vote
44 views

### What is the syntax for adding code, e.g. LinkWrite[...] to init.m? Version 12.0

I'm trying to use the suggestions for adding menu items discussed here: https://mathematica.stackexchange.com/a/909/44139 When I add ... ...
• 1,557
1k views

My init.m Feels Like it's Missing Something Although I am familiar with about a dozen or so programming languages I am only sort of, kind of, halfway competent in about three. MMA with it's boxes, ...
176 views

### How can the format of Initialization Cells be set to the format of normal input cells?

I don't like how initialization (or "Code") cells are formatted in notebooks, namely the grey background color and the spacing/wrapping settings. I want ...
• 483
183 views

### Initialization cells not evaluating?

I think I'm experiencing a bug, but perhaps there is a simple explanation and fix. I have many initialization cells in my notebook (a few hundred). As of quite recently, they stopped all evaluating ...
• 980
28 views

### SetOptions error message upon launching Mathematica v.12

When launching Mathematica v.12, before opining any notebook, I get the following message: It does not afffect the execution of my notebooks, but it is annoying and I would like to understand how to ...
58 views

### How to programmatically save tagged cells from currently open notebook (nb ext) as a package file (m ext)?

Please do not tag this question as already answered because the method described at Is there a way to programmatically do a “save as ” on an init.nb file to save it as init.m? is only for saving ...
• 2,467
182 views

### Manipulate and Initialization with functions and some variables

I am trying to do a manipulate with a function that depends on several variables, some of which are also functions. I can't get it to work. I have tried including an "Initialization" but it ...
• 119
71 views

### Why is loading a list of contexts with Map Get not working?

I wish to automate the loading of packages by using Map and Get but Mathematica doesn't seem to like it. How can I make this work? This is how packages are normally loaded... ...
• 2,467
1 vote
82 views

### Autoloading MaTeX and Rubi via DeclarePackage[] in the user init.m does not work

Former question: Autoloading and adding code to a package in the user init.m I am using MaTeX, and I found the updateMaTeX[] function] at the GitHub repo. I tried ...
• 872
222 views

The contents of init.m are placed inside an Initialization Cell so that some symbols are created in the Global context and to prepend alternate paths to ...
• 2,467
92 views

### How do I initialise a compound expression in Animate? Or, how do I have an expression evaluate on startup?

I have written a notebook with a few functions I defined. These functions describe a way of generating graphs using 2 inputs. e.g. graph[n_,s_] := Graph[...] I have ...
41 views

### Problem with Initialization cell and Manipulate

The following minimum failing example illustrates a problem that I am having building an application to simulate projectile motion. In the notebook's initialization cell, I have the definition of a ...
1 vote
38 views

### Initializing section header doesn't mark sub cells as initialization cell

I have some definitions organised into Chapter>Section>subsections etc in a notebook. I wish to run this code in wolframscript so I tried (following advise from various question on SE) exporting ...
• 1,164
1 vote
58 views

### .m files saving with comments [duplicate]

So I have posted a few questions on loading packages, because it is so simple, yet always failing for me. I made a new file Streams.m in the directory ~/Library/Mathematica/Applications/, which is in <...
• 101
81 views

### How can I ensure initialization cells are evaluated in order of definition?

I have a cell: Unprotect[Plus]; followed by a cell: Plus[label[t1_, l1_], label[t2_, l1_]] := label[t1 + t2, l1] If I ...
• 872
323 views

### Non linear fit without initial parameters

I have a certain unsightly list of point which I want to fit with the following function a^2 + b^2 + 2 abCos[q*d], where a and b are the fit parameters. When I use NonLinearModelFit to fit my list, ...
• 1,014
1 vote
48 views

### Determine init.m location from within said init.m file? [duplicate]

I have following question: can I easily determine location of init.m from within said init.m? We need to use premade Mathematica script/program/addon (don't know proper term) which unfortunately ...
• 223
144 views

### Mathematica Command for evaluating all initialisation cells

I've looked around the website and the documentation but I've had no success. The task is simple: I'm looking for a Mathematica command that evaluates all the initialisation cells in a given notebook, ...
• 607
394 views

### Is there a (simple!) way to convert all initialization cells of a document to normal cells?

I like to work with initialization cells. During the different stages of development of my notebooks, I however often need to change those. If they are scattered throughout the notebook, it is ...
• 673
275 views

### Why does args symbol exist in a fresh kernel?

In fresh kernel Mathematica 11.3 (Linux) asking for args (similarly for dims) I obtain ??args Globalargs As far as I ...
• 3,680
130 views

### Problem with PopupMenu: Its values don't update dynamically

I have a problem with PopupMenu inside DynamicModule, its values don't update dynamically as they supposed to. The example below ...
• 77
52 views

I have installed a package named HEP from Wolfram Library Archive which contains several .m files by Files -> Install (...
• 13
177 views

### init.m in Autoload directory is not read by parallel kernels in M11.2

Parallel kernels are not reading the init.m files in \$UserBaseDirectory/Autoload since version 11.2. The master kernel reads it ...
• 31k
1 vote
56 views

### How does -preinit work in 11.2?

On Initialization & Provisioning at http://reference.wolfram.com/language/guide/InitializationAndProvisioning.html the WolframScript Command-Line Options mention -preinit and -postinit. I am ...
• 31k
515 views

### Evaluate Initialization cells at startup [duplicate]

How can I start an evaluation of the initialization cells when a notebook is opened? Should I use FrontEndExecute[] in some way?
• 525
230 views

### Hide initialization cell [duplicate]

I would like to load a package at the beginning of a notebook. So i put these lines inside an initialization cell: ...
• 525
311 views

I have a package that initiates some periodic tasks via the ScheduledTasks functionality. The tasks in question also require the use of parallel tools and the launching of external commands. ...
• 61
1 vote
266 views

### How to *safely* enable automatic initialization cell evaluation for one notebook?

I want to configure this one notebook (let's call it X) so that its initialization cells get automatically evaluated when X is first opened1. To this end, I have applied the settings shown below to ...
• 11.7k
223 views

I've got a long document and I suspect know that I mistakenly set some cell in the middle of the document to be an initialization cell, probably hidden inside multiple collapsed sections and ...
• 10.3k
731 views

### Detecting kernel initialization

Certain operations do not work during kernel initialization. Code from Kernel/init.m, the Autoload directory, or packages set ...
• 236k
427 views

### Register "initialization code" to run on any newly started parallel kernel

Is it possible to register a some "initialization code" to be run on any newly started parallel kernel? This would be similar to how ParallelNeeds registers a ...
• 236k
134 views

### Initializate Manipulate

Hello I am a beginner in Mathematica and I have a question about initialization of manipulate. I have code like this and I want to ask you, how to modify that code if I want have default picture saved ...
• 33
1k views

### Mathematica won't evaluate on the first run & problem with code highlight

When I start Mathematica, the first evaluation always takes forever even it's as simple as x = 2, and when I halt the evaluation with ...
• 1,831
268 views

### Why InitializationCellWarning is False and still I get warnings?

I wrote a notebook containing initialization cells: (1) notebook's options related to initialization are set to: ...
• 1,843
159 views

### How to ensure that a package is always loaded on startup, even in parallel kernels?

Is there a robust way to ensure that a package is always loaded on startup, even in parallel kernels? Parallel kernels do not read Kernel/init.m.
• 236k
90 views

### How can I bypass the limitations of init.m? [duplicate]

In a series of QA it has been pointed out that init.m suffers of heavy limitations (see as example, Automatically load packages at startup or Why can't I import ...
• 1,843
501 views

### Strange Error with Initialization within Animate

Animate[x, {x, 0, h}, Initialization :> (h = 1)] The code above gives the error: Animate::vsform: Animate argument {x,0,h} does not have the correct form for ...
• 892