text:
#### Volume 15, issue 3 (2015)

The minimum $b_2$ problem for right-angled Artin groups
 1 S Baldridge, P Kirk, On symplectic $4$–manifolds with prescribed fundamental group, Comment. Math. Helv. 82 (2007) 845 MR2341842 2 S Baldridge, P Kirk, Constructions of small symplectic 4-manifolds using Luttinger surgery, J. Differential Geom. 82 (2009) 317 MR2520795 3 R Charney, M W Davis, Finite $K(\pi,1)$s for Artin groups, from: "Prospects in topology" (editor F Quinn), Ann. of Math. Stud. 138, Princeton Univ. Press (1995) 110 MR1368655 4 P Delsarte, J M Goethals, Alternating bilinear forms over $\mathrm{GF}(q)$, J. Combinatorial Theory Ser. A 19 (1975) 26 MR0401810 5 B Eckmann, $4$–manifolds, group invariants, and $l_2$–Betti numbers, Enseign. Math. 43 (1997) 271 MR1489886 6 J C Hausmann, S Weinberger, Caractéristiques d'Euler et groupes fondamentaux des variétés de dimension $4$, Comment. Math. Helv. 60 (1985) 139 MR787667 7 F E A Johnson, D Kotschick, On the signature and Euler characteristic of certain four-manifolds, Math. Proc. Cambridge Philos. Soc. 114 (1993) 431 MR1235990 8 P Kirk, C Livingston, The Hausmann–Weinberger $4$–manifold invariant of abelian groups, Proc. Amer. Math. Soc. 133 (2005) 1537 MR2111955 9 P Kirk, C Livingston, The geography problem for $4$–manifolds with specified fundamental group, Trans. Amer. Math. Soc. 361 (2009) 4091 MR2500880 10 D Kotschick, Four-manifold invariants of finitely presentable groups, from: "Topology, geometry and field theory", World Sci. Publ. (1994) 89 MR1312175 11 D Kotschick, Minimizing Euler characteristics of symplectic four-manifolds, Proc. Amer. Math. Soc. 134 (2006) 3081 MR2231635 12 W Lück, $L^2$–Betti numbers of mapping tori and groups, Topology 33 (1994) 203 MR1273782 13 J Milnor, A procedure for killing homotopy groups of differentiable manifolds, from: "Differential geometry", Proc. Sympos. Pure Math. 3, Amer. Math. Soc. (1961) 39 MR0130696


text:
; Beverages Mind Lab Pro is a comprehensive brain supplement which seeks to address every aspect of cognitive function for the long-term.  try to think of cheaper experiments I could run for benefits from iodine Recommendation #9 Improve attention/ focus/ concentration Meal Delivery Nootropics For Sale inhibiting inflammatory cytokines [R] This concludes the best nootropic supplements review for 2017 into 2018. 2012 Avocado Helps convert choline to acetylcholine. Improves communication between neurons, reduces physical & mental fatigue, cures brain fog & increases cerebral blood flow. work for us mail LEIGH WEINGUS 2016 at 3:59 am Determine exactly what your goals are for taking certain nootropics. Are you looking to be more productive at work without overloading on caffeine, or are you looking for something to help you wind down at night after a long day? It is considered unequivocally that vinpocetine is a very safe substance, even up to doses of 30mg per day (68). It is also remarked that this substance has no serious adverse effects (69). # power = 1 Working memory (14-day of use) [R]. Its’ use of a proprietary blend was the main issue we had with this product in addition to some side effects that were reported by consumers. However, it is overall a very solid supplement with high quality ingredients and fairly high overall potency. It includes Alpha GPC, GABA, Vinpocetine, and Bacopa Monnieri, which all have been clinically proven.

# nootropics

Diet, Food & Fitness 05 Cycling SUVs Mind Lab Pro Review: 4. Vitamin D Both Dr. Funk and Dr. Jones take fish oil supplements daily and recommend them for overall health, not just cognitive function. The omega-3 fatty acids in fish oil have neuroprotective properties that can improve memory and learning abilities. “I take fish oil even though I eat fish itself multiple times a week,” says Dr. Jones, who is a pescetarian. “I think it’s probably just one of the best all around supplements.” In addition to its brain health benefits, fish oil can also improve cardiovascular health, reduce joint pain, and ease skin conditions. However, Dr. Jones suggests avoiding the cheapest fish oil options to ensure there are minimal contaminants, like mercury, present. Here are more vitamin mistakes you don't realize you're making. Not a member?  Flow State - Brain Support Supplement for Memory, Focus, Clarity and Flow State Newly formulated and making our #5 pick, Cerebral Success has the edge on many brain supplements. Why? The ingredient profile has the essential ingredients proven to boost performance and focus, yet missing a few key ingredients. If you are someone who has ADD or just someone who needs a boost in mental performance to focus on tasks much easier and want a healthy alternative to prescription medicine, this is the decent choice. 3.3. Nicotine Kratom admin - March 21, 2017 USED FOR: Memory, Focus, Learning, Cognitive Impairment, ADHD, Mood, Motivation, Productivity, Reasoning, Synaptic Plasticity, Anti-Aging, Brain Health, Stroke, Vertigo and Age-Related Memory Loss. Sara Solovitch, Washington Post, "Tweaking brains with ‘smart drugs’ to get ahead in Silicon Valley," 11 June 2017 2 star Unlike many nootropic products, DREAM is intended to be taken at night, when the brain is extremely active. Memory consolidation and the transfer of information and skills learned during the day into long term memory occur while we sleep and DREAM is intended to provide nutritional support to enhance these processes. DREAM is mildly sleep promoting, but is not a sleeping pill. DREAM will promote restorative sleep, but is non-habit forming. Need further assistance? Please call Member Services at 1-800-333-0663 GABA is the so called “chief inhibitory neurotransmitter” in the CNS (Central Nervous System) and it is basically calming the nervous system down by binding to specific receptors in the brain. What this does is simply calming down the neurons. However, there are questions as to the effectiveness of this supplement, as it is not able to pass the so called blood-brain-barrier, which means it does not actually enter the brain. Even so, there are several studies suggesting it may have beneficial effects for those seeking a relief of symptoms of for instance light anxiety or insomnia. Vitamins & Supplements # 14 NA NA Contact Us Nathan Robison says: 5) Selank Improves Memory Self Tracking Apps & Brain Training Programs Discover the Best Brain Supplements Available Today & Learn the 3 Biggest Mistakes Shoppers Make When Buying Nootropics 30mg: 11 - 13 April: 1 the larger size of the community enables economies of scale and increases the peak sophistication possible. In a small nootropics community, there is likely to be no one knowledgeable about statistics/experimentation/biochemistry/neuroscience/whatever-you-need-for-a-particular-discussion, and the available funds increase: consider /r/Nootropics’s testing program, which is doable only because it’s a large lucrative community to sell to so the sellers are willing to donate funds for independent lab tests/Certificates of Analysis (COAs) to be done. If there were 1000 readers rather than 23,295, how could this ever happen short of one of those 1000 readers being very altruistic? This would be a very time-consuming experiment. Any attempt to combine this with other experiments by ANOVA would probably push the end-date out by months, and one would start to be seriously concerned that changes caused by aging or environmental factors would contaminate the results. A 5-year experiment with 7-month intervals will probably eat up 5+ hours to prepare <12,000 pills (active & placebo); each switch and test of mental functioning will probably eat up another hour for 32 hours. (And what test maintains validity with no practice effects over 5 years? Dual n-back would be unusable because of improvements to WM over that period.) Add in an hour for analysis & writeup, that suggests >38 hours of work, and 38×7.25=275.538 \times 7.25 = 275.5. 12,000 pills is roughly $12.80 per thousand or$154; 120 potassium iodide pills is ~$9, so 365.25120×9×5=137\frac{365.25}{120} \times 9 \times 5 = 137. Improve blood flow to your brain. Posters and Games (1987 votes) 9.7Read Review Mind Lab Pro Review: 4.0 out of 5 starsFour Stars DoctorSunder's Brain Tune is designed to help you: Health & Fitness Treating chronic prostatitis Hair Care Tianeptine The Top 10 Brain Boosting Supplements # 95% confidence interval: The main subtypes of omega-3 fatty acids are EPA, DHA and ALA Give your mind the nutritional support it needs to thrive with the best of the brain supplements on Amazon. Order Vitacern Brain Focus Supplement now. Noopept self-experiment (second): 1 Memory Improvement Tips Caffeine+theanine (daily) Sign Up Liver Health & Detoxification This doesn’t fit the U-curve so well: while 60mg is substantially negative as one would extrapolate from 30mg being ~0, 48mg is actually better than 15mg. But we bought the estimates of 48mg/60mg at a steep price - we ignore the influence of magnesium which we know influences the data a great deal. And the higher doses were added towards the end, so may be influenced by the magnesium starting/stopping. Another fix for the missingness is to impute the missing data. In this case, we might argue that the placebo days of the magnesium experiment were identical to taking no magnesium at all and so we can classify each NA as a placebo day, and rerun the desired analysis: ALL RELATIONSHIPS 1. Introduction Calorie Counting The Total-Body Dumbbell Fix Read Our Complete Review >> Your Goal Geniux © 2018 reddremedies.com Nootropics are essentially supposed to be smart drugs. So what’s with the silly name? Improving concentration and attention span in young people. Taking relatively small doses of ginkgo on a regular basis has been shown to improve some thinking skills in young to middle aged individuals. Ginkgo has been shown to significantly improve memory recall and speed of mental processing in individuals who show no signs of memory loss. ^ Malykh AG, Sadaie MR (February 2010). "Piracetam and piracetam-like drugs: from basic science to novel clinical applications to CNS disorders". Drugs. 70 (3): 287–312. doi:10.2165/11319230-000000000-00000. PMID 20166767. Sodium butyrate also increased memory function in patients with age-related brain diseases [R]. You’ll be able to remember information better and you won’t feel jittery either. This is a great alternative to drinks like Red Bull or coffee, because instead this is a natural chemical reaction. Politics Pet Health Increase the function of muscarinic choline receptors [R]. If we have any reliable scientific information about supplements to preserve or improve memory and other mental skills, it has come from clinical trials involving people at risk of mental decline or who have already developed Alzheimer's disease. In these studies, people have been assigned at random to take either the supplement or an inactive placebo pill. Choosing the Best Grounding Shoes FREE OPTIMIND TRIAL * Alpha-Lipoic Acid April 12, 2018 250 mg And if increased brain energy, more productivity and enhanced learning and memory isn’t enough to convince you, how about improving focus and reducing levels of stress and anxiety? Polygala tenuifolia 20:1 Extract 100mg Capsules (Yuan Zhi)$19.99 Choose Options Professionals Need Junglee.com Boost energy, alertness & memory Good diet can avoid the supplements. Unfortunately you specifically ask for them and NOT what's really best. Varied good food, including herbs and spices. Full of things your supplements extract artificially. # as.logical(Magnesium.citrate)TRUE 27.058060337 19.655569654 1.37661 0.17024431 TIM FERRISS’ FAVORITE SUPPLEMENTS – THE GO-TO STACK TIM TAKES DAILY all natural focus supplement|best supplement for brain focus and memory all natural focus supplement|best supplement for brain power all natural focus supplement|best supplement for memory and concentration
Legal | Sitemap

format: plain


text:
# Prove that $Var(\hat {Y_i})=\sigma^2h_{ii}$

I just got a simple question.

In general linear model, we have $$\hat Y=HY$$ where $H=X(X^TX)^{-1}X^T$ and the residual $$E=Y-\hat Y.$$

Now I want to prove that $$Var(\hat {Y_i})=\sigma^2h_{ii}$$ where $h_{ii}$ is the $(i,i)$ entry in $H$. First I tried with $$Var(\hat {Y_i})=Cov(\hat{Y_i},\hat{Y_i})=Cov(Y_i-E_i,\hat{Y_i})=Cov(Y_i,\hat{Y_i})-Cov(E_i,\hat{Y_i}).$$

Now, $$Cov(Y_i,\hat{Y_i})=Cov(Y_i,\sum_{j=1}^nh_{ij}Y_j)=\sum_{j=1}^n h_{ij}Cov(Y_i,Y_j)=h_{ii}\sigma^2$$ under the model assumptions (independence of error components)

And I also proved that $$Cov(E_i,\hat{Y_i})=0.$$

Therefore I got the result.

However, when I try to directly prove from $$Var(\hat{Y_i})=Cov(\hat{Y_i},\hat{Y_i})=Cov(\sum_{j=1}^nh_{ij}Y_j,\sum_{k=1}^nh_{ik}Y_k)=\sum_{j=1}^n\sum_{k=1}^nh_{ij}h_{ik}Cov(Y_j,Y_k)={h_{ii}}^2\sigma^2$$ under the independence assumption, which is not the right answer.

I know my last step might be wrong, but 'm not sure about it. Could anyone help me?

Yes, you did make an error in the last step.

You are correct till,

$$Var(\hat{Y}_i) = \sum_{j=1}^{n} \sum_{k=1}^{n} h_{ij} h_{ik} Cov(Y_j, Y_k).$$

After this point note that $Cov(Y_j,Y_k) = 0$ when $j \ne y$. Thus, inside the first summation, I can replace the sum with $k = j$.

$$Var(\hat{Y}_i) = \sum_{j=1}^{n} h_{ij} h_{ij} Cov(Y_j, Y_j) = \sigma^2\sum_{j=1}^{n} h_{ij}^2 = \sigma^2h_{ii},$$

where the last equality is because $H$ is idempotent and symmetric ($HH = H$).

As an aside, you made the problem more complicated than it should have been, by switching to Covariance. If you stick with variance and use independence of the $Y$s.

$$Var(\hat{Y}_i) = Var\left( \sum_{j=1}^{n}h_{ij}Y_j \right) = \sum_{j=1}^{n} h_{ij}^2 Var(Y_j) = \sigma^2h_{ii}.$$


text:
Section15.3Exercises

1

What are the orders of all Sylow $p$-subgroups where $G$ has order 18, 24, 54, 72, and 80?

2

Find all the Sylow 3-subgroups of $S_4$ and show that they are all conjugate.

3

Show that every group of order 45 has a normal subgroup of order 9.

4

Let $H$ be a Sylow $p$-subgroup of $G\text{.}$ Prove that $H$ is the only Sylow $p$-subgroup of $G$ contained in $N(H)\text{.}$

5

Prove that no group of order 96 is simple.

6

Prove that no group of order 160 is simple.

7

If $H$ is a normal subgroup of a finite group $G$ and $|H| = p^k$ for some prime $p\text{,}$ show that $H$ is contained in every Sylow $p$-subgroup of $G\text{.}$

8

Let $G$ be a group of order $p^2 q^2\text{,}$ where $p$ and $q$ are distinct primes such that $q \nmid p^2 - 1$ and $p \nmid q^2 - 1\text{.}$ Prove that $G$ must be abelian. Find a pair of primes for which this is true.

9

Show that a group of order 33 has only one Sylow 3-subgroup.

10

Let $H$ be a subgroup of a group $G\text{.}$ Prove or disprove that the normalizer of $H$ is normal in $G\text{.}$

11

Let $G$ be a finite group divisible by a prime $p\text{.}$ Prove that if there is only one Sylow $p$-subgroup in $G\text{,}$ it must be a normal subgroup of $G\text{.}$

12

Let $G$ be a group of order $p^r\text{,}$ $p$ prime. Prove that $G$ contains a normal subgroup of order $p^{r-1}\text{.}$

13

Suppose that $G$ is a finite group of order $p^n k\text{,}$ where $k \lt p\text{.}$ Show that $G$ must contain a normal subgroup.

14

Let $H$ be a subgroup of a finite group $G\text{.}$ Prove that $g N(H) g^{-1} = N(gHg^{-1})$ for any $g \in G\text{.}$

15

Prove that a group of order 108 must have a normal subgroup.

16

Classify all the groups of order 175 up to isomorphism.

17

Show that every group of order $255$ is cyclic.

18

Let $G$ have order $p_1^{e_1} \cdots p_n^{e_n}$ and suppose that $G$ has $n$ Sylow $p$-subgroups $P_1, \ldots, P_n$ where $|P_i| = p_i^{e_i}\text{.}$ Prove that $G$ is isomorphic to $P_1 \times \cdots \times P_n\text{.}$

19

Let $P$ be a normal Sylow $p$-subgroup of $G\text{.}$ Prove that every inner automorphism of $G$ fixes $P\text{.}$

20

What is the smallest possible order of a group $G$ such that $G$ is nonabelian and $|G|$ is odd? Can you find such a group?

21The Frattini Lemma

If $H$ is a normal subgroup of a finite group $G$ and $P$ is a Sylow $p$-subgroup of $H\text{,}$ for each $g \in G$ show that there is an $h$ in $H$ such that $gPg^{-1} = hPh^{-1}\text{.}$ Also, show that if $N$ is the normalizer of $P\text{,}$ then $G= HN\text{.}$

22

Show that if the order of $G$ is $p^nq\text{,}$ where $p$ and $q$ are primes and $p>q\text{,}$ then $G$ contains a normal subgroup.

23

Prove that the number of distinct conjugates of a subgroup $H$ of a finite group $G$ is $[G : N(H) ]\text{.}$

24

Prove that a Sylow 2-subgroup of $S_5$ is isomorphic to $D_4\text{.}$

25Another Proof of the Sylow Theorems

1. Suppose $p$ is prime and $p$ does not divide $m\text{.}$ Show that

\begin{equation*} p \nmid \binom{p^k m}{p^k}. \end{equation*}
2. Let ${\mathcal S}$ denote the set of all $p^k$ element subsets of $G\text{.}$ Show that $p$ does not divide $|{\mathcal S}|\text{.}$

3. Define an action of $G$ on ${\mathcal S}$ by left multiplication, $aT = \{ at : t \in T \}$ for $a \in G$ and $T \in {\mathcal S}\text{.}$ Prove that this is a group action.

4. Prove $p \nmid | {\mathcal O}_T|$ for some $T \in {\mathcal S}\text{.}$

5. Let $\{ T_1, \ldots, T_u \}$ be an orbit such that $p \nmid u$ and $H = \{ g \in G : gT_1 = T_1 \}\text{.}$ Prove that $H$ is a subgroup of $G$ and show that $|G| = u |H|\text{.}$

6. Show that $p^k$ divides $|H|$ and $p^k \leq |H|\text{.}$

7. Show that $|H| = |{\mathcal O}_T| \leq p^k\text{;}$ conclude that therefore $p^k = |H|\text{.}$

26

Let $G$ be a group. Prove that $G' = \langle a b a^{-1} b^{-1} : a, b \in G \rangle$ is a normal subgroup of $G$ and $G/G'$ is abelian. Find an example to show that $\{ a b a^{-1} b^{-1} : a, b \in G \}$ is not necessarily a group.


text:
# Revision history [back]

### Send packet to switch and back to controller

I am trying to create a latency-monitoring system by sending sepcial ping-like packets from the controller.

TransmitPacketInput input = new TransmitPacketInputBuilder().setNode(nodeRef(node.getId()))
.setEgress(nodeConnectorRef(node.getId(), egress))
.build();

The thing is, because my PINGs are from the controller to the controller, I need to compute the latencies of links individually, and I also need to calculate the latency of a link from the controller to the switch. This mean my packet must do this:

Controller - Switch - Controller

I've tried a few things, but none have really worked. What I have learned is that if I "setEgress", then the packet will immediately be forwarded out of the port, regardless of the flow rules installed on the switch.

As a result, I have two options, but I don't know if I can do either:

1. I could send the packet with "egress" set to the controller port. (But which port is that?)
2. I could find a way to let the flow rules decide of the output port, and NOT "egress". So far every time I tried not setting egress, I have gotten errors on the "transmitPacket" call, with "input" being apparently null.

Are either of those possible?

### Send packet to switch and back to controller

I am trying to create a latency-monitoring system by sending sepcial special ping-like packets from the controller.

TransmitPacketInput input = new TransmitPacketInputBuilder().setNode(nodeRef(node.getId()))
.setEgress(nodeConnectorRef(node.getId(), egress))
.build();

The thing is, because my PINGs are from the controller to the controller, I need to compute the latencies of links individually, and I also need to calculate the latency of a link from the controller to the switch. This mean my packet must do this:

Controller - Switch - Controller

I've tried a few things, but none have really worked. What I have learned is that if I "setEgress", then the packet will immediately be forwarded out of the port, regardless of the flow rules installed on the switch.

As a result, I have two options, but I don't know if I can do either:

1. I could send the packet with "egress" set to the controller port. (But which port is that?)
2. I could find a way to let the flow rules decide of the output port, and NOT "egress". So far every time I tried not setting egress, I have gotten errors on the "transmitPacket" call, with "input" being apparently null.

Are either of those possible?

### Send packet to switch and back to controller

I am trying to create a latency-monitoring system by sending special ping-like packets from the controller.

TransmitPacketInput input = new TransmitPacketInputBuilder().setNode(nodeRef(node.getId()))
.setEgress(nodeConnectorRef(node.getId(), egress))
.build();
packetProcessingService.transmitPacket(input);

The thing is, because my PINGs are from the controller to the controller, I need to compute the latencies of links individually, and I also need to calculate the latency of a link from the controller to the switch. This mean my packet must do this:

Controller - Switch - Controller

I've tried a few things, but none have really worked. What I have learned is that if I "setEgress", then the packet will immediately be forwarded out of the port, regardless of the flow rules installed on the switch.

As a result, I have two options, but I don't know if I can do either:

1. I could send the packet with "egress" set to the controller port. (But which port is that?)
2. I could find a way to let the flow rules decide of the output port, and NOT "egress". So far every time I tried not setting egress, I have gotten errors on the "transmitPacket" call, with "input" being apparently null.

Are either of those possible?

### Send packet to switch and back to controller

I am trying to create a latency-monitoring system by sending special ping-like packets from the controller.

TransmitPacketInput input = new TransmitPacketInputBuilder().setNode(nodeRef(node.getId()))
.setEgress(nodeConnectorRef(node.getId(), egress))
.build();
packetProcessingService.transmitPacket(input);

The thing is, because my PINGs are from the controller to the controller, I need to compute the latencies of links individually, and I also need to calculate the latency of a link from the controller to the switch. This mean my packet must do this:

Controller - Switch - Controller

I've tried a few things, but none have really worked. What I have learned is that if I "setEgress", then the packet will immediately be forwarded out of the port, regardless of the flow rules installed on the switch.

As a result, I have two options, but I don't know if I can do either:

1. I could send the packet with "egress" set to the controller port. (But which port is that?)
2. I could find a way to let the flow rules decide of the output port, and NOT "egress". So far every time I tried not setting egress, I have gotten errors on the "transmitPacket" call, with "input" being apparently null.

Are either of those possible?

PS: Incidentally, I have no idea what "setIngress" does...


text:
# Generalizations of the Mean Value Theorem

One of my hobbies here is running, and I recently ran 3km on the track, which led me to the following thought:

Was there a mile (~1600m) which I ran at least as fast as my average pace?

This can be thought of as a generalization of the mean value theorem, which says that a differentiable curve $f:[a,b] \to \mathbb{R}$ has at least one point where the derivative is equal to the “average” slope.  However, this asks whether there exist some (connected) interval where the derivative is less than the average slope.

This statement can be seen to be false, and we might as well use the running example.  Suppose the 3km was run at an average pace of 5:00min/mile, and in the race, for (counter-)example, I rode a bike to the 1,599m mark (which is still considered cheating so far as the IAAF is concerned), and got there after 1:00.  I stay there for 5:01, then ride my bike to the finishline (taking another minute).  I’ve just completed a 7:01 3k (WR, by the way) but there was never a 5minute period where I covered a mile.  With faster and faster bikes (or cars!) my “moving” time could be reduced until it takes me 5:00+$\epsilon$ to run the 3km.  Of course, this is the best I can do without covering a mile in under 5minutes, since as soon as cover 3km in under 5 minutes, I must have (by continuity) covered a mile in under 5 minutes.

Now, since I hate to be a downer, there’s a positive result to share, which can be thought of as a generalization of the above discussion, but does not require any differentiability, or even continuity (unless there are philosophical objections to the discontinuous crossing of a mile).  I’ll state the theorem for the unit interval, then translate that to the running example:

Suppose  $f:[0,1] \to \mathbb{R}$ has average speed $M$ (i.e., $f(1)-f(0) = M$) and $n$ is fixed.  Then for any $p \in (0,1]$ with $p \leq 1/n$, there is an interval with length $p$ where the average speed is at least $M/n$.

To see why this is true, just split up the interval into $n$ equal subintervals, and observe that the “average speed” on at least one of them must be at least $M/n$, or else the total change would not be great enough.

Hence, in the running example, if I ran a 9:00 3k, then I must have covered at least one of the kilometers in 3minutes or less, even if I didn’t cover any mile in under 5minutes!


text:
# Matter density measured by an observer

I was thinking about energy-matter densities in General Relativity and I can't seem to find a reference that answers my question, so I was hoping someone could help me.

Imagine that I live in a space-time with the following geometry: $$ds^2=-c^2dt^2+A(r)dr^2+r^2(d\theta^2+\sin^2(\theta)d\varphi^2),$$ where $A(r)$ is some function of the coordinate $r$, and, in this space-time, I have a matter density, $\rho(r)$. I'm wondering: this matter density is measured by which observer? I mean, if, for example, $\rho(r)=\alpha e^{-r^2}$, this gaussian density would be measured by which observer? And if a person wanted to assembly an apparatus to have this matter density, what should it measure in it's referential?

-
The infinitesimal physical radial distance locally measured by an observer at $r=r_0$ is $dr_{physical}^2(r_0) = A(r_0)dr^2$. If $A(r) \rightarrow 1$ when $r\rightarrow +\infty$, this means that $dr$ is the infinitesimal radial distance as seen by an observer at infinity. –  Trimok Jun 30 at 17:08


text:
# The norm of a separable Banach space can be determined by countable continuous linear functionals?

Recently I'm reading Stochastic Equations in Infinite Dimensions, a result is used many times. It is

If $E$ is a separable Banach spaces, then there is a sequence $\{ \phi_n \}$ in its dual $E^{\star}$ such that $$\|x\|=\sup_n |\phi_n(x)|$$

my question is

(1) How to prove it? Or where can I find the proof of it?

(2) Is there any other spaces that have this property? Where can I find related results?

thanks a lot.

-

For (1): Pick a countable dense set $x_i\in E$, and for each $x_i$ in that set, pick (by Hahn–Banach) a functional $\phi_i$ of norm $1$ such that $\|x_i\|=\phi_i(x_i)$.
For (2): duals of separable Banach spaces also have that property. For example, $L^{\infty}(\mathbb R)$ is the dual of $L^1(\mathbb R)$ and its norm is therefore determined by countably many functionals.


text:
# Change number of bar chart categories

I found this beautiful example:

\begin{tikzpicture}
\begin{axis}[title  = Contributions per category at LaTeX-Community.org,
xbar,
y axis line style = { opacity = 0 },
axis x line       = none,
tickwidth         = 0pt,
enlarge y limits  = 0.2,
enlarge x limits  = 0.02,
symbolic y coords = {LaTeX, Tools, Distributions, Editors},
nodes near coords,
]
\addplot coordinates { (57727,LaTeX) (5672,Tools) (2193,Distributions) (11106,Editors) };
\addplot coordinates { (14320,LaTeX) (1615,Tools) (560,Distributions) (3075,Editors)  };
\legend{Topics, Posts}
\end{axis}
\end{tikzpicture}

It gives a nice bar chart:

But the example is incredibly misleading! See what happens when I try to remove the 'editors' category:

\begin{tikzpicture}
\begin{axis}[title  = Contributions per category at LaTeX-Community.org,
xbar,
y axis line style = { opacity = 0 },
axis x line       = none,
tickwidth         = 0pt,
enlarge y limits  = 0.2,
enlarge x limits  = 0.02,
symbolic y coords = {LaTeX, Tools, Distributions},
nodes near coords,
]
\addplot coordinates { (57727,LaTeX) (5672,Tools) (2193,Distributions) };
\addplot coordinates { (14320,LaTeX) (1615,Tools) (560,Distributions) };
\legend{Topics, Posts}
\end{axis}
\end{tikzpicture}

Clearly something is missing and/or going wrong. How do I properly add or remove categories from this bar chart? Why did it work in the example?

It appears that the example was missing a ytick = data argument, which ensures that there are exactly as many labels as categories.


text:
# Pythagorean Theorem by Inscribed Semicircle

### J. Molokach Submitted May 19, 2015

The theorem is ilustrated in figure below.

$a^2+b^2=c^2$

Inscribe a semicircle into the right triangle:

To do that we only need to find the radius $r$ of the semicircle. This is determined from the proportion (due to the similarity of two triangles), $\displaystyle\frac{r}{c-a}=\frac{a}{b},$ so that $\displaystyle r=\frac{a(c-a)}{b}.$

To prove the Pythagorean theorem apply the Intersecting Chords Theorem: $(c-a)^{2}=b(b-2r).$ From this identity too we may express $\displaystyle r=\frac{b^{2}-(a-c)^{2}}{2b}.$ Comparing the two expressions for $r$ gives $2a(c-a)=b^{2}-(a-c)^{2}$ which is easily simplified to $a^2+b^2=c^2.$


text:
# Downsampling a PointCloud using a VoxelGrid filter

In this tutorial we will learn how to downsample – that is, reduce the number of points – a point cloud dataset, using a voxelized grid approach.

The VoxelGrid class that we’re about to present creates a 3D voxel grid (think about a voxel grid as a set of tiny 3D boxes in space) over the input point cloud data. Then, in each voxel (i.e., 3D box), all the points present will be approximated (i.e., downsampled) with their centroid. This approach is a bit slower than approximating them with the center of the voxel, but it represents the underlying surface more accurately.

# The code

Then, create a file, let’s say, voxel_grid.cpp in your favorite editor, and place the following inside it:

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 #include #include #include #include int main (int argc, char** argv) { pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2 ()); pcl::PCLPointCloud2::Ptr cloud_filtered (new pcl::PCLPointCloud2 ()); // Fill in the cloud data pcl::PCDReader reader; // Replace the path below with the path where you saved your file reader.read ("table_scene_lms400.pcd", *cloud); // Remember to download the file first! std::cerr << "PointCloud before filtering: " << cloud->width * cloud->height << " data points (" << pcl::getFieldsList (*cloud) << ")."; // Create the filtering object pcl::VoxelGrid sor; sor.setInputCloud (cloud); sor.setLeafSize (0.01f, 0.01f, 0.01f); sor.filter (*cloud_filtered); std::cerr << "PointCloud after filtering: " << cloud_filtered->width * cloud_filtered->height << " data points (" << pcl::getFieldsList (*cloud_filtered) << ")."; pcl::PCDWriter writer; writer.write ("table_scene_lms400_downsampled.pcd", *cloud_filtered, Eigen::Vector4f::Zero (), Eigen::Quaternionf::Identity (), false); return (0); }

# The explanation

Now, let’s break down the code piece by piece.

The following lines of code will read the point cloud data from disk.

  // Fill in the cloud data
// Replace the path below with the path where you saved your file

Then, a pcl::VoxelGrid filter is created with a leaf size of 1cm, the input data is passed, and the output is computed and stored in cloud_filtered.

  pcl::VoxelGrid<pcl::PCLPointCloud2> sor;
sor.setInputCloud (cloud);
sor.setLeafSize (0.01f, 0.01f, 0.01f);
sor.filter (*cloud_filtered);

Finally, the data is written to disk for later inspection.

  pcl::PCDWriter writer;
writer.write ("table_scene_lms400_downsampled.pcd", *cloud_filtered,
Eigen::Vector4f::Zero (), Eigen::Quaternionf::Identity (), false);

# Compiling and running the program

  1 2 3 4 5 6 7 8 9 10 11 12 cmake_minimum_required(VERSION 2.8 FATAL_ERROR) project(voxel_grid) find_package(PCL 1.2 REQUIRED) include_directories(${PCL_INCLUDE_DIRS}) link_directories(${PCL_LIBRARY_DIRS}) add_definitions(${PCL_DEFINITIONS}) add_executable (voxel_grid voxel_grid.cpp) target_link_libraries (voxel_grid${PCL_LIBRARIES})
\$ ./voxel_grid

PointCloud before filtering: 460400 data points (x y z intensity distance sid).


text:
Seite drucken

# Workshop on Arithmetic and Geometry

Der Workshop findet vom 26. August bis zum 4. September in Cetraro, Italien statt. Organisiert wird er von Fabrizio Catanese (Universität Bayreuth) und Umberto Zannier (Scuola Normale Superiore).

Research funded by

## Programm

### Samstag, 27. August

• 10:45–11:30Michael StollBayreuthRational points on curves contained in the square of an elliptic curve of rank 1

Demyanenko has shown that the rational points on a curve C with n+1 independent morphisms to an elliptic curve E of Mordell-Weil rank n have explicitly bounded height. Recently, Checcoli, Veneziano and Viada have given a different proof of this result for n = 1. I will present an improved version of their result with an elementary proof and compare the two methods (and possibly discuss some generalizations).

• 18:00–18:45Bruno KlinglerJussieu, ParisHodge theory and atypical intersections

Given a variation of Hodge structures $V$ over a smooth quasi-projective base $S$, I will explain the notion of an atypical subvariety for $\left(S,V\right)$ and state a simple general conjecture about these atypical subvarieties. When $S$ is a Shimura variety and $V$ a standard variation of Hodge structure on $S$, one recovers the Zilber-Pink conjecture.

### Sonntag, 28. August

• 09:30–10:15Ingrid BauerBayreuthOn rigid compact complex surfaces and manifolds

A compact complex manifold $X$ is rigid if it has no nontrivial deformations. The only rigid complex curve is the projective line; for dimension 2 we prove: Theorem. Let $S$ be a compact complex surface, which is rigid, then:

1) $S$ is minimal of general type, or

2) $S$ is a Del Pezzo surface of degree $\ge 5$, or

3) $S$ is an Inoue surface.

We explain different concepts of rigidity, their relations and give new examples of rigid manifolds, and pose open questions concerning the relation with the property of being a K(\pi,1) space.

This is joint work with F. Catanese.

• 10:45–11:30Yongnam LeeKAIST DaejeonOn rational maps from a hypersurface section of a Fano 3-fold and its double cover

In this talk, we treat dominant rational maps from a very general element in hypersurface sections of a smooth Fano 3-fold and its double cover to smooth projective surfaces. The method of our study combines the classification of algebraic surfaces and smooth Fano 3-folds, Hodge theory, and the deformation theory. This is joint work with Gian Pietro Pirola.

• 18:00–18:45Michael LönneBayreuthOn the stable topology of Hurwitz spaces

We want to discuss the topology of Hurwitz spaces, in particular those which parametrize Galois covers of curves with fixed finite group $G$ and fixed branch datum. First we formulate the problem of homological stability in general and then give a review of results concerning particular aspects. These include the stability range for the first Betti number in case of particular groups and other results obtained in collaboration with F.Catanese and F.Perroni. Also the results of F. Tietz and work in progress will be presented. Time permitting some open problems will be discussed pertaining also to the monodromy group of the Hurwitz spaces over the coloured configuration spaces.

### Montag, 29. August

• 09:30–10:15Yujiro KawamataTokyoDerived McKay correspondence for GL(3, C).

I explain a theorem that the equivariant derived category for a finite subgroup of GL(3, C) has a semi-orthogonal decomposition into the derived category of some partial resolution called a maximal Q-factorial terminalization of the corresponding quotient singularity and a relative exceptional collection. This is a generalization of a result of Bridgeland, King and Reid.

• 10:45–11:30Sönke RollenskeMarburgGorenstein stable surfaces with ${K}_{X}^{2}=1$

The moduli space of stable surfaces is a modular compactification of the Giesecker moduli space of surfaces. I will report on a joint project with Marco Franciosi and Rita Pardini where we explored the world of Gorenstein stable surfaces with ${K}_{X}^{2}=1$ and describe some connections to classical questions.

• 18:00–18:45Matthew StoverTemple Univ. PhiladelphiaBrauer groups of character varieties

Let $G$ be a finitely generated group and $X=X\left(\mathrm{\Gamma },S{L}_{2}\left(C\right)\right)$ be the "$S{L}_{2}\left(C\right)$-character variety" of $G$. Given an irreducible curve of characters $C$ on $X$ with smooth projective model $\stackrel{^}{C}$, I will discuss when, in terms of the Alexander module of $G$, one obtains a canonical element of the Brauer group $Br\left(\stackrel{^}{C}\right)$. I will then discuss some applications, e.g., to the arithmetic invariants of hyperbolic 3-manifolds obtained from Dehn surgery on a fixed knot. This is joint work with Ted Chinburg and Alan Reid.

### Dienstag, 30. August

• 10:00–10:45Michael DettweilerBayreuthThe inverse Galois problem, convolution and Fourier transform

The inverse Galois problem is the conjecture that any finite group occurs as Galois group over the rational numbers. We show that arithmetic versions of convolution and Fourier transform can be used to realise many special linear groups and symplectic groups as Galois groups over the rationals.

• 18:00–18:45Gareth JonesManchesterPfaffian functions and elliptic functions

I will discuss work in progress with Harry Schmidt in which we give a pfaffian definition of Weierstrass elliptic functions, refining a result due to Macintyre. The complexity of our definition is bounded by an effective absolute constant. As an application we give an effective version of a result of Corvaja, Masser and Zannier on a sharpening of Manin-Mumford for non-split extensions of elliptic curves by the additive group. We also give a higher dimensional version of their result.

### Mittwoch, 31. August

• 10:00–10:45Alberto PerelliGenovaConverse theorems for L-functions

Converse theorems aim at detecting the nature of L-functions from their analytic properties. After a brief survey of the classical converse theorems of Hamburger, Hecke and Weil, I'll describe more recent work on converse theorems in the general framework of the Selberg class of L-functions.

• 18:00–18:45Fabio PerroniTriesteDihedral Galois covers of algebraic varieties and the simple cases

I will report on a joint work with Fabrizio Catanese in which we study the structure of dihedral Galois covers of algebraic varieties. Explicit constructions of such covers X --> Y in concrete cases rely on the knowledge of the group of divisorial sheaves on double covers of Y. Thus we provide a description of this group in terms of rank 2 vector bundles on Y. We also define two special explicit classes of dihedral covers, the simple and the almost simple dihedral covers. We determine their basic invariants and their natural deformations. We also give applications to fundamental groups of complements of divisors.

### Donnerstag, 01. September

• 10:00–10:45Benjamin CollasDFG - BayreuthArithmetic and motivic considerations for the moduli stack of curves

Considering group theoretic properties of the mapping class group, then geometric properties of the special loci of curves with given automorphisms, I will present how to describe the Galois action on the cyclic stack inertia of the moduli spaces of curves. By a third and last shift of point of view, I will explain how Morel-Voevodski's unstable motivic homotopy theory offers a suitable framework to extend such considerations at a motivic level.

• 18:00–18:45Pietro CorvajaUdineOn the Hilbert Property for algebraic varieties over number fields

In 1892, David Hilbert proved his famous irreducibility theorem. In modern language, it can be rephrased in the following way: given an algebraic curve $C$ defined over a number field $k$ and a morphism $f:C\to {\mathbb{A}}^{1}$ from $C$ to the line ${\mathbb{A}}^{1}$ admitting no rational section, the image $f\left(C\left(k\right)\right)$ cannot cover the set $k={\mathbb{A}}^{1}\left(k\right)$. In this talk we shall investigate higher dimensional extensions. While it is well-known that the affine line can be replaced by any rational variety, we shall provide examples of non-rational algebraic surfaces $X$ such that for every morphism $f:YoX$$Y$ being another (possibly reducible) surface, admitting no rational section, the image $f\left(Y\left(k\right)\right)$ cannot cover $X\left(k\right)$. This is a joint work with Umberto Zannier.

### Freitag, 02. September

• Informal talks and mathematical discussions

### Samstag, 03. September

• Informal talks and mathematical discussions

Verantwortlich für die Redaktion: Univ.Prof.Dr. Mihai Paun


text:
# Reaction Chemistry

1. Jan 10, 2005

Hello all

Let's say we are given:

$$CH_4 + 2O_2 \rightarrow CO_2 + 2H_2O$$

We want to find $$\Delta_H$$ for the entire reaction.

Would I just use the formula:

$$\sum _i \Delta_H_i - \sum _j \Delta_H_j$$? In other words just look up enthalpies in book and subtract enthalpy of reactants from enthalpy of products?

Thanks

2. Jan 10, 2005

### dextercioby

IIRC,that's how it goes.To find the reaction enthalpy,u need to know the creation enthalpies for each of the components from the reaction.Pay attention with the signs.

Daniel.


text:
## SPPM renderer (CPU-only)

Discussion related to the implementation of new features & algorithms to the Core Engine.

Moderators: jromang, tomb, zcott, coordinators

### Re: SPPM renderer (CPU-only)

Aah ok, I will refer the hash from now on Tx.
Chawl

Posts: 71
Joined: Fri May 14, 2010 7:52 pm
Location: Ankara, Turkey

### Re: SPPM renderer (CPU-only)

sppm

Bi-directional

Is it just me, or does it appear like there's a noticeable band of "lighter" ground across the top of the images? I noticed it near the beginning and hoped it would go away with time, but a day later and it's still there. The Bidir render of the same scene didn't have the same anomaly.

I'm using the default settings for SPPM/Bidir.
helloworld922

Posts: 57
Joined: Sat Jul 10, 2010 12:21 pm

### Re: SPPM renderer (CPU-only)

Nope, not you. There's definitely some lighter ground.
Pilchard123

Posts: 406
Joined: Sun Oct 30, 2011 8:05 am

### Re: SPPM renderer (CPU-only)

helloworld922 wrote:
sppm.png

bidir.png

Is it just me, or does it appear like there's a noticeable band of "lighter" ground across the top of the images? I noticed it near the beginning and hoped it would go away with time, but a day later and it's still there. The Bidir render of the same scene didn't have the same anomaly.

I'm using the default settings for SPPM/Bidir.

I noticed this issue few times ago, but it is something really weird and difficult to trace. It appears that there is less light in place far away from the camera, but I don't see where we can have forgot a weighting factor which depends on the camera distance (and moreover, which increase with distance).

By the way, this scene is interesting, because we can see where SPPM is powerfull (the floor under the glass character) and where there is issue (the dark band, the blurred caustics and all those nasty fireflies).

For the fireflies, I'm really looking for a simple test scene which can show them quickly, If someone has one ?
guibou

Posts: 269
Joined: Fri Dec 04, 2009 10:14 am

### Re: SPPM renderer (CPU-only)

Here are fresh binaries of random_parameter_filtering_test branch for Windows x64...

Edit: Deleted the junk attachment.
Last edited by Chawl on Tue Jan 24, 2012 8:25 am, edited 1 time in total.
Chawl

Posts: 71
Joined: Fri May 14, 2010 7:52 pm
Location: Ankara, Turkey

### Re: SPPM renderer (CPU-only)

Chawl wrote:Here are fresh binaries of random_parameter_filtering_test branch for Windows x64...

Oh, wait, I have just started, far from having something usable ... and it is totally unrelated with SPPM

Posts: 4795
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

### Re: SPPM renderer (CPU-only)

guibou wrote:For the fireflies, I'm really looking for a simple test scene which can show them quickly, If someone has one ?

Something like this?

Here's an archive of the blender scene and luxblend exported files (hopefully I got everything):

untitled.7z
helloworld922

Posts: 57
Joined: Sat Jul 10, 2010 12:21 pm

### Re: SPPM renderer (CPU-only)

I pushed a new accel structure which may use less memory than every other structure and build faster during the eyepass. The performances should be better than hashgrid and kdtree and a bit behind hybrid.

guibou

Posts: 269
Joined: Fri Dec 04, 2009 10:14 am

### Re: SPPM renderer (CPU-only)

I can't compile 3e2c1631ea47 on VS2008 SP1 with this error:
Code: Select all
1>Compiling...1>parallelhashgrid.cpp1>..\..\..\lux\renderers\sppm\parallelhashgrid.cpp(52) : error C2664: 'boost::interprocess::detail::atomic_cas32' : cannot convert parameter 1 from 'unsigned int *' to 'volatile boost::uint32_t *'1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast1>..\..\..\lux\renderers\sppm\parallelhashgrid.cpp(54) : warning C4146: unary minus operator applied to unsigned type, result still unsigned1>..\..\..\lux\renderers\sppm\parallelhashgrid.cpp(59) : error C2664: 'boost::interprocess::detail::atomic_cas32' : cannot convert parameter 1 from 'unsigned int *' to 'volatile boost::uint32_t *'1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast1>..\..\..\lux\renderers\sppm\parallelhashgrid.cpp(60) : warning C4146: unary minus operator applied to unsigned type, result still unsigned1>..\..\..\lux\renderers\sppm\parallelhashgrid.cpp(79) : warning C4146: unary minus operator applied to unsigned type, result still unsigned1>..\..\..\lux\renderers\sppm\parallelhashgrid.cpp(84) : warning C4146: unary minus operator applied to unsigned type, result still unsigned1>..\..\..\lux\renderers\sppm\parallelhashgrid.cpp(119) : warning C4146: unary minus operator applied to unsigned type, result still unsigned1>..\..\..\lux\renderers\sppm\parallelhashgrid.cpp(127) : warning C4146: unary minus operator applied to unsigned type, result still unsigned1>Build log was saved at "file://***masked***\windows\Projects\luxrender\BuildTemp\liblux\x64\Release\BuildLog.htm"1>liblux - 2 error(s), 6 warning(s)========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========

PS: Also windows repo has to be updated for solution to contain the new parallelhasgrid.cpp
Chawl

Posts: 71
Joined: Fri May 14, 2010 7:52 pm
Location: Ankara, Turkey

### Re: SPPM renderer (CPU-only)

guibou wrote:For the fireflies, I'm really looking for a simple test scene which can show them quickly, If someone has one ?

They usually show up on the first or second pass for me.
Attachments
studio.blend
Competition Coordinator.
Current Competition: Math is Beautiful / Abstract Wallpaper

Member of the first official jeanphi-fan club

binarycortex

Posts: 1501
Joined: Fri Feb 22, 2008 10:44 pm

PreviousNext


text:
Subscribe
Issue No.03 - May/June (2011 vol.8)
pp: 858-864
Minh N. Nguyen , BioInformatics Institute, Singapore
Jacek M. Zurada , BioInformatics Research Center, Singapore
Jagath C. Rajapakse , BioInformatics Research Center, Singapore
ABSTRACT
Although numerous computational techniques have been applied to predict protein secondary structure (PSS), only limited studies have dealt with discovery of logic rules underlying the prediction itself. Such rules offer interesting links between the prediction model and the underlying biology. In addition, they enhance interpretability of PSS prediction by providing a degree of transparency to the predicting model usually regarded as a black box. In this paper, we explore the generation and use of C4.5 decision trees to extract relevant rules from PSS predictions modeled with two-stage support vector machines (TS-SVM). The proposed rules were derived on the RS126 data set of 126 nonhomologous globular proteins and on the PSIPRED data set of 1,923 protein sequences. Our approach has produced sets of comprehensible, and often interpretable, rules underlying the PSS predictions. Moreover, many of the rules seem to be strongly supported by biological evidence. Further, our approach resulted in good prediction accuracy, few and usually compact rules, and rules that are generally of higher confidence levels than those generated by other rule extraction techniques.
INDEX TERMS
Protein structure, secondary structure prediction, support vector machines, multiclass SVM, C4.5 decision trees, rule extraction.
CITATION
Minh N. Nguyen, Jacek M. Zurada, Jagath C. Rajapakse, "Toward Better Understanding of Protein Secondary Structure: Extracting Prediction Rules", IEEE/ACM Transactions on Computational Biology and Bioinformatics, vol.8, no. 3, pp. 858-864, May/June 2011, doi:10.1109/TCBB.2010.16
REFERENCES
 [1] J. Garnier, J.F. Gibrat, and B. Robson, "GOR Method for Predicting Protein Secondary Structure from Amino Acid Sequence," Methods in Enzymology, vol. 266, pp. 541-553, 1996. [2] A.A. Salamov and V.V. Solovyev, "Prediction of Protein Secondary Structure by Combining Nearest-Neighbor Algorithms and Multiple Sequence Alignments," J. Molecular Biology, vol. 247, pp. 11-15, 1995. [3] S.C. Schmidler, J.S. Liu, and D.L. Brutlag, "Bayesian Segmentation of Protein Secondary Structure," J. Computational Biology, vol. 7, pp. 233-248, 2000. [4] B. Rost and C. Sander, "Prediction of Protein Secondary Structure at Better than 70 Percent Accuracy," J. Molecular Biology, vol. 232, pp. 584-599, 1993. [5] S.K. Riis and A. Krogh, "Improving Prediction of Protein Secondary Structure Using Structured Neural Networks and Multiple Sequence Alignment," J. Computational Biology, vol. 3, pp. 163-183, 1996. [6] P. Baldi, S. Brunak, P. Frasconi, G. Soda, and G. Pollastri, "Exploiting the Past and the Future in Protein Secondary Structure Prediction," Bioinformatics, vol. 5, pp. 937-946, 1999. [7] D.T. Jones, "Protein Secondary Structure Prediction Based on Position-Specific Scoring Matrices," J. Molecular Biology, vol. 292, pp. 195-202, 1999. [8] J.A. Cuff and G.J. Barton, "Evaluation and Improvement of Multiple Sequence Methods for Protein Secondary Structure Prediction," Proteins, vol. 4, pp. 508-519, 1999. [9] M. Ouali and R.D. King, "Cascaded Multiple Classifiers for Secondary Structure Prediction," Protein Science, vol. 9, pp. 1162-1176, 1999. [10] T.Z. Sen, H. Cheng, A. Kloczkowski, and R.L. Jernigan,"A Consensus Data Mining Secondary Structure Prediction by Combining GOR V and Fragment Database Mining," Protein Science, vol. 15, no. 11, pp. 2499-2506, 2006. [11] S.F. Altschul, T.L. Madden, A.A. Schäffer, J. Zhang, Z. Zhang, W. Miller, and D.J. Lipman, "Gapped BLAST and PSI-BLAST: A New Generation of Protein Database Search Programs," Nucleic Acids Research, vol. 25, no. 17, pp. 3389-3402, 1997. [12] J. Meiler and D. Baker, "Coupled Prediction of Protein Secondary and Tertiary Structure," Protein Science, vol. 100, no. 21, pp. 12105-12110, 2003. [13] H. Kim and H. Park, "Protein Secondary Structure Prediction Based on an Improved Support Vector Machines Approach," Protein Eng. vol. 16, pp. 553-560, 2003. [14] M.N. Nguyen and J.C. Rajapakse, "Prediction of Protein Secondary Structure with Two-Stage Multi-Class SVM Approach," Int'l J. Data Mining and Bioinformatics, vol. 1, no. 3, pp. 248-269, 2007. [15] M.N. Nguyen and J.C. Rajapakse, "Prediction of Protein Relative Solvent Accessibility with a Two-Stage SVM Approach," Proteins: Structure, Function, and Bioinformatics, vol. 59, pp. 30-37, 2005. [16] M.N. Nguyen and J.C. Rajapakse, "Two-Stage Support Vector Regression Approach for Predicting Accessible Surface Areas of Amino Acids," Proteins: Structure, Function, and Bioinformatics, vol. 63, pp. 542-550, 2006. [17] J. He, H. Hu, R. Harrison, P.C. Tai, and Y. Pan, "Rule Generation for Protein Secondary Structure Prediction with Support Vector Machines and Decision Tree," IEEE Trans. Nanobioscience, vol. 5, no. 1, pp. 46-53, Mar. 2006. [18] K. Crammer and Y. Singer, "On the Learnability and Design of Output Codes for Multiclass Problems," Machine Learning, vol. 47, pp. 201-233, 2002. [19] M.T. Mitchell,Machine Learning. McGraw-Hill, 1997. [20] J.R. Quinlan, C4.5: Programs for Machine Learning. Morgan Kaufmann, 1993. [21] C.W. Hsu and C.J. Lin, "A Comparison on Methods for Multi-Class Support Vector Machines," IEEE Trans. Neural Networks, vol. 13, pp. 415-425, 2002. [22] J.M. Ma, M.N. Nguyen, and J.C. Rajapakse, "Gene Classification Using Codon Usage and Support Vector Machines," IEEE/ACM Trans. Computational Biology and Bioinformatics, vol. 6, no. 1, pp. 134-143, Jan.-Mar. 2009. [23] I.H. Witten and E. Frank, Data Mining: Practical Machine Learning Tools and Techniques, second ed. Morgan Kaufmann, 2005. [24] S. Padmanabhan, and R.L. Baldwin, "Tests for Helix-Stabilizing Interactions between Various Nonpolar Side Chains in Alanine-Based Peptides," Protein Science, vol. 3, pp. 1992-1997, 1994. [25] P.C. Lyu, J.C. Sherman, A. Chen, and N.R. Kallenbach, "$\alpha$ -Helix Stabilization by Natural and Unnatural Amino Acids with Alkyl Side Chains," Proc. Nat'l Academy of Sciences USA, vol. 88, pp. 5317-5320, 1991. [26] J.S. Richardson and D.C. Richardson, "Amino Acid Preferences for Specific Locations at the Ends of $\alpha$ Helices," Science, vol. 240, no. 4859, pp. 1648-1652, 1988. [27] N. Colloc'h and F.E. Cohen, "$\beta$ -Breakers: An Aperiodic Secondary Structure," J. Molecular Biology, vol. 221, no. 2, pp. 603-613, 1991. [28] C.J. Crasto and J.A. Feng, "Sequence Codes for Extended Conformation: A Neighbor-Dependent Sequence Analysis of Loops in Proteins," Proteins: Structure, Function, and Genetics, vol. 42, no. 3, pp. 399-413, 2001. [29] L.T. Huang, M.M. Gromiha, and S.Y. Ho, "Sequence Analysis and Rule Development of Predicting Protein Stability Change Upon Mutation Using Decision Tree Model," J. Molecular Modeling, vol. 13, no. 8, pp. 879-890, 2007. [30] L.T. Huang, M.M. Gromiha, S.F. Hwang, and S.Y. Ho, "Knowledge Acquisition and Development of Accurate Rules for Predicting Protein Stability Changes," Computational Biology and Chemistry, vol. 30, no. 6, pp. 408-415, 2006. [31] J. He, H.J. Hu, B. Chen, P.C. Tai, R. Harrison, and Y. Pan, "Rule Extraction from SVM for Protein Structure Prediction," Studies in Computational Intelligence, vol. 80, pp. 227-252, 2008. [32] R.B. Cornell and S.G. Taneva, "Amphipathic Helices as Mediators of the Membrane Interaction of Amphitropic Proteins, and as Modulators of Bilayer Physical Properties," Current Protein and Peptide Science, vol. 7, pp. 539-552, 2006. [33] A.L. Eilers, A.N. Billin, J. Li, and D.E. Ayer, "A 13-Amino Acid Amphipathic Alpha-Helix Is Required for the Functional Interaction between the Transcriptional Repressor Mad1 and mSin3A," J. Biological Chemistry, vol. 274, pp. 32750-32756, 1999. [34] D. Eisenberg, R.M. Weiss, and T.C. Terwilliger, "The Helical Hydrophobic Moment: A Measure of the Amphiphilicity of a Helix," Nature, vol. 299, no. 5881, pp. 371-374, 1982.


text:
## Annals of Functional Analysis

### Uniform openness of multiplication in Orlicz spaces

#### Abstract

Let $\Phi$ and $\Psi$ be Young functions, and let $L^{\Phi}(\Omega)$ and $L^{\Psi}(\Omega)$ be corresponding Orlicz spaces on a measure space $(\Omega,\mu)$. Our aim in this paper is to prove that, under mild conditions on $\Phi$ and $\Psi$, the multiplication from $L^{\Phi}(\Omega)\times L^{\Psi}(\Omega)$ onto $L^{1}(\Omega)$ is uniformly open. This generalizes an interesting recent result due to M. Balcerzak, A. Majchrzycki, and F. Strobin in 2013.

#### Article information

Source
Ann. Funct. Anal., Volume 7, Number 4 (2016), 543-551.

Dates
Accepted: 14 March 2016
First available in Project Euclid: 31 August 2016

https://projecteuclid.org/euclid.afa/1472659940

Digital Object Identifier
doi:10.1215/20088752-3661305

Mathematical Reviews number (MathSciNet)
MR3543146

Zentralblatt MATH identifier
1354.46029

#### Citation

Akbarbaglu, Ibrahim; Maghsoudi, Saeid; Rahmani, Iraj. Uniform openness of multiplication in Orlicz spaces. Ann. Funct. Anal. 7 (2016), no. 4, 543--551. doi:10.1215/20088752-3661305. https://projecteuclid.org/euclid.afa/1472659940

#### References

• [1] I. Akbarbaglu and S. Maghsoudi, Large structures in certain subsets of Orlicz spaces, Linear Algebra Appl. 438 (2013), no. 11, 4363–4373.
• [2] C. D. Aliprantis and O. Burkinshaw, Locally Solid Riesz Spaces with Applications to Economics, 2nd ed., Math. Surveys Monogr. 105, Amer. Math. Soc., Providence, RI, 2003.
• [3] M. Balcerzak, A. Majchrzycki, and F. Strobin, Uniformly openness of multiplication in Banach spaces $L_{p}$, preprint. http://arxiv.org/abs/1309.3433.
• [4] M. Balcerzak, A. Majchrzycki, and A. Wachowicz, Openness of multiplication in some function spaces, Taiwanese J. Math. 17 (2013), no. 3, 1115–1126.
• [5] M. Balcerzak, F. Strobin, and A. Wachowicz, “Bilinear mappings: selected properties and problems” in Traditional and Present-Day Topics in Real Analysis, Univ. of Łódź Press, Łódź, 2013.
• [6] M. Balcerzak, A. Wachowicz, and W. Wilczyński, Multiplying balls in the space of continuous functions on $[0,1]$, Studia Math. 170 (2005), no. 2, 203–209.
• [7] A. Komisarski, A connection between multiplication in $C(X)$ and the dimension of $X$, Fund. Math. 189 (2006), no. 2, 149–154.
• [8] S. Kowalczyk, On operations in $C(X)$ determined by continuous functions, Acta Math. Hungar. 142 (2014), no. 1, 56–71.
• [9] M. A. Krasnosel’skii and Ya. B. Rutickii, Convex Functions and Orlicz Spaces, Noordhoff, Groningen, 1961.
• [10] R. Li, S. Zhong, and C. Swartz, An open mapping theorem without continuity and linearity, Topology Appl. 157 (2010), no. 13, 2086–2093.
• [11] J. Musielak, Orlicz Spaces and Modular Spaces, Lecture Notes in Math. 1034, Springer, Berlin, 1983.
• [12] M. M. Rao and Z. D. Ren, Theory of Orlicz Spaces, Pure Appl. Math. 146, Dekker, New York, 1991.
• [13] A. Wachowicz, Multiplying balls in $C^{(N)}[0,1]$, Real Anal. Exchange 34 (2009), no. 2, 445–450.
• [14] A. C. Zaanen, Riesz Spaces, II, North-Holland Math. Library 30, North-Holland, Amsterdam, 1983.


text:
Skybox tutorial part 1

Recently I've shown my skybox, which has a new shader and code to calculate the positions of the sun and moon. People quite liked the result, and as such I thought it was time to also write a tutorial on this. It will be split in a series of at least 2 parts, where this part focuses on the shader for the sky colours, as well as the sun, moon, and stars. In part 2 we'll do the calculations for the sun and moon position as function of date and geographical location.

This tutorial was made with Unity 2020.3.26f1 and the Universal Render Pipeline (URP), and the shader is written in HLSL. Note that the general concept can be applied to any shader environment.

Acknowledgements

For this part the main acknowledgement would be NASA's Scientific Visualization Studio, for their publicly available texture maps of the moon and stars.

Contents

1. Introduction
2. Basic setup
3. The sun and sky
4. The moon
5. The stars
6. Eclipses
7. Conclusion

1. Introduction

Before we start doing anything in Unity I'd first like to talk about the general approach of this skybox, as it is not a physically based model. Instead we'll be trying to approach the look of the sky using basic inputs, such as the sun's position.

In this shader we're going to colour the sky by sampling 3 different colour gradients depending on the position and strength of the sun. In addition we'll draw the sun, moon and stars, and also take solar and lunar eclipses into account. In order to this we need 4 main directions as input. The sun direction, the moon direction, the view direction from the camera and the zenith direction, defined as directly above the observer which corresponds to the y-direction in Unity.

In order to give you a better idea I've drawn these four directions below. This is a 2D slice of the world, where the vertical axis corresponds to the y-axis in Unity, and the horizontal axis corresponds to the x-z plane in Unity. The symbols correspond to the following: H = horizon plane, Z = zenith direction, S = sun direction, M = moon direction, and V = view direction. Note that all directions point from the centre outwards, this is a convention we'll be following, where we define our directions to point from the camera/origin towards the object in question, e.g. the sun direction points towards the sun not from the sun.

These direction are in turn used to calculate 4 angles, each between two of these directions.

• sunView: angle between the sun and view direction,
• sunZenith: angle between the sun and the Zenith (the y-axis),
• viewZenith: angle between the view direction and Zenith,
• sunMoon: angle between the sun and the moon.

The sunView angle can be used to change the colour directly around the sun, e.g. when the sun sets there should be an orange glow around the sun. The sunZenith can be used to measure how far the sun is above (or below) the horizon. The viewZenith similarly measures how far we're looking above (or below) the horizon. Finally, the sunMoon angle is useful to determine when a solar (or lunar) eclipse occurs.

2. Basic setup

Start by creating a new scene, it should only have a main camera and a directional light. Rename the directional light to Sun and create a new empty gameObject called Moon. These objects will be used to set the direction of the sun and moon respectively. Also add a plane or some other objects so that you have a reference of where the horizon is.

2.1 Skybox controller

Despite the fact that this tutorial is all about the skybox shader, we do still need a small script to pass the sun and moon direction to the shader. Create a new empty gameObject, call it SkyboxController, and also create a new C# script SkyboxController.cs and add it to the gameObject. The script is very simple and shown below in the code block.

using UnityEngine;

[ExecuteAlways]
public class SkyboxController : MonoBehaviour
{
[SerializeField] Transform _Sun = default;
[SerializeField] Transform _Moon = default;

void LateUpdate()
{
// Directions are defined to point towards the object

// Sun

// Moon
}
}

We have two serialized fields that will contain the transform of the sun and moon. In order to get the sun and moon's direction data to the shader we set two global shader variables by calling Shader.SetGlobalVector within the LateUpdate. With this function we pass the string ID of the vector (within the context of shaders), followed by the vector data we want to pass.

The ExecuteAlways attribute at the top is used so that the script also runs in editor mode, otherwise we would need to run the game to see the sun and moon directions change.

Don't forget to set the actual transform fields in the inspector.

Note that because we define our directions to point towards the object we need to pass the negative forward directions of our transforms.

In this tutorial we'll be writing an HLSL shader consisting of a single pass, with a small vertex stage and large fragment stage. Start by creating a new unlit shader Skybox.shader, and replace Unity's standard code by the code block below.

Shader "KelvinvanHoorn/Skybox"
{
Properties
{
}
{
Tags { "Queue"="Background" "RenderType"="Background" "PreviewType"="Skybox" }
Cull Off ZWrite Off

Pass
{
HLSLPROGRAM
#pragma vertex Vertex
#pragma fragment Fragment

struct Attributes
{
float4 posOS    : POSITION;
};

struct v2f
{
float4 posCS        : SV_POSITION;
float3 viewDirWS    : TEXCOORD0;
};

v2f Vertex(Attributes IN)
{
v2f OUT = (v2f)0;

VertexPositionInputs vertexInput = GetVertexPositionInputs(IN.posOS.xyz);

OUT.posCS = vertexInput.positionCS;
OUT.viewDirWS = vertexInput.positionWS;

return OUT;
}

float3 _SunDir, _MoonDir;

float4 Fragment (v2f IN) : SV_TARGET
{
float3 viewDir = normalize(IN.viewDirWS);

float3 col = saturate(float3(step(0.9,dot(_SunDir, viewDir)), step(0.9,dot(_MoonDir, viewDir)), 0));
return float4(col, 1);
}
ENDHLSL
}
}
}

This is the basic shader we'll build upon in the following sections. I'll briefly go over its contents, starting with the tags. Because this will be a skybox shader we set the Queue and RenderType tags to Background. The PreviewType tag is less important, but it sets the material preview to render a skybox preview, instead of the standard sphere preview.

The Cull and ZWrite tags are both set to Off. I'm not that sure if it really matters if Cull is set to Back or Off, but this is what Unity does in their skybox shaders so we'll do it too.

As far as library files go we'll only include Core.hlsl from Unity's URP shader library, all other functions will be written in this file.

The Attributes struct contains the input for the vertex stage, which is only the position in object-space. The v2f struct is the output of the vertex stage, as well as the input of the fragment stage, hence v2f (vertex to fragment). The v2f struct includes the position in clip-space and the view direction (one of our 4 main directions).

In the Vertex function we use the object-space position to calculate the clip-space position and world-space position, which for skybox shaders corresponds to the view direction in world-space. We won't be making any more changes to the Vertex function.

In between the Vertex and Fragment function we define the _SunDir and _MoonDir, which are the global shader variables that are set in SkyboxController.cs.

Finally, in the Fragment function we're outputting the stepped dot products between the sun and view direction, and the moon and view direction. Do note that we need to normalize the viewDirWS from the vertex stage, we don't normalize _SunDir or _MoonDir as they already should be normalized from the C# script.

In order to see something create a material from this shader, and set it as your skybox material. The skybox material can be set in the environment tab from the Lighting window, if it is not open you can find it in the top-bar under Window Rendering Lighting. The sky should now be black, with a bright red and green spot that correspond to the positions of the sun and moon (it is yellow when they overlap). You can test this by rotating the Sun and Moon gameObjects from the previous section.

3. The sun and sky

In this section we'll go over calculating our 4 main angles, using the main angles to both sample and adjust the colour gradients for the sky, and drawing the sun.

3.1 Main angles

As a quick reminder the 4 main angles are: the sunView, sunZentih, viewZentih and sunMoon angle.

While I've been talking about angles all this time we're actually only going to calculate the dot product between the different directions. Mathematically this corresponds to the cosine of the angle between the directions (if both vectors are normalized). For our use case this is fine, though you should note that the cosine of an angle isn't linear (it flattens near 0° and 180°).

We already have the sun, moon and view direction in our shader and the zenith direction is simply $$(0, 1, 0)$$, so we can calculate all 4 dot products. Add the following highlighted lines to our shader in the Fragment function.

float3 viewDir = normalize(IN.viewDirWS);

// Main angles
float sunViewDot = dot(_SunDir, viewDir);
float sunZenithDot = _SunDir.y;
float viewZenithDot = viewDir.y;
float sunMoonDot = dot(_SunDir, _MoonDir);

Note that we've simplified the calculation of sunZenithDot and viewZenithDot, the dot product between a vector and $$(0, 1, 0)$$ corresponds simply to the y-value of that vector.

The dot products range from -1 to 1, with -1 being parallel but opposed vectors, 0 perpendicular vectors and 1 parallel vectors. While this is a useful range for some calculations, for others it is better to remap it to a 0, 1 range. As such add the following 2 lines just below the previous calculations.

float sunViewDot01 = (sunViewDot + 1.0) * 0.5;
float sunZenithDot01 = (sunZenithDot + 1.0) * 0.5;

These calculations haven't changed the look of the skybox yet, but form the foundation for most subsequent calculations.

3.2 Colours of the sky

The colours of the sky will be determined by sampling 3 gradient textures, adjusting them depending on our main angles, and adding them together.

Add all 3 gradient textures by adding the highlighted lines from the code block below. We add them to the properties, where the NoScaleOffset attribute simply removes the scale and offset from showing up in the inspector. Next we declare them and their samplers just below the Vertex function, using the macros TEXTURE2D and SAMPLER.

Properties
{
}

...
v2f Vertex(Attributes IN){}

float3 _SunDir, _MoonDir;

For those curious, the TEXTURE2D and SAMPLER macros form an abstraction layer between the shader and the different rendering APIs, such as D3D11, Metal and Vulkan. You can find these macros through the Project window in the Core RP Library package under Shaderlibrary/API.

3.2.1 Main sky colour

Now let us sample the first gradient and output its colour. The sunZenith gradient is the simplest and represents the general sky colour depending on how high the sun is in the sky. This is represented within our shader by the float sunZenithDot01. Add the following lines to the Fragment function and change the output value of col as seen below.

// Sky colours

float3 skyColor = sunZenithColor;

float3 col = skyColor;

I've used the following small gradient texture as my sunZenith gradient, where if the sun is directly below us it is nearly black and transitions to a brighter blue as the sun rises. You can download it, by right-clicking and save image, and set it as your texture or create one that better suits your needs.

For the gradient texture import settings I've turned off generate mip maps, set the filter mode to clamp, and set compression quality to high.

3.2.2 Horizon haze

The next gradient is the viewZenith gradient, which represents the difference in colour near the horizon (usually a slight haze). First thing to note is that the sample coordinate for the texture is still sunZenithDot01, because the colour of the haze depends on the height of the sun. However, we need to mask the haze depending on viewZenithDot.

Add the following two lines and change skyColor to reflect our newly added haze. The viewZenithColor is once again a texture sample using sunZenithDot01 as uv coordinate. The vzMask does, as the name suggests, mask the viewZenithColor. The mask is 1 at or below the horizon, where viewZenithDot is 0, and tends to 0 above the horizon. The pow is there to control how quickly the haze vanishes with height, I've set it to a power of 4 but you can experiment with this.

float3 viewZenithColor = SAMPLE_TEXTURE2D(_ViewZenithGrad, sampler_ViewZenithGrad, float2(sunZenithDot01, 0.5)).rgb;
float vzMask = pow(saturate(1.0 - viewZenithDot), 4);

float3 skyColor = sunZenithColor + vzMask * viewZenithColor;

For the gradient texture I've used the following, where you should note that near the middle the texture becomes orange before transitioning towards a pale blue. This represents the colour of the horizon during a sunset or sunrise. You can once again download it and use it as your gradient.

Note: you might see some extensive banding in the colours of the sky. I won't go into the details of this, but you can greatly reduce it by selecting your camera gameObject and turning on Post Processing and Dithering.

3.2.3 Sun bloom

The final of the gradient textures is the sunView gradient, which represents the brighter colour you see surrounding the sun. Similarly to the previous texture we use sunZenithDot01 as the uv coordinate and use solarViewDot for masking.

Add the following lines and once again update skyColor to our new value. The mask consists of the sunViewDot clamped between 0 and 1 using the saturate function. The mask is 1 when looking at the sun and 0 when looking 90° or more away from the sun. The pow is used again to control the fall-off, I've again set it to 4.

float3 sunViewColor = SAMPLE_TEXTURE2D(_SunViewGrad, sampler_SunViewGrad, float2(sunZenithDot01, 0.5)).rgb;

float3 skyColor = sunZenithColor + vzMask * viewZenithColor + svMask * sunViewColor;

For the gradient texture I've used the following, where most of the action occurs at the centre during sunrise/sunset. You can once again either download this texture or create one that suits your needs.

3.3 The sun

While we can see the bloom around where the sun should be, we currently don't actually see the sun. Let's fix that by making a mask for where the sun should be drawn. Let's encapsulate the sun mask in its own function called GetSunMask. The mask is quite simple, we step sunViewDot depending on a set radius. Add the following lines before the Fragment function. Note that we use the square of the radius, for it grants us finer control over the size. We take 1 minus the radius square because we want to draw the sun where the dot product is near 1.

float GetSunMask(float sunViewDot, float sunRadius)
{
}

We'll control the sun's radius with a float property set between 0 and 1, and we'll set the colour to the main light's colour (_MainLightColor). Add the property, declare it below _SunDir, and add the additional lines to the Fragment function.

Properties
{
}

float3 _SunDir, _MoonDir;

float4 Fragment (v2f IN) : SV_TARGET
{
// The sun
float3 sunColor = _MainLightColor.rgb * sunMask;

float3 col = skyColor + sunColor;
return float4(col, 1);
}

In order to give the sun a more blurred and sun-like edge we're going to add some post-processing to the scene, a bloom effect. Add a new gameObject to the scene and call it something like PostProcessing. Add a Volume component and make a new profile by clicking New. Now add the Bloom override. Enable the threshold and intensity and set them to 0.9 and 0.5 respectively. Make sure that your camera has post-processing enabled and you should now see the effect of bloom around the sun.

You can now control the colour and intensity of the sun through the light options on the Sun gameObject. If you don't want it linked to that you can instead create some properties for the shader to control the colour and intensity. I've kept the default values, but you can of course tweak them to your hearts desire.

4. The Moon

The sun seems a bit lonely in the sky, so lets add the moon as well. The method for the moon will be quite different, as we need more information for texture sampling and lighting. In order to do this we'll do some basic ray-tracing of a sphere in the sky and use that for our moon.

The first step is just getting the ray-traced sphere information and creating a mask from it. I'll not go into the specifics of ray-tracing and instead use this function from Inigo Quilez (with small modifications). You can also check my other tutorial on line intersections to learn more about ray-tracing. Add the following lines before the Fragment function.

// From Inigo Quilez, https://www.iquilezles.org/www/articles/intersectors/intersectors.htm
float sphIntersect(float3 rayDir, float3 spherePos, float radius)
{
float3 oc = -spherePos;
float b = dot(oc, rayDir);
float h = b * b - c;
if(h < 0.0) return -1.0;
h = sqrt(h);
return -b - h;
}

The function has 3 arguments, the ray direction (the view direction), the sphere's position (the moon direction) and the radius (the moon radius). In return it outputs the distance from the ray origin (our camera) to the intersection with the sphere, and if there is no intersection it returns -1. We can then create a mask by checking if the intersection is greater than -1 or not.

Now for the implementation we need a new property, the moon's radius. Add the following property and declare it by adding/changing the highlighted lines.

Properties
{
}

float3 _SunDir, _MoonDir;
float _SunRadius, _MoonRadius;

To show the moon on the screen we need to call sphIntersect in the Fragment function, define the mask and add it to col.

// The moon
float moonIntersect = sphIntersect(viewDir, _MoonDir, _MoonRadius);
float moonMask = moonIntersect > -1 ? 1 : 0;

float3 col = skyColor + sunColor + moonColor;

Note that in the picture above the moon and sun have a similar size, while the moon radius is 0.07 and the sun radius is 0.05. Unfortunately their radius variables do not scale the same.

4.2 Moon lighting

For the lighting we're going to do some simple NdotL lighting, except that we first need to calculate a normal. Luckily, that isn't that difficult as we have a ray-traced sphere as moon. We can take the difference between the moon direction and the intersection point, and normalize it. This procedure is illustrated below, where the moon's size is greatly exaggerated.

Let's add this normal calculation in the Fragment function by taking the difference between _MoonDir and viewDir scaled by moonIntersect. Add the highlighted line to our moon code.

// The moon
float moonIntersect = sphIntersect(viewDir, _MoonDir, _MoonRadius);
float moonMask = moonIntersect > -1 ? 1 : 0;
float3 moonNormal = normalize(_MoonDir - viewDir * moonIntersect);

We now have the normal, but for our NdotL lighting we also need the light direction. The light direction would be the direction of the sun's rays away from the moon. It is away from the sun because we want our surface to be lit if the dot product between the normal and light direction is 1.

In mathematical terms it can be expressed as $$d_l = norm(d_m r_m - d_s r_s)$$. Here $$d_l$$ is the light direction, $$d_m$$ the moon direction, $$r_m$$ the moon's distance to us, $$d_s$$ the sun direction, $$r_s$$ the sun's distance to us, and $$norm()$$ a normalization function. This might look complicated, however, we can use the fact that the sun is much further away from us than the moon (about 400 times further). Using this fact we can roughly approximate the light direction by saying the sun's distance is so big that the moon's distance is neglectable, i.e. $$d_l = norm(d_m r_m - d_s r_s) ≈ norm(-d_s r_s) = -d_s$$.

We can now calculate our NdotL using the moonNormal and _SunDir. Add the highlighted line and adjust our moon variable to show the new lighting. Note that we use saturate to clamp the dot between 0 and 1, because there is no such thing as negative lighting.

float3 moonNormal = normalize(_MoonDir - viewDir * moonIntersect);
float moonNdotL = saturate(dot(moonNormal, -_SunDir));
float3 moonColor = moonMask * moonNdotL;

Let's also add an exposure property, so that we can control how bright the moon is. Add the following highlighted lines, and add the exposure to moonColor.

Properties
{
_MoonExposure ("Moon exposure", Range(-16, 16)) = 0
}

float _MoonExposure;

float4 Fragment (v2f IN) : SV_TARGET
{
float3 moonColor = moonMask * moonNdotL * exp2(_MoonExposure);
}

4.3 Moon texture

For a stylised look a textureless moon might suffice, but more often than not you do want some texture for it. You could create your own, but we're going to use the publicly available color map from NASA's Scientific Visualization Studio. You can download the picture below or download it directly, and in higher resolutions, from NASA's site here.

We'll be sampling this texture as a cube map, so be sure to set the Texture Shape to Cube in the import settings. A benefit of sampling it as a cube map is that we can reuse the normals we've calculated as a 3 component UV for the cube map texture, which we'll refer to as UVW.

Adding the property and declaration of a cube map is very similar to that of textures, only a slight change in macros. Add the following highlighted lines.

Properties
{
[NoScaleOffset] _MoonCubeMap ("Moon cube map", Cube) = "black" {}
}

TEXTURECUBE(_MoonCubeMap);      SAMPLER(sampler_MoonCubeMap);

Let's make a new function to read our color map, with as input the moon's normal. Add the following GetMoonTexture function above the Fragment function. Sampling the cube map texture is similar to a regular 2D texture, except that we pass a float3 as UVW.

float3 GetMoonTexture(float3 normal)
{
float3 uvw = normal;
return SAMPLE_TEXTURECUBE(_MoonCubeMap, sampler_MoonCubeMap, uvw).rgb;
}

Now to see the texture add or change the following lines in the Fragment function, and don't forget to set our texture on the material in the inspector.

float3 moonTexture = GetMoonTexture(moonNormal);
float3 moonColor = moonMask * moonNdotL * exp2(_MoonExposure) * moonTexture;

Okay, we have the moon texture, so this section is done right? Well... if you change the moon's direction you'll notice that the texture changes, which is not how the real moon behaves (we only see 1 side). The texture changes because our UVW is the normal in world-space, meaning that it changes with the moon's rotation in the sky. What we want as UVW is the normal in the moon's local space, moon-space. In order to get that we need a space transformation matrix. We'll construct it in our C# script, SkyboxController.cs, from section 2.1. The transformation matrix consists of the 3 basis vectors that make up the local space, which are the forward, right and up vectors. Add the highlighted line to the SkyboxController.cs script, where we set a global shader matrix called _MoonSpaceMatrix. Note that we again use the negative directions.

void LateUpdate()
{
// Directions are defined to point towards the object

// Sun

// Moon
Shader.SetGlobalMatrix("_MoonSpaceMatrix", new Matrix4x4(-_Moon.transform.forward, -_Moon.transform.up, -_Moon.transform.right, Vector4.zero).transpose);
}

Note that our transformation matrix only has 3 vectors, not 4. We can get away with this because we only need to rotate the moon normal, not translate it.

Now we can access this matrix by declaring it in our shader. We then need to multiply this matrix with the moon's normal in world-space to get the normal in moon-space. Add the following highlighted lines to implement this.

float _MoonExposure;
float4x4 _MoonSpaceMatrix;

float3 GetMoonTexture(float3 normal)
{
float3 uvw = mul(_MoonSpaceMatrix, float4(normal,0)).xyz;
return SAMPLE_TEXTURECUBE(_MoonCubeMap, sampler_MoonCubeMap, uvw).rgb;
}

Now the moon's texture should appear stationary when you change the moon's direction. There is one final alteration I'd like to make, because we're not seeing the correct part of the moon texture. In order to correct this I've constructed an additional 3x3 rotation matrix, the values of which I got through some trial and error. All it does is rotate the normal such that the correct part is shown to us, you can think of it as a texture offset. Add the highlighted lines to get our final moon texture.

float3 GetMoonTexture(float3 normal)
{
float3 uvw = mul(_MoonSpaceMatrix, float4(normal,0)).xyz;

float3x3 correctionMatrix = float3x3(0, -0.2588190451, -0.9659258263,
0.08715574275, 0.9622501869, -0.2578341605,
0.9961946981, -0.08418598283, 0.02255756611);
uvw = mul(correctionMatrix, uvw);

return SAMPLE_TEXTURECUBE(_MoonCubeMap, sampler_MoonCubeMap, uvw).rgb;
}

5. The stars

For the stars we're also going to sample a cube map, however this time we're using the view direction as UVW coordinates and we need more rotation matrices. One as a tilt, because the stars position depends on your latitude, and a spinning rotation, which rotates the stars around the tilted axis.

The texture we'll be using again comes from NASA's Scientific Visualization Studio, and can be found here. It is the star map at the top of the page, where I'm using the 8192x4096 x-exr version. Don't forget to set the Texture Shape to Cube in the import settings in Unity, and also set the Max Size appropriately (8192 in this case).

Let's start by simply displaying the star map, by using the view direction directly as UVW. Add the cube map to the properties, declare it, and sample it in the Fragment function.

Properties{
[NoScaleOffset] _StarCubeMap ("Star cube map", Cube) = "black" {}
}

TEXTURECUBE(_MoonCubeMap);      SAMPLER(sampler_MoonCubeMap);
TEXTURECUBE(_StarCubeMap);      SAMPLER(sampler_StarCubeMap);

float4 Fragment (v2f IN) : SV_TARGET
{
// The stars
float3 starUVW = viewDir;
float3 starColor = SAMPLE_TEXTURECUBE(_StarCubeMap, sampler_StarCubeMap, starUVW).rgb;

float3 col = skyColor + sunColor + moonColor + starColor;
return float4(col, 1);
}

That was easy, but looking at the result you might see a few problems, one of them being that the stars are drawn on top of the moon (and also sun). To fix this we multiply the starColor by 1 minus the moon and sun masks.

float3 starColor = SAMPLE_TEXTURECUBE(_StarCubeMap, sampler_StarCubeMap, starUVW).rgb;
starColor *= (1 - sunMask) * (1 - moonMask);

Another thing is that the stars look rather blurry, even though we're using an 8K texture. In order to make the stars sharper we'll be biasing the mip-level. This would make the texture values flicker more with camera movement, which normally would be bad but actually is appropriate for stars. Change the cube map sampling macro to SAMPLE_TEXTURECUBE_BIAS and set the mip-mapping bias to -1 (read the texture one mip-level lower than normal).

float3 starColor = SAMPLE_TEXTURECUBE_BIAS(_StarCubeMap, sampler_StarCubeMap, starUVW, -1).rgb;

Alternatively you could just disable mip-mapping altogether for the texture, however, in some cases you might need it. One example would be when using a second camera that renders at a lower resolution, without mip-mapping it would flicker too much and become distracting.

Let's also add an exposure and power value for the star map, so that we have more control over the absolute and relative brightness of the stars. Add 2 new properties, declare them, take starColor to the power and multiply it by the exposure. The power basically makes fainter stars even fainter, as we're multiplying values smaller than 1 with themselves. The abs is only there to prevent an error message from Unity, as it can't handle powers of negative numbers.

Properties
{
_StarExposure ("Star exposure", Range(-16, 16)) = 0
_StarPower ("Star power", Range(1,5)) = 1
}

float _MoonExposure, _StarExposure;
float _StarPower;

float4 Fragment (v2f IN) : SV_TARGET
{
float3 starColor = SAMPLE_TEXTURECUBE_BIAS(_StarCubeMap, sampler_StarCubeMap, starUVW, -1).rgb;
starColor = pow(abs(starColor), _StarPower);
}

We're almost there but there is still one problem, the stars are still bright and visible during the day. In order to fix this we'll add another factor to starColor, which depends on sunZenithDot and sunViewDot01. The idea is that the stars are too dim compared to the sun or the sky during the day. Add and change the following lines.

float starStrength = (1 - sunViewDot01) * (saturate(-sunZenithDot));
starColor *= (1 - sunMask) * (1 - moonMask) * exp2(_StarExposure) * starStrength;

5.1 Star rotations

As you might know the night sky differs depending on where you are in the world and what time it is. To implement this we'll first tilt the star map depending on a latitude that we provide and then rotate the map around that tilted axis depending on time.

In order to do these rotations we need a new function that can rotate a direction, given a rotation axis and rotation amount. I won't go over the mathetmatical details of this function, instead we'll be using this AngleAxis3x3 function from Keijiro Takahashi (which you can find here). Add this function above the Fragment function.

// Construct a rotation matrix that rotates around a particular axis by angle
// From: https://gist.github.com/keijiro/ee439d5e7388f3aafc5296005c8c3f33
float3x3 AngleAxis3x3(float angle, float3 axis)
{
float c, s;
sincos(angle, s, c);

float t = 1 - c;
float x = axis.x;
float y = axis.y;
float z = axis.z;

return float3x3(
t * x * x + c, t * x * y - s * z, t * x * z + s * y,
t * x * y + s * z, t * y * y + c, t * y * z - s * x,
t * x * z - s * y, t * y * z + s * x, t * z * z + c
);
}

Let's encapsulate the rotations we're going to do in a new function called GetStarUVW. This function will take the view direction, a latitude and local sidereal time as input. We tilt the star map with respect to the world x-axis and spin it around the y-axis. The rest of this function is simply converting the latitude and time to radians and multiplying the rotation matrices in the correct order.

// Rotate the view direction, tilt with latitude, spin with time
float3 GetStarUVW(float3 viewDir, float latitude, float localSiderealTime)
{
// tilt = 0 at the north pole, where latitude = 90 degrees
float tilt = PI * (latitude - 90) / 180;
float3x3 tiltRotation = AngleAxis3x3(tilt, float3(1,0,0));

// 0.75 is a texture offset for lST = 0 equals noon
float spin = (0.75-localSiderealTime) * 2 * PI;
float3x3 spinRotation = AngleAxis3x3(spin, float3(0, 1, 0));

// The order of rotation is important
float3x3 fullRotation = mul(spinRotation, tiltRotation);

return mul(fullRotation,  viewDir);
}

You might be wondering, what is local sidereal time? Sidereal time is the time of day as measured from distant stars instead of the sun, i.e. 1 sidereal day is 1 full rotation of the stars. This value will be between 0 and 1, where 0 refers to the time when the sun is the highest in the sky (noon). The local part refers to that were using the local time zone, instead of greenwich time. You can read more about sidereal time on the wiki page.

Another interesting thing to note is that we subtract time, this is because the time represents the rotation of the earth, but in our scene the earth is stationary and thus the stars should rotate in the opposite direction.

Now we just need to set starUVW to this instead of viewDir. However, we do need some input for the latitude and time. So let's add two new properties, the latitude in degrees between -90° (south pole) and 90° (north pole) and the speed with which the stars rotate (given in days per second). For the time itself we can use Unity's built-in variable _Time.y. Add or change the highlighted lines.

Properties
{
_StarLatitude ("Star latitude", Range(-90, 90)) = 0
_StarSpeed ("Star speed", Float) = 0.001
}

float _StarPower;
float _StarLatitude, _StarSpeed;

float4 Fragment (v2f IN) : SV_TARGET
{
// The stars
float3 starUVW = GetStarUVW(viewDir, _StarLatitude, _Time.y * _StarSpeed % 1);
}

Animation of the stars at a highly exaggerated speed, you can see Polaris (the North Star) at the top. Latitude is 52° (The Netherlands), speed = 0.01.

5.2 Constellations

The star map is technically finished, however, when looking for a star map I found that NASA also has a constellation map and it might be fun to add it to our sky. It is also really easy to add with what we already have. Download the constellation map from the picture below or from NASA directly, it is the "Constellation figures in celestial coordinates." at 4096x2048 resolution. Don't forget to set the import setting's Texture Shape to Cube.

Now add the map as property, as well as a colour for the constellation lines. We can reuse the starUVW as UVW, so sample the texture and multiply it by the _ConstellationColor. Again we need to mask the sun and moon, as well as multiply it by the starStrength. Finally, add the result to the final col. Add or change the highlighted lines.

Properties
{
[NoScaleOffset] _ConstellationCubeMap ("Constellation cube map", Cube) = "blank" {}
_ConstellationColor ("Constellation color", Color) = (0,0.3,0.6,1)
}

TEXTURECUBE(_StarCubeMap);      SAMPLER(sampler_StarCubeMap);
TEXTURECUBE(_ConstellationCubeMap); SAMPLER(sampler_ConstellationCubeMap);

float _StarLatitude, _StarSpeed;
float3 _ConstellationColor;

float4 Fragment (v2f IN) : SV_TARGET
{
// The constellations
float3 constColor = SAMPLE_TEXTURECUBE(_ConstellationCubeMap, sampler_ConstellationCubeMap, starUVW).rgb * _ConstellationColor;

float3 col = skyColor + sunColor + moonColor + starColor + constColor;
}

6. Eclipses

We're getting close to the end of this tutorial as there are only 2 phenomena left that we'll implement, the solar and lunar eclipse. A solar eclipse occurs when the moon is in front of the sun, and a lunar eclipse occurs when the earth casts it shadow onto the moon, i.e. the the sun is at the opposite direction of the moon. Of these 2 the solar eclipse is easier to implement so let's start with that.

6.1 Solar eclipse

Currently the sun and moon are both drawn, even if they're on top of each other. To fix this we simply use the inverse (one minus) of the moon's mask to mask out the sun if the moon is in front. Add the following lines to the Fragment function below the constellation code.

// Solar eclipse
sunColor *= (1 - moonMask);

I've never seen a total solar eclipse in person and finding reliable images of the sky during one is quite hard, but it seems that the sky becomes darker and the area around the sun seems brighter as a result. In order to implement this we'll use sunMoonDot to determine how much of the sun is eclipsed. As a function of this we'll lower the value of skyColor and increase the value of sunColor (so that the bloom has a greater effect).

// Solar eclipse
skyColor *= lerp(1, 0.4, solarEclipse01);
sunColor *= (1 - moonMask) * lerp(1, 16, solarEclipse01);

Notice that we use a similar calculation to the sun's mask, except we use a smoothstep so that solarEclipse01 is 0 up until the centre of the moon overlaps the edge of the sun and becomes 1 when the moon and sun centres align.

This is only one way of changing the sky during a solar eclipse, you could of course expand on this using more colours or colour gradients and sample those as function of solarEclipse01. Though if you do, be aware that solar eclipses can also occur at night, when you can't see the sun.

6.2 Lunar eclipse

The lunar eclipse will work similar to the solar eclipse, we'll mask out the moon and calculate a lunarEclipse01 variable. This time the variable will be used only to change the moon, not the sky.

Unfortunately we can't reuse sunMask or moonMask and instead have to calculate a new mask. This mask is very similar to sunMask, but we take the step function of negative sunViewDot, which means it is 1 when the sun is opposite of the view direction. Add the following lines to make the mask and mask out the moonColor. Add the following lines to the Fragment function below the solar eclipse code.

// Lunar eclipse
moonColor *= lunarEclipseMask;

The mask needs to be one minus the step because we want the moon to be visible unless it is in the mask. Technically speaking we should be defining an earth radius and use that for the mask, because the mask should represent the earth's shadow. However, for our purposes it works fine to use the sun's radius instead.

If you've seen a lunar eclipses you'll know that it turns slightly red once it gets fully eclipsed. Let's implement that as well. In order to do this we need to know when the moon is nearly fully eclipsed. We do this by using a smoothstep function, similarly to calculating solarEclipse01. However, this time we want it to be 0 up until the sun and moon are almost oppositely aligned. To do this we multiply the masking radius (the _SunRadius) by a small number (0.05). Finally we lerp between the mask and a dark orangish red colour and multiply the moonColor with that. Add or change the highlighted lines.

// Lunar eclipse
moonColor *= lerp(lunarEclipseMask, float3(0.3,0.05,0), lunarEclipse01);


text:
# Minimum total area

• February 21st 2009, 01:52 PM
jbray
Minimum total area
A garden is being designed to have a planted area of 12m^2. Around the edge there will be a path, 1m wide on two opposite sides and 1.5m wide on the other two opposite sides. Find the dimentions of the garden so that minimum total area of the garden and path is used.

• February 21st 2009, 04:30 PM
TheEmptySet
Quote:

Originally Posted by jbray
A garden is being designed to have a planted area of 12m^2. Around the edge there will be a path, 1m wide on two opposite sides and 1.5m wide on the other two opposite sides. Find the dimentions of the garden so that minimum total area of the garden and path is used.

Draw a diagram (not included) it always helps with word problems.

let l be the length and w be the width.

we know that $12=lw \iff w=\frac{12}{l}$ be we also know that that area we are trying to minimize is A=(l+2)(w+3) (if you don't see why draw the diagram)

Now subbing the first into the 2nd we get

$A=(l+2)\left(\frac{12}{l}+3\right)=12+3l+\frac{24} {l}+6=18+3l+\frac{24}{l}$

Just take the derivative from here.

Good luck