text:
# Incarnations of Modularity

November 05, 2019 - lutz

On more occasions than I’d be comfortable with I’ve heard that software should be modular. To be fair: I am one of the advocates of the claim that modularity is worth striving for. But what is actually meant by that? There is no universally agreed upon definition for modularity.

In this post I’d like to write about how “modularity” was implemented and has changed over the course of projects I was involved in. Since “modularity” is so ambiguous this post is highly subjective.

The first really big™ software I contributed significant amounts to is the FUmanoids software. The FUmanoids are the humanoid football playing robots of the Freie Universität Berlin (where I studied). If you have not heard about humanoid robot football, I pity you for your lack of knowledge; but I also envy you for the moments to come when you realize how awesome it is to live in a world where this sport exists! Robot football! Fuck Yeah!!! Unfortunately there is no electrical engineering (or engineering in general) faculty at my university, therefore the project members were almost entirely from a computer science background. The rules of our robot football league dictate the general layout of the robots. Also the rules encourage custom designed robots (there is actually a league where all teams compete with identical robots, we were not part of that). So we’ve also developed custom hardware! That part was mostly learning by doing. Go and have a look what we’ve developed but please keep in mind that we didn’t have any training. What I’m trying to convey is the fact that the FUmanoids team consisted of students. Most of the time we tried to tackle problems that were far above our level of expertise and frankly, there was rather limited engineering supervision and guidance from the university.

However, when it comes to software we actually had training, or more accurately: We were in the process of training right there, we were students after all. This means that the FUmanoids software was an interesting playground to try out things. There were some constantly recurring challenges though:

Students don’t tend to be around for long. Eventually they graduate and are released into the wilderness of the non-academic world. For the project this meant that students needed to get into the development cycle as quickly as possible. Also, the faster students could try stuff out the faster they gain knowledge. “Trying things out” and “playing with it” are IMHO the absolute best ways to gain knowledge in any engineering discipline. But the more things are tried out, the more failed trials your project accumulates. Therefore, another necessity emerged: Removing stuff shall be as easy as adding stuff. The latter is a quality trait in software that is highly underrated. In a nutshell: Our development cycle was better when the hurdle to add code as well as to remove code was lowered.

## Modularity

As stated above, there is no universal definition of modularity (in software) that I am aware of where all developers agree upon. However, technically speaking “modular” simply means that something is composed of “modules”. “Modularity” could as well be understood as guidelines to structure a project. A module can be anything though: A source file, a set of source files grouped in directories to form modules or some abstract concept within a Software. Regardless of how you look at software you’ll see that any software is modular in its own way. Developers like to organize logic and with that some sort of modularity is implemented as a byproduct. Also, a project might not necessarily have a single concept of modularity; Modularity can also be achieved as an hierarchy of rules.

Summarized: Encouraging modularity in software actually means encouraging separation of logic. By dividing software into pieces (modules) following certain rules, you only need to tell a future reader those rules and help her or him greatly to understand the code.

Another aspect of modularity is that it enables modules to be replaced or altered. The easier the process of replacement, the faster a software can evolve.

### Some History of the FUmanoids

The FUmanoids were found in 2006 and were (unfortunately rather forcefully) discontinued in 2017. Our robots were humanoid (two legs, two arms, one head) and had to move in a humanlike fashion (i.e., walk). Only sensors with an equivalent in humans were allowed (no GPS, Radar, Lidar, ultrasonic) so they had to rely on cameras as a primary input.

### The Beginnings

2008 was one year after the first iPhone was released. That was way before people even thought about devices like Raspberry PIs! The FUmanoids had to work with hardware they could get their hands on and get students working with (no exotic DPSs or the likings). Back in the day an AVR processor had to do. The founder and head of the team had plenty of experience with ATmega controllers: How to program and how to build hardware that integrates them. So it was decided that an ATmega128 will do. If you know that platform then you are aware of the very limited resources of the ATmega128 but since there was some experience at hand the benefit of getting shit done™ outweighed the lack of RAM (4kB), ROM (128kB), clock speed (16MHz) and performance in arithmetic containing numbers greater than 65535 (yes, that 8bit processor was able to natively handle 16bit numbers! It just couldnt handle a lot of them). In that phase of the project the software had to fit into that processor and handle image processing and movement creation. The RAM was actually so scarce that certain RAM areas (buffers) were reused by multiple concurrently running pieces of the application. However, it worked. Unfortunately the code that was running then is lost to me, so all I know about it is on the level of hearsay. From what I’ve heard, the structure of the project was very easy straight forward and thus easy to follow even though some parts of the code were rather messy. The point is: it worked and also it enabled new students to join and contribute to the project quickly.

Modularity then was mostly implemented on an execution level. The application was split into five threads (vision, motion, behavior, role, strategy) therefore the boundaries between modules were defined on a more functional level. By that I mean: What was run independently belonged to an independent module. So if you were working on the behavior aspect of the code you’d know what source files to work on. The same applied to the other features of the software.

### The First Computer

Not too much time later, the first single board computers emerged and were happily welcomed into our robots heads. In 2009 one of the first “kinda easily” available embeddable Computer, a gumstix verdex pro (32Bits, whoopwhoop), replaced the tiny AVR. Suddenly a whole Linux and a whopping 128MB of RAM and 32MB Flash was available! With the new platform the FUmanoids software evolved from something with a focus on low RAM footprint to a software as you’d expect. However, even that transition was not entirely painless as a very brave student set out to first port the old AVR code to the new platform. The code that remained wasn’t that complex; There was a main() where a Robot object was instantiated which in turn had a representation of the body, a communication interface and image processing. There was a single implementation for each of those representations. However, some parts of the software were actually built like interchangeable blocks for certain tasks: There were specific roles for each situation all implemented as subclasses sharing a common interface. The same applied for strategies as well as motions. Apart from those interface classes the overall structure was still following the thread-scheme from the the previous section.

From my current point of knowledge I’d say that the level of abstraction and modularity was actually a very good fit for the amount of code then. There were no enforced abstract classes where none were necessary and the code was still straight forward and easy to understand.

### Sudden Capacity

In the course of the next two years the embedded computer marked started to boom. The variety of hardware exploded; As did our software. Hardware constraints were loosened a lot: suddenly there was almost infinite memory at hand! While the processing platform was changed twice, the amount of code went from 6k LOC to ca. 40k where a major portion of the code was never run at all. Students came and student parted, but their code remained as if it was integral. The project that used to be easy to understand now consisted of a multitude of singletons for each aspect of the software. I.e., there was a singleton for the robot, vision, for the motion, world model, debugger, feet(!), for every aspect of communication and so on. In other words, at this stage of the software modularity was achieved through rigorous usage of singletons that could be (and were) accessed from all over the code. Interestingly enough, there was very little abstraction (as in abstract base classes) happening actually. Note: IMHO singletons1 are not a bad design pattern; as long as the pattern is not overused or abused. For objects that can exist at most once within a software and need to be accessed from disjoint locations singletons are exactly the right design pattern.

I know first hand how hard it was to follow through the code, locate features and start to contribute. That was the time when I joined the team.

### The BlackBoard Framework

In 2011 a collaboration between the NaoTH (the robot football team of the Humboldt-University Berlin) and the FUmanoids emerged. Before that we were good friends, but since then we shared code. NaoTH compete in the standard platform league where all robots are identical. They came up with a framework that could enable software exchange on a source code level even across teams competing in different leagues. The idea was to have a “blackboard”, a data storage for arbitrary types, where modules could fetch data from and put data into. This framework introduced a concrete concept, in terms of source code, for what a module represents and how it is incarnated in code. Module was a base class where instances of derived classes were to be run in a specific order. Somewhere was a list of names of modules to instantiate for the cognition as well as for the motion aspects of the robot. After instantiation the modules could be inspected to determine their inputs and outputs and therefore their execution order. In practice this looked like this: A module accesses the data on the blackboard by requiring or providing data. With that no module would call any method on another module but communicate via data only. That way of modularization enabled almost entirely disjoint source code. At this point students could come, develop a module of their own and without prior knowledge about the overall structure of the software they could have their own code executed.

Here is a simplified example of how my_module.cpp looked like (yes, it was pre C++11):

// this macro generates something like "struct MyModuleBase : Module {"
BEGIN_DECLARE_MODULE(MyModule)
// this generates a read only accessor to an input: InputType const& getInputType() const;
REQUIRE(InputType)
// this generates as accessor to an output: OutputType& getOutputType();
PROVIDE(OutputType)
// this generates the end of definition brackets "};"
END_DECLARE_MODULE(MyModule)

struct MyModule : MyModuleBase {
virtual void execute() {
InputType const& input = getInputType();
OutputType& output = getOutputType();
// do some processing
}
};

// emit a global factory object that can produce instances of MyModule
// all those factory objects are known to a central collection of factories by their name ("MyModule" in this case)
REGISTER_MODULE(MyModule)

The execute() method is called after all modules that provide something that is required in the current module have been executed. The first module to be executed does not have any requires.

This framework helped a lot to clean up the code and to build tools to visualize dependencies between modules, quickly integrate students into the workflow and so on. It also enabled us to easily remove code without breaking the whole software! Further it defined a workflow how to add features and a set of rules for the expected granularity of modules. Anyways, it was purely focussed on dataflow: Modules were synonymous for stages inside the data processing pipeline. But because of the nature of the FUmanoids focusing on the data processing pipeline was exactly the right tool at the right time for the project.

### Modern C++

Years have passed when the code flourished again. Eventually though, a student set out to replace the blackboard framework with something that works very much the same way but utilizes modern C++. With this rewrite we got rid of the macros and simplified a lot of code. Until 2016 it grew to around 75k LOC while remaining easy to navigate. Modules were named by what they are doing and as there was virtually no performance penalty in splitting a single module into multiple, some modules actually did very little.

now a module’s code looked like this:

struct MyModule : moduleChain::Module {
moduleChain::Require<InputType>  input  {"NamedInput"};
moduleChain::Provide<OutputType> output {"NamedOutput"};
void execute() override {
InputType const& input = *input;
OutputType& output = *output;
}
};
REGISTER_MODULE(MyModule)

### Meng Meng (TNGL)

Eventually I left the FUmanoids but I’ve constantly worked on projects that were spiritually related to the FUmanoids code. What I’ve learned from the FUmanoids was that data processing in a pipelined fashion works very well and benefits teams a lot. But some pieces of data don’t quite fit into the concept of a pipeline. There were certain data types that were pushed into the pipeline but didn’t belong there as they actually were not (meaningfully) mutable. E.g., the representation of the robot was passed through the pipeline even though at no stage the robot was actually produced or consumed; it was never even altered. At the same time the representation of a robot better be not implemented as a singleton as it would impose limits on the software which are hard to remove after the fact. I.e., when implemented as a singleton there could be only one robot at the same time in the software. I wanted to have a system that could give a similar flexibility as the pipeline where modules are instantiated and hooked together during runtime but where the modules don’t have to live within a pipeline. Also I wanted that system to be inspectable as the pipeline was (we were able to generate really pretty data flow diagrams of the pipeline).

Meng Meng is not only the name of a Panda in Berlin’s zoo but also the codename of my personal robot control software successor to the FUmanoids. The aspect within Meng Meng that provides modularization is called TNGL: A TNGL (meaning: tangle; pronunciation: tingle) is a bundle of nodes (modules) that have links to other nodes within the same TNGL. A node implements an interface by whatever means applicable (virtual or normal inheritance) thus exposing certain methods to other nodes. Links between nodes are implemented as members of nodes; their inner workings are very much the same as pointers. Also information about the relationship to a link’s target can be expressed: When Node A cannot work without having access to some B (it requires the existence of a B) then the TNGL will try to fulfill this necessity. If it cannot do so, then A will be torn down and not be part of the TNGL. A could also indicate that a link to a B is nice to have but if it cannot be fulfilled the A shall not be deleted. There are actually some more relationships that can be expressed. They are all rather straight forward.

However, TNGL does not enforce any requirements on nodes apart from them to use links. It comes with a caveat that is worth mentioning though: TNGL allows for circular relationships between nodes. To achieve this, the initialization process of a TNGL requires the nodes to be created first and then be linked together. That means that nodes need to have a method that is invoked after all nodes are hooked together. In other words: TNGL enforces a two stage construction. It also enforces a two stage destruction where a method on all nodes is called prior to the destructors of all nodes.

Anyways, here is some Code do demonstrate how a tngl::Node looks like:

// my_interface.h
struct MyInterface {
virtual void foo() = 0;
virtual ~MyInterface() = default;
};

// A.cpp
namespace {
struct A : tngl::Node, MyInterface {
A() {} // throw here to indicate this node cannot be constructed for some reason
void initializeNode() override {} // called after all nodes are hooked together; implementation can be omitted
void deinitializeNode() override {} // called after before nodes are destroyed; implementation can be omitted
};
// a factory to produce MyFunctionality nodes. This factory is known to a singleton holding all application wide factories
auto builder = tngl::NodeBuilder<A>("A");
}

// B.cpp
#include "my_interface.h"
namespace {
struct B : tngl::Node {
void initializeNode() override {
interface->foo();
}
};
auto builder = tngl::NodeBuilder<B>("B");
}

// main.cpp
int main(int argc, char** argv) {
B seed_node;
tngl::TNGL{B};
tngl.initialize(); // call initializeNode on all modules
tngl.deinitialize(); // call deinitializeNode on all modules
return 0;
}

As you can see, the code overhead to implement nodes is very limited. Also all relationships between nodes can be inspected at runtime and pretty graphs can be generated:

When using TNGL it becomes pretty easy to add new features as dependencies of those features can be expressed as interfaces. Also, nodes are very testable as you’d need to implement tests against an interface; the rest (instantiation of the test-node and the testee-node and the actual testing) can be automated.

What is now TNGL has been evolving over several years. For my current bigger projects it helps me a lot. Especially the abstraction of aspects of the software via interfaces helps me focussing on one task at a time and get into the software quickly when I have not touched it for some time. I also fancy the inspection features of tngl, e.g., dependency graphs can be created automatically as well as information about what nodes are available, what nodes are instantiated and which nodes are not instantiated and why. It also enables me to implement other aspects of modularization like pipelining, load balancing and many more with the means of nodes. E.g., pipelining is realized by a node that has links to all other nodes implementing the interface of a pipeline-module and hooking them together analogous to the pipeline of the previous section.

### Takeaway

In this post I’ve omitted concepts of modularity from closed source project that I’ve worked on as well. Frankly, I didn’t encounter any meaningful or different concept of modules there.

When modularization was enforced in code, it boiled down to separation of logic by imposing design rules. As a rule of thumb: whatever choice of modularity, it has to be easily defined. If a concept of modularity cannot be easily described it’s very likely that it will do more harm than good to a project.

##### Singletons

I’d strongly disadvocate cooking modules into singletons: I’ve seen it help code to grow wild and also I’ve seen people cleaning it up. It renders software very unscalable and makes people very unhappy.

From my experience I find that enforcing execution driven modularization to be a very fragile approach. It can be a perfectly adequate choice for smaller code bases but when the project grows it becomes hard to force functionality to remain in the boundaries of a single execution unit. Especially the exchange of data and synchronization between execution units can become tricky because knowing how and what data is exchanged needs knowledge of the whole software.

#### Data Driven Tasks with Dependencies

If your software happens to revolve around complex data processing tasks then this is a very nice concept of modularization. Adding, removing, trying code comes with a very low overhead. Because the overall data processing can be split into comprehensive parts, knowledge of the entire software is not necessary to contribute software. However, this is only applicable to streamlinable data processing situations. It also comes with the need of settling on a framework that might be hard to migrate away from.

#### Interface Driven Modularity

For any reasonable complex software I prefer this approach over all others. It poses the fewest assumptions on your project and (in the case of TNGL) comes with neat tools to inspect and verify the software on multiple levels. Also it plays nicely with other aspects of modularization as some nodes might use threads or some nodes might group to something that works like a pipeline.

1. Meyers singletons of course


text:
# Robust Counterpart of an uncertain LP

Consider the following robust optimization problem:

min c'x

s.t.: $Ax\geq b \;\;\forall (A,b)\in \mathcal{U}$.

Why can the robust counterpart of the problem be written in this form? $min_x{\{ max_{(A,b)} Ax\geq b\}}$?

How does it work principally? Does it mean that I have to, for a fixed $x$ value, maximize the constraints $Ax\geq b$ for all realization of the uncertain data, and then minimize the value $x$?

Please make this point clear to me with a small example.

• Where do you see it written this way? This doesn't really make a lot of sense. For one thing, $Ax$ is a vector, and the $\max$ function as written doesn't really operate on vectors. Perhaps this is a convention adopted by some in the robust optimization community; if so, perhaps you can point us to a paper. – Michael Grant Apr 19 '13 at 1:11

format: plain


text:
# PRACTICE: Multiplication

Lesson

## Practice multiplication

We have been learning some ways to build our multiplication skills. These include:

•  making arrays  to show equal sized groups
•  noticing patterns  , such as doubling and skip-counting

We also worked on some time tables, including:

•  multiplying by 0 or 1
•  multiplying by 2
•  multiplying by 4
•  multiplying by 3
•  multiplying by 10
•  multiplying by 5

### Examples

#### Example 1

Find the product of 2\times 8.

Worked Solution
Create a strategy

This can be thought of as 2 groups of 8 stars, as represented in the picture below.

Apply the idea

In the above image there are 16 stars in total.2 \times 8 = 16

#### Example 2

Find the value of 6\times3.

Worked Solution
Create a strategy

We can think of 6\times 3 as 6 groups of 3 just like in the image below that has 6 groups of 3 squares:

Apply the idea

The above image has 18 squares in total.

6 \times 3 = 18

#### Example 3

Find the value of 5\times9.

Worked Solution
Create a strategy

We can think of 5\times 9 as 5 groups of 9 just like in the image below that has 5 groups of 9 squares:

Apply the idea

The above image has 45 squares in total.

5 \times 9 = 45

Idea summary

There are different ways to solve multiplication, including repeated addition and using arrays. We can also multiply our numbers in a different order, so 3 \times 4 has the same answer as 4 \times 3.

### Outcomes

#### MA2-6NA

uses mental and informal written strategies for multiplication and division


text:
# Which is better practice: rendering figures on the fly, or importing them as images?

I've come to a philosophical quandary with respect to my use of LaTeX for scientific writeups. At first I tried to render all figures in LaTeX at compile-time, for example making a graph using PGFPlots instead of importing it from Excel. However as I started bigger projects my compile time got exponentially larger, and I heard that many prefer pre-rendered images in figures rather than figures rendered at compile-time. Which is better practice for large projects with many diagrams?

The project I'm working on now includes a couple of graphs and circuit diagrams in circuitikz, for a certain degree of context. I also am considering taking figures designed in LaTeX, exporting them as images, then reimporting them into the final document. Thanks.

• When a figure is under construction and likely to change as the surrounding discussion changes I generate it on the fly. When that part of my (large) document is stable I comment out the local generation and include the graphic. I would recommend not mixing plots from Excel and PGFplots - use one or the other, for consistency of style. – Ethan Bolker Jul 16 '15 at 20:03
• Welcome to TeX.SX! The TikZ externalization library (section 50 in the manual) might be a good compromise. – erik Jul 16 '15 at 20:11
• Some references in terms of compile-time: How do I speed-up LaTeX compile time?; Speeding up LaTeX compilation; How can I speed up LaTeX compilation? – Werner Jul 16 '15 at 20:18
• Not completely opinion based, but certainly “document depending”. – egreg Jul 16 '15 at 20:29
• TikZ external library, standalone... there are ways to set things up so things are compiled only when necessary (mostly, anyway). But... it all depends. There are surely figures you ought not try to produce using TeX regardless of compilation time ! You have limited accuracy, for example, and extremely limited capacity for 3D rendering. Summary: what @egreg said. – cfr Jul 16 '15 at 22:13

standalone can be set up to recompile included pictures only if required. Otherwise, it will include the previously compiled PDF. So it is not necessary to switch to \includegraphics to benefit from pre-compilation.

Here's a basic example.

The figure:

% mytikz.tex
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{cathod}
\begin{document}
\begin{tikzpicture}
\pic {cath gorwedd={blue!50}{blue!25}{green}{yellow}{red!20!brown}};
\end{tikzpicture}
\end{document}

All that is really necessary here is the tikzpicture environment but the rest is handy while working on the image initially and standalone will ignore it when appropriate, so it might as well stay.

Now the main file:

\documentclass{article}
\usepackage[mode=buildnew]{standalone}
\usepackage{tikz}
\usetikzlibrary{cathod}
\begin{document}
\begin{figure}
\includestandalone{mytikz}
\end{figure}
\end{document}

Provided compilation is done with -shell-escape, the following will happen:

• on the first run, a separate compilation process will run to create a cropped version of the image, mytikz.pdf which will then be included with \includegraphics{};
• on subsequent runs, the image will be included using \includegraphics{} unless the source has changed, in which case it will be recompiled first.

By altering the value of mode=, this behaviour can be customised as required.

In all cases, I get a lovely blue cat:

However, you can use it with pictures of other cats, too. Even non-cat content works, or so I've been given to understand.

An alternative is to use the external TikZ library to externalise images. Again, this requires -shell-escape and it can be configured. By default, it also recompiles a figure only if it has changed. However, this is obviously limited to PGF/TikZ pictures whereas standalone provides a more generalised approach.

It seems to me that publications will mostly want pre-compiled graphics. You can ease your quandary relatively painlessly by moving your preamble and Tikz/PGF graphics to separate .tex files and use \input to give yourself a choice at compile time. For instance, your main document might look like:

\documentclass{report}
\input{preamble}
\begin{document}
\begin{figure}
%\includegraphics{pgf_graphic.pdf}
\input{pgf_graphic.tex}
\caption{\label{fig:...}...}
\end{figure}
\end{document}

and if you want to pre-compile, you make a wrapper for your graphic like:

\documentclass{standalone}
\input{preamble}
\begin{document}
\input{pgf_graphic.tex}
\end{document}

then, you can swap the comments on the lines with \input{pgf... with the \includegraphics{pgf... in the main document based on need, mood, etc...

I do this, but I am still trying to settle on the best file structure to make the workflow seamless.

• You don't need to swap them. Isn't that the whole point of standalone? ;) – cfr Jul 17 '15 at 0:21
• @cfr The difference would be putting a pre-compiled graphic in the figure, or compiling the graphic within the main document. I think the OP was searching for a way to decide whether to do one or the other, and so switching would offer some way to compare – repurposer Jul 17 '15 at 0:25
• Yes, but I am pretty sure standalone offers facilities for this. (I've never used that function, but I'm sure I've read it in the docs.) – cfr Jul 17 '15 at 0:30
• @cfr It might, I guess I should get out of the habit of only reading the manual after I have said something embarassing ;) – repurposer Jul 17 '15 at 0:31
• It might not. I should probably get out of that habit, too ;). – cfr Jul 17 '15 at 0:36


text:
mPDF Manual – Configuration

# Configuration files v6.x

(mPDF >= 6.0 & < 7.0)

Four configuration files are included in the root directory of mPDF:

File name Details
config.php

Configure most variables which affect mPDF. These values can be set at the beginning of individual scripts, but changes here will affect all of your PDF files.

Also contains basic default CSS stylesheet properties.

config_fonts.php Details of fonts installed in mPDF.
config_lang2fonts.php

Sets the options used for which fonts to use, when the text is defined by the lang attribute.

config_script2lang.php Sets the options of which lang to mark up text with, when using automatic font selection based on the text script.


text:
Midpoint of an interval

The midpoint of an interval with endpoints $$P(x_1, y_1)$$ and $$Q(x_2, y_2)$$ has coordinates

$$(\dfrac{x_1 + x_2}{2},\ \dfrac{y_1 + y_2}{2})$$.

The coordinates are found by calculating the average of the x-coordinates and the average of the y-coordinates.

Example 3

Find the coordinates of the midpoint of the line interval joining the points (6, 8) and (−3, 2).

Solution

The midpoint M has coordinates

$$(\dfrac{6 + (-3)}{2},\ \dfrac{8 + 2}{2}) = (\dfrac{3}{2},\ 5)$$.


text:
# Improve a car battery's performance with capacitors

These days, it got very cold in my area, and I started to think I need a new car battery. But then, as long as temperatures are above -10°C, my battery works fine. It just can't support the high current needed to start the engine when the temperatures are below -10°C. So my thought was:

Can I add capacitors to my car battery, that will help supply the needed current?

I found 6 Capacitors with $$\2.7\text{ V}\$$ and $$\500\text{ F}\$$ each on ebay for a total of 25$. If I put them in series, their capacitance should be $$\\frac{1}{\frac{1}{500}\cdot6}\approx 83\text{ F}\$$ at $$\16.2 \text{ V}\$$. The energy in watt seconds would then be: $$\0.5\cdot83\cdot16.2^2\approx 10891 \text{ Ws}\$$, which should be enough to start my small little engine (small gasoline engine rarely takes more than a second to start, even in cold temps, so that would be about 130 Amps for one sec). Unfortunately, that's about as far as my knowledge of electronics goes. Can I really just attach the 6 Capacitors, which I connected in series, to the Battery? Is there something here I am not seeing, which would make it extremely impractical to do that? I can't seem to find anyone on the Internet doing this, which makes me sceptical. There are some people that use capacitors instead of batteries, but that seems like a bad idea to me since it won't last more than one start... • If you can't find anyone, you are not searching hard enough. There are lots of youtube videos about people starting their cars with ultracaps. Jan 17 '17 at 10:18 • A crazy suggestion: assuming the battery is still in good enough condition and has enough energy stored: why not just turn on the lights or some other power consumer in the car so that the battery has to deliver some current. Leave that on for a couple of minutes. This will heat up the battery somewhat which might be enough so that is it able to start the engine. Jan 17 '17 at 10:23 • @FakeMoustache: You mean like all the people in cold weather countries do it all the time? That assumes you don't do short distances constantly though. Jan 17 '17 at 10:27 • 0.5*83*16.2² is the total energy stored - unfortunately this is erroneous as (a) the battery voltage (and hence the capacitor voltage) is more likely to be around 13V and (b) the capacitor voltage can only fall the same amount as the battery so the amount of energy available from the capacitors will only be a small fraction of the total. Jan 17 '17 at 10:34 • If you can't start the car in -20°C, either the battery is a bad, or the rest of the car is. -10°C should be easy. Something is faulty or insufficient. Throwing capacitors at the problem will only mask it, it won't solve it. Jan 17 '17 at 11:18 ## 6 Answers Putting capacitors in series to add up their voltage ratings isn't very wise. Their difference in leakage current will lead to an imbalance in the voltage they'll have across them (see https://electronics.stackexchange.com/a/80589/107479), and some of the capacitors could easily experience overvoltage (especially given the low voltage ratings supercapacitors have). The solution for that would be to add a resistor ladder in parallel to compensate this, but that would increase your standby battery drain, which is not a good idea either. Moreover, your computation is wrong, since the capacitor will be charged to the battery voltage (~13V), not the full capacitor voltage rating. And I doubt it requires less than one second to start. And, when you say in your comment: The top rated answer in the post that PlasmaHH linked, suggests doing exactly what I want to do, using capacitors in addition to the batterie, so the battery can store lots of energy, and the capacitor can deliver it at high rates for short times. you're mistaken: this answer you're referring to, when it mentions "short times", it means "a few ms", for example to smooth the big current spikes due to the inrush of the starter. Not for the starter the whole starting time. This is where it begins not making sense. Finally, if your car doesn't start when it is -10°C outside, you simply have a problem somewhere with your car. Bring it to your mechanic. He'll fix it, and he surely won't fix it by adding capacitors. He'll find the actual faulty component (which, by the way, you don't seem to have really checked - you're assuming it's the battery, but it could be anything: glow plug/starter motor/some sensors/whatever/...) and replace it (because when such a component starts to fail, trying to fix it by adding capacitors or duct tape is futile - you replace it). • I am sure it's the battery, and I don't have a mechanic. I usually fix my car by myself. I will replace the battery. I knew that this was the most intelligent thing to do from the beginning on, I'm just naturally curious and wanted to know whether it was possible to build something like this (capacitor supported battery) for relatively little money. After all, they are using it nowadays in cars that have a start-stop-automation (but it's ridiculously expensive, 700€ for a 1200F capacitor in addition to the starter battery). Jan 18 '17 at 16:47 • Actually, the price is not that irrelevant compared to what you planned to buy. You said you could have the equivalent of 83F for 25$. That would be about 360$for 1200F. Depending on quality (lifetime, ESR, ...) the price for a cap of a given capacitance and voltage can easily range from one to twice the price... Anyway, I'm glad you're going for the sane choice of replacing the battery. That would be the best usage of your money IMO. – dim Jan 18 '17 at 20:28 There is a company that sells capacitor banks that completely eliminate the need for a lead acid storage battery for automotive as well as other applications. Since they are non chemical based they are not affected as much by extreme low temperatures. Here is a link to check out and tease yourself silly with ideas. http://www.maxwell.com/products/ultracapacitors/cells This link contains specs as well as product line and company contact info. I read somewhere a while ago that these units will charge in about 3 secs. • Can you show where the company recommends ultracaps to replace lead-acid batteries in gas-powered cars? Dec 9 '19 at 16:58 Conceptually sound but not likely to work in practice. The starter needs lots of current, and you will need a lot of capacitance to make a difference. • A lot of Capacitance is cheap nowadays, as you can see on youtube, people are building capacitors large enough to power a starter motor for around 40$ Jan 17 '17 at 12:32

Simple solution - get a car starter kit and keep it somewhere warm. For example

The market offers plenty of small jump starters for every purpose, but which packs the most punch? Here's our verdict

I add 6pcs 2.7v 500f supercapacitors in series with protection board and that drain my car battery in 6 hours, so I decide to remove all the protection boards and not use it, now I have 7pcs 2.7v 500f supercapacitors in series and paralleled with my car battery, everything working perfectly, the capacitor not over charge since my alternator maximum charge is only 13.8v So my supercapacitors in series has 18.9v and 71.4 farads totals. One thing make sure you install a 80A fuse as protections

• ... and a second thing: fire protection, e.g. a fire proof enclosure. Jan 17 '20 at 6:20
• So does it work? Can you start the car from the capacitor bank if the battery is dead? Jan 17 '20 at 14:07

What a lot of these people seem to misunderstand is what is nede dto stat s motor is power. As the bat can not cope with demand its votage drops, and as the volts drop the cap releases.its stored power. Lots of vids on u tube. Seems like drop in voltage starting is less than a third. EVEN BETTER when it's cold and battery IS LESS EFFICIENT. Yes people have tried caps only but I would be inclined to have both. Need to disconnect caps when goes to garage for service, and probably precharge before connecting to bat. I EXPECT REDUCING STRESS on battery will give it a longer life so I would do it to cope with a year then get new bat which will last longer.
Best of luck and please feed in reports on how it worked. Ps I understand in deep cold caps are more efficient must be even better..

• What is needed to start a motor is current, voltage at the start can be low, so, you do not (necessarily) need a lot of power. Dec 9 '19 at 20:53


text:
시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 3 2 2 66.667%

## 문제

The Kingdom of Byteland decided to develop a large computer network of servers offering various services.

The network is built of n servers connected by bidirectional wires. Two servers can be directly connected by at most one wire. Each server can be directly connected to at most 10 other servers and every two servers are connected with some path in the network. Each wire has a fixed positive data transmission time measured in milliseconds. The distance (in milliseconds) d(V,W) between two servers V and W is defined as the length of the shortest (transmission time-wise) path connecting V and W in the network. For convenience we let d(V,V)=0 for all V.

Some servers offer more services than others. Therefore each server V is marked with a natural number r(V), called a rank. The bigger the rank the more powerful a server is.

At each server, data about nearby servers should be stored. However, not all servers are interesting. The data about distant servers with low ranks do not have to be stored. More specifically, a server W is interesting for a server V if for every server U such that d(v,U) ≤ d(V,W) we have r(U) ≤ r(W).

For example, all servers of the maximal rank are interesting to all servers. If a server V has the maximal rank, then exactly the servers of the maximal rank are interesting for V. Let B(V) denote the set of servers interesting for a server V.

We want to compute the total amount of data about servers that need to be stored in the network being the total sum of sizes of all sets B(V). The Kingdom of Byteland wanted the data to be quite small so it built the network in such a way that this sum does not exceed 30n.

Write a program that:

• reads the description of a server network from the standard input,
• computes the total amount of data about servers that need to be stored in the network,
• writes the result to the standard output.

## 입력

In the first line there are two natural numbers n, m, where n is the number of servers in the network (1 ≤ n ≤ 30000) and m is the number of wires (1 ≤ m ≤ 5n)). The numbers are separated by single space.

In the next n lines the ranks of the servers are given. Line i contains one integer ri (1 ≤ ri ≤ 10) -- the rank of i-th server.

In the following m lines the wires are described. Each wire is described by three numbers a, b, t (11 ≤ t ≤ 1000, 1 ≤ a, b ≤ n, a ≠ b), where a and b are numbers of the servers connected by the wire and t is the transmission time of the wire in milliseconds.

## 출력

The output consists of a single integer equal to the total amount of data about servers that need to be stored in the network.

## 예제 입력 1

4 3
2
3
1
1
1 4 30
2 3 20
3 4 20

## 예제 출력 1

9

## 힌트

because B(1)={1,2}, B(2)={2}, B(3)={2,3}, B(4)={1,2,3,4}.


text:
## Wednesday, February 13, 2013

### Portfolio Update (6 months later)

 My portfolio gains versus the S&P, Dow, and NASDAQ.
It's been about 6 months now after I bought my first round of stocks. Overall, my portfolio has performed consistently well and netted a total return of 12% so far, which amounts to about $600 of passive, tax-free income. In this post, I will summarize the results below with a bit of commentary. First, let me go over my current portfolio as well as some positions that I've closed since my initial purchase. Company Ticker Status % Gain Cisco Systems Inc. CSCO Closed 16% Citigroup Inc. C Closed 14% Hewlett-Packard Company HPQ Open -3% Intel Corporation INTC Open -8% JetBlue Airways Corporation JBLU Open 21% JPMorgan Chase & Co. JPM Closed 8% Knight Capital Group Inc. KCG Open 24% NRG Energy Inc. NRG Open 17% Office Depot Inc. ODP Closed 14% Pepco Holdings, Inc. POM Open 2% PG&E Corporation PCG Open -7% Safeway Inc. SWY Open 32% Staples, Inc. SPLS Closed 9% Xerox Corporation XRX Open 16% As you can see, I closed positions in Cisco, Citigroup, JPMorgan Chase, Office Depot, and Staples. Cisco was one of the very first companies that I invested in and was mainly for testing the waters. I sold it at about$19 once I hit the 15% profit mark. While it currently sits at $21, I didn't really do a thorough valuation so I have no qualms about selling it early so that I can reinvest my cash elsewhere. I bought Citigroup in August 2012 when the price had stabilized after falling significantly. That caught my attention and after doing an initial valuation, I found it to have very solid fundamentals. Plus, as a Citibank customer, I have been extremely satisfied with their banking service and their technology. I sold it shortly thereafter in October after a modest gain at$35. Currently it sits at $44. I'm not sure what to make of this. I sold it because I read that the financials of financial firms can be misleading due to the various ways that the balance sheet can be manipulated. I didn't want to take a risk so I sold it early. Maybe a slight regret after seeing how the stock has been doing, but I'd rather play it safe. JPMorgan was a similar situation to Citigroup. I did not want to be involved in any company whose business I do not fully understand. I bought Office Depot and Staples in August 2012 after office supply stocks had been falling steadily for 6 months. I happened to get extremely lucky and bought just as they started rising again. But regardless, I found that they were significantly undervalued at the time despite concerns of losing business to things like online retailers. I sold them after they had risen past my margin of error. In retrospect, they had risen far further than that, but again, hindsight is 20-20. Most of my currently open positions that have netted gains are pretty straightforward: JetBlue, NRG Energy, Pepco, Safeway, Xerox. All of them had solid fundamental numbers, a good outlook, and (aside from NRG) products and services that I am personally happy with. You may have noticed that I left out Knights Capital Group. I will admit, this particular stock was my little "experiment" (read: gamble). There was a huge fiasco regarding the company on August 1, 2012 that disrupted several companies in the NYSE and caused them to lose over$400 million. As a result, the stock price plummeted and I wanted to test to see if it was a market overreaction. I figure that as one of the largest trading firms on Wall Street, it must be able to get back on its feet and resume its business. This was completely my intuition and it happened to be correct.

Now, we arrive at the trickiest and most important part of the portfolio: the losses. I have three stocks that are currently sitting on losses: HP, Intel, and PG&E.

I bought HP after doing some basic fundamental analysis. The company has been plagued with a lot of problems, both external market forces and internal organizational issues. I found that the market forces (i.e. declining PC and printer sales) were not enough to justify its low price. However, a lot of organizational changes within the company in addition to some weak earnings in the past two quarters have caused the price to dip quite far down. However, it has been recovering steadily since December 2012 so I am still optimistic and confident in my analysis. Despite all of the financial problems HP faces, it still gives out a regular 1% quarterly dividend, which is a positive sign and offsets some of the recent losses. I plan to invest in the long term, so I'm not particularly worried. I will hold onto the stock for 20 years if I have to.

Intel also faced some earnings disappointments in the past quarter or so. The price dipped significantly before I bought it so I figured it would be a good time to enter. Intel has proven to be at the forefront of semiconductor technology time and time again and I don't see any good reason why it would not be a solid investment for the future. The CPU isn't going anywhere and Intel has also had big successes with their integrated graphics cards. It also gives out a 1% quarterly dividend as icing on the cake.

Finally, we have PG&E. I wanted about 20% of my portfolio to be in very consistent, solid companies with a nice dividend. I figured that energy would be a good place to put that money. I suspect that I just got unlucky with the timing of buying the stock. These minor price fluctuations aside, it gives over 1% in dividends quarterly. I am happy with their service and think that the energy needs of the West coast isn't going to alter considerably. If anything, it will go up in the coming years. There are some government regulations surrounding energy companies, so it is unclear to me how this will affect the company's profits. All-in-all, this was just a money dump for me.

## Obligatory Disclaimer

The author is not qualified to give financial, tax, or legal advice and disclaims any and all liability for this information.


text:
# TTP97-40 O(\alpha_s^2) Corrections to Top Quark Production at e^+e^- Colliders

TTP97-40 O(\alpha_s^2) Corrections to Top Quark Production at e^+e^- Colliders

TTP97-40 O(\alpha_s^2) Corrections to Top Quark Production at e^+e^- Colliders

In this article we evaluate mass corrections up to $O((m^2/q^2)^6)$ to the three-loop polarization function induced by an axial-vector current. Special emphasis is put on the evaluation of the singlet diagram which is absent in the vector case. As a physical application $O(\alpha_s^2)$ corrections to the production of top quarks at future $e^+e^-$ colliders is considered. It is demonstrated that for center of mass energies $\sqrt{s} >~ 500$ GeV the inclusion of the first seven terms into the cross section leads to a reliable description.

 R. Harlander and M. Steinhauser Eur. Phys. J. C 2 151-158 1998 PDF PostScript arXiv


text:
# pyramid.authorization¶

class ACLAuthorizationPolicy[source]

An authorization policy which consults an ACL object attached to a context to determine authorization information about a principal or multiple principals. If the context is part of a lineage, the context's parents are consulted for ACL information too. The following is true about this security policy.

• When checking whether the 'current' user is permitted (via the permits method), the security policy consults the context for an ACL first. If no ACL exists on the context, or one does exist but the ACL does not explicitly allow or deny access for any of the effective principals, consult the context's parent ACL, and so on, until the lineage is exhausted or we determine that the policy permits or denies.

During this processing, if any pyramid.security.Deny ACE is found matching any principal in principals, stop processing by returning an pyramid.security.ACLDenied instance (equals False) immediately. If any pyramid.security.Allow ACE is found matching any principal, stop processing by returning an pyramid.security.ACLAllowed instance (equals True) immediately. If we exhaust the context's lineage, and no ACE has explicitly permitted or denied access, return an instance of pyramid.security.ACLDenied (equals False).

• When computing principals allowed by a permission via the pyramid.security.principals_allowed_by_permission() method, we compute the set of principals that are explicitly granted the permission in the provided context. We do this by walking 'up' the object graph from the root to the context. During this walking process, if we find an explicit pyramid.security.Allow ACE for a principal that matches the permission, the principal is included in the allow list. However, if later in the walking process that principal is mentioned in any pyramid.security.Deny ACE for the permission, the principal is removed from the allow list. If a pyramid.security.Deny to the principal pyramid.security.Everyone is encountered during the walking process that matches the permission, the allow list is cleared for all principals encountered in previous ACLs. The walking process ends after we've processed the any ACL directly attached to context; a set of principals is returned.

Objects of this class implement the pyramid.interfaces.IAuthorizationPolicy interface.


text:
# Sponge with PRF instead of PRP

In most uses of Sponge mode of operations such as SHA3 and many of the round-2 candidates in the NIST lightweight cryptography project, the underlaying primitive is a cryptographic permutation - that is, it's bijective.

For reasons of curiosity, I noticed that a proposed Sponge-based PRNG implement forward secrecy (back-tracing resistance) by truncating part of the permutation state to all-bits-zero (Section 4.3 of the linked paper).

This got me wonder, what if the permutation is one-way (e.g. $$p(x) \oplus x$$):

Q1: What are the security implications if SHA3 hash and XOF functions were built on top of Sponge-PRF?

Q2: If the proposed PRNG used PRF, how would the security proof break apart?

Q3: If sponge-based duplex AEADs used PRF, how would their security proof break apart?

• One minor note: Sponges usually do not use keyed permutations (PRPs) but public random permutations, so technically PRF is not the correct model here. – SEJPM Dec 6 '19 at 12:02

I sent a mail to the Keccak team asking about this, and I got a response from one of the authors (Joan Daemen to be specific).

According to him, we actually can instantiate Sponge functions and Duplex objects with a "transformation" in addition to a permutation, the latter of which is what we commonly do. As long as the underlaying (fixed-width) function is indistinguishable (computationally) from a random one.

So the real reason we don't usualy use a "transformation", is that - It's not usually efficient.

Quote from the mail response.

The reason that the sponge construction is mostly instantiated with permutations (Keccak, Xoodyak, Spongent, etc.) is that we - as a cryptographic community - have a method to build efficient permutations that seem to give rise to secure sponge functions but not to build efficient transformations that do the same and the invertibility of the permutation does not hurt as far as the indifferentiability and indinguishability bounds are concerned. ...

This is true, the round functions in Feistel-network block ciphers such as DES and SM4 aren't optimal efficiency-wise, especially when compared to constructs such as ARX (add-rotate-xor such as that in ChaCha20), and bitwise-and-shift operations (such as those in Gimli, Keccak, NORX).

To conclude:

... We actually build a permutation by iterating a simple round function that does mixing, nonlinearity and shuffling. Sponges have been built with a transformation that is not a permutation, like Gluon, but that was no great success in my opinion.


text:
# What is the slope of the tangent line of r=theta-cos(-4theta+(2pi)/3) at theta=(7pi)/4?

Nov 8, 2017

$m = 0.0564$

#### Explanation:

The reference Tangents with Polar Coordinates gives us this formula for $\frac{\mathrm{dy}}{\mathrm{dx}}$:

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\frac{\mathrm{dr}}{d \theta} \sin \left(\theta\right) + r \cos \left(\theta\right)}{\frac{\mathrm{dr}}{d \theta} \cos \left(\theta\right) - r \sin \left(\theta\right)} \text{ [1]}$

Substitute $\theta - \cos \left(- 4 \theta + \frac{2 \pi}{3}\right)$ for every instance of r in equation [1]:

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\frac{\mathrm{dr}}{d \theta} \sin \left(\theta\right) + \left(\theta - \cos \left(- 4 \theta + \frac{2 \pi}{3}\right)\right) \cos \left(\theta\right)}{\frac{\mathrm{dr}}{d \theta} \cos \left(\theta\right) - \left(\theta - \cos \left(- 4 \theta + \frac{2 \pi}{3}\right)\right) \sin \left(\theta\right)} \text{ [2]}$

Substitute $1 - 4 \cos \left(\frac{\pi}{6} - 4 \theta\right)$ for every instance of (dr)/(d theta) in equation [2]:

$\frac{\mathrm{dy}}{\mathrm{dx}} = \frac{\left(1 - 4 \cos \left(\frac{\pi}{6} - 4 \theta\right)\right) \sin \left(\theta\right) + \left(\theta - \cos \left(- 4 \theta + \frac{2 \pi}{3}\right)\right) \cos \left(\theta\right)}{\left(1 - 4 \cos \left(\frac{\pi}{6} - 4 \theta\right)\right) \cos \left(\theta\right) - \left(\theta - \cos \left(- 4 \theta + \frac{2 \pi}{3}\right)\right) \sin \left(\theta\right)} \text{ [3]}$

The slope, m, is equation [3] evaluated at $\theta = \frac{7 \pi}{4}$:

$m = \frac{\left(1 - 4 \cos \left(\frac{\pi}{6} - 7 \pi\right)\right) \sin \left(\frac{7 \pi}{4}\right) + \left(\frac{7 \pi}{4} - \cos \left(- 7 \pi + \frac{2 \pi}{3}\right)\right) \cos \left(\frac{7 \pi}{4}\right)}{\left(1 - 4 \cos \left(\frac{\pi}{6} - 7 \pi\right)\right) \cos \left(\frac{7 \pi}{4}\right) - \left(\frac{7 \pi}{4} - \cos \left(- 7 \pi + \frac{2 \pi}{3}\right)\right) \sin \left(\frac{7 \pi}{4}\right)}$

$m = 0.0564$

Here is a graph of r $0 \le \theta < 2 \pi$, the specified point, and the tangent line with the above slope:


text:
# Tag Info

7

It is unlikely that there is a simple method, not involving relatively expensive chemical analysis, for distinguishing 4N, 5N, and 6N copper specimens. Shown below is a photograph of some copper specimens I have: The evaporating dish contains copper shot, the large plate (4.76 mm thick) is OFHC (oxygen free high conductivity) copper and the third specimen ...

5

One of the oldest reputable sources that I managed to find allowing to define what "uraneous oxide" is, was Roscoe's Lessons in Elementary Chemistry [1, p. 253] (strong emphasis mine): URANIUM. Symbol U, Combining Weight 240, Specific Gravity 18·4. Uranium is a metal which occurs but sparingly in nature, existing combined in two somewhat rare ...

3

According to Nickel Metal Hydride (NiMH): Handbook and Application Manual of Energizer Nical Metal Hydride: The nickel-metal hydride battery chemistry is a hybrid of the proven positive electrode chemistry of the sealed nickel-cadmium battery with the energy storage features of metal alloys developed for advanced hydrogen energy storage concepts. This ...

3

The cathode is made of $\ce{NiOOH}$ when the cell is new. This can also be written $\ce{NiO(OH)}$,where the oxidation degree of $\ce{Ni(III)}$ is more evident. The cathode is made of $\ce{Ni(OH)2}$ when the cell is discharged. Whatever the nature of the anode (cadmium, hydrogen, or any other material), the cathode is working according to the equation \ce{...

2

Pure iron is more corrosion resistant than regular steel. Also there is an alloy of iron named wrought iron which has very low carbon content, and that makes it more resistance to corrosion, but steel has better strength. I think also Eiffel tower was made out of wrought iron. From the Wikipedia article about wrought iron: Wrought iron is an iron alloy with ...

Top 50 recent answers are included


text:
# Properties

 Label 7350.2.a.t Level 7350 Weight 2 Character orbit 7350.a Self dual yes Analytic conductor 58.690 Analytic rank 1 Dimension 1 CM no Inner twists 1

# Related objects

## Newspace parameters

 Level: $$N$$ $$=$$ $$7350 = 2 \cdot 3 \cdot 5^{2} \cdot 7^{2}$$ Weight: $$k$$ $$=$$ $$2$$ Character orbit: $$[\chi]$$ $$=$$ 7350.a (trivial)

## Newform invariants

 Self dual: yes Analytic conductor: $$58.6900454856$$ Analytic rank: $$1$$ Dimension: $$1$$ Coefficient field: $$\mathbb{Q}$$ Coefficient ring: $$\mathbb{Z}$$ Coefficient ring index: $$1$$ Twist minimal: no (minimal twist has level 210) Fricke sign: $$1$$ Sato-Tate group: $\mathrm{SU}(2)$

## $q$-expansion

 $$f(q)$$ $$=$$ $$q - q^{2} + q^{3} + q^{4} - q^{6} - q^{8} + q^{9} + O(q^{10})$$ $$q - q^{2} + q^{3} + q^{4} - q^{6} - q^{8} + q^{9} - 5q^{11} + q^{12} + q^{13} + q^{16} - 2q^{17} - q^{18} + 7q^{19} + 5q^{22} + 3q^{23} - q^{24} - q^{26} + q^{27} - 6q^{31} - q^{32} - 5q^{33} + 2q^{34} + q^{36} - 5q^{37} - 7q^{38} + q^{39} - 9q^{41} + 10q^{43} - 5q^{44} - 3q^{46} - 13q^{47} + q^{48} - 2q^{51} + q^{52} - q^{53} - q^{54} + 7q^{57} + 4q^{59} - 2q^{61} + 6q^{62} + q^{64} + 5q^{66} + 6q^{67} - 2q^{68} + 3q^{69} - 2q^{71} - q^{72} + 4q^{73} + 5q^{74} + 7q^{76} - q^{78} - 14q^{79} + q^{81} + 9q^{82} - 10q^{83} - 10q^{86} + 5q^{88} + 10q^{89} + 3q^{92} - 6q^{93} + 13q^{94} - q^{96} + 8q^{97} - 5q^{99} + O(q^{100})$$

## Embeddings

For each embedding $$\iota_m$$ of the coefficient field, the values $$\iota_m(a_n)$$ are shown below.

For more information on an embedded modular form you can click on its label.

Label $$\iota_m(\nu)$$ $$a_{2}$$ $$a_{3}$$ $$a_{4}$$ $$a_{5}$$ $$a_{6}$$ $$a_{7}$$ $$a_{8}$$ $$a_{9}$$ $$a_{10}$$
1.1
 0
−1.00000 1.00000 1.00000 0 −1.00000 0 −1.00000 1.00000 0
 $$n$$: e.g. 2-40 or 990-1000 Significant digits: Format: Complex embeddings Normalized embeddings Satake parameters Satake angles

## Inner twists

This newform does not admit any (nontrivial) inner twists.

## Twists

By twisting character orbit
Char Parity Ord Mult Type Twist Min Dim
1.a even 1 1 trivial 7350.2.a.t 1
5.b even 2 1 7350.2.a.bn 1
5.c odd 4 2 1470.2.g.f 2
7.b odd 2 1 7350.2.a.b 1
7.c even 3 2 1050.2.i.o 2
35.c odd 2 1 7350.2.a.ch 1
35.f even 4 2 1470.2.g.a 2
35.j even 6 2 1050.2.i.f 2
35.k even 12 4 1470.2.n.i 4
35.l odd 12 4 210.2.n.a 4
105.x even 12 4 630.2.u.c 4
140.w even 12 4 1680.2.di.a 4

By twisted newform orbit
Twist Min Dim Char Parity Ord Mult Type
210.2.n.a 4 35.l odd 12 4
630.2.u.c 4 105.x even 12 4
1050.2.i.f 2 35.j even 6 2
1050.2.i.o 2 7.c even 3 2
1470.2.g.a 2 35.f even 4 2
1470.2.g.f 2 5.c odd 4 2
1470.2.n.i 4 35.k even 12 4
1680.2.di.a 4 140.w even 12 4
7350.2.a.b 1 7.b odd 2 1
7350.2.a.t 1 1.a even 1 1 trivial
7350.2.a.bn 1 5.b even 2 1
7350.2.a.ch 1 35.c odd 2 1

## Atkin-Lehner signs

$$p$$ Sign
$$2$$ $$1$$
$$3$$ $$-1$$
$$5$$ $$-1$$
$$7$$ $$1$$

## Hecke kernels

This newform subspace can be constructed as the intersection of the kernels of the following linear operators acting on $$S_{2}^{\mathrm{new}}(\Gamma_0(7350))$$:

 $$T_{11} + 5$$ $$T_{13} - 1$$ $$T_{17} + 2$$ $$T_{19} - 7$$ $$T_{23} - 3$$ $$T_{31} + 6$$

## Hecke characteristic polynomials

$p$ $F_p(T)$
$2$ $$1 + T$$
$3$ $$1 - T$$
$5$ 1
$7$ 1
$11$ $$1 + 5 T + 11 T^{2}$$
$13$ $$1 - T + 13 T^{2}$$
$17$ $$1 + 2 T + 17 T^{2}$$
$19$ $$1 - 7 T + 19 T^{2}$$
$23$ $$1 - 3 T + 23 T^{2}$$
$29$ $$1 + 29 T^{2}$$
$31$ $$1 + 6 T + 31 T^{2}$$
$37$ $$1 + 5 T + 37 T^{2}$$
$41$ $$1 + 9 T + 41 T^{2}$$
$43$ $$1 - 10 T + 43 T^{2}$$
$47$ $$1 + 13 T + 47 T^{2}$$
$53$ $$1 + T + 53 T^{2}$$
$59$ $$1 - 4 T + 59 T^{2}$$
$61$ $$1 + 2 T + 61 T^{2}$$
$67$ $$1 - 6 T + 67 T^{2}$$
$71$ $$1 + 2 T + 71 T^{2}$$
$73$ $$1 - 4 T + 73 T^{2}$$
$79$ $$1 + 14 T + 79 T^{2}$$
$83$ $$1 + 10 T + 83 T^{2}$$
$89$ $$1 - 10 T + 89 T^{2}$$
$97$ $$1 - 8 T + 97 T^{2}$$


text:
# Conclusively solving the extreme gerrymandering puzzle

This is the source of the following puzzle: CMU puzzle 20

When I look at the official solution though, I feel that the proof is not comprehensive. First the question (slightly rephrased to improve comprehension):

The presidential elections are to be held in Anchuria. Of the 20,000,000 voters only 1 percent support the current president Wobushko, the other $$99\%$$ favoring the opposition.

Here's how the election system in Anchuria works: There is a list of numbers, $$n_1,\dots,n_L$$. The entire population is divided into $$n_1$$ equally sized groups. Each of these groups is divided into $$n_2$$ equally sized subgroups, each subgroup is divided into $$n_3$$ equal sub-subgroups, and so on down the line.

On election day, each sub-sub-$$\dots$$-subgroup elects a representative to vote for it at the next level up. Tie votes count as win for the opposition.

The current president has the power to choose the numbers $$L,n_1,\dots, n_L$$, and to choose which voters go in which groups. Can Wobushko organize the groups and distribute his supporters so that he wins the elections?

Now, the official solution: http://www.cs.cmu.edu/puzzle/solution20.pdf , says the following :

So, in this case, we can have L = 11 levels and Wobushko will win.

Now, here is my question:

Let's say that only 100,000 of the 20 million voters supported Wobushko. 20,000,000 = $$5^7*4^4$$ . In which case, Wobushko needs to have $$3^7$$*$$3^4$$ = 177,147 but he only has 100000 supporters.

Is this proof comprehensive enough to say that Wobushko will lose ? Or do we need to look at all possible breakups of 20 million?

For instance, one other way to breakup 20 million is, 20 million = $$125*625*256$$ which requires $$63*313*129$$ = 2543751 supporters for Wobushko. So, in the case where the group sizes are 125, 625 and 256, Wobushko will also not win.

Basically, do we need to look at all the possible breakups of 20 million and make sure that Wobushko does not win in any of these breakups or is just looking at 20,000,000 = $$5^7*4^4$$ enough?

Yes, the proof comprehensively proves that Wobushko will lose if they do not have at least the required 177,147 voters.

Now let's take a look at why:

To maximize their advantage, Wobushko should aim to divide Anchuria into the largest number of electoral levels $$L$$ possible, represented by the number of factors of $$N$$ = 20,000,000 one chooses. If Anchuria were a perfect democracy (that is, we had $$L = 1$$), Wobushko would need at least 10,000,001 voters to win the election.

Now, we can show that

by increasing the number of electoral levels of Anchuria and re-distributing their supporters accordingly, the number of voters Wobushko needs to win generally decreases (which plays to their advantage). For example, by splitting Anchuria's $$N$$ = 20,000,000 voters into $$A$$ = 2,000 groups of $$B$$ = 10,000 voters, Wobushko would need to win 5,001 of the 10,000 voters in every group and 1,001 of the 2,000 groups, resulting in Wobushko only needing 5,006,001 voters to win the election. In fact, we can observe that the number of voters required to win a group of size $$N$$, $$\mathrm{floor}(\frac{N}{2})+1$$, is almost always greater than the number of voters required to win $$A$$ groups of size $$B$$, which is $$\small(\mathrm{floor}(\frac{A}{2})+1)\cdot(\mathrm{floor}(\frac{B}{2})+1) = \mathrm{floor}(\frac{A}{2})\cdot\mathrm{floor}(\frac{B}{2}) + \mathrm{floor}(\frac{A}{2}) + \mathrm{floor}(\frac{B}{2}) + 1$$The only situation in which this is not true is when one of $$A$$ or $$B$$ is very small. Specifically, if $$A$$ or $$B$$ is less than or equal to 2, Wobushko gains no advantage in dividing, because they must win every electoral level by strict majority -- which would mean winning both resulting groups if $$A = 2$$ or all voters in each group if $$B = 2$$.

Thus,

the "ultimate" way that Wobushko could game the system is if they performed the above "division" as many times as possible without selecting $$A$$ or $$B$$ less than or equal to 2 or creating any unequally sized groups. To accomplish this, Wobushko should calculate the factorization of $$N$$ with the largest number of factors without including 2 as a factor. This is accomplished by the above factorization $$N = 5^{7} \cdot 4^{4}$$, which is the prime factorization of $$N$$ if we consider 4 to be "prime" (since we cannot divide a group of size $$N = 4$$ into $$A = 2$$ groups of size $$B = 2$$). This yields 177,147 as a strict minimum for the number of voters Wobushko must have to win the election.

• Thank you for this well written answer. I do have 2 questions though. Firstly, you said that as long as A and B are > 2, $\mathrm{floor}(\frac{N}{2})+1$ is always greater than $$\small(\mathrm{floor}(\frac{A}{2})+1)\cdot(\mathrm{floor}(\frac{B}{2})+1) = \mathrm{floor}(\frac{A}{2})\cdot\mathrm{floor}(\frac{B}{2}) + \mathrm{floor}(\frac{A}{2}) + \mathrm{floor}(\frac{B}{2}) + 1$$ Can you prove this ? Jul 29 at 4:36


text:
# Integration

Contents

### Summary

Indefinite Integral:      $\int { { x }^{ n } } dx\quad =\quad \frac { { x }^{ n\quad +\quad 1 } }{ n\quad +\quad 1 } \quad +\quad C$

The ”C” means any number. This is the constant of integration.

Definite Integral:      $\int _{ a }^{ b }{ f^{ ' }\left( x \right) dx\quad =\quad f\left( b \right) } \quad -\quad f\left( a \right)$

Area under the curve:      $\int _{ a }^{ b }{ f\left( x \right) dx }$

Area between a curve and a line      $=\quad \int _{ a }^{ b }{ f\left( { y }_{ 1 }\quad -\quad { y }_{ 2 } \right) dx }$

Approximate area using trapezium rule: $\int _{ a }^{ b }{ { y }_{ i } } dx\quad \approx$

$\quad \frac { 1 }{ 2 } h\left[ { y }_{ 0 }\quad +\quad 2({ y }_{ 1 }\quad +\quad { y }_{ 2\quad }........\quad +\quad { y }_{ n-1 })\quad +\quad { y }_{ n } \right]$

Where $h\quad =\quad \frac { b\quad -\quad a }{ n }$ and ${ y }_{ i }\quad =\quad f\left( a\quad +\quad ih \right)$.

Integration is the inverse of differentiation. It is the general formula for the Area under the graph between any 2 points.

RECALL
Differentiation is used to find the gradient of a curve which also tells you the rate of change of the curve at that point.

#### When do we integrate?

• We integrate when we know the derivative and need to find the function.
• To find Area under the graph.
• To find volume of solid of revolution

#### How do we integrate?

Remember, when we differentiate, we first multiply the coefficient by the power and then we take 1 away from our power. e.g

$y\quad =\quad { x }^{ 2 }$

${ dy }/{ dx }\quad =\quad 2{ x }^{ (2\quad -\quad 1) }$

${ dy }/{ dx }\quad =\quad 2{ x }$

Now when we integrate we do the opposite. We first add 1 to our power and then we divide by the new power.

$dy\quad =\quad \int { 2x\quad dx }$

$y\quad =\quad \left[ 2{ x }^{ (1\quad +\quad 1) }/2 \right] \quad +\quad C$

$y\quad =\quad { x }^{ 2 }\quad +\quad C$

In such a case where we don’t have limits of integration we must add a constant C in the end. This just shows there might be a constant in the equation of the function.

E.g the equation $(y\quad =\quad { x }^{ 2 }\quad +\quad C)$ from above can have different values of C but when you differentiate it, you will get the same equation $(y\quad =\quad { x }^{ 2 })$. As power of a constant always becomes 0, and anything when multiplied by 0 results in a 0 as well.

Tip: You can check you have integrated properly by differentiating the answer. You should end up with the thing you started with.

When we integrate we can find out Area under the graph.

#### There are different types of integrals:

• Indefinite Integration: Integrate simple functions without defined limit.

Example:

$\int { 5{ x }^{ 2 } } dx\quad =\quad \frac { 5{ x }^{ 2\quad +\quad 1 } }{ 3 } \quad +\quad C$

$\quad =\quad \frac { 5{ x }^{ 3 } }{ 3 } \quad +\quad C$

Indefinite integral:

$\int { { x }^{ n } } dx\quad =\quad \frac { { x }^{ n\quad +\quad 1 } }{ n\quad +\quad 1 } \quad +\quad C$

where C is an arbitrary constant

Other forms:

$\int { { ax }^{ n } } dx\quad =\quad \frac { { ax }^{ n\quad +\quad 1 } }{ n\quad +\quad 1 } \quad +\quad C$

$\int { { (ax\quad +\quad b) }^{ n } } dx\quad =\quad \frac { { (ax\quad +\quad b) }^{ n\quad +\quad 1 } }{ a(n\quad +\quad 1) } \quad +\quad C$

$\int { a\quad dx\quad =\quad ax\quad +\quad C } } dx\quad =\quad \frac { { (ax\quad +\quad b) }^{ n\quad +\quad 1 } }{ a(n\quad +\quad 1) } \quad +\quad C$

To integrate a power of x (except ${ x }^{ -1 }$):

1.     Increase the power by one, then divide by it.
2.     Stick a constant on the end.

• Definite Integration: Integrate a function between defined limits.

$\int _{ a }^{ b }{ f^{ ' }\left( x \right) dx\quad =\quad f\left( b \right) } \quad -\quad f\left( a \right)$

Where f’(x) is the derived function of f throughout the interval (a, b).

Three stages to work out the definite integral:

Definite integration includes three types:

1.     Integration to find Area under curves

Example:

$f\left( x \right) \quad =\quad 3{ x }^{ 2 }\quad \quad \quad \quad \quad \quad \quad \quad \quad \quad a\quad =\quad 1,\quad b\quad =\quad 2$

$Area\quad =\quad \int _{ 1 }^{ 2 }{ 3{ x }^{ 2 } } dx\quad =\quad { \left[ { x }^{ 3 } \right] }_{ 1 }^{ 2 }$

$=\quad ({ 2 }^{ 3 })\quad -\quad ({ 1 }^{ 3 })$

$=\quad 8\quad -\quad 1$

$=\quad 7$

2.     Integration to find Area between a curve and a line

The area between a line (equation y1) and a curve (equation y2) is given by:

$Area\quad =\quad \int _{ a }^{ b }{ ({ y }1\quad -\quad { y }2) } dx$

Example:

Diagram shows a curve with equation ${ y }2\quad =\quad x(4\quad -\quad x)$ and the line with equation ${ y }1\quad =\quad x$.

To find the area of the region bounded by the curve and the line, we first find the point of intersection between the curve and the line.

We do this by equating both the equations:

${ x(4\quad -\quad x) }\quad =\quad x$
$4x\quad -\quad { x }^{ 2 }\quad =\quad x$

Take$4x\quad -\quad { x }^{ 2 }$ to the other side of the equal to sign.

${ x }^{ 2 }\quad -\quad 3x\quad =\quad 0$
${ x }(x\quad -\quad 3)\quad =\quad 0$
$x\quad =\quad 0\quad or\quad x\quad =\quad 3$

Find y coordinates by substituting x back in one of the equations. The line y1 = x is the simplest one.

Therefore, the line cuts the curve at (0, 0) & (3, 3).

Next we use the formula and integrate the expression.

$Area\quad =\quad \int _{ 0 }^{ 3 }{ \left[ x(4\quad -\quad x)\quad -\quad x \right] } dx$

$=\quad \int _{ 0 }^{ 3 }{ (3x\quad -\quad { x }^{ 2 }) } dx$

$=\quad { \left[ \frac { 3 }{ 2 } { x }^{ 2 }\quad -\quad \frac { { x }^{ 3 } }{ 3 } \right] }_{ 0 }^{ 3 }$

$=\quad (\frac { 27 }{ 2 } \quad -\quad 9)\quad -\quad (0)\quad =\quad 4.5$

3.     Approximate the area under a curve by using trapezium rule

Sometimes we may want to find the area beneath a curve but we may not be able to integrate the equation.

However, we can find an approximate value of the area under the curve between two limits a and b using the trapezium rule.

The formula given is: $\int _{ a }^{ b }{ { y }_{ i } } dx\quad \approx$

$\quad \frac { 1 }{ 2 } h\left[ { y }_{ 0 }\quad +\quad 2({ y }_{ 1 }\quad +\quad { y }_{ 2\quad }........\quad +\quad { y }_{ n-1 })\quad +\quad { y }_{ n } \right]$

Where $h\quad =\quad \frac { b\quad -\quad a }{ n }$ and ${ y }_{ i }\quad =\quad f\left( a\quad +\quad ih \right)$.

Consider the graph below. The equation of the curve is y = f(x).

We divide the area between a and b into n equal strips.

Width of each strip   $h\quad =\quad \frac { b\quad -\quad a }{ n }$

Each area between two strips is considered a trapezium and we know that area of a trapezium is given by:

$Area\quad =\quad \frac { 1 }{ 2 } ({ y }_{ 0 }\quad +\quad { y }_{ 1 })h$

Hence to find approximate area under the curve we calculate area for n number of trapeziums and add them.

$\int _{ a }^{ b }{ { y } } dx\quad \approx \quad$

$\frac { 1 }{ 2 } h({ y }_{ 0 }\quad +\quad { y }_{ 1 })\quad +\quad \frac { 1 }{ 2 } h({ y }_{ 1 }\quad +\quad { y }_{ 2 })\quad ......$

$.........\quad +\quad \frac { 1 }{ 2 } h({ y }_{ n\quad -\quad 1 }\quad +\quad { y }_{ n })$

Factorising:

$\int _{ a }^{ b }{ { y } } dx\quad \approx$

$\quad \frac { 1 }{ 2 } h({ y }_{ 0 }\quad +\quad { y }_{ 1 }\quad +\quad { y }_{ 1 }\quad +\quad { y }_{ 2 }\quad +{ \quad y }_{ 2...................$

$.......................... }\quad +\quad { y }_{ n\quad -\quad 1 }\quad +\quad { y }_{ n\quad -\quad 1 }+\quad { y }_{ n })$

$\int _{ a }^{ b }{ { y } } dx\quad \approx$

$\quad \frac { 1 }{ 2 } h\left[ { y }_{ 0 }\quad +\quad 2({ y }_{ 1 }\quad +\quad { y }_{ 2 }\quad +\quad { y }_{ n\quad -\quad 1 })\quad +\quad { y }_{ n } \right]$

Example:

Use the trapezium rule with 4 strips to estimate the area under the curve with equation $y\quad =\quad \sqrt { 2x\quad +\quad 3 }$ between the lines x = 0 and x = 2.

To do this by trapezium rule we first work out the width of each strip.

Width   $h\quad =\quad \frac { 2-0 }{ 4 } \quad =\quad 0.5$

We now calculate the value of y at the boundaries of each of the strips.

 x 0 0.5 1 1.5 2 $y\quad =\quad \sqrt { (2x\quad +\quad 3) }$$y\quad =\quad \sqrt { (2x\quad +\quad 3) }$ 1.732 2 2.236 2.449 2.646

Finally, we use the formula to work out the estimated area under the curve.

$Area\quad =\quad \frac { 1 }{ 2 } \quad \times \quad 0.5\quad \times \quad \left[ 1.732\quad +\quad 2(2\quad +\quad 2.236\quad +\quad 2.449)\quad +\quad 2.646 \right]$

$=\quad \frac { 1 }{ 2 } \quad \times \quad 0.5\quad \times \quad \left[ 17.748 \right]$

$=\quad 4.437$

Note: Increasing the number of strips, improves the accuracy of the approximation.


text:
# How to typeset an independent and identical normal distribution (iidN) in LaTex?

Is there an elegant way of writing "iidN()" in LaTex, other than just writing it "iidN()"?

That is, is there a macro for "iid" and/or for normal distribution "N" symbols?

-
Scrap that. I meant i.i.d. $X \sim \mathcal{N}(\mu,\sigma^2)$. –  Jubobs May 9 '13 at 18:54
+1 Thank you again =) –  jjepsuomi May 9 '13 at 19:01

I'd recommend defining macros to reduce the number of keystrokes for i.i.d. and \mathcal N, if you use them a lot: this will.allow you to quickly type them out, and quickly change the way they're typeset if you decide to. For instance:
\newcommand\iid{i.i.d.}
\iid~$X \sim \pN(\mu, \sigma^2)$

If you want to write i.i.d. without a nonbreaking space, I'd recommend \iid\ (note the space).


text:
# Detecting if resistances are parallel or series in complex circuits

I know how to detect when resistors are arranged in parallel or series arrangement and
I can also find their equivalent resistance in simple circuits or when resistances are connected in form of
triangle but what happens when the arrangement is complex like this :

Which resistors are parallel and which are in series ? How can I find the equivalent resistance in such cases ? Is there rule or method for figuring this out ?

Alfred got in before me, but I have a diagram!

I've marked all continuous bits of wire in the same colour, and marked the corresponding colours on the ends of the resistors. A quick redraw later and I get:

which is a lot simpler!

• Now, if you can just animate this! :) – Alfred Centauri Oct 1 '13 at 16:59
• Nice ,but how did you redraw the circuit? When I get a complex circuit like this , how should I approach redrawing it? Is there any method ? Thank you. – A Googler Oct 2 '13 at 7:57
• Do what I did. Start at some point on the wire and mark all contiguous wire (i.e. without crossing any resistors, capacitors, etc) in the same colour. Move to the next bit or wire and do the same in a different colour. – John Rennie Oct 2 '13 at 8:02
• @JohnRennie But how did you convert first figure into second ? – A Googler Oct 2 '13 at 8:06
• You can move and stretch wires as you wish, as long as you don't break them, and it doesn't change the circuit. All I did was (mentally) shrink the red wires as much as possible to get the red ends of the resistors grouped together. Then I did the same with the blue ends. – John Rennie Oct 2 '13 at 8:12

Ok, the answers given so far are pretty good and I would always choose a graphical approach, but my experience tells my that some people have difficulties morphing graphs in their heads so here is a more formal way of doing it.

Close the circuit at points $A$ and $B$ with a voltage supply. You can identify three closed loops and apply Kirchhoff's second rule as indicated in my picture:

Assuming a voltage drop of $V$ between points A and B, we get:

$V = (I_1-I_2)R_1$

$0 = (I_2-I_1)R_1+(I_2-I_3)R_2$

$0 = I_3R_3+(I_3-I_2)R_2$

Now we want to replace the circuit one with only one resistor, $R_{tot}$, thus we want $V=-I_1R_{tot}$. Note the minus sign. This is because we actually have a drop, not an increase in voltage. If you forget it, it's not so bad, just keep in mind that the final resistance should be positive.

Now, we can turn this into a matrix equation:

$\begin{pmatrix}R_1+R_{tot} & -R_1 & 0\\-R_1 & R_1+R_2 & -R_2\\0 & -R_2 & R_2+R_3\end{pmatrix}\begin{pmatrix}I_1\\I_2\\I_3\end{pmatrix}=\begin{pmatrix}0\\0\\0\end{pmatrix}$

For this system to have a non-trivial solution, we need to have that the determinant of the coefficient matrix vanishes. This yields the equation:

$(R_1+R_{tot})(R_1+R_2)(R_2+R_3)-R_2^2(R_1+R_{tot})-R_1^2(R_2+R_3)=0$

Which can be solved for $R_{tot}$:

$R_{tot} = \dots = \frac{1}{\frac{1}{R_1}+\frac{1}{R_2}+\frac{1}{R_3}}$

Finally, we get the same total resistance we know we would get if $R_1$, $R_2$ and $R_3$ were in parallel. Therefore, the two circuits are equivalent.

Well, I guess this post turned itself into a reminder why you shouldn't try this in an exam.

• +1, especially for you shouldn't try this in an exam! – Kyle Oman May 14 '14 at 16:52
• Your equations made Kirchhoff's law too simpler for me! Thanks. :) – Harshal Gajjar Jul 28 '15 at 15:36

The rule is to redraw the circuit so that it is plain to see how the circuit elements are connected.

In this case, note that one end of each resistor is connected to node A and the other end of each resistor is connected to node B so redraw the circuit that way and note that the resistors are parallel connected, i.e., the identical voltage is across all three resistors.

Even simple circuits such as this can be drawn in such a way that it isn't obvious if the circuit elements are series or parallel connected so, when it isn't clear how they are connected, try redrawing the circuit until it is.

There are many ways to solve Complex resistor circuits -- Like Parallel axis of symmetry ,

Perpendicular axis of symmetry ,

Balanced Wheat stone bridge ,

Shifted symmetry ,

Path symmetry ,KCL and KVL ,

Nodal method

Y-delta

For This is a very simple case , We will first need to define nodes a,b,c,d as in image. Redraw the circuit.Here ac and b,d are on same resistance , so circuit can be more simplified in all 3 resistor in parallel

As the 3 resistors are connected within the same potentials they are parallel.


text:
## Mesh Adaptive Direct Searches (MADS) algorithm for derivative-free and black-box optimization

### Description

An implementation of the Mesh Adaptive Direct Searches (MADS) algorithm for derivative-free and black-box optimization. It uses a series of variable size meshes to search the space and to converge to (local) minima with mathematical proof of convergence. It is usable on unbounded and bounded unconstrained problems. The objective function can return “NA” if out-of-bound or violating constraints (strict barrier approach for constraints), or a penalty can be added to the objective function.

### Usage

mads(par, fn, lower=-Inf, upper=Inf, scale=1, control = list(), ...)

### Arguments

 par A starting vector of parameter values. Must be feasible, i.e. lie strictly between lower and upper bounds. fn Noisy, non-differentiable, non-convex, piecewise or nonlinear objective function that is to be optimized. It takes a real vector as argument and returns a scalar or “NA” that is the value of the function at that point (see details). lower Lower bounds on the parameters. A vector of the same length as the parameters. If a single value is specified, it is assumed that the same lower bound applies to all parameters. If all lower bounds are -Inf and all upper bounds are Inf, then the problem is treated as unbounded. upper Upper bounds on the parameters. A vector of the same length as the parameters. If a single value is specified, it is assumed that the same upper bound applies to all parameters. If all lower bounds are -Inf and all upper bounds are Inf, then the problem is treated as unbounded. scale Optional scaling, default is 1. A vector of the same length as the parameters. If a single value is specified, it is assumed that the same scale factor applies to all parameters. This scale factor can be customized for each parameter allowing non-proportional moves in the space (normally used for unbounded problems). control A list of control parameters. See *Details* for more information. ... Additional arguments passed to fn

### Details

Argument control is a list specifing any changes to default values of algorithm control parameters for the outer loop. The list items are as follows:

tol Convergence tolerance. Iteration is terminated when the absolute difference in function value between successive iteration is below tol. Default is 1.e-06.

maxfeval: Maximum number of objective function evaluations allowed. Default is 10000).

trace A logical variable indicating whether information is printed on the console during execution. Default is TRUE.

maximize A logical variable indicating whether the objective function should be maximized. Default is FALSE (hence default is minimization).

pollStyle A string variable indicating density of the poll set, or, number of vectors in the positive basis. Choices are: “lite” (n+1 points) or “full” (2n points). Default is “lite”.

deltaInit A numerical value specifying the initial mesh size, between “tol” and 1 (mesh size is limited to 1). Default is 0.01.

expand A numerical value >1 specifying the expansion (is success) and contraction (if no success) factor of the mesh at the end of an iteration. Default is 4.

lineSearch A integer value indicating the maximum of search steps to consider. Line search is performed at the end of a successful poll set evaluation, along the line going from last to new “best” solution. Stepsize will be automatically increased according to the Fibonacci series. Default is 20. Set to -1 to disable the feature.

seed Seed value for the internal pseudo random numbers generator. Default is 1138.

### Value

A list with the following components:

 par Best estimate of the parameter vector found by the algorithm. value The value of the objective function at termination. feval The number of times the objective fn was evaluated. convergence Final mesh size, should be

### Note

This algorithm is based on the Lower Triangular method described in the reference.

### Author(s)

Vincent Bechard <vincent.bechard@hec.ca>, HEC Montreal (Montreal University) URL:https://www.linkedin.com/in/vincentbechard

### References

C. Audet and J. E. Dennis, Jr. Mesh adaptive direct search algorithms for constrained optimization. SIAM Journal on Optimization, 17(1): 188-217, 2006.

optim, hjk, nmk

### Examples

 rosbkext <- function(x){
# Extended Rosenbrock function
n <- length(x)
sum (100*(x[1:(n-1)]^2 - x[2:n])^2 + (x[1:(n-1)] - 1)^2)
}

np <- 10
p0 <- rnorm(np)
ans1 <- mads(fn=rosbkext, par=p0, lower=-10, upper=10, scale=1, control=list(trace=FALSE))

### A non-smooth problem from Hock & Schittkowski #78
hs78 <- function(x){
f <- rep(NA, 3)
f[1] <- sum(x^2) - 10
f[2] <- x[2]*x[3] - 5*x[4]*x[5]
f[3] <- x[1]^3 + x[2]^3 + 1
F <- prod(x) + 10*sum(abs(f))
return(F)
}

p0 <- c(-2,1.5,2,-1,-1)
ans2 <- mads(p0, hs78, control=list(trace=FALSE)) #minimum value around -2.81

[Package dfoptim version 2020.10-1 Index]