text:
# Enemy shooting

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

## Recommended Posts

I'm creating a very simple 2D game in C++ (with a given external library) where I might have something like 20-30 enemy sprites on the screen from the beginning. I keep track on whether the enemy is alive or not through a member variable of the enemy object (simply a bool variable).

Now I want to have one random enemy of these 20-30 enemies to shoot a bullet and I want this to happen periodically. So for example every two seconds one enemy should be shooting a bullet. First time it might be the first enemy, second time might be the 10th enemy etc. I thought I could keep this simple by just generating a random number within a limit (which is the number of enemies) and use that number to determine which enemy that will shoot. The issue here is that an enemy can only shoot if it is alive, and if I have...say 20 enemies and 19 of them are dead I will keep generating random numbers until I get that very specific number of the remaining enemy that is alive and that feels like quite a waste of computations, basically a very inefficient way of doing it.

Surely there are better ways of doing this? The problem is that I'm not quite sure on what to search for on the net when it comes to this.

##### Share on other sites
 header: int m_FrameTime; // Initialized on zero in the cpp int m_ShootCounter; // Initialized on a certain number of frames. cpp: // In the constructor(or initialize) m_FrameTime = 0; m_ShootCounter = 2; // 2 frames for example //in the gamecycle(or gametick): if(m_FrameTime > m_ShootCounter) // When my frametime reached the amount of frames of the shootcounter, search for a random enemy { if(m_pEnemyList->Size() > 0 ) { int random = rand()%(m_pEnemyList->Size()-1); // Creates a random number from zero to the maximum number of enemies /*NOTE: array starts from zero until the 'size-1', so if the last enemy is random-ed and you don't add a -1 to it, you are out of the array! */ m_pEnemyList->At(random)->ShootBullet(); } m_FrameTime = 0 // Reset frameTime } ++m_FrameTime;  Edited by EngineProgrammer

##### Share on other sites
I guess that you are storing your enemies in an array since they can either be set as alive or dead.

Just read EngineProgrammer's answer, and his code has an m_pEnemyList. It's not defined in his code, but it seems to be a vector.

Going with that, you add your living enemies to the vector, while still using the array as a data pool to spawn new enemies and keep dead ones. The vector would have pointers to the enemies that are alive in the array, and you would query a random index for the vector.

##### Share on other sites

I guess that you are storing your enemies in an array since they can either be set as alive or dead.

Just read EngineProgrammer's answer, and his code has an m_pEnemyList. It's not defined in his code, but it seems to be a vector.

Going with that, you add your living enemies to the vector, while still using the array as a data pool to spawn new enemies and keep dead ones. The vector would have pointers to the enemies that are alive in the array, and you would query a random index for the vector.

You are correct that I have an array where I have stored my enemies in. Going by the two answers given by you, I would at the start of the game have a vector of pointers to all of my enemies and as soon as a certain enemy is dead I should remove the pointer to this enemy from this vector, correct?. Yes this does basically reduce the amount of enemies that can shoot each time so it does solve the problem. But doesn't this also mean that each time I remove an element from the vector all the data in it has to be moved due to the nature of the stl vector? Is there a way of avoiding all that shuffling of data inside the vector? Or perhaps this movement of data in the vector isn't expensive due to the fact that it only consist of pointers?

##### Share on other sites

[quote name='CC Ricers' timestamp='1346355995' post='4974892']
I guess that you are storing your enemies in an array since they can either be set as alive or dead.

Just read EngineProgrammer's answer, and his code has an m_pEnemyList. It's not defined in his code, but it seems to be a vector.

Going with that, you add your living enemies to the vector, while still using the array as a data pool to spawn new enemies and keep dead ones. The vector would have pointers to the enemies that are alive in the array, and you would query a random index for the vector.

You are correct that I have an array where I have stored my enemies in. Going by the two answers given by you, I would at the start of the game have a vector of pointers to all of my enemies and as soon as a certain enemy is dead I should remove the pointer to this enemy from this vector, correct?. Yes this does basically reduce the amount of enemies that can shoot each time so it does solve the problem. But doesn't this also mean that each time I remove an element from the vector all the data in it has to be moved due to the nature of the stl vector? Is there a way of avoiding all that shuffling of data inside the vector? Or perhaps this movement of data in the vector isn't expensive due to the fact that it only consist of pointers?
[/quote]

Yes, the vector would have to move all the data after the erased element down one position. The operation takes linear time whether it holds pointers or not, but for 30 enemies this is not a big deal and you won't notice a performance hit.

##### Share on other sites
But doesn't this also mean that each time I remove an element from the vector all the data in it has to be moved due to the nature of the stl vector? Is there a way of avoiding all that shuffling of data inside the vector? Or perhaps this movement of data in the vector isn't expensive due to the fact that it only consist of pointers?

If you do not care too much about the ordering of the pointers inside the element, you can swap the element to be deleted with the last element in the array then erase the last element in the array.

##### Share on other sites
EngineProgrammer provided a nice solution

Something far more simple would be to:
keep track of how many enemies are alive (variable initialized with number of enemies and decremented each time one dies);
using the same process he described to do this at certain intervals: generate a random number using the number of living enemies as your cap, and iterate through your enemies array, skipping dead ones, while decrementing the random number, and have the enemy shoot when your random number is 0
Hope that makes sense

Some pseudo code could help:
int totalEnemies = 30; int livingEnemies = totalEnemies; Enemy[30] enemies; // in code region dealing with enemy death livingEnemies--; // // on iterval for enemy to shoot if(livingEnemies > 0) { int randNum = Math.Rand(0, livingEnemies); // generates a random integer between bounds, lower exclusive, upper inclusive for(int i = 0; i < totalEnemies; i++) { if(enemies.isAlive) { randNum--; if(randNum == 0) { // Enemy shoots } } } } //  Edited by TheResolute

##### Share on other sites
I disagree with deleting an enemy at run-time.

Assume you are creating a game World Of Warcraft: There is a mob you are killing. The mod has like 40items carrying, position, rotation, etc. All stored in data members. And then... You kill it in run-time. The mob is gone.. And the world continues happily ever after. But then... unexpected The mob has a re-spawn!! BAM! Enemy has been allocated again! 40items, position, rotation, and many more data members created in Run-time.

I think we all know what will happen? If not: the game have a possibility of lag. always try to avoid lag so never ever allocate an object at run-time. ( unless it's a temporary local data variable or something.

Solution: The enemy has a "bool m_IsKilled" or somethng. You only calls Ticks, Paints, Checks on the Enemy when he is still alive.

##### Share on other sites

Some pseudo code could help:
int totalEnemies = 30; int livingEnemies = totalEnemies; Enemy[30] enemies; // in code region dealing with enemy death livingEnemies--; // // on iterval for enemy to shoot if(livingEnemies > 0) { int randNum = Math.Rand(0, livingEnemies); // generates a random integer between bounds, lower exclusive, upper inclusive for(int i = 0; i < totalEnemies; i++) { if(enemies.isAlive) { randNum--; if(randNum == 0) { // Enemy shoots } } } } //

Won't work.

So you have 30 enemies. Let us say I have killed the 2nd, 4th, 6th one. So 27 enemies left.

the rand() seeder will only give me a number from 0-27.
Meaning, if I get the number 0, 4, 6 those enemies will try to shoot but they are dead..
Also means the last 3 enemies will never be able to shoot a bullet.

##### Share on other sites

Won't work.

So you have 30 enemies. Let us say I have killed the 2nd, 4th, 6th one. So 27 enemies left.

the rand() seeder will only give me a number from 0-27.
Meaning, if I get the number 0, 4, 6 those enemies will try to shoot but they are dead..
Also means the last 3 enemies will never be able to shoot a bullet.

You must have misread the code or I made a mistake, but it is not accessing the array using the random number as an index, it is iterating through the array and every time an enemy is alive, it decrements its counter and if the counter is zero, meaning that this enemy is the nth living one, it will then have it shoot

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5
frob
12

• 9
• 21
• 13
• 9
• 17
• ### Forum Statistics

• Total Topics
632608
• Total Posts
3007391

×


text:
# Alternative function for Matlab Stationary Wavelet Transformation

I'm currently working on a project of mine where I have to use stationary wavelet transformation. I found a perfect way to do the transformation using wavelet toolbox of the Matlab. But since it is not free, I need to find a free function to do the exactly same thing SWT function of wavelet toolbox does.

What I Found

I found a Matlab functions package called WaveLab. They have defined a function called FWT_Stat to do Stationary wavelet transformation.

FWT_Stat -- stationary wavelet transform
Usage
StatWT = FWT_Stat(x,D,qmf)
Inputs
x        array of dyadic length n=2^J
L        degree of coarsest scale
Outputs
StatWT   stationary wavelet transform table
formally same data structure as packet table
log_2(n)-D scales by n elements

Below shows information about SWT function from wavelet toolbox.

SWC = swt(X,N,'wname') computes the stationary wavelet decomposition of the signal X at level N, using 'wname'.

Problem

FWT_Stat function asks for 3 parameters and final parameter is orthonormal quadrature mirror filter.But I couldn't find a way to add haar filter as the input for 3rd parameter .If I used SWT function from wavelet toolbox, all I have to do is add wavelet name (e.g: harr) instead of wname and swt function take care of all other things.

So my problem is, how can I add haar filter as the 3rd parameter for FWT_stat function on Matlab without Wavelet toolbox.

Or, Is there any alternative function (which is free) to do the exact same thing as SWT function from wavelet toolbox?

haarF = MakeONFilter('Haar');

format: plain


text:
# How to calculate $\sum \limits_{x=0}^{n} \frac{n!}{(n-x)!\,n^x}\left(1-\frac{x(x-1)}{n(n-1)}\right)$

What are the asymptotics of the following sum as $n$ goes to infinity? $$S =\sum\limits_{x=0}^{n} \frac{n!}{(n-x)!\,n^x}\left(1-\frac{x(x-1)}{n(n-1)}\right)$$

The sum comes from Probability of finding a duplicate or two numbers. Consider a random process where integers are sampled uniformly with replacement from $\{1...n\}$. Let $X$ be a random variable that represents the number of samples until either a duplicate is found or both the values $1$ and $2$ have been found. So if the samples where $1,6,3,5,1$ then $X=5$ and if it was $1,6,3,2$ then $X=4$. This sum is therefore $\mathbb{E}(X)$.

We therefore know that $S = \mathbb{E}(X) \leq \text{mean time to find a duplicate} \sim \sqrt{\frac{\pi}{2} n}$.

Taking the first part of the sum, $$\sum_{x=0}^{n} \frac{n!}{(n-x)!\,n^x} = \left(\frac{e}{n} \right)^n \Gamma(n+1,n) \sim \left(\frac{e}{n} \right)^n \frac{n!}{2} \sim \sqrt{\frac{\pi}{2} n}.$$

-
Can you provide some context to this sum? Also what have you tried already? – Fabian Jan 2 '13 at 10:54
@lip1: Given the number of questions you have asked, you might consider registering your account so that you can participate more fully on this site. – cardinal Jan 2 '13 at 15:47
Are you interested in the next term in the asymptotic expansion? I'm getting $S = \sqrt{\pi n/2} + \frac{2}{3} + o(1)$. – Mike Spivey Jan 8 '13 at 7:00
@MikeSpivey Yes but even more interested in exactly how you get that next term. (Thank you.) – user54551 Jan 9 '13 at 16:33

Let $N_n$ denote a Poisson random variable with parameter $n$, then $$S_n=\frac{n-2}{n-1}n!\left(\frac{\mathrm e}n\right)^n\mathbb P(N_n\leqslant n)+\frac2{n-1}.$$ As a consequence, $\lim\limits_{n\to\infty}S_n/\sqrt{n}=\sqrt{\pi/2}$.

To show this (for a shorter proof, see the end of this post), first rewrite each parenthesis in $S_n$ as $$1-\frac{x(x-1)}{n(n-1)}=\frac2n(n-x)-\frac1{n(n-1)}(n-x)(n-x-1).$$ Thus, $\displaystyle S_n=n!\,(2U_n-V_n)$ with $$U_n=\frac1n\sum_{x=0}^n\frac1{n^x}\frac{n-x}{(n-x)!}=\sum_{y=1}^n\frac1{n^y}\frac1{(n-y)!}=n^{-n}\sum_{x=0}^{n-1}\frac{n^x}{x!},$$ and $$V_n=\frac1{n(n-1)}\sum_{x=0}^n\frac1{n^x}\frac{(n-x)(n-x-1)}{(n-x)!}=\frac{n}{n-1}\sum_{z=2}^n\frac1{n^z}\frac1{(n-z)!},$$ that is, $$V_n=\frac{n}{n-1}n^{-n}\sum_{x=0}^{n-2}\frac{n^x}{x!}.$$ Introducing $$W_n=n^{-n}\sum_{x=0}^n\frac{n^x}{x!},$$ this can be rewritten as $$U_n=W_n-\frac1{n!},\qquad V_n=\frac{n}{n-1}\,\left(W_n-\frac2{n!}\right),$$ hence $$S_n=n!\left(2\left(W_n-\frac1{n!}\right)-\frac{n}{n-1}\left(W_n-\frac2{n!}\right)\right)=n!\frac{n-2}{n-1}W_n+\frac2{n-1}.$$ The proof is complete since $$W_n=n^{-n}\mathrm e^n\cdot\mathrm e^{-n}\sum_{x=0}^n\frac{n^x}{x!}=n^{-n}\mathrm e^n\cdot\mathbb P(N_n\leqslant n).$$ Edit: Using the distribution of $N_n$ and the change of variable $x\to n-x$, one gets directly $$S_n=n!\left(\frac{\mathrm e}n\right)^n\left(\mathbb P(N_n\leqslant n)-\mathbb E(u_n(N_n))\right),$$ with $$u_n(t)=\frac{(n-t)(n-t-1)}{n(n-1)}\,\mathbf 1_{t\leqslant n}.$$ Since $N_n/n\to1$ almost surely when $n\to\infty$, $u_n(N_n)\to0$ almost surely. Since $u_n\leqslant1$ uniformly, $\mathbb E(u_n(N_n))\to0$. On the other hand, by the central limit theorem, $\mathbb P(N_n\leqslant n)\to\frac12$, hence Stirling's equivalent applied to the prefactor of $S_n$ yields the equivalent of $S_n$.

Edit-edit: By Berry-Esseen theorem, $\mathbb P(N_n\leqslant n)=\frac12+O(\frac1{\sqrt{n}})$. By the central limit theorem, $\mathbb E(u_n(N_n))=O(\frac1n)$. By Stirling's approximation, $n!\left(\frac{\mathrm e}n\right)^n=\sqrt{2\pi n}+O(\frac1{\sqrt{n}})$. Hence, $S_n=\sqrt{\pi n/2}+T_n+o(1)$ where $\limsup\limits_{n\to\infty}|T_n|\leqslant 2C\sqrt{2\pi}(1+\mathrm e^{-1})$ for any constant $C$ making Berry-Esseen upper bound true, hence $\limsup\limits_{n\to\infty}|T_n|\lt3.3$.

-
Hi Didier; you may already be aware, but this post appears to have gotten cut off. Cheers. – cardinal Jan 2 '13 at 13:52
@cardinal: Now, don't be hasty, Master Meriadoc... – Did Jan 2 '13 at 14:01
There is, using a little more of probabilistic machinery, see Edit. – Did Jan 2 '13 at 14:26
(+1) Just wanted to make sure it wasn't due to some technical glitch. I think other readers will find your edit, in particular, to be illuminating. :-) – cardinal Jan 2 '13 at 14:36
@cardinal Thanks. – Did Jan 2 '13 at 14:52

The result below is not completely rigorous though I believe the argument (and especially the result) to be essential correct.

Defining $$f_n(k) = \frac{n!}{(n-k)!\,n^k}\left[1-\frac{k(k-1)}{n(n-1)}\right],$$ we transform the sum $$S_n=\sum_{k=0}^n f_n(k) =\sum_{k=1}^{n} k [f_n(k-1) -f_n(k)]$$ using summation by parts. Some straightforward calculation shows $$g_n(k) = f_n(k-1)- f_n(k) = \frac{(k-1)(k+n)}{n(n-1)} \frac{n!}{ n^k (n-k)!}.$$ Because of the definition of $f_n(k) = P(X\ge x)$, we know that $g_n(k) \geq 0$ for $k\in[1,n]$.

We have that $$\frac{n!}{(n-k)!} \frac{1}{n^k} = \frac{n}{n} \frac{n-1}{n} \cdots \frac{n-k+1}{n} = \prod_{j=1}^{k-1} \left(1- \frac{j}{n}\right)$$ thus ($k\ll n$) $$\log \left[\frac{n!}{(n-k)!} \frac{1}{n^k}\right] = \log\left[ 1 -\sum_{j=1}^{k-1}\frac{j}{n} + \mathcal{O}\left(\frac{1}{n^2}\right)\right] = - \frac{k(k-1)}{2n} + \mathcal{O}\left(n^{-2}\right).$$ You can see that for large $n$ this function is maximal for $k=1$ with a broad peak of size $\simeq \sqrt{n}$. Nevertheless, because for large $n$, $\sqrt{n} \ll n$ the most weight of the sum is concentrated for small $k \lesssim \sqrt{n} \ll n$.

We can simplify $$S_n =\sum_{k=1}^n k g_n(k) \sim \sum_{k=1}^n \frac{k (k-1)\overbrace{(k+n)}^{\approx n}}{\underbrace{n(n-1)}_{\approx n^2}} e^{-k(k-1)/2n} \sim -2 \partial_{\alpha}\sum_{k=1}^n e^{-\alpha k(k-1)/2n}\bigg|_{\alpha=1}.$$

Because the summand changes little from $k$ to $k+1$, the remaining sum can be approximated by the integral $$\sum_{k=1}^n e^{-\alpha k(k-1)/2n} \sim \int_0^n e^{-\alpha x^2/2n} \sim \int_0^\infty e^{-\alpha x^2/2n} = \sqrt{\frac{\pi n}{2 \alpha}}.$$

Concluding, we have $$S_n \sim -2 \partial_{\alpha} \sqrt{\frac{\pi n}{2 \alpha}}\,\bigg|_{\alpha=1}= \sqrt{\frac{\pi n}{2}}.$$

1) in the expansion of $$\log \left[\frac{n!}{(n-k)!} \frac{1}{n^k}\right]$$ the next term is $\mathcal{O}(k^3/n^2) = \mathcal{O}(n^{-1/2})$ using the fact that $k\leq \sqrt{n}$.

2) We have $k+n = n [1+ \mathcal{O}(n^{-1/2})]$ and $n(n-1) = n^2[1+\mathcal{O}(n^{-1})]$.

3) The error in replacing the sum with the integral $$\sum_{k=1}^n e^{-\alpha k(k-1)/2n} \sim \int_1^{n-1} e^{-\alpha x(x-1)/2n}$$ is given by the maximum of $\partial_x e^{- x(x-1)/2n}$ times $\sqrt{n}$, i.e., the error is of the order $n^{-1/2}$.

4) Replacing $x(x-1)$ with $x^2$ introduces a relative error of $n^{-1/2}$.

5) Extending the upper bound of the integral to infinity contributes with an error $\propto e^{-n}$.

s) Summarizing, we expect $S_n = \sqrt{\pi n/2} + \mathcal{O}(1)$.

-
@lip1: sorry, I made a stupid mistake. It is corrected now... – Fabian Jan 2 '13 at 12:57
@lip1: yes, and I believe it is correct. To make my answer more rigorous you have to work a bit and estimate the error made in each step. It would be curious to see what is the next term in the asymptotic expansion (if I have time I give it some thought). I am sure though that somebody with better knowledge in probability theory will be able to solve this problem in a few lines using some well-known theorem. – Fabian Jan 2 '13 at 13:02
It will not go to 0 but to a constant! – Fabian Jan 2 '13 at 13:21

I get $$S = \sqrt{\frac{\pi n}{2}} + \frac{2}{3} + O(n^{-1/2+4\epsilon}).$$

An asymptotic for the summand.

If $x \leq n^{1/2+\epsilon}$, then Stirling's approximation yields $$\log\left(\frac{n!}{(n-x)!n^x}\right) = - \frac{x^2}{2n} + \frac{x}{2n} - \frac{x^3}{6n^2} + O(n^{-1+4\epsilon}) \tag{1}.$$ To obtain this, we need to rewrite $\log(n-x)$ as $\log(n) \log(1-x/n)$, use the Maclaurin series $\log(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} + O(x^4)$ to get the dominant terms of $\log(1-x/n)$, and then crunch through a lot of algebra. Most of the initially dominant terms cancel.

Thus, if $x \leq n^{1/2+\epsilon}$, $$\frac{n!}{(n-x)!n^x} = e^{-x^2/2n} \left(1 + \frac{x}{2n} - \frac{x^3}{6n^2} + O(n^{-1+4\epsilon})\right),$$ where we use the Maclaurin series $e^x = 1 + x + O(x^2)$ on all but the dominant term in Eq. (1).

Bounding the tail sum.

Since $\displaystyle \frac{n!}{(n-x)!n^x}$ is a decreasing function of $x$, if $x > n^{1/2+\epsilon}$, then $\displaystyle \frac{n!}{(n-x)!n^x} = O(e^{-x^2/2n}) = O(e^{-n^{2\epsilon}/2})$. Thus for the tail sum we get $$\sum_{x > n^{1/2} + \epsilon} \frac{n!}{(n-x)!n^x} = O(ne^{-n^{2\epsilon}/2}),$$ which is exponentially small. Therefore we can ignore it from here out for asymptotic purposes.

A useful asymptotic sum.

Problem 9.30 (p. 491) in Concrete Mathematics states that $$\sum_{k \geq 0} k^r e^{-r^2/n} = \frac{1}{2} n^{(r+1)/2} \Gamma\left(\frac{r+1}{2}\right) - \frac{B_{r+1}}{(r+1)!} + O(n^{-1}) \tag{2},$$ where $B_r$ is the $r$th Bernoulli number. (An outline of the proof is given in the answer section of the book.)

The asymptotic for the first, dominant term.

Equation (2) gives us \begin{align*} \sum_{x =0}^n \frac{n!}{(n-x)!n^x} = &\frac{1}{2} \sqrt{2n} \Gamma(1/2) + \frac{1}{2} + O(n^{-1}) + \frac{1}{2n}\left(\frac{1}{2} 2n \Gamma(1) + O(1)\right) \\ &- \frac{1}{6n^2} \left(\frac{1}{2} (2n)^2 \Gamma(2) + O(1)\right) + O(n^{-1/2 + 4 \epsilon}) \\ = & \sqrt{\frac{\pi n}{2}} + \frac{2}{3} + O(n^{-1/2 + 4 \epsilon}). \end{align*}

An asymptotic for the second term.

For the second term $\displaystyle \sum_{x =0}^n \frac{n!}{(n-x)!n^x} \frac{x(x-1)}{n(n-1)},$ a similar analysis holds. We can ignore the tail sum when $x > n^{1/2+\epsilon}$ because it is even smaller than the tail sum in the first term. If $x \leq n^{1/2+\epsilon}$, we get $$\frac{n!}{(n-x)!n^x} \frac{x(x-1)}{n(n-1)} = e^{-x^2/2n} O(n^{-1+\epsilon}).$$ Therefore, by Equation (2), $$\sum_{x=0}^n \frac{n!}{(n-x)!n^x} \frac{x(x-1)}{n(n-1)} = O(n^{-1/2+\epsilon}).$$

Finally.

All together, then,

$$S = \sqrt{\frac{\pi n}{2}} + \frac{2}{3} + O(n^{-1/2+4\epsilon}).$$

Incidentally, the sum $\displaystyle \sum_{x=0}^n \frac{n!}{(n-x)!n^x}$ is one that appears in several places in Knuth's work, and in The Art of Computer Programming, Vol. I, p. 120, he gives the asymptotic (in his notation) $$\sum_{x=0}^n \frac{n!}{(n-x)!n^x} = 1 + Q(n) = \sqrt{\frac{\pi n}{2}} + \frac{2}{3} + \frac{1}{12}\sqrt{\frac{\pi}{2n}} - \frac{4}{135n} + \frac{1}{288} \sqrt{\frac{\pi}{2n^3}} + O(n^{-2}).$$


text: Answer gives a software for calculating conditional Lyapunov exponent (CLE) for coupled oscillators in chaos synchronization. The method of determination of a Lyapunov functional for a time delay system with one delay was presented by Repin. Kuznetsova, St. Diagnostic approach: Finite-time Lyapunov exponents (FTLE) trenches Since both shearing and stretching are as low as possible along a parabolic LCS, one may seek initial positions of such material surfaces as trenches of the FTLE field F T L E t 0 t 1 ( x 0 ) {\displaystyle FTLE_{t_{0}}^{t_{1}}(x_{0})}. Even although others are free, they require the purchase of expensive commercial software on which they depend (e. FTLA is based on finite-time Lyapunov exponents (FTLEs) and vectors (FTLVs) and its main advantage is that it is more widely applicable with respect to other methodologies. Eykholt, and R. Mob mentality rules jackdaw flocks; NASA lander captures marsquakes, other Martian sounds; New public-private research upends traditional carbon pricing and presents a more effective method for pricing emissions. We have considered the initial point as (0. 718281, and is the base of the natural logarithm, ln (this means that, if , then. Using the code is very simple, it needs only an scalar time series, number of lags and number of hidden unites. Sandri in order to determine the maximum Lyapunov exponent as well as all the Lyapunov exponents. Numerical calculation of Lyapunov exponents for three-dimensional systems of ordinary di erential equations Clyde-Emmanuel Estorninho Meador We consider two algorithms for the computation of Lyapunov exponents for systems of ordinary di erential equations: orbit separation and continuous Gram-Schmidt orthonormal-ization. The LCS appear as ridges in the FTLE, and divide the flow into regions of qualitatively different dynamics. A MATLAB code was used that calculated. Results Up: 2. In the figure we plot the graph of the maximum lyapunov exponent against parameter values ( ) varies from 0. This may be done through the eigenvalues of the Jacobian matrix J 0 (x 0). Johnson and Charles Meneveau. Collins, C. The maximum Lyapunov exponent measures the average rate of divergence of close trajectories in the system. Consider two iterations of the logistic map starting from two values of x which are close together. Period-doubling route to chaos. We utilize the Routh-Hurwitz stability criterion to obtain speed controller parameters,and to calculate the initial value by computtation of Lyapunov exponent to determine whether the system is in chaos behavior. Sum-of-squares programming Tags: Polynomial programming, Polynomials, Semidefinite programming, Sum-of-squares programming Updated: September 17, 2016 The sum-of-squares module is described in the paper Löfberg 2009 (which should be cited if you use this functionality). Taha Module 04 — Optimization and KKT Conditions 13 / 28. Lecture Series on MATLAB. ESTIMATION OF THE CORRELATION DIMENSION AND MAXIMAL LYAPUNOV EXPONENT OF HEART RATE VARIABILITY 6. Here is the following example code I am using:. • Generalized entropies & permutation entropy. > I am having a program from the book '' Dynamical systems application using matlab''. Internally these functions are subdivided into different modules such as measures and datasets, but you should not need to import these modules directly unless you want access to some internal helper functions. The Lyapunov exponent measures the divergence rate between two points which are initially close in the state space. Wolf et aL / Determining Lyapunov exponents from a time series 287 the sum of the first j exponents is defined by the long term exponential growth rate of a j-volume element. txt) or read online for free. 0, is a MATLAB software package that can be used to compute finite-time Lyapunov exponents (FTLE). Then, different statistics on the set of the Lyapunov exponents are computed: - The minimum, respectively the maximum of the Lyapunov spectra. The Lyapunov exponent is defined as the average over the whole attractor/trajectory. % m: m is embedding dimension. 3 determines exponential growth/contraction rate of small volumes between four trajectories and so on for sums over increasing number of Lyapunov exponents. This page provides supplementary information and relevant links for Chapter 6 in Advanced Methods for ECG Analysis, which is co-edited by Francisco Azuaje and Patrick McSharry, and is published by Artech House. pdf), Text File (. exponent for a chaotic restricted three-body orbit, with several values of 0 ranging from 10d-5 to 10-15, with arescaling threshold of 10-4. • Spectrum of Lyapunov exponents. Plot of this exponents is % very helpful. Lyapunov Exponents via author employed Matlab Simulation:11011151 If the two adjacent phase trajectory is dissipative with the Lyapunov exponent, (D increases gradually with time t. Dynamical Systems And Chaos: Lyapunov Exponents (Optional) - Duration: 9:41. - *Lyap*: Positive Lyapunov exponents indicate chaos and unpredictability. Hardware achieved by using DS1104 processor board, which is the product of the dspace. MATLAB codes from a recent work inspired by Sara’s MSc thesis, see. maximum Lyapunov exponent (STLmax). The diagram displays phase-space analysis of 24002 = 5. A LYAPUNOV EXPONENT APPROACH FOR IDENTIFYING CHAOTIC BEHAVIOR IN A FINITE ELEMENT BASED DRILLSTRING VIBRATION MODEL A Thesis by KATHIRA MONGKOLCHEEP Submitted to the Office of Graduate Studies of Texas A&M University in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE August 2009 Major Subject: Mechanical Engineering. 2- And has the maximum or the minimum or the negative values a meaning knowing tht I found that the Lyapunov exponent unit is the bits/s. 1) In a system with positive, negative, perhaps zero exponents, the average rate of orbital divergence is dominated by the term that grows fastest, which by definition, is the exponential term with an exponent that is the largest POSITIVE Lyapunov exponent. and became the prime benchmark for finite-time Lyapunov exponents. However, it is hard to follow and there is no graphical output of the plot (and it is in C, more complex). exponential, and the maximum slope of the growth curve can be at any value. Lyapunov Exponents via author employed Matlab Simulation:11011151 If the two adjacent phase trajectory is dissipative with the Lyapunov exponent, (D increases gradually with time t. λ_max = lyapunov(ds, 5000): Value to use for largest Lyapunov exponent for finding the Lyapunov prediction time. Sample software that calculates the Lyapunov exponent (-0. % ioutp - step of print to MATLAB main window. 2 Numerical Scheme For the realization of simulation used the proposed code by Moeng (1984) and parameterization of sub-grid Sul-livan et al. ANNLYAP: MATLAB function to calculate Lyapunov exponents. 61 mm according x axis direction and y direction, and maximum value for output stress of 120 MPa while input displacement of 0. In case the loglinear-option is used, this corresponds to a linear trend in the logged observables, i. The objective of this thesis is to nd the parameter values for a system that determines chaos via the Lyapunov exponents. Properties of the Caputo’s ﬀtial operator, Dq ∗, are discussed in [Podlubny, 1999; Gorenﬂo & Mainardi, 1997]. You may need to know a bit about the dist inction between external functions and other types. To this aim, the deformation tensor is modiﬁed to take into account that the stretching rate between particles separated by a certain distance is inﬂuenced by the initial velocity of the particles. Divergence of nearest trajectories can be seen on the graph. Again, because there would be a large number of graphs, we only. The diagram displays phase-space analysis of 24002 = 5. De Luca(1992), A practical method for calculating largest Lyapunov exponents from small data sets". There is not just one global variable available. png 801 × 801；485 KB Main gui. The Wikipedia and the Scholarpedia entries have a lot of valuable information about the history and usage of these quantities. Internally these functions are subdivided into different modules such as measures and datasets, but you should not need to import these modules directly unless you want access to some internal helper functions. ) was selected and the raw data were down-sampled to 100 Hz. Microsoft Office 2003中文版下载地址及安装——简介Microsoft Office 2003. "On Lyapunov Exponents and their Furstenberg-Kesten Bounds," July 1999, Invited Speaker, Hirota Laboratory, Dept. method with some modifications based on below references. Forced nonlinear oscillators. lyapunov算法程序. Kirchhoff migration operator is a highly oscillatory integral operator. The Lyapunov exponent is defined as the average over the whole attractor/trajectory. A MATLAB-based program for dynamical system investigation. Shapour Mohammadi () Statistical Software Components from Boston College Department of Economics. Re: matlab source code for lyapunov exponent of eeg signals What parameter of EEG have u decided to take for studying its chaotic nature ? You might have to look for an ERP and use wavelet methods which is best for feature extraction and then formulate a non-linear dynamical mathematical structure. Lyapunov Exponents. I mean, by using the variational equations or by monitoring the deviation between two initially nearby orbits? If it is the latter, then I could provide such a Mathematica code. Using The Lyapunov exponent as a practical test for noisy chaos Abstract This paper presents a practical framework to test chaotic dynamics even for noisy systems as opposed to stochastic dynamics. nearest for the choice of optimal embedding parameters. This program, NETLE. There is not just one global variable available. lyapunov_wolf Can realize the maximum Lyapunov function. Recall from last time, for a linear renewing ow: 2hlogk'0ki= loga+ 1 ˇ Z. series (see buildTakens). There are two peaks detected inside the window. These averages have a standard deviation of around 0. dim: Integer denoting the maximum dimension in which we shall embed the time. Kirchhoff migration operator is a highly oscillatory integral operator. Indeed, they are directly. (Note That The Rate Of Separation Between Two Trajectories Can Be Different For Different Realizations, Also The Time Interval 5. the Matlab code was my own. The Lyapunov functionals are used to test the stability of systems, in calculation of the robustness bounds for uncertain time delay systems, in computation of the exponential estimates for the solutions of time delay systems. Lyapunov exponents measure rates of separation of nearby trajectories in the flow of a dynamical system. calculate lyapunov of the logistic map lyap=zeros(1,1000); j=0; for (r=3:0. the Lyapunov exponents are the same then they can only take the value zero. Here, Lyapunov exponents are determined in forced homogeneous isotropic turbulence for a range of Reynolds numbers. 3 and 0 < C < 2 is also available in (DOS) BASIC source and executable code. tude of the largest Lyapunov exponent indicates the maximum amount of instability in any direction in the attractor. Hunt Institute for Physical Science and Technology University of Maryland College Park, MD 20742 [email protected] This alternate definition will provide the basis of our spectral technique for experimental data. It elaborates an-easy-to-use and comprehensive algorithm to build a program to test chaos based on theoretical studies. 0 YBAMP package - version 1. Part B: Here is Matlab code for finding the Lyapunov exponent of the attractor. maximum Lyapunov exponent under two different l values. exponent for a chaotic restricted three-body orbit, with several values of 0 ranging from 10d-5 to 10-15, with arescaling threshold of 10-4. dim and max. txt) or read online for free. Lyapunov Exponents. $\begingroup$ Please define "Lyapunov curve". • Generalized dimensions and automated procedure of deducing them. Using the code is very simple, it needs only an scalar time series, number of lags and number of hidden unites. As you vary parameters in the task, it automatically updates the generated code for performing the estimation and creating the plot. $\begingroup$ Please define "Lyapunov curve". Below every paper are TOP 100 most-occuring words in that paper and their color is based on LDA topic model with k = 7. We prove a conjecture of Il'yashenko, that for a C. It's a really cryptic way to explain the algorithm. Neural networks are estimated by the method of nonlinear least squares (NLS) (Kuan and Liu (1995)); Lyapunov exponents are calculated from the derivative matrices of estimated network models (Gencay and Dechert (1992)). Contributions To The Study of Autonomous Chaotic Circuits and Cellular Automata by Bharathwaj Muthuswamy Doctor of Philosophy in Engineering-Electrical Engineering and Computer Sciences University of California, Berkeley Professor Leon O. Let's estimate the maximal Lyapunov exponent of the Lorenz system, which is known to be chaotic. I found a MatLab program lyaprosen. the maximum nonzero Lyapunov exponent. It allow to user select embedding lag( tau) and embedding dimension(m), but if a user cannot give any value to this parameters the code will select automatically this values. It elaborates an-easy-to-use and comprehensive algorithm to build a program to test chaos based on theoretical studies. 1 Naive numerical evaluation of 1. I am currently doing research in non-linear dynamical systems, and I require to calculate Lyapunov exponents from time series data frequently. , comments (lines that begin with #) and documentation strings (material enclosed in triple quotes """ that document what each module, class, and function is about and can be queried with the Python help. matlab编写的Lyapunov指数计算程序---文档精品，是我多年收藏整理的好文档，都是文档中的经典，精品，极品，确实值得下载收藏！ 频道 豆丁首页. Wolf et aL / Determining Lyapunov exponents from a time series 287 the sum of the first j exponents is defined by the long term exponential growth rate of a j-volume element. A version of MATLAB1 m-code. 1 INTRODUCTION In this chapter, Correlation Dimension (CD) and Maximal Lyapunov Exponent (MLE) of heart rate variability are introduced. It tests the positivity of the dominant (or largest) Lyapunov exponent λ at a specified confidence level. The advisor of the project, Professor Humi, suggested a program called TISEAN to find the largest Lyapunov exponent of each stock, where a larger exponent indicated greater volatility. Daca aveti cont Ad Astra si de Facebook, intrati pe pagina de profil pentru a da dreptul sa va logati pe site doar cu acest buton. Supplemental Materials for— Moira L. Question: Lyapunov exponent Tags are words are used to describe and categorize your content. The irrational number e is also known as Euler’s number. If you have not any information about % embedding dimension please let it zero. Kuznetsova, St. , 2012; Wolf et al. From the Start button, select All programs, Scientific software and Matlab2010b. Moving averages were later introduced to decrease the noise in the model input data. 2 Back Study Data Collection 19 2. Most software that requires Matlab can also be used with Octave, a freely available open-source program that is compatible with Matlab. It is written in C. From the studies above, it seems that the maximum finite time Lyapunov exponent is a common and useful tool to quantify torso stability from time series data. We apply the method by M. Please try reloading this page, or contact support. Also, the programs to obtain Lyapunov exponents as function of the bifur-cation parameter and as function of the fractional order are described. The Matlab program prints and plots the Lyapunov exponents as function of time. To decrease the computing time, a fast Matlab program which implements the Adams-Bashforth-Moulton method, is utilized. Learn how to simulate a three-phase power system containing electrical machines and other three-phase models. the code will find proper % embedding dimension. It allow to user select embedding lag( tau) and embedding dimension(m), but if a user cannot give any value to this parameters the code will select automatically this values. These map to x1 and x1 +dx1. ” Conditional Lyapunov exponents measure trajectory divergence (or convergence) caused by the intrinsic dynamics of a system when exposed to external forcing. m Matlab m-file to fit logistic curve to China's population. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included. $\endgroup$ - Arastas Oct 4 at 8:44. Numerical Calculation of Largest Lyapunov Exponent J. com and understand terms, two variables and lots of additional algebra subject areas. In this page, the Lyapunov exponent is applied to an equation that jumps between stability and instability, between chaos and order — the logistic equation. Matlab code for Lyapunov exponents of fractional order systems 3 point 03 Dq ∗x(t) = 1 Γ(1−q) ∫ t 0 (t−τ)−qx′(τ)dτ, with Γ the known Euler function. 1102, the system is in cyclic motion and its maximum Lyapunov exponent is close to 0. However, it is hard to follow and there is no graphical output of the plot (and it is in C, more complex). From this it appears that the maximum Lyapunov exponent of the Lorenz system is 0. For small enough thresholds, one recovers the usual (maximum) Lyapunov exponent, while for large amplitudes, $$\ell$$ saturates to zero, since a perturbation cannot be larger than the size of the accessible phase-space. 1)(Cignetti et al. 105-181 19179 Blanco Rd #181 San Antonio, TX 78258 USA. , the HRV toolkit for MatLab). There is no warranty of any kind whatsoever connected to the programs and algorithms. My problem is that I don't know first Lyapunov exponent is average of all the lyapunovs when k = 1 or average of all the lyapunovs for the first time that data[i] - data[j] < eps? Is this right implementation for Lyapunov exponent? And this is the Numerical Calculation of Lyapunov Exponent. 4, (1997), 520). 285-317, 1985. Whereas the (global) Lyapunov exponent gives a measure for the total predictability of a system, it is sometimes of interest to estimate the local predictability around a point x 0 in phase space. Results show that the maximum exponent increases with Reynolds number faster than the inverse Kolmogorov time scale, suggesting that the instability processes may be acting on length and time scales smaller than Kolmogorov scales. This may be done through the eigenvalues of the Jacobian matrix J 0 (x 0). Estimate maximum Lyapunov exponent for short time series using Rosenstein, et al. - The median of the absolute value of the Lyapunov spectra. Recall from last time, for a linear renewing ow: 2hlogk'0ki= loga+ 1 ˇ Z. The code will calculates % the tau. You do not consider multiple initial displacements or rescale the displacement vector. The following code solves the system of the ODEs and also plots the output 3D orbit. This format allows for the special case of differentiation with respect to no variables, in the form of an empty list, so the zeroth order derivative is handled through diff(f,[x$0]) = diff(f,[]). Initialize the positions and the velocities for all the particles randomly. Abstract: This M-file calculates Lyapunov exponents with minimum RMSE neural network. As with any scientific publication, you are welcome to use this material at your own risk. These map to x1 and x1 +dx1. The reason for this disagreement is that Eckhardt is using a Lyapunov exponent with a log base two. Use features like bookmarks, note taking and highlighting while reading Lyapunov Exponents: A Tool to Explore Complex Dynamics. png 801 × 801；485 KB Main gui. Here, Lyapunov exponents are determined in forced homogeneous isotropic turbulence for a range of Reynolds numbers. A version of MATLAB m-code is provided in the appendix. 1 Ouverture Firstly, create a folder (directory) in your Windows system of name mas2106. 2 From the studies above, it seems that the maximum finite time Lyapunov exponent is a. species3driver. lyapunov_max (w0, integrator, dt, n_steps[, …]) Compute the maximum Lyapunov exponent of an orbit by integrating many nearby orbits ( noffset ) separated with isotropically distributed directions but the same initial deviation length, d0. xlyap generates and graphically displays an array of Lyapunov exponents for a variety of iterated periodically forced non-linear maps of the unit interval. Dynamical Systems And Chaos: Lyapunov Exponents (Optional) - Duration: 9:41. 1 INTRODUCTION In this chapter, Correlation Dimension (CD) and Maximal Lyapunov Exponent (MLE) of heart rate variability are introduced. Block: observation_trends; Description. 1 Using Program 1 as a guide, write Matlab function ikeda. This tutorial shows how to use the MATLAB solver DDE23 to solve delay differential equations (DDEs) with constant delays. Part B: Here is Matlab code for finding the Lyapunov exponent of the attractor. MATLAB中文论坛MATLAB 基础讨论板块发表的帖子：问个问题。下面是个画lyapunov指数图谱的程序段，画出来是四条线，怎样才能只画最大的三条线，便于观察。. Even although others are free, they require the purchase of expensive commercial software on which they depend (e. Steyn-Ross, D. I learned a lot about calculating Lyapunov exponents and thinking practically about chaotic systems. % ioutp - step of print to MATLAB main window. As it so often goes with easy ideas, it turns out that Lyapunov exponents are not natural for study of dynamics, and we would have passed them. for the moments obtained from the codes by substituting them in the Bogoliubov-Born-Green-Kirkwood-Yvon-like (BBGKY-like) moment evolution hierarchy and verify-ing that this set of equations is satisﬁed to a relatively high order. 2 Back Study Data Collection 19 2. Région de Grenoble, France. The irrational number e is also known as Euler’s number. Here we discuss the Lyapunov exponent for the logistic map. % OUTPUTS: % LLE: Largest Lyapunov Exponent % lambda: Lyapunov exponents for various ks. 3 Empirical Measurement of System Dynamics 17 2. lyapunov spectrum (all Lyapunov exponents). SO_figs Function to generate selected subset of SOinC (slow oscillations in cortex) gures from the paper. t0/;1 i nwith nthe dimension of the phase space such that iDlim t!1. You can use Benettin's algorithm, which uses the linearized equations about the full nonlinear reference trajectory from a particular starting point. MATDS (Govorukhin VN, 2010) is MATLAB -based soft-ware for investigation of dynamic systems; it displays bifurcations and Lyapunov exponents, has few system analysis methods and. The Math Forum has a rich history as an online hub for the mathematics education community. Eskin and M. The Lorenz attractor, named for Edward N. Current version allows to compute trajectories, equilibria, Poincare map, Lyapunov exponents and vector field visualization for ordinary differential equation systems. A new architecture for optimization modeling frameworks. This project produces a linear t for both a short term and a long term Lyapunov exponent. A version of MATLAB m-code is provided in the appendix. implemented in MATLAB. Abscissa represents the control parameter " " while the ordinate represents maximum Lyapunov exponent. Lyapunov Exponents and Adaptive Mesh Reﬁnement for High-Speed Flows 2. 2 For each global reference point (specified by an intger index in the reference matrix) a local Lyapunov spectrum is calculated, one exponent for each dimension from 1 to local. Murray California Institute of Technology Zexiang Li Hong Kong University of Science and Technology. These averages have a standard deviation of around 0. strange attractor, correlation dimension, the surrogate data, and maximum Lyapunov exponent MLE methods 1,3–6. After estimation of network weights and finding network with minimum BIC, derivatives are calculated. ,[2] proposed the frequently used choice of calculating such ex-ponents using Gram-Schmidt orthonormalization process. Consider two iterations of the logistic map starting from two values of x which are close together. Join GitHub today. A new technique involving the products of the ratios of successive differentials is used to find maximal Lyapunov exponents in systems of differential equations. Ensemble Kalman filter for the Henon attractor. TSTOOL can be used for computing: Time-delay reconstruction, Lyapunov exponents, Fractal dimensions, Mutual information, Surrogate data tests, Nearest neighbor statistics, Return times, Poincare sections,. It will last 2 hours. The sum of Lyapunov exponents is negative for dissipative systems. For this, consider the distance between the two sequences after k steps: d ( k) = | ti+k – tj+k |. I need some help setting up the calculation of the maximum Lyapunov exponent of the system I was describing in my previous thread,. Graduate course on nonlinear dynamical systems: Spring 2016 version. The Lyapunov exponent is the mean exponential rate of divergence of initially nearby points in the reconstructed space (Figure 3B). It is based on template metaprogramming, is independent of a specific container type and can be used with modern graphic cards. Vastano, "Determining Lyapunov Exponents from a Time Series," Physica D, Vol. 1 Ouverture Firstly, create a folder (directory) in your Windows system of name mas2106. The Lyapunov exponents are used to study the stability of a system, e. 71) for the estimate of lyapunov exponent with 100 iterations. Table of functions []. Pielke (1991)Estimating the Lyapunov-Exponent Spectrum from Short Time Series of Low Precision, Physical Review Letters, Vol. Case-A: Lyapunov exponents and the corresponding bifurcation diagram of the local maximum of. Lyapunov exponent formula. Re : problème pour traduire un code Matlab en Mathematica Une reponse a cote de la plaque mais qui peut etre utile, tu peux utiliser "OCTAVE" qui est un clone gratuit de matlab, ainsi aucune traduction de scripts ne sera necessairre. We know that the Lyapunov exponent is an important tool in the spec-tral theory for one-dimensional Schro˘ dinger operators with almost periodic or random potentials. 285-317, 1985. MATLAB 1 Matlab basics 1. Swinney, and J. % % Output parameters: % Texp - time values % Lexp - Lyapunov exponents to each time value. ru Abstract: In the present paper a realization of a classical method for Lyapunov quantities computation in Maple is considered. To estimate a Lyapunov exponent, The Chaos textbook reports the largest exponent of a chaotic Chua orbit to be 0. Technically, the procedure for the first two Lyapunov exponents is: Select some parameters$ε$, representing the size of a small perturbation, and$τ$representing the rescaling interval. Zaslavskii map The Zaslavskii map is very chaotic (largest Lyapunov exponent 3. 1985, Nychka et al. MATLAB codes from a recent work inspired by Sara’s MSc thesis, see. Topics include linear stability analysis and classification of equilibria, qualitative dynamics and phase portraits in 1D and 2D, various bifurcations, Lyapunov stability, Lyapunov functions, limit cycles, Floquet theory and Poincare maps, parametric excitation, discrete dynamical systems, chaos and sensitive dependence on. In essence, the question of stability for ﬂuids is this: If we perturb our initial conditions by a small amount,. , comments (lines that begin with #) and documentation strings (material enclosed in triple quotes """ that document what each module, class, and function is about and can be queried with the Python help. This report contains some basic information on the origin of this system and my results on its behaviour, in particular, programs to visualize the strange attractor and follow chaotic orbits. Lipp and S. In case the loglinear-option is used, this corresponds to a linear trend in the logged observables, i. The following Matlab project contains the source code and Matlab examples used for largest lyapunov exponent with rosenstein's algorithm. To estimate a Lyapunov exponent, The Chaos textbook reports the largest exponent of a chaotic Chua orbit to be 0. Note: Mathematics 016A, 016B, and 016C are intended for students who will take no more Mathematics courses. We adopt finite-time Lyapunov analysis (FTLA) as the methodology to diagnose the timescalebehavior and to characterize the manifold structure. ” Conditional Lyapunov exponents measure trajectory divergence (or convergence) caused by the intrinsic dynamics of a system when exposed to external forcing. where the Lyapunov exponent is the slope of the linear function. To decrease the computing time, a fast Matlab program which implements the Adams-Bashforth-Moulton method, is utilized. the maximum nonzero Lyapunov exponent. The corresponding eigenvector is called Finite-Time Lyapunov Vector. species3driver. 3 Empirical Measurement of System Dynamics 17 2. 9 is a graph of a first normalized distribution of local Lyapunov exponents for the Lorenz system. ioutp==0 - no print, % if ioutp>0 then each ioutp-th point will be print. Lab 4: Lyapunov exponent. Yes, of course. Diagnostic approach: Finite-time Lyapunov exponents (FTLE) trenches Since both shearing and stretching are as low as possible along a parabolic LCS, one may seek initial positions of such material surfaces as trenches of the FTLE field F T L E t 0 t 1 ( x 0 ) {\displaystyle FTLE_{t_{0}}^{t_{1}}(x_{0})}. Wolf et aL / Determining Lyapunov exponents from a time series 287 the sum of the first j exponents is defined by the long term exponential growth rate of a j-volume element.$\endgroup\$ - Arastas Oct 4 at 8:44. Let the two starting values be x0 and x0 +dx0. A new technique involving the products of the ratios of successive differentials is used to find maximal Lyapunov exponents in systems of differential equations. 9 is a graph of a first normalized distribution of local Lyapunov exponents for the Lorenz system. Created Date: 10/1/2005 1:22:31 AM. , the HRV toolkit for MatLab). Figure 2: A comparison of resampled Monte{Carlo (J. It then prints the message "The age of NAME is AGE" on a line by itself, where NAME and AGE represent the values read into the variables name and age respectively. The mission of the bachelor of science in mechanical engineering is to deliver a laboratory-intensive, undergraduate mechanical engineering education that provides students with the tools and skills to excel in the engineering profession, as they pursue lifelong learning and make positive contributions to society. 2 For each global reference point (specified by an intger index in the reference matrix) a local Lyapunov spectrum is calculated, one exponent for each dimension from 1 to local. You may use any books, notes, or computer programs (e. Qigui Yang, Daoyu Zhu and ; Matlab Code for Lyapunov Exponents of Fractional-Order Systems. Based on the pseudospectral reduction to ODEs, with these codes one can approximate a number of Lyapunov exponents of a DDE. LYAPROSEN: MATLAB function to calculate Lyapunov exponent. , 1985) to calculate the maximum Lyapunov exponent. The maximal Lyapunov exponent can be calculated in any dimension by monitoring the separation distance in phase space used to write the Matlab code. What is MATLAB code for maximum lyaponuva exponent for discrete dynamical systems? I would like to know if the Maximal Lyapunov Exponent should be selected as the largest oositive number of. Undergraduate Courses. Here, Lyapunov exponents are determined in forced homogeneous isotropic turbulence for a range of Reynolds numbers. The objective of this thesis is to nd the parameter values for a system that determines chaos via the Lyapunov exponents. lyapunov exponent fortran Search and download lyapunov exponent fortran open source project / source codes from CodeForge. maximum Lyapunov exponent under two different l values. Let the two starting values be x0 and x0 +dx0. 3 Estimation of Maximum Lyapunov Exponent 15 2. Even although others are free, they require the purchase of expensive commercial software on which they depend (e. In this Letter, we introduce a definition of the nonlinear finite-time Lyapunov exponent (FTLE), which is a nonlinear generalization to the existing local or finite-time Lyapunov exponents. The following code solves the system of the ODEs and also plots the output 3D orbit. 2 From the studies above, it seems that the maximum finite time Lyapunov exponent is a. Result can be compared to the Matlab code written by V. Chercheur postdoctoral GIPSA-lab février 2017 – octobre 2017 9 mois. 11, 0, 0, -1. 0 100 200 300 400 500 600 700 800 900 1000 −20 −15 −10 −5 0 5 10 Time Lyapunov Exponents Fig. Kirchhoff migration operator is a highly oscillatory integral operator. A n-dimensional system will have n Lyapunov exponents. The paper by Wolf et. The Scientific World Journal is a peer-reviewed, Open Access journal that publishes original research, reviews, and clinical studies covering a wide range of subjects in science, technology, and medicine. In the Sinai Billiard case, there is only one positive Lyapunov exponent X and then it is proportional to the KS entropy. The Lyapunov spectra of system (2)witht = 1000, starting from (1. Why is the result positive? B2. However, it is hard to follow and there is no graphical output of the plot (and it is in C, more complex). Chaotic systems are unpredictable, but how much so? Can we say that one system is more chaotic than another? It's clear from our simulations and visualizations of chaotic attractors that they come in many shapes and forms and have distinct properties, such as being fractals and having sensitive dependence on initial conditions. maximum lyapunov exponent. 001:4) xn1=rand(1); lyp=0; j=j+1; for (i=1:10000) xn=xn1; %logistic map xn1=r*xn*(1-xn. Lyapunov exponents were computed using the techniques described in Ref. 3 and 0 < C < 2 is also available in (DOS) BASIC source and executable code. LYAPACK is a MATLAB toolbox for the solution of certain large scale problems in control theory, which are closely related to Lyapunov equations. This allows you to estimate the Lyapunov exponent of a scalar map by only knowing the. leading Lyapunov exponent. Collins, C. The software package includes a user-friendly GUI. , comments (lines that begin with #) and documentation strings (material enclosed in triple quotes """ that document what each module, class, and function is about and can be queried with the Python help. I don't know of any MATLAB code, but I believe the LyapOde software linked at the bottom of Paul Bryant's page may implement what you want. If ever you actually call for service with math and in particular with math pre-test or real numbers come visit us at Mathenomicon. We find that the Lyapunov exponent of turbulence, which measures the exponential separation of two initially close solutions of the Navier-Stokes equations, grows with the Reynolds number of the flow, with an anomalous scaling exponent, larger than the one obtained on dimensional grounds. The Lorenz oscillator is a 3-dimensional dynamical system that exhibits chaotic flow, noted for its lemniscate shape. 11, 0, 0, -1. the Matlab code was my own. My problem is that I don't know first Lyapunov exponent is average of all the lyapunovs when k = 1 or average of all the lyapunovs for the first time that data[i] - data[j] < eps? Is this right implementation for Lyapunov exponent? And this is the Numerical Calculation of Lyapunov Exponent.


text:
## The Astounding Power of Area

### 2.6 The Remainder Theorem/Factor Theorem

Here is something curious.

The reverse area method shows that $$p\left(x\right) = x^{4}-2x^{3}+3x^{2}-7x+9$$ leaves a remainder of $$7$$ when divided by $$x-2$$.

(We have $$\dfrac{x^{4}-2x^{3}+3x^{2}-7x+9}{x-2}=x^{3}+3x-1+\dfrac{7}{x-2}$$.  Check this!)

And the value of $$p\left(2\right)$$ is $$2^{4}-2\cdot2^{3}+3\cdot2^{2}-7\cdot2+9=7$$.

This is not a coincidence.

1. The reverse area method shows that dividing a polynomial $$p\left(x\right)$$ by a linear term $$x-h$$ gives a remainder (if any) that is just a single number $$a$$ (no $$x$$ terms): $$\dfrac{p\left(x\right)}{x-h}=q\left(x\right) + \dfrac{a}{x-h}$$ for some other polynomial $$q$$.

(If, for any reason, we have $$\dfrac{p\left(x\right)}{x-h}=q\left(x\right) + \dfrac{ax^{2}+bx+c}{x-h}$$, say, or $$\dfrac{p\left(x\right)}{x-h}=q\left(x\right) + \dfrac{ax+b}{x-h}$$, we can perform yet another division on the ratio term starting at the top left cell to reduce the power of $$x$$ that appears in a remainder.)

2. Multiplying through by $$x-h$$ gives $$p\left(x\right) = q\left(x\right)\left(x-h\right) + a$$.

3. Putting $$x=h$$ shows $$p\left(h\right) = a$$. That is, the remainder $$a$$ is the value of the polynomial at $$x=h$$.

THE REMAINDER THEOREM

When dividing a polynomial $$p\left(x\right)$$ by a linear term $$x-h$$, the remainder is $$p\left(h\right)$$. We have $$\dfrac{p\left(x\right)}{x-h}=q\left(x\right) + \dfrac{p\left(h\right)}{x-h}$$.

Taking it a bit further, we see $$p\left(x\right) = q\left(x\right)\left(x-h\right) + p\left(h\right)$$.

It follows that if $$p\left(h\right) = 0$$, then $$x-h$$ is a factor of the polynomial.

THE FACTOR THEOREM

If $$x=h$$ is a zero of a polynomial $$p\left(x\right)$$, that is, $$p\left(h\right)=0$$, then $$x-h$$ is a factor of the polynomial.

(And, conversely, if $$x-h$$ is a factor of a polynomial, that is, $$p\left(x\right) = \left(x-h\right)q\left(x\right)$$, then $$p\left(h\right)=0$$.

EXERCISE:  Quickly show that $$p\left(x\right) = x^{5}+ x^{4}-7x^{3}-x^{2}+6x$$ has factors $$x-1$$, $$x+1$$, $$x-2$$, and $$x$$. Now factor $$p\left(x\right)$$ completely.

AN ALTERNATIVE SLICK WAY TO THE FACTOR THEOREM

We saw in lesson 2.3 that $$x^{n}-a^{n}$$ is evenly divisible by $$x-a$$. So if $$p\left(x\right) = b_{n}x^{n}+b_{n-1}x^{n-1}+\ldots+b_{1}x+b_{0}$$, then $$p\left(x\right) – p\left(a\right)$$ is evenly divisible by $$x-a$$ too.

$$\dfrac{ p\left(x\right) – p\left(a\right)}{x-a}=q\left(x\right)$$ for some polynomial $$q$$.

If it turns out that $$p\left(a\right) = 0$$, then this reads

$$\dfrac{p\left(x\right)}{x-a}=q\left(x\right)$$

and we see that $$x-a$$ is a factor of $$p\left(x\right)$$.

EXERCISE SOLUTION:

Check that $$p\left(1\right)=0$$, $$p\left(-1\right)=0$$, $$p\left(2\right)=0$$, and $$p\left(0\right)=0$$. This shows that $$x-1$$, $$x+1$$, $$x-2$$, and $$x-0=x$$ are each factors of the polynomial. So the polynomial is evenly divisible by $$\left(x-1\right)\left(x+1\right)\left(x-2\right)x=x^{4}-2x^{3}-x^{2}+2x$$. Dividing $$p\left(x\right)$$ by this polynomial shows that the remaining factor is $$x+3$$. So $$p\left(x\right)=x\left(x-1\right)\left(x+1\right)\left(x-2\right)\left(x+3\right)$$.

## Books

Take your understanding to the next level with easy to understand books by James Tanton.

BROWSE BOOKS

## Guides & Solutions

Dive deeper into key topics through detailed, easy to follow guides and solution sets.

BROWSE GUIDES

## Donations

Consider supporting G'Day Math! with a donation, of any amount.

Your support is so much appreciated and enables the continued creation of great course content. Thanks!


text:
시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 35 17 17 58.621%

## 문제

Three secret agents A, B and C want to confirm if their secret codes are identical. To keep this secret, they did not set the meeting time. Instead, they decided to appear randomly at a café during the time interval [0, S] of a day. Let tA, tB, tC denote the arrival time of A, B, and C to the café, respectively. So, tA, tB, tC are random numbers chosen uniformly from time interval [0, S].

The code confirmation proceeds as follows. The agent who arrives earlier waits for the next agents to appear for a predetermined waiting time. If two agents encounter in the café, both check if their codes are identical. Then the agent who arrived earlier leaves the café immediately after the code confirmation. The second agent then waits till the third agent appears at the café. The agent leaves the café if the agent encounters the last agent in the agent’s own waiting time.

The waiting times of three agents A, B, C have already been determined as wA, wB, wC. It is crucial that each of the arrival times tA, tB, tC is a real number between 0 and S, not necessarily an integer, whereas each of the waiting times wA, wB, wC is a positive integer satisfying 0 < wA + wB, wB + wC, wA + wC < S. We assume it takes no time in code confirmation task. The agent immediately leaves the café if the agent confirms the code with the agent arrived later. Let us explain this procedure using Figure G.1.

Figure G.1 Four cases for successful and unsuccessful confirmations.

Successful code confirmation needs at least two encounters among three agents. When the arrival order is A, B, C, both of Case-1 and Case-4 are examples for successful confirmation, but Case-2 and Case-3 are not. In Case-1, the agent A leaves the café at time x = tB immediately not waiting by time tA + wA. It is easy to see that Case-2 is an unsuccessful case. In Case-2, though the waiting time of A overlaps those of B and C, B cannot confirm the code with C since the agent A (who already confirmed the code with B) leaves the café at time x. So, there is no way to confirm the code between B and C. Note that A also leaves the café at time x in Case-3 and Case-4.

We know the probability of the successful code confirmation depends on four integers (S, wA, wB, wC). We are given n different scenarios determined by four integers (S, wA, wB, wC). We want to sort these n scenarios in terms of this confirmation probability.

Given n scenarios, write a program to print the scenario indices in the non-decreasing order of the probability.

## 입력

Your program is to read from standard input. The input starts with a line containing an integer n (3 ≤ n ≤ 20), where n is the number of scenarios. In the following n lines, each line contains four positive integers S, wA, wB, wC in this order, describing a scenario (S, wA, wB, wC) where 0 < wA + wB, wB + wC, wA + wC ≤ 1,000.

## 출력

Your program is to write to standard output. Print the indices of n scenarios in the non-decreasing order of the probability in one line. If scenarios i and j for 1 ≤ i < jn have the same probability, then print i before j.

## 예제 입력 1

3
100 12 13 14
110  8  9 15
200 23 30 40

## 예제 출력 1

2 1 3

## 예제 입력 2

6
201 15 16 16
375 30 32 27
900 75 73 67
203 16 17 16
373 31 32 27
895 73 75 66

## 예제 출력 2

1 2 3 6 5 4


text:
# How do I delete an exported environment variable?

Before installing gnuplot, I set the environment variable GNUPLOT_DRIVER_DIR = /home/gnuplot/build/src. During the installation, something went wrong. I want to remove the GNUPLOT_DRIVER_DIR environment variable. How can I achieve it?

Tom O.

tutor
export -n GNUPLOT_DRIVER_DIR=""
Report

07/10/19


text:
# Question 42dcd

Mar 26, 2017

$7.80 \times {10}^{3} \text{cal}$, which is $7.80 \text{Cal, kcal, food calories,nutritional calories}$, whatever

#### Explanation:

Recall that $q = m C \Delta T$ within a phase and that during melting, $q = m {H}_{f}$

Given that ${C}_{\text{water"=4.18"J/g°C}}$, ${C}_{\text{ice"=2.09"J/g°C}}$, H_(f"water")=334"J/g", and the melting point of water is $0 \text{°C}$

First we need to make the $55.00 \text{g}$ of ice melt, that is raise it from $\text{-"10.0"°C}$ to $0 \text{°C}$ so $\Delta T = 10.0 \text{°C}$.

${q}_{1} = \left(55.00 \text{g")(2.09"J/g°C")(10.0"°C}\right)$, therefore ${q}_{1} = 1 \text{,"149.5"J"~~1","150"J}$

Then we need to actually melt the ice.

${q}_{2} = \left(55.00 \text{g")(334"J/g}\right)$, therefore ${q}_{2} = 18 \text{,"370"J"~~18","370"J}$

Then we need to raise the water to the desired temperature of $57.0 \text{°C}$ from the current $0 \text{°C}$ so $\Delta T = 57.0 \text{°C}$.

${q}_{3} = \left(55.00 \text{g")(4.18"J/g°C")(57.0"°C}\right)$, therefore ${q}_{3} = 13 \text{,"104.3"J"~~13","100"J}$

To find the total heat, we use $q = {q}_{1} + {q}_{2} + {q}_{3}$

q=(1","150"J")+(18","370"J")+(13","100"J")=32","620"J"~~32","600"J"#

Recall that $1 \text{cal"=4.18"J}$, so $\left(1 \text{cal")/(4.18"J}\right) = 1$

$32 \text{,"600"J"xx(1"cal")/(4.18"J")=7799.043"cal"~~7.80xx10^3"cal}$

Note: I used the $\approx$ symbol to show rounding for significant figures.


text:
# A Question From Jackson Electrodynamics

I have a question regarding Jackson's Classical Electrodynamics. Consider the equation

$$\varphi \left ( x\right )=\tfrac{1}{4\pi\epsilon _{0}} \int_V \frac{\varrho ( x )}{R}d^{3}x+\tfrac{1}{4\pi} \oint_{\partial V} \left(\frac{1}{R}\frac{\partial }{\partial n}\varphi -\varphi \frac{\partial }{\partial n}\frac{1}{R} \right)dS.$$

This expresses the electrostatic potential due to a charge distribution $\varrho$ in a finite volume $V$ with specified boundary conditions. The first integral expresses the charge inside a volume in space. The second integral encodes the boundary conditions on the surface of this volume.

My first question: does this determine the total potential completely inside that volume regardless of any charge that you put or remove outside the volume? Or does the change in the charge distribution outside the volume cause changes in the boundary conditions (the potential and its normal derivative at the surface)?

My second question: I can understan mathematically that the potential outside the volume should be zero but I can't see why this is so physically. Also, the zero potential outside will change if you put some charge outside the volume, right?

-
The potential on the outside of the volume can only be zero if the total charge inside the volume is zero. The boundary conditions that determine the second integral are not specified. –  Ron Maimon May 19 '12 at 20:07
Ok , But Jackson says in page 37 that the Potential Should be Zero outside the Volume??? –  EGY May 19 '12 at 20:11
I just have to ask, why the randomly capitalized letters? –  Colin K May 20 '12 at 4:41
@ColinK Possibly because he's German, and in written German you capitalize all nouns. –  QuantumDot Aug 25 '12 at 23:48

So, the first integral:

$\tfrac{1}{4\pi\epsilon _{0}} \int \frac{\varrho ( x )}{R}d^{3}x$

Is your basic potential from a charge distribution equation. It is the potential from all charges inside the volume.

And the second integral:

$\tfrac{1}{4\pi} \oint \left(\frac{1}{R}\frac{\partial }{\partial n}\varphi -\varphi \frac{\partial }{\partial n}\frac{1}{R} \right)$

Is going to depend on the boundary conditions. If you specify the potential on the surface (the $\varphi \frac{\partial }{\partial n}\frac{1}{R}$ term), then this is going to encode the potential from all the charges outside the volume.

If you specify the Electric Field on the surface: (the $\frac{1}{R}\frac{\partial }{\partial n}\varphi$), that also encodes the charges from outside the volume.

This equation doesn't say anything about what the potential is outside the volume. Only what it is inside.

-
The potential is not zero outside the volume. The source of this confusion is "if the observation point is out side the volume, $\phi$ is zero"


text:
## Asymptotics for 2D critical first-passage percolation

Series:
Stochastics Seminar
Thursday, September 10, 2015 - 15:05
1 hour (actually 50 minutes)
Location:
Skiles 006
,
School of Mathematics, Georgia Tech
Organizer:
We consider the first-passage percolation model defined on the square lattice Z^2 with nearest-neighbor edges. The model begins with i.i.d. nonnegative random variables indexed by the edges. Those random variables can be viewed as edge lengths or passage times. Denote by T_n the length (i.e. passage time) of the shortest path from the origin to the boundary of the box [-n,n] \times [-n,n]. We focus on the case when the distribution function of the edge weights satisfies F(0) = 1/2. This is sometimes known as the "critical case" because large clusters of zero-weight edges force T_n to grow at most logarithmically. We characterize the limit behavior of T_n under conditions on the distribution function F. The main tool involves a new relation between first-passage percolation and invasion percolation. This is joint work with Michael Damron and Wai-Kit Lam.


text:
Center for Nuclear Study, The University of Tokyo

2018-05-16
• ImPACT nuclear mutation project in which the OEDO is involved got the 21-century discovery award.


text:
# Chapter 5 - Linear Functions - 5-2 Direct Variation - Lesson Check - Page 302: 2

$y=10x$

#### Work Step by Step

Input $y=30$ and $x=3$ into the equation $y=kx$, yielding $30=k(3)$ Solve for $k$ by dividing each side by $3$, $k$ equals 10 Substitute $k$ into the equation $y=kx$, $y=10x$

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.


text:
# A block is kept on a smooth inclined plane of angle of inclinaton 30 degree that moves with a constant acceleration so that the block does not slide relative to the inclined plane .Let F1 be the contact force between the block and the plane .Now the inclined plane stops and let F2 be the contact force between the two in this case .Then F1/F2 IS (a) 1       (b)4/3    (c)2    (d)3/2

abinayaa
49 Points
3 years ago
in the first case,
F1 sin = 30=ma
and F1 cos=30=mg or f1 = mg/cos30

and in the second case,
f2 =mg cos 30

therefore,
F2 = mg cos 30
F1/F2 =1/cos^2 30 = 4/3


text:
nondegenerateBorels -- construct all nondegenerate strongly stable ideals of given length

Synopsis

• Usage:
nondegenerateBorels(d, S)
• Inputs:
• d, an integer, the length of the desired ideals in S$• S, a ring, a polynomial ring • Optional inputs: • Sort => , default value false, whether to sort the generators of each ideal in a slightly more natural way • Outputs: • a list, of all strongly stable ideals in$S$which are saturated, are (affine) dimension one, have degree$d\$, and have no linear forms in their ideal

Description

This is a simplified interface to the stronglyStableIdeals function.

For example, the following are all of the strongly stable ideals with degree 7, and their Betti tables.

 i1 : S = ZZ/101[a..d]; i2 : Bs = nondegenerateBorels(7, S); i3 : netList Bs +---------------------------------------+ | 2 2 5 | o3 = |ideal (b*c, a*c, b , a*b, a , c ) | +---------------------------------------+ | 2 2 2 4 | |ideal (a*c, b , a*b, a , b*c , c ) | +---------------------------------------+ | 2 3 2 2 3 | |ideal (a*c, a*b, a , c , b*c , b c, b )| +---------------------------------------+ | 2 2 3 2 2 | |ideal (b , a*b, a , c , b*c , a*c ) | +---------------------------------------+ i4 : netList pack(4, Bs/minimalBetti) +--------------+--------------+---------------+--------------+ | 0 1 2 3| 0 1 2 3| 0 1 2 3| 0 1 2 3| o4 = |total: 1 6 8 3|total: 1 6 8 3|total: 1 7 10 4|total: 1 6 8 3| | 0: 1 . . .| 0: 1 . . .| 0: 1 . . .| 0: 1 . . .| | 1: . 5 6 2| 1: . 4 4 1| 1: . 3 3 1| 1: . 3 2 .| | 2: . . . .| 2: . 1 2 1| 2: . 4 7 3| 2: . 3 6 3| | 3: . . . .| 3: . 1 2 1| | | | 4: . 1 2 1| | | | +--------------+--------------+---------------+--------------+

Using the Sort option as follows gives a somewhat more natural ordering. Sometimes computations involving the groebnerSratum ideal will be either much faster or slower with this option. But it is often worth trying it both ways, if your computations are slow.

 i5 : Bs2 = nondegenerateBorels(7, S, Sort => true); i6 : netList Bs2 +---------------------------------------+ | 2 2 5 | o6 = |ideal (a , a*b, b , a*c, b*c, c ) | +---------------------------------------+ | 2 2 2 4 | |ideal (a , a*b, b , a*c, b*c , c ) | +---------------------------------------+ | 2 3 2 2 3 | |ideal (a , a*b, a*c, b , b c, b*c , c )| +---------------------------------------+ | 2 2 2 2 3 | |ideal (a , a*b, b , a*c , b*c , c ) | +---------------------------------------+

This is a convenience function. Here is the simple code:

 i7 : code methods nondegenerateBorels o7 = -- code for method: nondegenerateBorels(ZZ,Ring) /usr/share/Macaulay2/QuaternaryQuartics.m2:116:47-122:5: --source code: nondegenerateBorels(ZZ, Ring) := List => opts -> (d, S) -> ( Bs := stronglyStableIdeals(d, S); Bs = select(Bs, i -> all(i_*, f -> degree f =!= {1})); if opts.Sort then Bs = Bs/(i -> ideal sort(gens i, MonomialOrder => Descending, DegreeOrder => Ascending)); Bs )


text:
# Math Help - strange limit equal to second derivative?

1. ## strange limit equal to second derivative?

I'm not exactly a beginner at this, but for some reason I've hit a wall on this simple result.

Suppose f:R-->R is twice continuously differentiable on an open set about a in the reals. Does it follow that

f ''(a) = limit (h-->0) (1/h^2)*(f(a+h)+f(a-h)-2f(a)) ?

What if we assume that f(t) is less than or equal to f(a) for t in a neighborhood of a?

I'm not sure how the proof I'm reading arrived at the above limit, but I'm suspicious of this: the second derivative is defined in terms of two iterated limits (say limit s->0 lim h->0 F(s,h)). In the above, we have only h. So it looks like we're taking the limit along the diagonal s=h (of something). But how is this justified? Thanks for any help.


text:
# Finding the average acceleration of a basketball player

Tags:
1. Dec 26, 2016

1. The problem statement, all variables and given/known data
A bascketball player , who has a weight of 890 N , jumps vertically with a height of 1.2 m ,

1- Find his speed when he left the floor.

2- If the time that takes the basketball player to quit the floor is 0.3 s, what is his average acceleration ?

(I don't understand this question at all, is there any function of time that I've to found or anything like this ?)

3-Find out the value of the force that the player applies to the ground .

2. Relevant equations
F = m.a ..(1) , Vf²-Vi² = 2 .a.d ..(2) , p =m.g ..(3)

3. The attempt at a solution

1- For the 1'st question it's quite easy just by using the formula (2) above , we get
$$V_{i} = \sqrt{2.g.d } = 4.84 m/s$$

2- for the second I think that it's :

$$a = \frac{\Delta V}{ \Delta t} = \frac{V_{i}}{0.3} = 16.16 m.s^{-2}$$

3- For this I didn't understand at all , by using the Newton 2'nd law I get : f = m.a ( where f is the magnitude of the applied force on the ground ) , but when the player applies that force he is at rest in the ground , not moving , which means a = 0 , thus f = 0 , isn'it ???

2. Dec 26, 2016

### CWatters

Think about how someone jumps. They bend their knees then straighten them. So most of the player isn't at rest.

3. Dec 26, 2016

I didn't understand , they bend their knees and straighten them , yes , and after that ? I mean how this could help us to find out f ????

4. Dec 26, 2016

### TomHart

Maybe it would help to think of it as similar to a mass attached to the top of a compressed spring sitting on the ground (except, in the case of the spring, the force and acceleration are not constant). When the spring is instantaneously released from its compressed state, the mass starts accelerating upward, even though the bottom of the spring remains in contact with the ground. Once the spring has released all of its energy, the spring lifts up off of the ground - like the basketball players feet leave the ground. So apparently, you already calculated the acceleration, and you know the mass of the basketball player . . .

5. Dec 26, 2016

### CWatters

Your use of F=ma was correct.

6. Dec 26, 2016

### Staff: Mentor

During the 0.3s take-off phase he is accelerating his Centre of Mass by pushing his feet against the floor. The moment his toes lose contact with the floor he can no longer gain acceleration—there's nothing now to be pushed against.

https://www.physicsforums.com/attachments/110502.gif


text:
# 1.4 Reference Angles.

## Presentation on theme: "1.4 Reference Angles."— Presentation transcript:

1.4 Reference Angles

Definition: Reference Angle - A positive acute angle found between the terminal side of an angle in standard position and the x-axis.

Examples: Determine the reference angle of the following angles:  = 65 Let’s draw a picture: Let’s calculate the reference angle… Terminal side Reference Angle ’ = 65 Let’s see where the reference angle is…

Examples: Determine the reference angle of the following angles:  = 192 Let’s draw a picture: Let’s calculate the reference angle… Reference Angle ’ = 192- 180 ’ = 12 Terminal side Let’s see where the reference angle is…

Examples: Determine the reference angle of the following angles:  = 119 Let’s draw a picture: Let’s calculate the reference angle… Terminal side ’ = 180- 119 Reference Angle ’ = 61 Let’s see where the reference angle is…

Examples: Determine the reference angle of the following angles:  = 341 Let’s draw a picture: Let’s calculate the reference angle… Reference Angle ’ = 360- 341 Terminal side ’ = 19 Let’s see where the reference angle is…

Examples: Determine the reference angle of the following angles:  = /9 Let’s draw a picture: Let’s calculate the reference angle… Reference Angle Terminal side ’ = /9 Let’s see where the reference angle is…

Examples: Determine the reference angle of the following angles:  = 7/5 Let’s draw a picture: Let’s calculate the reference angle… Reference Angle ’ = 7/5 -  ’ = 2/5 Terminal side Let’s see where the reference angle is…

Examples: Determine the reference angle of the following angles: We need to first find a coterminal angle:  = -3/8 Let’s draw a picture: -3/8 + 2 -3/8 + 16/8 13/8 Let’s calculate the reference angle… Reference Angle Terminal side Let’s see where the reference angle is… ’ = 2 - 13/8 ’ = 3/8

1.4 Working with Reference Angles

Now that you have been exposed to the concept of reference angle, it is time to finish this section.
We can now determine trigonometric values of non-acute angles.

Example: Let (-3,4) be a point on the terminal side of  (in standard position). Determine the sine, cosine and tangent of . Step 1: Draw a picture of the situation. Step2: Draw the reference triangle (drop the altitude to the x-axis). Then determine the lengths of the sides of the reference triangle. Step 3: Use the non-unit circle definitions to determine the values of the trig. functions requested. Determine the radius of the circle passing through the point referenced. (-3,4)  5 4 3 sin = cos = tan = 4 5 -3 5 -4 3

Example: Let (-4,-6) be a point on the terminal side of  (in standard position). Determine the sine, cosine, tangent, cosecant, secant and cotangent of . Step 1: Draw a picture of the situation. Step2: Draw the reference triangle (drop the altitude to the x-axis). Then determine the lengths of the sides of the reference triangle. Step 3: Use the non-unit circle definitions to determine the values of the trig. functions requested. Determine the radius of the circle passing through the point referenced. 4 sin = cos = tan = csc = sec = cot = -3√13 13 -2√13 13 3 2 6 (-4,-6) 2√13 -√13 3 2 3 -√13 2

All Star Trig. Class (−,+) (+,+) (−,−) (+,−)


text:
# Projectile with air resistance

Grεετings! 🙂

I have some questions about a physics problem. I would appreciate some help with understanding this.

1. The problem statement, all variables and given/known data
The task is to plot some graphs for a projectile at different angles, first when neglecting air resistance and then including a formula for air resistance. The projectile initial speed is 10 m/s and you are supposed to plot the projectile movement from three different initial angles: 20 degrees, 40 degrees and 60 degrees.

2. Relevant equations
We are supposed to use a particular formula for air resistance so it has already been given in the task and it looks like this:
$$\vec{a} = \vec{F}/m = -k\cdot \vec{v} = -k\cdot(v_{x},v_{y})\ with \ k=1$$
3. The attempt at a solution
The plots are supposed to be made with MATLAB. I have already solved the task of plotting the projectile movements when neglecting air resistance, but I need some help when doing it with air resistance.

First of all I wonder if I understand the given formula correctly. I haven’t seen a formula for air resistance being written in this way before. When trying to figure it out I would first simplify it, and since k=1 we get simply that $$\vec{a} = -\vec{v}$$ and this would mean that the acceleration in any given point is equal in magnitude to the velocity at that point but opposite in direction. So in the beginning the acceleration would be -10 m/s^2 and in the end it would be +10 m/s^2. Is that a correct interpretation of the formula? I guess this is a possible model to use. But I don’t know how to implement it.

I tried doing it in two ways, but none of them worked as I intended.

First try:

Code:

% Note that variables x and y are vectors of the x and y location of the projectile p20 = polyfit(x,y,2); px = linspace(0,12,100); fp20 = polyval(p20,px); % plot(px,fp20,'k'); % this plot is equal to the one I've plotted when excluding air resistance. v20 = polyder(p20); fv20 = polyval(v20,px); fv20x = fv20 * cos(angle(1)); % angle(1) being equal to the number of radians corresponding to 20 degrees fv20y = fv20 * sin(angle(1)); a20x = -fv20x; a20y = -fv20y; x20 = vix .* t + (1/2) * a20x .* t.^2; % vix and viy being equal to 10*cos(angle(1)) and 10*sin(angle(1)) y20 = viy .* t + (1/2) * a20y .* t.^2; plot(x20,y20,'k');

Second try

Code:

t = linspace(0,2,N); dh = diff(y); dt = diff(t); v = [0 dh./dt]; vx = v * cos(angle(1)); vy = v * cos(angle(1)); a20x = -vx; a20y = -vy; x20 = vix .* t + (1/2) * a20x .* t.^2; y20 = viy .* t + (1/2) * a20y .* t.^2; plot(x20,y20,'k');

But it doesn’t work, although graphs are plotted, they don’t look like they are supposed to. Can anyone see what I’m doing wrong?


text:
# xlog scale with pgfplots for random x-values

in the code below, two things should be modified:

1. xlabels and xgrid should appear for x=10^-0.1, x=10^0 and x=10^0.1 only
2. the grid along the x-axis should reflect the logarithmic scale (ie, not constant) with the major grid for the values listed above only

MWE:

\documentclass[12pt]{book}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=1.3,width=10cm}
\pgfkeys{/pgf/number format/.cd,set decimal separator={,}}
\begin{document}
\begin{tikzpicture}
\begin{semilogxaxis}[grid=both,enlarge x limits=false,scale only axis,width=8.5cm,height=6cm,ymin=1,ymax=1.5,tick style={draw=none}]
coordinates{(0.666667,1.21982)(1.49206,1.19949)};
\end{semilogxaxis}
\end{tikzpicture}
\end{document}
-


text:
# Custom theorem numbering

This one should be easy for the gurus…

Suppose I want to define a theorem environment which has a custom numbering scheme. That is, instead of being numbered according to some counter, it is numbered according to a passed parameter. So writing something like

\begin{customtheorem}{8}
Text.
\end{custom theorem}

would produce

Theorem 8. Text.

I realize I could define a new environment on my own, but then the header will be bold, or small caps, or whatever I defined it to be, and so may differ from the rest of the document if I switch documentclass. So I would like something that also matches the regular theorem headers.

Thanks in advance for any ideas.

An easy way is

\documentclass{article}
%\usepackage{amsthm} %% uncomment to see the difference
\newtheorem{innercustomthm}{Theorem}
\newenvironment{customthm}[1]
{\renewcommand\theinnercustomthm{#1}\innercustomthm}
{\endinnercustomthm}

\begin{document}

\begin{customthm}{8}\label{eight}
Every theorem must be numbered by hand.
\end{customthm}

Here is a reference to theorem~\ref{eight}.
\end{document}

You can also use the optional argument for attribution:

\begin{customthm}{99}[Somebody]\label{ninetynine}
Statement.
\end{customthm}

A more generic interface for defining several of these environments; this doesn't respect theorem styles; it could be adapted, though.

\documentclass{article}
\usepackage{amsthm}

\newtheorem{innercustomgeneric}{\customgenericname}
\providecommand{\customgenericname}{}
\newcommand{\newcustomtheorem}[2]{%
\newenvironment{#1}[1]
{%
\renewcommand\customgenericname{#2}%
\renewcommand\theinnercustomgeneric{##1}%
\innercustomgeneric
}
{\endinnercustomgeneric}
}

\newcustomtheorem{customthm}{Theorem}
\newcustomtheorem{customlemma}{Lemma}

\begin{document}

\begin{customthm}{8}\label{eight}
Every theorem must be numbered by hand.
\end{customthm}

Here is a reference to theorem~\ref{eight} and
one to the important lemma~\ref{life-universe-everything}

\begin{customlemma}{42}\label{life-universe-everything}
This lemma explains everything.
\end{customlemma}

\end{document}

• I guess that's simpler than mine (and allows non numeric values too) – David Carlisle May 1 '12 at 16:48
• @DavidCarlisle Yes, it uses the fact that innercustomthm is stepped, so the reference is established, but \theinnercustomthm is used, which can contain anything (well, almost). – egreg May 1 '12 at 16:50
• @egreg and is it possible to extend this to definition, lemma? – athos Jul 3 '14 at 6:59
• @athos \newtheorem{innercustomlemma}{Lemma} and \newenvironment{customlemma}[1]{\renewcommand\theinnercustomlemma{#1}\innercustomlemma}{\endinnercustomlemma} – egreg Jul 3 '14 at 8:00
• @PhoemueX I'm not sure why you'd like to do that. You can do \makeatletter\newcommand\manuallabel[1]{\def\@currentlabel{#1}}\makeatletter and use \begin{customthm}{8}\manuallabel{-5}\label{abc} – egreg Jan 17 '18 at 11:41

You can just temporarily reset your theorem counter:

\documentclass{article}
\usepackage{amsthm}

\newtheorem{Theorem}{Theorem}

\makeatletter

\newenvironment{customTheorem}[1]
{\count@\c@Theorem
\global\c@Theorem#1 %
\Theorem}
{\endTheorem
\global\c@Theorem\count@}

\makeatother

\begin{document}

\begin{Theorem}
Dummy text
\end{Theorem}

\begin{customTheorem}{99}
Dummy text
\end{customTheorem}

\begin{Theorem}
Dummy text
\end{Theorem}

\end{document}


text:
## $$H$$-$$p$$ clouds – an $$h$$-$$p$$ meshless method.(English)Zbl 0869.65069

The so-called meshless methods (unlike the finite element or the finite difference methods) can dramatically simplify the large scale simulation of physical phenomena. Among the first methods of these types have been the methods due to T. Liszka [Int. J. Numer. Methods Eng. 20, 1599-1612 (1984; Zbl 0544.65006)] or to T. Belytschko, Y. Y. Lu, L. Gu [ibid. 37, No. 2, 229-256 (1994; Zbl 0796.73077)], based on ideas of P. Lancaster, K. Salkauskas [Math. Comp. 37, 141-158 (1981; Zbl 0469.41005)].
The article presents a new family of meshless methods for the solution of boundary value problems. The method uses radial basis functions of varying size of supports. Namely, the definition of a class of functions, to be used as trial and test functions for Galerkin approximations, is based on a partition of unity, connected with a scattered set of nodes. The idea behind that definition is the hierarchical addition of appropriate elements to the partition functions, that the resulting set represents (through linear combinations) polynomials of certain higher degree.
- Numerical experiments with the new technique in one or two dimensions show very promising results: Evidently the recent paper is a part of a running discussion. One of its essential aims is to bring more stringency (and this means: more analysis) into that domain of numerical mathematics.

### MSC:

 65N30 Finite element, Rayleigh-Ritz and Galerkin methods for boundary value problems involving PDEs 35J20 Variational methods for second-order elliptic equations

### Citations:

Zbl 0544.65006; Zbl 0796.73077; Zbl 0469.41005
Full Text:

### References:

 [1] , and , Crack propagation by element free Galerkin methods, in Advanced Computational Methods for Material Modeling, p. 191, 1993, AMD-Vol. 180/PVP-Vol. 268, ASME 1993. [2] Liszka, Inter. J. Numer. Meth. Eng. 20 pp 1599– (1984) · Zbl 0544.65006 [3] and , Finite difference method for arbitrary irregular meshes in nonlinear problems of applied mechanics, in IV SMiRt, San Francisco, 1977. [4] Liszka, Comput. Struct. 11 pp 83– (1980) · Zbl 0427.73077 [5] Gingold, J. Comp. Phys. 46 pp 429– (1982) · Zbl 0487.76010 [6] Lucy, Astron. J. 82 pp 1013– (1977) [7] Monaghan, SIAM J. Sci. Stat. Comput. 3 pp 422– (1982) · Zbl 0498.76010 [8] Monaghan, Comp. Phys. Comm. 48 pp 89– (1988) · Zbl 0673.76089 [9] Nayroles, Comp. Mech. 10 pp 307– (1992) · Zbl 0764.65068 [10] Belytschko, Int. J. Num. Meth. Eng. 37 pp 229– (1994) · Zbl 0796.73077 [11] Amarantuga, Int. J. Num. Meth. Eng. 37 pp 2703– (1994) · Zbl 0813.65106 [12] , , and , Wavelet solutions of linear and nonlinear elliptic, parabolic and hyperbolic problems in one space dimension, in ”9th Int. Conf. on Numerical Methods in Applied Sciences and Engineering,” SIAM, Philadelphia, 1990. [13] Qian, J. Comp. Phys. 106 pp 155– (1993) · Zbl 0771.65072 [14] Kansa, Comput. Math. Appl. 19 pp 127– (1990) · Zbl 0692.76003 [15] Kansa, Comput. Math. Appl. 19 pp 147– (1990) · Zbl 0850.76048 [16] Liu, Inter. J. Num. Meth. Fluids [17] Kam Liu, Inter. J. Num. Meth. Eng. [18] Some remarks on free mesh method: A kind of meshless finite element method, in International Conference on Computational Engineering Science, Hawaii, August 1995. [19] Lancaster, Math. Comp. 37 pp 141– (1981) [20] and , Curve and Surface Fitting, an Introduction, Academic Press, San Diego, 1986. · Zbl 0649.65012 [21] A review of some meshless methods to solve partial differential equations, Technical Report 95-06, TICAM, The University of Texas at Austin, 1995. [22] , , , and , An analysis of the smoothed particle hydrodynamics, Technical Report SAND93-2513 UC-705, Sandia, 1994. [23] Lu, Comput. Meth. Appl. Mech. Eng. [24] Franke, Math. Comp. 38 pp 181– (1982) [25] Lu, Comput. Meth. Appl. Mech. Eng. 113 pp 397– (1994) · Zbl 0847.73064 [26] Personal communication, 1994. [27] and , Hp clouds-a meshless method to solve boundary-value problems Technical Report 95-05, TICAM, The University of Texas at Austin, 1995. [28] Sobolev Spaces. Academic Press, Boston, 1978. [29] A two-dimensional function for irregularly spaced data, in ACM Nat. Conf. p. 517, 1968. [30] and , Nodal integration of the element-free Galerkin method, pre-print, 1995. [31] The Finite Element Method for Elliptic Problems, North-Holland, Amsterdam, 1978. [32] and , Texas Finite Element Series Volume IV-Mathematical Aspects, Prentice-Hall, New Jersey, 1983. [33] Babuska, SIAM J. Num. Anal. 15 pp 736– (1978) · Zbl 0398.65069 [34] ”On Generalized Finite Element Methods,” Ph. D. thesis, The University of Maryland, 1995.
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
We’ve almost got a playable game, I promise! I think that jumping backwards and forwards is quite a confusing way to learn, hence why we’re building all the individual components separately and then joining them all together at the end. Anyway, in this section we’ll begin to think about how fighting will work in this game, and we’ll be creating a Creature class accordingly.

The battle system in this game will be very simple; every fight will involve two sides—the player and the enemies—who will take turns attacking each other. Unlike in some RPGs a turn will not consist of all the enemies attacking and then the player attacking, but rather every creature involved will attack at a separate time independent of their side. To determine the order in which each creature attacks, we will use an agility value; the higher their agility, the earlier they attack. Once all creatures have attacked once, the turn starts again.

When a creature attacks, they will not be guaranteed to hit and will instead have a chance to do damage that decreases as the defender’s evasion increases. If the attacker hits the defender the amount of damage done will be determined by what weapon the attacker has equipped, how much strength the attacker has, and what armor the defender has equipped. It will also be modified by a small random factor to add a little bit of excitement into the mix! The amount of damage the attacker does will be subtracted from the defender’s hit points, and when their hit points are reduced to zero the defender will die.

With that in mind, the Creature class should have hp, strength, agility, evasion, equippedWeapon, and equippedArmor member variables. To allow for healing and restoration of hit points we should also have a maxHp value, and of course each Creature should also have a name. Finally, no RPG is complete without experience points and loot drops, so we’ll also give each Creature an xp value and an inventory. It’ll also be important to know which Area the Creature is in, and we should add a function to allow Creatures to move from one Area to another.

Note that we’ve forward-declared each class that we’re only storing a pointer to, but we’ve had to #include "inventory.hpp" because we are storing an actual instance of Inventory instead of a pointer. The usual constructors and JSON-related functions are present, but we’ve got a few more functions as well to make dealing with the Creature a little easier, most notably the getAreaPtr function. So far we’ve almost exclusively stored pointers to entities instead of their ids, but here we’ve stored the id instead, and have added a function to convert it to a pointer when necessary. Honestly there isn’t much of a reason for this besides making things a little bit simpler later on, so feel free to change it back to the usual method.

Most of the functions here are just variations on ones we’ve seen before (though there’s a lot more data involved here), but traverse is more interesting. The traverse function requires a Door that the Creature is attempting to travel through. First it checks the locked property of the door. If the door is closed but unlocked or locked but the Creature has the key then it is opened. Once the door is opened the Creature is moved to the other Area linked to by the door. It makes sense to make traverse a member function of Creature and not Door because the Creature is the one doing the action (though it’s perfectly possible to do it the other way around).

Before moving on, don’t forget to load the creatures from a JSON file similarly to the other entities we’ve created, and also add the template specialisations and instantiations to entity_manager.cpp. Since the Creature class makes use of Weapons and Armor, load creatures.json after those.

### Creatures and Areas

We’ve said that we want a battle system, but how is the player going to encounter all those other Creatures in the first place? Since they’re entities that appear in the game world, it makes sense to add them to the Area class like everything else. This isn’t very hard to do so I’ll leave it mostly to you, but there is something you have to take into account that’s easy to miss.

Note that Creatures are the only entities that are both modifiable (Areas also are) and multi-instance (Items also are). Modifying an Area was fine because each Area was only ever used once, and using the same Item multiple times was fine because they were never modified. Creatures however will be reused many times (imagine having to create a separate JSON entry every time a Rat appeared) but will also take damage, and so will be modified. If we store pointers to their positions in the Entity Manager, every Rat will be identical and when one Rat takes damage, they all will! Obviously this would be disastrous, so instead of storing pointers to Creatures in the Area we should store actual Creatures. The Creature constructor can still use pointers though, because we can leave the duplication up to the Area class. Hence

To build the member creatures list, iterate over the argument creatures list and add use * to dereference the creature and add it to the list. Now for the JSON changes. These aren’t much harder, you just have to account for the presence of a "creatures" key, e.g. for load


text:
# Delete files and folder using bat file via schedule task

• ### General discussion

• Hi I have written this batch file running as schedule task to delete files and folder as listed below. Script runs and not deleting any of the files or folder.

@echo off
del /F /Q E:\Apple\*.*
del /F /Q E:\Pet\*.*
del /F /Q E:\Animal\*.*
del /F /Q E:\IT\*.*
del /F /Q E:\device\*.*
del /F /Q E:\equipment\*.*
exit

• Changed type Tuesday, November 7, 2017 10:20 PM
• Moved by Tuesday, November 7, 2017 10:20 PM This is not "search the Internet for me" forum
Wednesday, September 27, 2017 6:37 AM

### All replies

• Hi,

Use the below command instead and try

del /S /Q X:\Path\to\directory\*.*

Wednesday, September 27, 2017 7:00 AM
• Drive mappings are per-user, so if the user running the scheduled task does not have that drive mapping, of course the E: drive will not exist. If that's the case, specify the UNC path to the directory rather than a drive letter.

If E: is a local drive, then my only guess is that the user running the scheduled task does not have permission to remove files from those directories. (This could also be the case if you use a UNC path.)

-- Bill Stewart [Bill_Stewart]

Wednesday, September 27, 2017 2:01 PM
• It does make some space into drive when I run the schedule task manually and complete with no issue. When I look into the folders the subfolder and files still exist. How could I generate log file to see why it is not deleting the rest.

batch file after update-

@echo off
del /S /Q E:\Apple\*.*
del /S /Q E:\Pet\*.*
del /S /Q E:\Animal\*.*
del /S /Q E:\IT\*.*
del /S /Q E:\device\*.*
del /S /Q E:\equipment\*.*
exit