text:
# Measure the speed of a stationary bike with belt drive

I have a problem with the measurement of the speed of my stationary bike.

(also here)

Parameters:

1. radius of flywheel is 13cm
2. second wheel is 12cm (0.12m)
3. the sensor is simply a reed switch

I'm trying to calculate the speed using this formula :

$$\text{angular velocity} = \text{rotation per second (Hz)}\cdot 2\cdot \pi$$

$$\text{speed} = \text{angular velocity}\cdot{0.12}m/s$$

$$\text{speed} =\text{speed} \cdot 3.6 km/h$$

Are my formulas correct? I'm not using a flywheel in this calculation. I'm using an Arduino Mega with Interrupts. The result isn't quite good (output: pastebin.com/V2mtGzmn).

How to do it more acurrately?

The code is here.

• The bike's speed is zero; it's stationary. But really, what about the results is not good? How are you measuring time? – Samuel Nov 25 '14 at 0:29
• With the interrupt - is 1 sec because of 1Hz; I'm comparing the results with the original computer (on the bike) and "speed" is different. On my Arduino is about 5 km/s less... – user59000 Nov 25 '14 at 0:37
• You're measuring the time between the interrupts from the reed switch, presumably these come in different increments than once per second (1Hz), how are you measuring that time? A timer/counter? Converting it to seconds? You're using floating points for doing math? Come on man, help us help you. – Samuel Nov 25 '14 at 0:45
• Of course. Sorry about that. Maybe just look at my code pastebin.com/iq3yR6vN (with comments). Edit: and I'm not using the flywheel - should I ? If yes that how I can use it in this code... ? – user59000 Nov 25 '14 at 0:54
• Can't say for sure what your issue is, how do you know the bike computer isn't the incorrect measure? Also, worth noting, instead of three floating point multiplications you can simply multiply once (Hz*2.9376) = (Hz * (2*pi*0.12*3.6)). It may reduce rounding errors. – Samuel Nov 25 '14 at 1:06

Your system seems to be working as you've designed it. You're counting in increments of one Hz. So your results make perfect sense.

1 Hz = 2.94 km/h

2 Hz = 5.88 km/h

3 hz = 8.82 km/h

etc.

If you want more precision, count the milliseconds between each revolution. Your measured revolutions per second (that you're incorrectly calling "angular velocity") value will be 1/(measured seconds), which is in Hertz. Use that value in place of "angular velocity" and you'll likely get the results you're expecting rather than what you've currently designed for.

• You mean 1/(measured milliseconds) but Hertz = 1/s. So it will be 1/(measured milliseconds/1000) ? And the rest of code seems to be like: speed = 1/(measured milliseconds/1000.0) * 0.12; speed = speed * 3.6; right? – user59000 Nov 25 '14 at 3:51
• But, for example 1/5000ms * 0.0029376 = 0.00000059 hmm? – user59000 Nov 25 '14 at 4:07
• Yes, fair enough, 1/(measured milliseconds/1000). Or 1/(measured milliseconds) * 2937.6 = speed [km/h] – Samuel Nov 25 '14 at 16:25
• And, Samuel - this is 2712,96 not 2937,6 . – user59000 Nov 26 '14 at 18:34
• Hey, @Samuel - it's still not working well. With this code pastebin.com/17pHZ6wY results are lowest than I was expected - in the console speed is 22, in my program 5 (km/h)... What I'm doing wrong ? If I calculate this with r = 0.06 (half of r - on this distanse reedswtich is mounted) result is e.g. 1,771 when on console 17,7 km/h – user59000 Dec 10 '14 at 1:58

format: plain


text:
# 我的第一篇 Octopress 博客

## BlockQuote

• 方法一： 使用 >

A sample blockquote.

Nested blockquotes are also possible.

This is the outer quote again.

• 方法二：使用 blockquote 作标记

Wheeee!

## 代码展示

• 方法一：缩进一个 tab
System.out.println("Hello World!");

• 方法二：使用波浪线
This is also a code block.
~~~
Ending lines must have at least as
many tildes as the starting line.

• 方法三：使用连续 3 个  作标记
• 方法四：导入文件中的代码
• 方法五：导入 gist 中的代码
• 方法六：使用 codeblock 作标记

## 使用 Inline Code

Use Kramdown::Document.new(text).to_html to convert the text in kramdown syntax to HTML.

Use backticks to markup code, e.g. code`.

## 使用目录

• list element with functor item

## 使用数学公式

random variables $X_1, X_2, X_3$ from

The following is a math block:

But next comes a paragraph with an inline math statement:

$5 + 5$

## 使用链接

Jekyll is a very popular and very powerful static blog generator. Out of the box it’s able to generate sophisticated site structures, and has a ton of configurability. One of the areas where I feel that Jekyll lacks some sophistication is around the handling of categories and tags; these are two data-sets that are core to Jekyll, but there isn’t a lot of functionality actually built around them. This is in contrast to dynamic blogging platforms like WordPress, or possibly Drupal, where these two data points are used to drive a lot of central navigation for the site.

## 使用 pullquote

Surround your paragraph with the pull quote tags. Then when you come to the text you want to pull, surround it like this and that’s all there is to it.

## 使用表格

Default aligned Left aligned Center aligned Right aligned
First body part Second cell Third cell fourth cell
Second line foo strong baz
Third line quux baz bar

## 使用列表

• 方法一：使用数字
1. Item one
1. sub item one
2. sub item two
3. sub item three
2. Item two
• 方法二：使用 *
• Item one
• Item two
• Item three

## 使用定义列表

term
definition
another definition
another term
and another term
and a definition for the term

## 为块级元素添加 attribute

A nice blockquote

paragraph

This is red.

## 使用扩展

This is a paragraph … paragraph continues here.

Extensions can also be used inline **see**!

Notes

• comment
• Treat the body text as a comment which does not show in the output.
• nomarkdown
• Don’t process the body with kramdown but output it as-is. The attribute type specifies which converters should output the body: if the attribute is missing, all converters should output it. Otherwise the attribute value has to be a space separated list of converter names and these converters should output the body.
• options
• Should be used without a body since the body is ignored. Is used for setting the global options for the kramdown processor (for example, to disable automatic header ID generation). Note that options that are used by the parser are immediately effective whereas all other options are not! This means, for example, that it is not possible to set converter options only for some part of a kramdown document.

Emphasized

Emphasized

Strong

Strong

## 使用 Typographic Symbols

— will become an em-dash (like this —)

– will become an en-dash (like this –)

… will become an ellipsis (like this …)

<< will become a left guillemet (like this «) – an optional following space will become a non-breakable space

>> will become a right guillemet (like this ») – an optional leading space will become a non-breakable space

1. 我的脚注

Tags: octopress, 网页开发


text:
MLIR  16.0.0git
Utils.h
Go to the documentation of this file.
1 //===- Utils.h - SCF dialect utilities --------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This header file defines prototypes for various SCF utilities.
10 //
11 //===----------------------------------------------------------------------===//
12
13 #ifndef MLIR_DIALECT_SCF_UTILS_UTILS_H_
14 #define MLIR_DIALECT_SCF_UTILS_UTILS_H_
15
17 #include "mlir/IR/PatternMatch.h"
18 #include "mlir/Support/LLVM.h"
21
22 namespace mlir {
23 class Location;
24 class Operation;
25 class OpBuilder;
26 class Region;
27 class RewriterBase;
28 class ValueRange;
29 class Value;
30
31 namespace func {
32 class CallOp;
33 class FuncOp;
34 } // namespace func
35
36 /// Replace the loop with newIterOperands added as new initialization
37 /// values. newYieldValuesFn is a callback that can be used to specify
38 /// the additional values to be yielded by the loop. The number of
39 /// values returned by the callback should match the number of new
40 /// initialization values. This function
41 /// - Moves (i.e. doesnt clone) operations from the loop to the newly created
42 /// loop
43 /// - Replaces the uses of loop with the new loop.
44 /// - loop isnt erased, but is left in a "no-op" state where the body of the
45 /// loop just yields the basic block arguments that correspond to the
46 /// initialization values of a loop. The loop is dead after this method.
47 /// - All uses of the newIterOperands within the generated new loop
48 /// are replaced with the corresponding BlockArgument in the loop body.
49 using NewYieldValueFn = std::function<SmallVector<Value>(
51 scf::ForOp replaceLoopWithNewYields(OpBuilder &builder, scf::ForOp loop,
52  ValueRange newIterOperands,
53  const NewYieldValueFn &newYieldValuesFn);
54
55 /// Update a perfectly nested loop nest to yield new values from the innermost
56 /// loop and propagating it up through the loop nest. This function
57 /// - Expects loopNest to be a perfectly nested loop with outer most loop
58 /// first and innermost loop last.
59 /// - newIterOperands are the initialization values to be used for the
60 /// outermost loop
61 /// - newYielValueFn is the callback that generates the new values to be
62 /// yielded from within the innermost loop.
63 /// - The original loops are not erased, but are left in a "no-op" state where
64 /// the body of the loop just yields the basic block arguments that correspond
65 /// to the initialization values of a loop. The original loops are dead after
66 /// this method.
67 /// - All uses of the newIterOperands within the generated new loop
68 /// are replaced with the corresponding BlockArgument in the loop body.
71  ValueRange newIterOperands,
72  NewYieldValueFn newYieldValueFn);
73
74 /// Outline a region with a single block into a new FuncOp.
75 /// Assumes the FuncOp result types is the type of the yielded operands of the
76 /// single block. This constraint makes it easy to determine the result.
77 /// This method also clones the arith::ConstantIndexOp at the start of
78 /// outlinedFuncBody to alloc simple canonicalizations.
79 /// Creates a new FuncOp and thus cannot be used in a FuncOp pass.
80 /// The client is responsible for providing a unique funcName that will not
81 /// collide with another FuncOp name. If callOp is provided, it will be set
82 /// to point to the operation that calls the outlined function.
83 // TODO: support more than single-block regions.
84 // TODO: more flexible constant handling.
87  StringRef funcName, func::CallOp *callOp = nullptr);
88
89 /// Outline the then and/or else regions of ifOp as follows:
90 /// - if thenFn is not null, thenFnName must be specified and the then
91 /// region is inlined into a new FuncOp that is captured by the pointer.
92 /// - if elseFn is not null, elseFnName must be specified and the else
93 /// region is inlined into a new FuncOp that is captured by the pointer.
94 /// Creates new FuncOps and thus cannot be used in a FuncOp pass.
95 /// The client is responsible for providing a unique thenFnName/elseFnName
96 /// that will not collide with another FuncOp name.
97 LogicalResult outlineIfOp(RewriterBase &b, scf::IfOp ifOp, func::FuncOp *thenFn,
98  StringRef thenFnName, func::FuncOp *elseFn,
99  StringRef elseFnName);
100
101 /// Get a list of innermost parallel loops contained in rootOp. Innermost
102 /// parallel loops are those that do not contain further parallel loops
103 /// themselves.
106
107 /// Return the min/max expressions for value if it is an induction variable
108 /// from scf.for or scf.parallel loop.
109 /// if loopFilter is passed, the filter determines which loop to consider.
110 /// Other induction variables are ignored.
113  SmallVectorImpl<Value> &symbols,
114  llvm::function_ref<bool(Operation *)> loopFilter = nullptr);
115
116 /// Replace a perfect nest of "for" loops with a single linearized loop. Assumes
117 /// loops contains a list of perfectly nested loops with bounds and steps
118 /// independent of any loop induction variable involved in the nest.
120
121 /// Take the ParallelLoop and for each set of dimension indices, combine them
122 /// into a single dimension. combinedDimensions must contain each index into
123 /// loops exactly once.
124 void collapseParallelLoops(scf::ParallelOp loops,
125  ArrayRef<std::vector<unsigned>> combinedDimensions);
126
127 /// Promotes the loop body of a scf::ForOp to its containing block if the loop
128 /// was known to have a single iteration.
129 LogicalResult promoteIfSingleIteration(scf::ForOp forOp);
130
131 /// Unrolls this for operation by the specified unroll factor. Returns failure
132 /// if the loop cannot be unrolled either due to restrictions or due to invalid
133 /// unroll factors. Requires positive loop bounds and step. If specified,
134 /// annotates the Ops in each unrolled iteration by applying annotateFn.
136  scf::ForOp forOp, uint64_t unrollFactor,
137  function_ref<void(unsigned, Operation *, OpBuilder)> annotateFn = nullptr);
138
139 /// Tile a nest of standard for loops rooted at rootForOp by finding such
140 /// parametric tile sizes that the outer loops have a fixed number of iterations
141 /// as defined in sizes.
143 using TileLoops = std::pair<Loops, Loops>;
144 TileLoops extractFixedOuterLoops(scf::ForOp rootFOrOp, ArrayRef<int64_t> sizes);
145
146 /// Performs tiling fo imperfectly nested loops (with interchange) by
147 /// strip-mining the forOps by sizes and sinking them, in their order of
148 /// occurrence in forOps, under each of the targets.
149 /// Returns the new AffineForOps, one per each of (forOps, targets) pair,
150 /// nested immediately under each of targets.
152  ArrayRef<scf::ForOp> targets);
153
154 /// Performs tiling (with interchange) by strip-mining the forOps by sizes
155 /// and sinking them, in their order of occurrence in forOps, under target.
156 /// Returns the new AffineForOps, one per forOps, nested immediately under
157 /// target.
159  scf::ForOp target);
160
161 /// Tile a nest of scf::ForOp loops rooted at rootForOp with the given
162 /// (parametric) sizes. Sizes are expected to be strictly positive values at
163 /// runtime. If more sizes than loops are provided, discard the trailing values
164 /// in sizes. Assumes the loop nest is permutable.
165 /// Returns the newly created intra-tile loops.
166 Loops tilePerfectlyNested(scf::ForOp rootForOp, ArrayRef<Value> sizes);
167
168 /// Get perfectly nested sequence of loops starting at root of loop nest
169 /// (the first op being another AffineFor, and the second op - a terminator).
170 /// A loop is perfectly nested iff: the first op in the loop's body is another
171 /// AffineForOp, and the second op is a terminator).
173  scf::ForOp root);
174
175 } // namespace mlir
176
177 #endif // MLIR_DIALECT_SCF_UTILS_UTILS_H_
Include the generated interface declarations.
SmallVector< scf::ForOp > replaceLoopNestWithNewYields(OpBuilder &builder, ArrayRef< scf::ForOp > loopNest, ValueRange newIterOperands, NewYieldValueFn newYieldValueFn)
Update a perfectly nested loop nest to yield new values from the innermost loop and propagating it up...
Definition: Utils.cpp:105
FailureOr< func::FuncOp > outlineSingleBlockRegion(RewriterBase &rewriter, Location loc, Region &region, StringRef funcName, func::CallOp *callOp=nullptr)
Outline a region with a single block into a new FuncOp.
Definition: Utils.cpp:139
This class contains a list of basic blocks and a link to the parent operation it is attached to...
Definition: Region.h:26
bool getInnermostParallelLoops(Operation *rootOp, SmallVectorImpl< scf::ParallelOp > &result)
Get a list of innermost parallel loops contained in rootOp.
Definition: Utils.cpp:266
std::pair< Loops, Loops > TileLoops
Definition: Utils.h:143
Operation is a basic unit of execution within MLIR.
Definition: Operation.h:28
LogicalResult coalesceLoops(MutableArrayRef< AffineForOp > loops)
Replace a perfect nest of "for" loops with a single linearized loop.
Definition: LoopUtils.cpp:1715
LogicalResult promoteIfSingleIteration(AffineForOp forOp)
Promotes the loop body of a AffineForOp to its containing block if the loop was known to have a singl...
Definition: LoopUtils.cpp:131
static constexpr const bool value
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Definition: Location.h:48
LogicalResult tilePerfectlyNested(MutableArrayRef< AffineForOp > input, ArrayRef< unsigned > tileSizes, SmallVectorImpl< AffineForOp > *tiledNest=nullptr)
Tiles the specified band of perfectly nested loops creating tile-space loops and intra-tile loops...
Definition: LoopUtils.cpp:859
void collapseParallelLoops(scf::ParallelOp loops, ArrayRef< std::vector< unsigned >> combinedDimensions)
Take the ParallelLoop and for each set of dimension indices, combine them into a single dimension...
Definition: Utils.cpp:668
LogicalResult outlineIfOp(RewriterBase &b, scf::IfOp ifOp, func::FuncOp *thenFn, StringRef thenFnName, func::FuncOp *elseFn, StringRef elseFnName)
Outline the then and/or else regions of ifOp as follows:
Definition: Utils.cpp:243
This class represents an efficient way to signal success or failure.
Definition: LogicalResult.h:26
This class provides support for representing a failure result, or a valid value of type T...
Definition: LogicalResult.h:78
SmallVector< SmallVector< AffineForOp, 8 >, 8 > tile(ArrayRef< AffineForOp > forOps, ArrayRef< uint64_t > sizes, ArrayRef< AffineForOp > targets)
Performs tiling fo imperfectly nested loops (with interchange) by strip-mining the forOps by sizes an...
Definition: LoopUtils.cpp:1692
LogicalResult loopUnrollByFactor(AffineForOp forOp, uint64_t unrollFactor, function_ref< void(unsigned, Operation *, OpBuilder)> annotateFn=nullptr)
Unrolls this for operation by the specified unroll factor.
Definition: LoopUtils.cpp:1091
void getPerfectlyNestedLoops(SmallVectorImpl< AffineForOp > &nestedLoops, AffineForOp root)
Get perfectly nested sequence of loops starting at root of loop nest (the first op being another Affi...
Definition: LoopUtils.cpp:945
scf::ForOp replaceLoopWithNewYields(OpBuilder &builder, scf::ForOp loop, ValueRange newIterOperands, const NewYieldValueFn &newYieldValuesFn)
Definition: Utils.cpp:41
TileLoops extractFixedOuterLoops(scf::ForOp rootFOrOp, ArrayRef< int64_t > sizes)
Definition: Utils.cpp:925
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition: Value.h:85
This class helps build Operations.
Definition: Builders.h:192
This class provides an abstraction over the different types of ranges over Values.
Definition: ValueRange.h:345
std::function< SmallVector< Value >(OpBuilder &b, Location loc, ArrayRef< BlockArgument > newBBArgs)> NewYieldValueFn
Replace the loop with newIterOperands added as new initialization values.
Definition: Utils.h:50
This class coordinates the application of a rewrite on a set of IR, providing a way for clients to tr...
Definition: PatternMatch.h:398
Optional< std::pair< AffineExpr, AffineExpr > > getSCFMinMaxExpr(Value value, SmallVectorImpl< Value > &dims, SmallVectorImpl< Value > &symbols, llvm::function_ref< bool(Operation *)> loopFilter=nullptr)
Return the min/max expressions for value if it is an induction variable from scf.for or scf...


text:
# SM-3b-TheDiameterOfAGraph

## 4308 days ago by nhanbaoho

One of the most basic measures of a graph $G$'s structure is its diameter: what's the maximum distance every attained between one vertex in $G$ and another? A simple-minded algorithm to compute this statistic involves computing higher and higher powers of $G$'s adjacency matrix, keeping track as we go of whether or not we've yet found a path between any given pair of vertices. The first method we require is a quick-and-dirty matrix power algorithm:
def matrix_power(m,p): if p == 1: return m else: return m * matrix_power(m,p-1)
This last method in hand, we introduce the following ones. The first does the bookkeeping that allows us to tell whether we've yet found a path from any given vertex to any other; the second, as long as the first one says "no," computes higher and higher powers of the adjacency matrix, stopping the instant we know we've found a path between any two most mutually distant vertices.
def is_full(m): dim = len(m.rows())-1 for i in [0..dim]: for j in [i..dim]: if m.rows()[i][j] == 0: return False return True def diameter(m): dim = len(m.rows()) - 1 cumulative = m + matrix(dim+1,dim+1,1) d = 1 while not is_full(cumulative): d = d + 1 cumulative = cumulative + matrix_power(m,d) return d
How's it work? Let's try it out on a random tree:
G = graphs.RandomBarabasiAlbert(30,1) show(G) m = matrix(G) print m diameter(m)
  30 x 30 dense matrix over Integer Ring (type 'print m.str()' to see all of the entries) Traceback (click to the left of this block for traceback) ... NameError: name 'diameter' is not defined  30 x 30 dense matrix over Integer Ring (type 'print m.str()' to see all of the entries) Traceback (most recent call last): File "", line 1, in File "/tmp/tmpiWsdgI/___code___.py", line 10, in exec compile(u'diameter(m) File "", line 1, in NameError: name 'diameter' is not defined
Or maybe we'd like to check a more orderly graph:
P = graphs.PetersenGraph() show(P) mP = matrix(P) print mP diameter(mP)
  [0 1 0 0 1 1 0 0 0 0] [1 0 1 0 0 0 1 0 0 0] [0 1 0 1 0 0 0 1 0 0] [0 0 1 0 1 0 0 0 1 0] [1 0 0 1 0 0 0 0 0 1] [1 0 0 0 0 0 0 1 1 0] [0 1 0 0 0 0 0 0 1 1] [0 0 1 0 0 1 0 0 0 1] [0 0 0 1 0 1 1 0 0 0] [0 0 0 0 1 0 1 1 0 0] Traceback (click to the left of this block for traceback) ... NameError: name 'diameter' is not defined  [0 1 0 0 1 1 0 0 0 0] [1 0 1 0 0 0 1 0 0 0] [0 1 0 1 0 0 0 1 0 0] [0 0 1 0 1 0 0 0 1 0] [1 0 0 1 0 0 0 0 0 1] [1 0 0 0 0 0 0 1 1 0] [0 1 0 0 0 0 0 0 1 1] [0 0 1 0 0 1 0 0 0 1] [0 0 0 1 0 1 1 0 0 0] [0 0 0 0 1 0 1 1 0 0] Traceback (most recent call last): diameter(mP) File "", line 1, in File "/tmp/tmpliUFgT/___code___.py", line 8, in exec compile(u'diameter(mP) File "", line 1, in NameError: name 'diameter' is not defined


text:
# Math Help - Direct and inverse proportions

1. ## Direct and inverse proportions

If x is directly proportional to the square root of y, then y is inversely proportional to...?

2. Originally Posted by jpp
If x is directly proportional to the square root of y, then y is inversely proportional to...?

lets begin with definitions. what does it mean for x to be proportional to y?

3. x = ky

in this problem..

x = k * sqrt(y)

is that correct?

4. Originally Posted by jpp
x = ky

in this problem..

x = k * sqrt(y)

is that correct?
yes, correct! now what does it mean to be inversely proportional? Lets say i said "a is inversely proportional to b", what equation would go along with that?

5. Originally Posted by Jhevon
yes, correct! now what does it mean to be inversely proportional? Lets say i said "a is inversely proportional to b", what equation would go along with that?
a = k / b, right?

6. Originally Posted by jpp
a = k / b, right?

Correct.

so according to your question: $x = {k}{\sqrt{y}}$

can you complete it now by finding what y is inversely proportional to?

7. Originally Posted by jpp
a = k / b, right?
right. so you know $\displaystyle x = k \sqrt y$ and you want to get to $\displaystyle y = \frac C{f(x)}$ (by solving for y and, perhaps, rearranging)

where $\displaystyle C$ is a constant and $\displaystyle f(x)$ is some function of $\displaystyle x$. That $\displaystyle f(x)$ is the answer to your question. can you find it?

8. I rearranged x = k * sqrt(y) to get y = x^2/k^2

y = C/f(x) -> x^2/k^2 = C/f(x)

does C = k?

9. Originally Posted by jpp
I rearranged x = k * sqrt(y) to get y = x^2/k^2

y = C/f(x) -> x^2/k^2 = C/f(x)

does C = k?
C is just a constant. and you do not yet have the form you need to get to. you need to write it as a constant over a function of x.

10. Originally Posted by jpp
I rearranged x = k * sqrt(y) to get y = x^2/k^2

y = C/f(x) -> x^2/k^2 = C/f(x)

does C = k?
the crucial point is not "C", but f(x). What is f(x) here?


text:
# Sba financing ppp loans. The Paycheck Protection Program (PPP) Loan is that loan

Sba financing ppp loans. The Paycheck Protection Program (PPP) Loan is that loan

## Exactly what does it suggest if my full PPP Loan is maybe maybe perhaps not forgiven?

The PPP Loan can be a real loan that should be repaid, less the part this is certainly forgiven. The remaining balance must be repaid if the SBA approves forgiveness of a large portion of your loan, but not all of the loan. For instance: in the event that you borrowed $100,000 as well as the SBA approves forgiveness for 90per cent of this loan, you would need to repay 10% or$10,000.

What’s the interest back at my loan and exactly how long will that rate use?

PPP Loans are a definite fixed rate loan at 1.0per cent each year when it comes to lifetime of the mortgage. The initial term of those loans had been two years nevertheless the government that is federal supplied the possibility to give the mortgage to five years with shared contract of debtor and loan provider.

When do i need to start making repayments on my PPP Loan?

Re re re Payment of principal and interest is deferred through to the lender gets re re re re payment for the forgiven part of the mortgage; and for 10-months following the end for the covered duration if there is no application for forgiveness.

Are there pre-payment penalties if we pay-off my PPP Loan early?

No. You can easily spend the balance that is unforgiveness of PPP Loan instantly, or quicker compared to the amortization routine without any penalty.

What the results are to my SBA EIDL Disaster Loan Advance?

The SBA EIDL Disaster Loan Advance is supposed to be subtracted through the amount that is forgiven.

Is there caps in the level of loan forgiveness designed for owner-employees and self-employed peopleвЂ™ very very own payroll settlement?

Yes. For borrowers that received a PPP loan and elect to use an eight-week covered duration, the quantity of loan forgiveness asked for for owner-employees and self-employed peopleвЂ™ payroll compensation is capped at eight monthsвЂ™ worth (8/52) payment (i.e., roughly 15.38 per cent payment) or $15,385 per person, whichever is less, as a whole across all companies. For many other borrowers, the quantity of loan forgiveness asked for for owner-employees and self-employed peopleвЂ™ payroll compensation is capped at 2.5 monthsвЂ™ worth (2.5/12) settlement (for example., roughly 20.83 per cent payment) or$20,833 per person, whichever is less, as a whole across all organizations.

## Are medical care advantage re re payments qualified expenditures for PPP Loan forgiveness?

Payments to acquire medical care benefits for workers meet the criteria expenses for PPP Loan forgiveness, but re re payments for healthy benefits for company owners are not qualified to receive forgiveness.

What type of paperwork am I going to need certainly to make forgiveness of my SBA PPP Loan?

OR

SBA Form 3508EZ

The SBA Form 3508EZ is supposed for PPP borrowers who will be a self-employed person, separate contractor, or single proprietor that has no workers at that time; or borrowers whom made few or no modifications to work, hours and wages before and through the period that is covered. See directions for information on eligibility.

According to the job, you may want to submit the annotated following:

Banking account statements or third-party payroll solution provider reports Documenting the actual quantity of money payment compensated to workers.

Documentation include IRS Form 1040, Schedule C, E or F; IRS Form 1065 or 1120-S / K1вЂ™s.

Tax forms (or comparable third-party payroll solution provider reports) for the durations that overlap with the Covered Period or perhaps the alternate Payroll Covered Period вЂ“ typically IRS Form 941. Quarterly state wage reporting company and specific worker wage reporting and jobless insurance coverage income tax filings reported, or which will be reported, into the appropriate state.

Employer Contributions to employee wellness retirement and insurance plans re re re Payment receipts, terminated checks, or account statements documenting the total amount of any company contributions to worker medical health insurance and your your retirement plans that the debtor contained in the forgiveness quantity (PPP Schedule A, lines (6) and (7)).

The common amount of FTE workers on payroll every month used by the Borrower; OR perhaps the normal wide range of FTE workers on payroll every month used by the Borrower; OR in the way it is of the regular manager, the common wide range of FTE workers on payroll every month utilized by the Borrower; or any consecutive twelve week duration.

The chosen time frame should be the exact same period of time chosen for purposes of finishing PPP Schedule payday loans in New York the, line 11.

Papers can include payroll taxation filings reported, or that’ll be reported, towards the IRS (typically, Form 941) and state quarterly business and specific employee wage reporting and unemployment insurance coverage taxation filings reported, or that’ll be reported, into the appropriate state. Papers submitted may cover periods longer compared to the time period that is specific.

Company mortgage interest may be documented with a duplicate for the home loan lenderвЂ™s amortization schedule and receipts or terminated checks confirming qualified re payments through the Covered Period; or mortgage company account statements and also the months regarding the Covered Period through a month following the end associated with the Covered Period verifying interest amounts and payments that are eligible.

Company lease costs may be documented with a duplicate of present rent contract and receipts or cancelled checks confirming qualified re re re payments through the Covered Period; or lessor account statements and through the Covered Period through a month following the end for the Covered Period confirming payments that are eligible.

Company energy re re re payments are documented with a duplicate of invoices and the ones compensated throughout the Covered Period and receipts, terminated checks, or account statements confirming those payments that are eligible.

Documentation showing company ended up being in procedure along with workers consist of tax documents, payroll documents, bank statements, worker advantages documents.


text:
Product of Borel sigma algebras - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-20T17:38:06Z http://mathoverflow.net/feeds/question/39882 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/39882/product-of-borel-sigma-algebras Product of Borel sigma algebras Bill Johnson 2010-09-24T18:11:10Z 2012-11-30T21:15:52Z
If $X$ and $Y$ are separable metric spaces, then the Borel $\sigma$-algebra $B(X \times Y)$ of the product is the the $\sigma$-algebra generated by $B(X)\times B(Y)$. I am embarrassed to admit that I don't know the answers to:

Question 1. What is a counterexample when $X$ and $Y$ are non separable?

Question 2. If $X$ is an uncountable discrete metric space, does $B(X)\times B(X)$ generated the Borel $\sigma$-algebra on $X \times X$?

Question 3. If $X$ and $Y$ are metric spaces with $X$ separable, does $B(X)\times B(Y)$ generated the Borel $\sigma$-algebra on $X \times Y$?
 http://mathoverflow.net/questions/39882/product-of-borel-sigma-algebras/39883#39883 Answer by Gerald Edgar for Product of Borel sigma algebras Gerald Edgar 2010-09-24T18:20:10Z 2010-09-24T18:20:10Z
Q1. Discrete spaces with cardinal > c ... then the diagonal is a Borel set, but not in the product sigma-algebra.

This also answers Q2 (no)

but not Q3.
 http://mathoverflow.net/questions/39882/product-of-borel-sigma-algebras/39886#39886 Answer by Byron Schmuland for Product of Borel sigma algebras Byron Schmuland 2010-09-24T18:38:34Z 2010-09-24T18:38:34Z
The answer to question 3 is yes. At least according to Lemma 6.4.2 of the second volume of Bogachev's book "Measure Theory".

He requires both spaces to be Hausdorff and one of them to have a countable base. They need not be metric spaces.
 http://mathoverflow.net/questions/39882/product-of-borel-sigma-algebras/81491#81491 Answer by Michael Greinecker for Product of Borel sigma algebras Michael Greinecker 2011-11-21T10:37:43Z 2011-11-21T10:37:43Z
To close a gap: From the answer of Gerald Edgar, we know that the answer to the second question is no if the spaces involved have cardinality larger than $\mathfrak{c}$. This leaves open what happens when they do have cardinality $\mathfrak{c}$. The answer is yes under the continuum hypothesis, and in general it holds that $2^{\omega_1}\otimes 2^{\omega_1}=2^{\omega_1\times\omega_1}$. This was shown in

B. V. Rao, On discrete Borel spaces and projective sets Bull. Amer. Math. Soc. Volume 75, Number 3 (1969), 614-617.

In Bogachev's remarkable book, it can be found as Proposition 3.10.2.
 http://mathoverflow.net/questions/39882/product-of-borel-sigma-algebras/115024#115024 Answer by Martin for Product of Borel sigma algebras Martin 2012-11-30T21:10:38Z 2012-11-30T21:15:52Z
This is should probably rather be a comment to Michael Greinecker's answer, but I do not have the necessary privileges.

Michael Greinecker's answer leaves open what happens with a continuum-sized discrete space when one does not assume the continuum hypothesis.

Arnold W. Miller showed in section 4 of On the length of Borel hierarchies that it is consistent relative ZFC that no universal analytic set $U \subset [0,1] \times [0,1]$ belongs to the product $\sigma$-algebra $\mathcal{P}[0,1] \otimes \mathcal{P}[0,1]$. Combined with Rao's result mentioned by Michael Greinecker, this shows that $2^{\mathfrak{c \times c}} = 2^{\mathfrak{c}} \otimes 2^\mathfrak{c}$ is independent of ZFC.

See my answer to Universally measurable sets of $\mathbb{R}^2$ on math.stackexchange.com for related results and more details and references.


text:
Screw Jack

What is a Screw Jack?

Machines are mechanical devices which are used to change the direction or magnitude of an applied force or work. A screw jack consists of two simple machines in series – (1) a lever and (2) a screw and nut assembly. A long operating handle serves as a lever whose output force turns the screw. The load is attached with the nut. So the mechanical advantage is increased by a longer handle as well as a finer screw thread.

Use of Screw Jack

Screw Jack is most popular lifting machine which uses the principle of screw and nut of a simple machine.

1. Screw jack is the ideal product to use for push, pull, lift, lower of heavier loads.
2. It is commonly used to lift moderately heavyweights, such as vehicles, to raise and lower the horizontal stabilizers of aircraft, foundations of houses and machine beds.
3. It is used for positioning and leveling of heavy loads like machine beds.
4. Screw jacks are essential components in automated machinery because of high reliability and synchronization.
5. Due to higher energy efficiency of screw jacks, they are used as alternatives to conventional pneumatic and hydraulic systems.

Working principle of a screw jack

Screw Jack works on the principle of working of a screw which intern uses the principle of inclined plane.

Consider about a screw jack as shown in figure. If one complete turn of a screw thread is unwound from the body of screw and flattened on a plane surface, it will form an inclined plane as shown in figure.

Let –

• Pitch of thread of screw is ( p ) .
• Mean diameter of screw is ( D ) .
• Helix angle of screw is ( \alpha ) = Inclination of projected inclined plane.
• Angle of friction for screw jack material is ( \phi ) .

Load is kept on screw head and effort is applied on circumference of head using a long rod or lever.

For one complete rotation of screw, distance moved by effort is \pi D and distance moved by load is p

Therefore, Velocity ratio of screw jack will be \left ( \frac {\pi D}{p} \right )

Considering about the figure of projected inclined plane, we have –

\tan \alpha = \left ( \frac { p }{ \pi D } \right )

Efficiency of a Screw Jack

Ratio of output work obtained from machine to the input work supplied to machine is called its efficiency.

Therefore, efficiency of screw jack –

\eta = \left ( \frac {\text {Output work}}{\text {Input work}} \right )

Efficiency can be expressed in another form as –

\eta = \frac {\text {Ideal effort}}{\text {Actual effort}}

Now, considering about the force of friction of screw, we find the following effects of friction –

1. When load is lifted the frictional force acts downward as shown in figure. Here the frictional force is acting opposite to the movement of load. Hence, total effort required to lift the load increases.
2. When load is being lowered the frictional force acts upward. Here the frictional force is acting in favor of direction of movement of load. Hence, total effort required to lower the load get reduced.

Effort required for rising of a load will be –

P _ {Rising} = W \tan \left ( \phi + \alpha \right )

Effort required for lowering of a load will be –

P _ {Lowering} = W \tan \left ( \phi - \alpha \right )

When friction is neglected, the angle of friction ( \phi ) becomes zero.

Then ideal efficiency of screw jack for rising of a load will be –

P_{Ideal} = W \tan \alpha

Therefore, actual efficiency of screw jack for rising of load will be –

\eta = \left ( \frac{\text {Ideal effort}}{\text {Actual effort}} \right )

Or, \quad \eta = \left [ \frac {W \tan \alpha}{W \tan (\alpha + \phi)} \right ]

Therefore, \quad \eta_{Rising} = \left [ \frac {\tan \alpha}{\tan (\alpha + \phi)} \right ]

Maximum Efficiency of Screw Jack

During lifting work, expression for efficiency of a screw jack is written as –

\eta = \left [ \frac {\tan \alpha}{\tan (\alpha + \phi)} \right ]

= \left [ \left ( \frac {\sin \alpha}{\cos \alpha } \right )  \div \left ( \frac {\sin ( \alpha + \phi)}{\cos ( \alpha + \phi )} \right ) \right ]

= \left [ \frac{ \sin \alpha \times \cos \left ( \alpha + \phi \right ) }{ \cos \alpha \times \sin \left ( \alpha + \phi \right ) } \right ]

Multiplying numerator and denominator by 2 , we will get –

\eta = \left [ \frac { 2 \sin \alpha \times \cos \left ( \alpha + \phi \right ) }{ 2 \cos \alpha \times \sin \left ( \alpha + \phi \right ) } \right ]

Using trigonometric identities, we have –

1. \quad \left [ \sin ( A + B ) + \sin ( A - B ) = 2 \sin A \cos B \right ]
2. \quad \left [ \sin ( A + B ) - \sin ( A - B ) = 2 \cos A \sin B \right ]

Therefore, efficiency of screw jack will be –

\eta = \left [ \frac { \sin \left ( 2 \alpha + \phi \right ) - \sin \phi }{ \sin \left ( 2 \alpha + \phi \right ) + \sin \phi } \right ]

So, \quad \left [ \left ( 1 - \eta \right ) \right ] = \left [ 1 - \frac { \sin \left ( 2 \alpha + \phi \right ) - \sin \phi }{ \sin \left ( 2 \alpha + \phi \right ) + \sin \phi } \right ]

= \left [ \frac { 2 \sin \phi }{ \sin \left ( 2 \alpha + \phi \right ) + \sin \phi } \right ]

From expression, it is clear that, efficiency of screw jack will be maximum when \left ( 1 - \eta \right ) will be minimum.

But for a given screw, ( \phi ) is a constant term because it depends on material of the screw. Therefore, \left ( 1 - \eta \right ) will be minimum, when [ \sin \left ( 2 \alpha + \phi \right ) ] is maximum.

Hence, putting the maximum possible value of [ \sin \left ( 2 \alpha + \phi \right ) ] = 1 in efficiency expression, we will get maximum efficiency.

Therefore, maximum efficiency for screw jack –

\eta _ {Max} = \left [ \frac { \sin \left ( 2 \alpha + \phi \right ) - \sin \phi }{ \sin \left ( 2 \alpha + \phi \right ) + \sin \phi } \right ]

= \left [ \frac { 1 - \sin \phi }{ 1 + \sin \phi } \right ]

Overhauling of Screw Jack

During lowering operation of a load, required effort ( P ) is given by –

P = W \tan \left ( \phi - \alpha \right )

In the above expression, if ( \phi < \alpha ) , then the effort required in lowering the load will be negative. In other words, the load will start moving downward without the application of any effort. Such a condition is called overhauling of a screw and the machine is called a reversible machine.

A lifting machine is called a reversible machine if it is capable of doing work in reverse direction when the applied effort is removed.

Reversibility feature is not a desirable quality for a lifting machines. When the applied effort is removed, the lifted load will lower by itself which may cause accident and damage to the equipment.

If ( \phi > \alpha ) , then the effort required to lower the load will be positive. That means an effort is required to lower the load. Such a screw is called self locking screw.

Therefore, a lifting machine must be irreversible or self-locking.

Hence, for self locking of a screw, the friction angle ( \phi ) is greater than helix angle ( \alpha ) .

Let, ( P_{Actual} ) is the actual effort required to lift a load and ( P_{Ideal} ) is the ideal effort neglecting friction force.

Then, velocity ratio for screw jack will be –

VR = \left ( \frac { W }{ P_ { Ideal }} \right )

Or, \quad ( P _ { Ideal } ) = \left ( \frac { W }{ VR } \right )

And, effort lost in friction will be –

( P _ { Friction } ) = ( P _ { Actual } - P _ { Ideal } ) = \left [ P _ { Actual } - \left ( \frac { W }{ VR } \right ) \right ]

When, applied effort ( P_{Actual} ) is removed, the force resisting the spontaneous falling down of load will be the force of friction. This force of friction is equal to \left [ P _ { Actual } - \left ( \frac { W }{ VR } \right ) \right ]

If this frictional force is greater than ( P_{Ideal} ) , then load ( W ) will not fall spontaneously even when effort ( P_{Actual} ) is removed.

Therefore, friction force \left [ P _ { Actual } - \left ( \frac { W }{ VR } \right ) \right ] is necessary to balance the load ( W ) in the absence of effort.

Hence, necessary condition for a machine to be irreversible or self locking is –

( P _ { Friction } ) > ( P _ { Ideal } )

So, \quad ( P _ {Actual} - P _ {Ideal} ) > ( P _ {Ideal} )

Therefore, \quad ( P _ {Actual} ) > 2 ( P _ {Ideal} )

Therefore, for a self locking machine actual effort required for lifting a load is more than double of the ideal effort required for lifting the same load.

Condition of Self Locking

Thus, necessary condition for a machine to be irreversible or self locking is –

( P _ {Actual} ) > 2 ( P _ {Ideal} )

So, \quad \left ( \frac {P _ {Actual}}{P _ {Ideal}} \right ) > 2

Or, \quad \left ( \frac {P _ {Ideal}}{P _ {Actual}} \right ) < \left ( \frac {1}{2} \right )

But, ratio \quad \left ( \frac { P_{Ideal}}{P_{Actual}} \right ) is called efficiency of a machine.

Therefore, for a machine to be irreversible, we have –

\eta < \left ( \frac {1}{2} \right )


text:
Projecting a vector field onto a H(div) space

I've got a uniform quadrangular mesh and for each node there's a vector quantity $u$ defined. I also have a non-aligned material interface across the mesh. Now I need that vector quantity to have a zero jump across the interface $[u\cdot n]=0$ where $n$ is the interface normal. I want to project $u$ into another space that satisfies this condition. Could I use Raviart-Thomas finite element for this case? I have never worked with RT elements and I was wondering if they could be built using an arbitrary direction instead of the element's normal (recall that the interface normal is not aligned with the elements and also that I am only interested in having $[u\cdot n]=0$, whereas the other components can have non-zero jumps) Thanks.

That said, I'm surprised that you need the condition $[u \cdot n]=0$. Typically, one would require that the flux across an interface separating two materials is continuous. The flux is usually a material constant times the vector-valued solution.
• Yes. $u$ would be my flux in this case. My problem is that my material interface is not explicitly defined. It's defined with a QUAD4 LAGRANGE element that takes 1 or 0 values. In the interface the element will have 0 and 1 as nodal values. This makes the material actually continuous, but with a strong gradient and discontinuous in the limit. – balborian May 3 '16 at 14:00
• So in that case, how exactly do you even define what it means for $[u \cdot n]$ to be zero? – Wolfgang Bangerth May 3 '16 at 15:05
• The normal can be calculated using several elements. It is true that given that the material field is actually continuous, there are no $[u \cdot n]$ and that I could just have $\nabla \cdot u$ (no body forces in my laplace equation) I wanted to enforce $[u \cdot n]$ because it would be the situation in the limit. Sorry I should have included more details in my question. – balborian May 3 '16 at 15:27


text:
# A way to find the (Windows) computer name via the browser?

Ideally I'd like to send a link via staff email that staff could click on to reveal their computer name. (Specifically first part of the 'Long computer name' found in the second tab of My Computer Properties.)

Is there some JavaScript/VBScript/ActiveX object on the client side, or CGI script on the server-side that can let a user know their computer name by returning a simple web page?

For good reasons the organisations stops users from downloading/running apps, so oneClick deploy and downloading batch files is out of the question with the existing infrastructure/policy setup.

Oh - it should work for the enterprise wide install of Internet Explorer 6/Windows XP that isn't likely to be updated anytime soon.

Answers

Via email

Send them a link for:

http://%computername%

This will bring up "Internet explorer cannot display the webpage" but the address bar will show the machine name.

Server Side

You want the REMOTE_HOST server variable. First enable reverse DNS on the web server. Then create a page to return the variable you want. Here it is in ASP.

<% Response.Write ServerVariables("REMOTE_HOST") %>

-
Commenting as this does not involve using the broswer. This SF question has a novel way of displaying %COMPUTERNAME% instead of My Computer. Works on Windows XP also. –  jscott Aug 17 '10 at 16:41
add comment

## 7 Answers

Send them a link for:

http://%computername%

This will bring up "Internet explorer cannot display the webpage" but the address bar will show the machine name.

or

They could run a bat file from their desktop:

echo %computername% >> c:\users\%username%\Desktop\computername.html
"c:\program files\internet explorer\iexplore.exe" c:\users\%username%\Desktop\computername.html

-
add comment

This doesn't answer your question, but you might consider deploying Sysinternals BGInfo as part of your desktop image. This puts the name of the PC (and other relevant information you specify) right on the user's desktop background.

-
+1 good tip but not possible in this case. –  Stephen Jun 19 '09 at 20:57
add comment

You want the REMOTE_HOST server variable. First enable reverse DNS on the web server. Then create a page to return the variable you want. Here it is in ASP.

<% Response.Write ServerVariables("REMOTE_HOST") %>

If you want to take a look at all the possible variables, use this

<%
for each x in Request.ServerVariables
response.write(x  & ": " & Request.ServerVariables(x) & "<br />")
next
%>

-
add comment

Or client could open commandprompt and type "hostname" and hit enter. Or Start > Run > (Winkey+R) type: "cmd.exe /k hostname" and hit enter.

-
add comment

This should work as client-side VBScript:

Set ADSysInfo = CreateObject ("ADSystemInfo")
Set CurrentComp = GetObject ("LDAP://" & ADSysInfo.ComputerName)
ShortCompName = ADSysInfo.sAMAccountName

This implementation just gets the short name, without your domain appended; look in ADSIEdit or on TechNet or MSDN to get the full list of properites you can retrieve.

You might also need to do some jiggery-pokery in your intranet zone IE settings.

-
add comment

If this is Windows Only environment, your best bet will be OneClick deployment and simple c# (or vb.net) program which uses System.Environment.MachineName with or without combination with System.Net.Dns.GetHostByAddress for more information.

-
add comment

Not really, no, the browser security is pretty much setup to prevent web servers from getting information like that.

I guess since you mention CGI is an option, if DNS updates where working perfectly, you might be able to write some kind of program that runs on an internal web server that looks up the reverse DNS record for the IP address that was used to connect and then returns that.

I suppose, you could store an HTA on a file server and send a UNC to the users.

-
add comment


text:
# When To Use Negative Test Statistic over Positive Test Statistic in Wilcoxon Signed Rank Test

I've got the following data values:

POW |157 days after release | 379 days after release
1   | 2.46                  | 3.73
2   | 4.11                  | 5.46
3   | 3.93                  | 7.04
4   | 4.51                  | 4.73
5   | 4.96                  | 4.71
6   | 4.42                  | 6.19
7   | 1.02                  | 1.42
8   | 4.30                  | 8.70
9   | 7.56                  | 7.37
10  | 7.07                  | 8.46
11  | 8.00                  | 7.16

The values above are the test scores on brain function for Prisoners of War. The higher the test scores, the worse their brain is performing. I am trying to see whether the prisoners' brains perform worse 379 days after release than compared to 157 days after release.

Because the samples are performed on the same subjects, and the samples are assumed to be not normal and are less than 25 in size, I am supposed to use a wilcoxon signed rank test. The test is with a significance level of 0.05.

I realize how to rank and assign the differences, and how to get the value of 14 from the Wilcoxon table. I also realize that the negative rank sum is 9 and the positive rank sum is 57. What I do not understand is why, in the solution below, we use the negative rank sum (9) instead of the positive rank sum (57) in order to test against the value of 14 (we got from the Wilcoxon table). As well, why are we checking whether 9 is less than or equal to 14 (e.g., why don't we test whether 57 is greater than or equal to 14?)?

The solution to this question is apparently the following below:

• What tables are you using? Oct 18, 2016 at 3:22
• I used this table: onlinepubs.trb.org/onlinepubs/nchrp/cd-22/v2appendixc_files/…. Where n = 11 and significance is = 0.05. Oct 18, 2016 at 3:26
• The information would be both in the book where it describes the test and normally in the margin or heading or footer of the table, but the heading and footer are cut off here. It's possible to work it out but I won't have time to do it for several hours Oct 18, 2016 at 3:35
• Okay, no worries, I appreciate the input, and I believe this enough for me to get by on for now. Thanks, Glen. Oct 18, 2016 at 3:36
• Well, that doesn't explain it, because your document defines it as the sum of the positive ranks onlinepubs.trb.org/onlinepubs/nchrp/cd-22/v2chapter6.html Oct 18, 2016 at 3:45


text:
## Saturday, June 18, 2011

### Area of a Triangle Given Coordinates

There are at least 6 methods to determine the area of a triangle given the coordinates of the vertices.  Some of the methods apply to triangles only, and some are more generic.  We’ll find two clear winners for this problem (that are nearly the same), but also notice, that if we were given different information (such as lengths of sides instead of coordinates of vertices) it would change the winner.  I am focusing here on 2D coordinates.  Here's a picture of our triangle:

Heron’s Formula

Heron’s formula uses the lengths a, b, and c of the sides to determine the area of the triangle:

where

To use this formula, we must determine the lengths of the sides.  We use the Pythagorean theorem to do so:

This whole calculation involves 4 square roots, 9 multiplications, 1 division by 2, and 14 addition/subtractions.  This method is very expensive compared with the other methods.  However, if we were given the lengths of the sides and not the coordinates of the vertices, it would be less expensive than the alternative.  The alternative would require the use of trigonometric functions (law of cosines and law of sines) in order to determine the height to use the formula A = bh/2.  Trig functions are way more expensive (time-wise) than square roots.

Note that this method could be extended to work given 3D coordinates, since the Pythagorean theorem extends to 3D coordinates.  It would be a bit more expensive in 3D.

Coordinates Method

This method can be used with any polygon – it need not be a regular polygon (all sides and interior angles equal) or a triangle.  The only requirement is that none of the sides intersect.  The method is performed as follows:

This method requires 6 multiplications, 1 division by 2, and 5 addition/subtractions – easily outperforming Heron’s formula when we’re given the coordinates.

Double Meridian Distance (DMD)

This is another generic method that applies in the same circumstances as the coordinates method.  It is always more efficient than using the method of coordinates.  In a spreadsheet is would look like this:

 A B C D E F 1 x-coord y-coord delta y delta x DMD 2*A 2 Ax Ay =B3-B2 =A3-A2 =D2 =E2*C2 3 Bx By =B4-B3 =A4-A3 =E2+D2+D3 =E3*C3 4 Cy Cy =B5-B4 =A5-A4 =E3+D3+D4 =E4*C4 5 Ax Ay 6 =sum(F2:F4)/2

This method requires 3 multiplications, 1 division by 2, and 12 addition/subtractions.  Although we have way more addition subtraction, we have half the number of multiplications.  Since multiplication and division are way more expensive than addition and subtraction, this method is computationally superior to the method of coordinates.

The Usual Method (sorta)

Youre probably wondering why I havent just taken half the base times the height.  Okay wise guy, where`s the base?  How about the height?  Can we calculate them?  Yes, but are you sure you know how much work you’re in for?  You say, isn’t the area just

No, it’s not that simple.  The base must be the length of one of the sides.  The height must be measured perpendicularly from the chosen base to the vertex which is not on the base.  But we can find the area using this method if we follow it through to the bitter end.  Let’s do it.

First, we calculate the length of the base, which we will choose as side b above:

Now, we need to calculate the height, h, between point B and line AC (side b).  This will be nontrivial and slightly painful.

We determine the equation of the line through A and C using the point-slope form:

We re-express this result as

where

At this point we use a formula for the distance between a point and a line that uses the equation of the line as expressed above:

Finally, we get to say “Area = bh/2,” and I hope you are satisfied!  We needed 2 square roots, 9 multiplication/divisions, and 11 addition/subtractions.  This method gives you the right answer, but there’s got to be a better way!

A Better Way

Let’s redraw our triangle with a fancy rectangular border:
Okay, it’s not that fancy, but it’s useful!  First, let’s calculate L, R, λ, and ρ.

We can calculate the area of our triangle now:

I’ve skipped showing all of the simple expansion and simplification steps above because I’m getting tired of all that typing.  But here’s the vital statistics: 2 multiplications, 1 division by 2, and 5 addition/subtractions.

Cross Product Method

This method not only works in 3D, it requires 3D – sorta.  We’ll apply it to the 2D case here – we just augment our coordinates with zeros for the z-coordinates.  It goes like this:

The final score for this method is 2 multiplications, 1 division by 2, and 5 addition subtractions.  This method is the clear winner since it is tied with the previous method in 2D but is easily applied to 3D with an increase in cost.

Method Comparison Table
 method square roots multiplication/division division by 2 addition/ subtraction Heron’s Formula 4 9 1 14 Coordinates Method 0 6 1 5 DMDs 0 3 1 12 “Usual” Method 2 9 1 11 A Better Way 0 2 1 5 Cross Product 0 2 1 5

* Note:  I've put division by 2 in a separate category because division and multiplication by 2 can be implemented more efficiently on the computer than general case multiplication and division.


text:
# List of interesting integrals for early calculus students

I am teaching Calc 1 right now and I want to give my students more interesting examples of integrals. By interesting, I mean ones that are challenging, not as straightforward (though not extremely challenging like Putnam problems or anything). For example, they have to do a $u$-substitution, but what to pick for $u$ isn’t as easy to figure out as it is usually. Or, several options for $u$ work so maybe they can pick one that works but they learn that there’s not just one way to do everything.

So far we have covered trig functions, logarithmic functions, and exponential functions, but not inverse trig functions (though we will get to this soon so those would be fine too). We have covered $u$-substitution. Thinks like integration by parts, trig substitution, and partial fractions and all that are covered in Calc 2 where I teach. So, I really don’t care much about those right now. I welcome integrals over those topics as answers, as they may be useful to others looking at this question, but I am hoping for integrals that are of interest to my students this semester.

It’s very common in calculus texts to resort to the trick of multiplying and dividing by $(\sec x + \tan x)$, upon doing which the answer jumps right out with a bit of simplification. Any reasonable student, though, might complain about this “rabbit out of the hat approach,” asking, “How on earth could you expect me to come up with this idea?” All this approach does is impress the student with the author’s cleverness while at the same time making them feel stupid. Here’s an alternative approach that involves a different, and perhaps more accessible, kind of cleverness.


text:
# Vector

This topic is 2890 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi

I am wanting to create a rectangle for two points (vector). I need a function that takes two points and a length and calculates a perpendicular point from line (vector) AB, to a given length.

I found this code, however it doesn't seem to work.

 Private Function doit(ByVal a As PointF, ByVal b As PointF, ByVal l As Double) As PointF Dim lfraction, dx, dy As Double dx = b.X - a.X dy = b.Y - a.Y If dx = 0 And dy = 0 Then Exit Function lfraction = l / Math.Sqrt(dx * dx + dy * dy) Return New Point(b.X + lfraction * dy, b.Y + lfraction * dx) End FunctionIs there any easy or other methods i can use to create a rectangle from a line

Maybe a line stroke method or something.

Thanks

Gary

##### Share on other sites
I am not sure I understand what you are saying, so let me know if this doesn't answer your question.

If you have a vector (x,y), the vectors (y,-x) and (-y,x) are perpendicular to it (you have a choice as to whether you want to rotate 90 degrees one way or the other). If you want a vector of a particular length, you can divide by the length of the vector and multiply by the desired length.

If you now have points (Ax,Ay) and (Bx,By), you can compute a point (Cx,Cy) such that the vectors (Bx-Ax,By-Ay) and (Cx-Ax,Cy-Ay) are perpendicular and (Cx-Ax,Cy-Ay) has the desired length:
Vx = By-Ay
Vy = -(Bx-Ax)
initial_length = sqrt(Vx*Vx+Vy*Vy)
scale = desired_length/initial_length
scaled_Vx = Vx*scale
scaled_Vy = Vy*scale
Cx = Ax + scaled_Vx
Cy = By + scaled_Vy

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 13
• 30
• 9
• 16
• 12


text:
# Math Help - uniform convergence series

1. ## uniform convergence series

Suppose $\sum f_n(x)$ converges uniformly on $A$and $g :A \rightarrow B$ is a continuous function.
Do we have any conclusion about the series $\sum g(f_n(x))$?
( $A$ and $B$ are subsets of real number)

2. Originally Posted by problem
Suppose $\sum f_n(x)$ converges uniformly on $A$and $g :A \rightarrow B$ is a continuous function.
Do we have any conclusion about the series $\sum g(f_n(x))$?
( $A$ and $B$ are subsets of real number)
No.

$\sum g(f_n(x))$ might diverge or converge. Just take $f_n(x)=2^{-n}$ and $g(x)=1$, in this case we have divergence. However, if $g(x)=x$ we have convergence. So we need to know more about $g$

3. putnam120,if I change the g to be a uniformly continuous function,can I claim that \sum g(f_n) converges uniformly?

Or it will be the case that convergence/uniform convergence of a series is not invariant under any continuous/uniform continuous function?

4. Notice that g(x)=1 and g(x)=x are both uniformly continious function, the claim still can't be true.

5. So is there any properties that a function should have so that the uniform convergence of a series is invariant under the particular function?

6. I think, the answer is negative.

7. Originally Posted by problem
putnam120,if I change the g to be a uniformly continuous function,can I claim that \sum g(f_n) converges uniformly?

Or it will be the case that convergence/uniform convergence of a series is not invariant under any continuous/uniform continuous function?
Going by what I think you mean you're misunderstanding your question:

If $f_n : A\rightarrow B$ and $g: B \rightarrow \mathbb{R}$ are such that $f_n \rightarrow f$ unif. on $A$ and $g$ is unif. cont. on $B$ then $g(f_n)\rightarrow g(f)$ unif. on $A$. Applying this result to the partial sums of a series, say $\sum_{k=1}^{\infty } h_k = h$ (which converges unif.) we get that $g(\sum_{k=1}^{n} h_k) \rightarrow g(h)$ uniformly. Thus unif. continuity does preserve unif. convergence. What you're asking however is convergence of the series given by $\sum_{k=1}^{\infty } g(h_k)$. Do you see the difference?

PS. I think this works for your original question:

Let $h_k,h : A \rightarrow B$ such that $\sum_{k=1}^{\infty } h_k(x) = h(x)$ be a unif. conv. series of functions such that it converges absolutely for all $x \in A$, and $g: B\rightarrow \mathbb{R}$ be unif. continous and $\vert g(x) \vert \leq M \vert x \vert$ for all $x\in B$ then $\sum_{k=1}^{\infty } g(h_k)$ converges unif. on $A$ and absolutely for all $x\in A$


text:
# Perigee Apogee Ratio

A satellite, placed into the Earth's orbit to investigate the ionosphere, had the following orbit parameters: perigee, 475 km; apogee, 2265 km (both distances above the Earth's surface); period, 112.7 min. Find the ratio vp/va of the speed at perigee to that at apogee.

I was told by someone that this ratio is equal to the inverse ratio of the distances. But the period is thrown in so I have no idea where to start on this one. I know this follows an elliptical shape but I still can't think of where to begin.

Can anyone give a first couple of steps to get me started?
Thanks

Google Keplers laws of motion. He found that equal orbital areas are swept in equal time, and developed the math to explain it. Which still hols up well, unless looking at Mercury, but thats a later chapter.

ive done reasearch and i have notes but i cant seem to apply it properly, only post plz if u can give me a concrete path to take or equation to use

Ok, if the research didn't help, try the following, assume that in both cases, that the orbit is circular where v^2/r=g. What results do you get for v in both cases?

Ok, if the research didn't help, try the following, assume that in both cases, that the orbit is circular where v^2/r=g. What results do you get for v in both cases?

v = sqrt(gr)

but then the ratio would be equal to sqrt(r1)/sqrt(r2) since g cancels,
is this right?

Post some numbers.

Vp/Va = sqrt(2265)/sqrt(475)
= 2.184

but sum1 told me before that
Vp/Va = 2265/475 (inverse ratio)

but i dont kno why the period is not a factor

because g is not constant. You need to correct for that first.

because g is not constant. You need to correct for that first.

o ya oops i forgot

i kno ur not supposed to give ppl direct answers on this, but im super frustrated with this question so could sumbody please give me a big boost,
like just explain wut need to be equated together cuz all the hints make me more confused and with planetary motion there are too many equations and its rough enough trying to simplify them
i dont mind working hard for this question but i just need a good foundation to work with

ok ive seen the equations for kepplers laws, i just dont know where to get the velocity out of it
i know there is the equation with the squared equal to the cubed
but i have no clue where to get the velocity into the picture,
also do i need to find the eccentricity first

sum1 please tell me the first few steps to follow in roder to solve this


text:
1. All Categories
2. Tezos

# Tezos : Recent Questions and Answers

## How to calculate the total locked XTZ?

Using the TZscan.io Stats - Key Numbers dashboard, how can I calculate the total locked XTZ in the system? And shouldn't this be a KPI measure by itself? Since delegators...

## How to send XTZ from fundraiser wallet

I purchased XTZ during the fundraiser and I have them in a paper wallet. I would like to bake with them but I need instructions on how to send them...

Asked on 12/05/2021 by Nick Doulas

## Running Tezos node with rolling mode but sync started at the beginning

I'm running the node by described here:https://medium.com/@Jamyye/install-tezos-node-on-ubuntu-18-04-rolling-history-mode-e26598daa3d2ORhttps://gist.github.com/hclivess/cfbc8eddb1f5692c619036cb47072934with rolling mode but sync started at the beginning and already use 50GB. I...

Asked on 11/17/2021 by Bake Tz

## Question on receiving first staked reward

I am new at staking and I delegated several thousand XTZ with Kraken using the Ledger Nano X. It has been 43 days and nothing seems to have happened....

## How to set contract as input argument

I have a method Token_metadata_registry which takes contract(address) as input parameter and I would like to call that method from ligo dry-run. How do I do that? ligo dry-run...

## Why can't I move my XTZ?

Firstly, the questions that have been asked similar to this one have zero answers. Today I tried to move my XTZ from the KT1 address in my Galleon wallet to...

## What guarantees do we have when verifying the sender's identity (in SmartPy)?

When we check the address that called the current entry point e.g. in SmartPy:sp.verify(self.data.authorizedAddr == sp.sender)What guarantees do we have? For example, is it possible for someone else to...

## Is there a formula to build parameter messages to be passed to smart contract entrypoints?

When calling a smart contract entrypoint, it is required to pass the needed entrypoint parameters. This is done through a message that must be sent in JSON/Pairs format. My doubt...

## Calling view of Fa1.2 contract

From my understanding, getBalance, getAllowance, getTotalSupply & getAdministrator entrypoint requires another contract to read the values. How will the entry point of the second contract look like for getBalance for...

## experience with AWS cloudHSM and remote-signer

I'm wondering how to generate keys on cloudHSM and setup the remote signer to use with the baker thanks in advance for your help !...

Asked on 08/20/2021 by Romain Braud


text:
# Beta reduction for expression

I'm given the following where:

TRUE = λxy.x
FALSE = λxy.y

IF = λbtf. b t f
OR = λxy. IF x TRUE y

and I'm trying to evaluate:

OR FALSE TRUE

using Beta reduction. Since beta reduction is left associative, i started from the left but I'm having difficulties with the OR where there contains IF and TRUE inside it's expression. So i tried:

OR FALSE TRUE
(λxy. IF x TRUE y) (λxy.y) (λxy.x)
(λxy. (λbtf. b t f) x (λxy.x) y) (λxy.y) (λxy.x) #i substituted btf with x here but I'm not fully sure if it's valid
(λxy. x (λxy.x) y) (λxy.y) (λxy.x)
(λxy. x x) (λxy.y) (λxy.x)
(λxy.y) (λxy.y) (λxy.x)
(y) (λxy.x)

But I'm pretty sure I messed up somewhere along way as evaluating the OR was confusing enough. I'm not certain if I beta reduced correctly so I would appreciate some help on this.

I gave it another go so here's what I did:

OR FALSE TRUE
(λxy. IF x TRUE y) FALSE TRUE
IF FALSE TRUE FALSE TRUE
(λbtf. btf) FALSE TRUE FALSE TRUE
FALSE TRUE FALSE TRUE
(λxy.y) TRUE FALSE TRUE
(λx.TRUE) FALSE TRUE
TRUE TRUE
(λxy.x) TRUE
λy.TRUE

Again I'm still uncertain if it's correct this way too. Some help needed.

Indeed $$\text{OR} \ \text{FALSE} \ \text{TRUE}$$ $$\beta$$-reduces to $$\text{TRUE}$$, as expected. Let us see that in a step-by-step $$\beta$$-reduction.
\begin{align} \text{OR} \ \text{FALSE} \ \text{TRUE} &= (\lambda xy. \text{IF} \ x \ \text{TRUE} \ y) \ \text{FALSE} \ \text{TRUE} \\ &\to_\beta (\lambda y. \text{IF} \ \text{FALSE} \ \text{TRUE} \ y) \ \text{TRUE} \\ &\to_\beta \text{IF} \ \text{FALSE} \ \text{TRUE} \ \text{TRUE} \\ &= (\lambda btf. \, b\,t\,f) \ \text{FALSE} \ \text{TRUE} \ \text{TRUE} \\ &\to_\beta (\lambda tf. \text{FALSE} \ t\,f) \ \text{TRUE} \ \text{TRUE} \\ &\to_\beta (\lambda f. \text{FALSE} \ \text{TRUE} \ f) \ \text{TRUE} \\ &\to_\beta \text{FALSE} \ \text{TRUE} \ \text{TRUE} \\ &= (\lambda x y. y) \ \text{TRUE} \ \text{TRUE} \\ &\to_\beta (\lambda y. y) \ \text{TRUE} \\ &\to_\beta \text{TRUE} \end{align}
Your error in the first reduction you wrote is in the following step: $$$$(\lambda xy. x (\lambda xy.x) y) (\lambda xy.y) (\lambda xy.x) \to_\beta (\lambda xy. x x) (\lambda xy.y) (\lambda xy.x)$$$$ which is not correct. Indeed, you cannot reduce $$(\lambda xy.x) y$$ within $$\lambda xy. x (\lambda xy.x) y$$ because, as you said, application is left-associative, hence $$\lambda xy. x (\lambda xy.x) y = \lambda xy. (x (\lambda xy.x)) y$$. The correct step is: \begin{align} (\lambda xy. x (\lambda xy.x) y) (\lambda xy.y) (\lambda xy.x) &\to_\beta (\lambda y. (\lambda xy.y) (\lambda xy.x) y) (\lambda xy.x) \to_\beta \dots \end{align}


text:
# Recombination groups in database{ …_zb{} } and database{ …_wz{} }¶

There are about 18 identicall groups available directly under all zincblende- and wurtzite-related groups. In this section we describe one of them, specifically the group related to recombination models recombination{}.

## database{ …{ recombination{} } }¶

This section specifies the coefficients related to recombination processes. These are used when the current equation is solved. In nextnano++, the following recombination processes are included:

### Example¶

binary_zb {
name    = Si                        # material name, e.g. Si, GaAs, InP, ...

...

recombination{
SRH{        tau_n  = 1.0e-9     # [s]    zero doping scattering time for electrons
nref_n = 1.0e19     # [cm^-3] reference doping concentration for electrons
tau_p  = 1.0e-9     # [s]    zero doping scattering time for holes
nref_p = 1.0e18     # [cm^-3] reference doping concentration for holes
}

# Auger recombination
Auger{      c_n    = 2.8e-31    # [cm^6/s]
c_p    = 9.9e-31    # [cm^6/s]
}

# direct recombination
radiative{  c = = 2.0e-10   }   # [cm^3/s]c:\Users\herbert.maczko\Documents\Sphinx\nnpp\source\_build\html\error_handling\index.html
# 2.0e-10 for GaAs, 0 for Si (indirect semiconductor)

}

}

SRH model models the generation/recombination process that is assisted by impurities. The recombination/generation rates depend on the deviation of the carrier concentration from the equilibrium value and the scattering rates depend on the doping concentration. The rate is calculated using the following formulas:

\begin{align}\begin{aligned}R_{SRH} &= \frac{p\cdot n - n_i^2}{\tau_p(n+n_i)+\tau_n(p+p_i)},\\\tau_{p/n}&=\frac{\tau_{p0/n0}}{1+\frac{N_D+N_A}{N_n/p,ref}},\end{aligned}\end{align}

where $$\tau_{n0}$$ is zero doping scattering time for electrons, $$N_{n,ref}$$ is reference doping concentration for electrons, $$\tau_{p0}$$ is zero doping scattering time for holes, and $$N_{p,ref}$$ is reference doping concentration for holes.

tau_n

zero doping scattering time for electrons $$\tau_{n0}$$

type

double

unit

s

nref_n

reference doping concentration for electrons $$N_{n,ref}$$

type

double

unit

cm-3

tau_p

zero doping scattering time for holes $$\tau_{p0}$$

type

double

unit

s

nref_p

reference doping concentration for holes and $$N_{p,ref}$$

type

double

unit

cm-3

### Auger recombination¶

More imformation on physics: Auger recombination processes in semiconductor heterostructures.

Auger process is a dominant recombination channel for devices with an extremely high carrier concentrations. It is a three-particle process, therefore, scaling with the third power of the carrier density.

The phonon-assisted Auger recombination rate, which plays an important role especially at high carrier injection, is modeled by the following equation:

$R_{Auger} = (C_n n + C_p p)\cdot(np-n_i^2),$

where $$C_n$$ and $$C_p$$ are coefficients.

c_n

coefficient $$C_n$$

type

double

unit

cm6 s-1

c_p

coefficient $$C_p$$

type

double

unit

cm6 s-1

More imformation on physics: Auger recombination processes in semiconductor heterostructures.

The simplest, and the most important for light emitting devices, process for the generation and recombination of electron-hole pairs is the direct emission or absorption of a photon (radiative recombination) modelled within the formula

$R_{radiative} = C(np-n_i^2),$

where $$C$$ is a coefficient.

c

a coefficient $$C$$

type

double

unit

cm3 s-1

example

2.0e-10 (for GaAs), 0.0 (for Si, indirect semiconductor)


text:
# Boldface Sigma LaTeX Problem

1. Nov 14, 2008

### Dahaka14

1. The problem statement, all variables and given/known data
I am trying to write a paper describing my undergraduate research and its progress to a committee. I am having trouble making my sigmas boldface using LaTeX. I am using the correct coding, because it is working when I wish to type other vectors, but the sigmas look the same whether I type \mathbf{\sigma} or {\bf \sigma}. My temporary fix is to just put an arrow above with \vec{\sigma}, but I don't want to be inconsistent with my other vectors being boldface. What can I do to make the boldface of my sigmas more noticeable?

2. Relevant equations

\mathbf{\sigma} or {\bf \sigma}?

3. The attempt at a solution

i guess \vec{\sigma}

2. Nov 14, 2008

### Hootenanny

Staff Emeritus
Try simply \bold{\sigma}

3. Nov 14, 2008

### Avodyne

You need the LaTeX package amsbsy (or amsmath). Put

\usepackage{amsbsy}

near the top of your document, and then use $\boldsymbol\sigma$.

4. Nov 14, 2008

### Dahaka14

thanks a lot!

5. Nov 15, 2008

### CompuChip

And if you want to make all your vectors boldface, I suggest something like

\renewcommand\vec[1]{\ensuremath\boldsymbol{#1}}

in the preamble of your document and just use \vec everywhere. If you later decide that boldface is not distinctive enough and you want arrows after all, it will save you a lot of work.


text:
## Thank you

Hi Rdenney,

Thank you for your work and suggestions on Swine and Moringa. Below is a standard greeting that may be useful. Thanks again, I look forward to seeing more of your edits. You may be interested in how to use citations as well. Mainly, you use the following form:

Some assertion.<ref>citation text</ref>

Then after you do that for all of your citations, you can include a references section near the bottom of a document, in the form of:

==References==
{{References}}

## Welcome!

Hi Rdenney,

Welcome to Appropedia. Please make yourself at home! If you need help, please check out the Help pages or leave me a message on my talk page.


text:
# Eigenvalue decomposition of non symmetric matrix

Often in examples, eigenvalue decomposition $A=U\Lambda U^T$, $A$ is usually assumed to be a symmetric matrix. I am wondering what are the differences and implications when $A$ is a non-symmetric (still positive values if that helps).

What can we say about the eigenvalues and eigenvectors of such decomposition?

The first implication of symmetry is normality. All Matrix, that suffice $A^TA = AA^T$ are acalled normal and the eigenvectors are orthogonal to each other. This makes it possible, to write $A = U Λ U^T$ instead of $A = U Λ U^{-1}$, which is correct for diagonizable matrices.
This means, that either $Λ \in \mathbb{C}^{n \times n}$ or you get $2\times 2$ blocks, instead of a diagonal matrix.