text:
alteryx Community

# Alteryx Designer Discussions

SOLVED

## Jupyter Flow tool NoSuchKernel error

Alteryx

Originally posted by @jrgo here :

Trying to learn this tool, but get stuck on step V9 (first run) finishing with an error directing me review the log file (below).

C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\papermill\iorw.py:50: FutureWarning: pyarrow.HadoopFileSystem is deprecated as of 2.0.0, please use pyarrow.fs.HadoopFileSystem instead.
Input Notebook:  C:\Users\<redact>\my_env\first_notebook_post_processed.ipynb
Output Notebook: C:\Users\<redact>\my_env\first_notebook_post_processed.ipynb
Executing:   0%|          | 0/3 [00:00<?, ?cell/s]Kernel 'Python 3 (ipykernel)' is referencing a kernel provisioner ('local-provisioner') that is not available.  Ensure the appropriate package has been installed and retry.
Executing:   0%|          | 0/3 [00:00<?, ?cell/s]
Traceback (most recent call last):
File "C:\ProgramData\Alteryx\Tools\JupyterFlow_venv\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\ProgramData\Alteryx\Tools\JupyterFlow_venv\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\<redact>\.jupyter_flow\b01b3cec3977e9e-cv-0-1.pyz\__main__.py", line 3, in <module>
File "C:\Users\<redact>\.jupyter_flow\b01b3cec3977e9e-cv-0-1.pyz\_bootstrap\__init__.py", line 233, in bootstrap
File "C:\Users\<redact>\.jupyter_flow\b01b3cec3977e9e-cv-0-1.pyz\_bootstrap\__init__.py", line 36, in run
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\click\core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\click\core.py", line 1062, in main
rv = self.invoke(ctx)
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\click\core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\click\decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\papermill\cli.py", line 250, in papermill
execute_notebook(
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\papermill\execute.py", line 107, in execute_notebook
nb = papermill_engines.execute_notebook_with_engine(
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\papermill\engines.py", line 49, in execute_notebook_with_engine
return self.get_engine(engine_name).execute_notebook(nb, kernel_name, **kwargs)
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\papermill\engines.py", line 343, in execute_notebook
cls.execute_managed_notebook(nb_man, kernel_name, log_output=log_output, **kwargs)
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\papermill\engines.py", line 402, in execute_managed_notebook
return PapermillNotebookClient(nb_man, **final_kwargs).execute()
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\papermill\clientwrap.py", line 43, in execute
with self.setup_kernel(**kwargs):
File "C:\ProgramData\Alteryx\Tools\JupyterFlow_venv\lib\contextlib.py", line 113, in __enter__
return next(self.gen)
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\nbclient\client.py", line 456, in setup_kernel
self.start_new_kernel(**kwargs)
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\nbclient\util.py", line 78, in wrapped
return just_run(coro(*args, **kwargs))
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\nbclient\util.py", line 57, in just_run
return loop.run_until_complete(coro)
File "C:\ProgramData\Alteryx\Tools\JupyterFlow_venv\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\nbclient\client.py", line 412, in async_start_new_kernel
await ensure_async(self.km.start_kernel(extra_arguments=self.extra_arguments, **kwargs))
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\nbclient\util.py", line 89, in ensure_async
result = await obj
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\jupyter_client\manager.py", line 331, in _async_start_kernel
kernel_cmd, kw = await ensure_async(self.pre_start_kernel(**kw))
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\jupyter_client\utils.py", line 33, in ensure_async
return await obj
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\jupyter_client\manager.py", line 295, in _async_pre_start_kernel
self.kernel_spec,
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\jupyter_client\manager.py", line 131, in kernel_spec
self._kernel_spec = self.kernel_spec_manager.get_kernel_spec(self.kernel_name)
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\jupyter_client\kernelspec.py", line 294, in get_kernel_spec
return self._get_kernel_spec_by_name(kernel_name, resource_dir)
File "C:\Users\<redact>\.shiv\b01b3cec3977e9e-cv-0-1_830b0357a27e50e91c83b7a77e0750042db9a80cd6fde18310e1a11b29ef90c1\site-packages\jupyter_client\kernelspec.py", line 258, in _get_kernel_spec_by_name
raise NoSuchKernel(kernel_name)
jupyter_client.kernelspec.NoSuchKernel: No such kernel named python3

Re-posting here with solution to ensure others can find this workaround while I look into a permanent fix.

Jeff Arnold
Sr. Full Stack Software Engineer | Alteryx
13 REPLIES 13
Alteryx

Solution:

@jrgo try doing this in your environment and re-running the tool:

C:\path\to\your\environment\root\folder\Scripts\pip.exe install jupyter-client==6.1.12

Jeff Arnold
Sr. Full Stack Software Engineer | Alteryx
13 - Pulsar

Thanks again for the assist. I am running into another issue that I wanted to run by you and get your thoughts. I followed the steps to prepare for packaging/publishing and when I run in Gallery, it returns an error.

I published it to 2 different environments after installing the Jupyter Flow tool (as admin and completed without error), one running 21.2 with a service account set as the Run As and the other on the latest, v21.3, that has no Run as set up. I'm mentioning the Run as because that looks to have an impact to the error return as well as the errors showing in the log file the mentioned in the result page.

Attached is the packaged workflow and I included a copy of the log from each server within the yxzp.

Also want to note that I opened the workflow from the server (RDP) from their respective Gallery and ran them in Designer and it finishes without error.

AMP turned on or off doesn't seem to have any impact.

Any ideas here?

Thank you,

Jimmy

Alteryx

Hey again @jrgo . Sorry you're having this issue. But hopefully we can get it squared away and make sure this tool is solid for everyone.

I don't see anything weird in your notebook, and I'm currently working on reproducing the issue.

One quick checklist item is that JupyterFlow has to be installed as Admin if you didn't do it that way. To do this, open Designer as administrator, and do not drag the yxi or double click the yxi. Instead, go to open a workflow and open that yxi instead. This will ensure that the tool is installed as admin.

If that doesn't fix it, could you upload the log files if possible? Even just a screenshot of their contents would be helpful.

Jeff Arnold
Sr. Full Stack Software Engineer | Alteryx
13 - Pulsar

Hi @JeffA

Yes, I made sure that the tool was installed from an elevated instance of Designer and was presented and selected the option the install for all users.

Alteryx

@jrgo Ok so I reproduced an error throwing on Server 2021.3 with your workflow. It did not fail in Designer but it did fail on Server.

In my case, this was a long paths not enabled issue. The reason it passed in Designer was because the user context was different, so the path in which shiv (one of the libs we use for Jupyter Flow) was saving its files was short. When running from server the path was a lot longer, and so failure ensued. After enabling long paths on that machine, it worked. I enabled long paths using the command shown in this guide: https://www.msftnext.com/how-to-enable-ntfs-long-paths-in-windows-10/

I'm personally looking forward to the day when Windows stops defaulting long paths to disabled 😕

Let me know if that was not it! If that was the problem, do you think it would be helpful to include that step in my guide?

Jeff Arnold
Sr. Full Stack Software Engineer | Alteryx
13 - Pulsar

@JeffA that fix didn't seem to work for me. I only attempted this on my local sandbox environment. I've attached the Jupyter log for the last attempt.

Alteryx

A few questions to help me reproduce this faster:

1. What is the server version that this error log you linked was generated from?

2. Was this the version with no "Run As" set up, or the version with "Run As" set up?

Jeff Arnold
Sr. Full Stack Software Engineer | Alteryx
13 - Pulsar

Was on 2021.3. It was ran WITH a service account, but that was on the same server that I had previously tested without one, in case that matters. I did also test it before the SA was added (after fix you suggested was applied).

Alteryx

Has the logfile been showing basically the same issue each time? Or is it significantly different based on whether or not a service account was used?

Jeff Arnold
Sr. Full Stack Software Engineer | Alteryx
Labels


text:
# Electric field

1. Sep 29, 2005

### stunner5000pt

A large flat nonconducting surface carries a uniform surface charge density of sigma. A small circular hole of radius R has been cut out from this surface as in the figure. Ignore the fringing of the fierld lines around all the edges and calculate the electric field at point P located a distance z from the centre of the hole. (Hint says to refer to the electric field due to a charged disc and use superposition)

well im using the hint and thinking that the field would the electric field due to a nonconducting surface less the electric field due to this charged disc.

so would it be $$E = \frac{\sigma}{2\epsilon_{0}} - \frac{\sigma}{2\epsilon_{0}} (1- \frac{z}{\sqrt{z^2+r^2}}) = \frac{\sigma z}{2 \epsilon_{0} \sqrt{z^2+R^2}}$$

#### Attached Files:

• ###### charge.JPG
File size:
3.6 KB
Views:
40
2. Sep 29, 2005

### Staff: Mentor

Looks good to me.

format: plain


text:
# SIAM Chapter Seminar: On the weighted asymptotic number of simplicial spanning trees in random $$k$$-regular simplicial complexes

#### 24.11.2021, 4:30 pm - 5:00 pm  –  Golm, Haus 9, Raum 2.22 and Zoom

Lior Tenenbaum

Abstract: In 1981, Mckay proved an asymptotic result regarding the number of spanning trees in random $$k$$-regular graphs. In this talk we will discuss an analogous result for random high dimensional $$k$$-regular simplicial complexes, showing that the weighted number of simplicial spanning trees in such complexes converge asymptotically almost surely to an explicit constant $$\zeta_{d,k}$$, when $$n$$ tends to infinity provided that $$k\geq 2d^2+2d\sqrt{d^2-1}$$. A key ingredient in the proof is the local convergence of such random complexes to the $$d$$-dimensional, $$k$$-regular arboreal complex, which allows us to generalize Mckay's result regarding the Kesten-Mckay distribution.

Get to know what your fellow Ph.D students are working on! Details are announced via mailing lists "mathe-phd" and "SIAM-chapter-list", or ask Undine or Florian.

zu den Veranstaltungen


text:
# What is the relationship between Clique, Independent Set, and Vertex Cover?

I'm aware that Vertex Cover and Independent Set are complements of eachother, but I've also heard Independent Set referred to something in relation to Clique; I just don't recall what. It can't be the complement, because if it is, then Clique and Vertex cover would be the same, wouldn't it?

-

A set of vertices in a graph $\Gamma$ form a clique iff they form an independent set in the complement of $\Gamma$. Is that what you were looking for?


text:
# A bi‐level transactive control model for integrating decision‐making and DLMP‐pricing in distribution networks

A bi‐level transactive control model for integrating decision‐making and DLMP‐pricing in... The market‐driven demand side management of distribution networks suffers from the challenge of operational security issues. This paper proposes a distribution locational marginal price (DLMP) based bi‐level transactive control model for distribution networks to manage demand side resources of nodal agents, ensuring both the network security and the agents' optimal decision. The proposed model consists of a DLMP‐pricing model at the upper level and DLMP‐based demand response (D‐DR) models at the lower level, integrating the DLMP‐pricing of the distribution network and the decision‐making of agents. The DLMP‐pricing model is constructed as the dual form of a linearized optimal power flow problem to determine DLMP related to the decision of all agents. The D‐DR model enables each nodal agent to minimize its own expenditure under the DLMP, which is established as a linear programming problem. The bi‐level model is converted into single‐level programming through replacing the D‐DR models by Karush‐Kuhn‐Tucker conditions, in which the bi‐linear items of the complementary slackness are further linearized by introducing integer variables. Consequently, the intractable bi‐level transactive control model is equivalently reconstructed as a single‐level mixed‐integer linear programming problem that can be conveniently solved. Comprehensive numerical studies validate the effectiveness of the proposed model. http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png "IET Generation, Transmission & Distribution" Wiley

# A bi‐level transactive control model for integrating decision‐making and DLMP‐pricing in distribution networks

, Volume 16 (19) – Oct 1, 2022

## A bi‐level transactive control model for integrating decision‐making and DLMP‐pricing in distribution networks

, Volume 16 (19) – Oct 1, 2022

### Abstract

The market‐driven demand side management of distribution networks suffers from the challenge of operational security issues. This paper proposes a distribution locational marginal price (DLMP) based bi‐level transactive control model for distribution networks to manage demand side resources of nodal agents, ensuring both the network security and the agents' optimal decision. The proposed model consists of a DLMP‐pricing model at the upper level and DLMP‐based demand response (D‐DR) models at the lower level, integrating the DLMP‐pricing of the distribution network and the decision‐making of agents. The DLMP‐pricing model is constructed as the dual form of a linearized optimal power flow problem to determine DLMP related to the decision of all agents. The D‐DR model enables each nodal agent to minimize its own expenditure under the DLMP, which is established as a linear programming problem. The bi‐level model is converted into single‐level programming through replacing the D‐DR models by Karush‐Kuhn‐Tucker conditions, in which the bi‐linear items of the complementary slackness are further linearized by introducing integer variables. Consequently, the intractable bi‐level transactive control model is equivalently reconstructed as a single‐level mixed‐integer linear programming problem that can be conveniently solved. Comprehensive numerical studies validate the effectiveness of the proposed model.

/lp/wiley/a-bi-level-transactive-control-model-for-integrating-decision-making-tBf8pslKvR
Publisher
Wiley
© 2022 The Institution of Engineering and Technology.
eISSN
1751-8695
DOI
10.1049/gtd2.12549
Publisher site
See Article on Publisher Site

### Abstract

The market‐driven demand side management of distribution networks suffers from the challenge of operational security issues. This paper proposes a distribution locational marginal price (DLMP) based bi‐level transactive control model for distribution networks to manage demand side resources of nodal agents, ensuring both the network security and the agents' optimal decision. The proposed model consists of a DLMP‐pricing model at the upper level and DLMP‐based demand response (D‐DR) models at the lower level, integrating the DLMP‐pricing of the distribution network and the decision‐making of agents. The DLMP‐pricing model is constructed as the dual form of a linearized optimal power flow problem to determine DLMP related to the decision of all agents. The D‐DR model enables each nodal agent to minimize its own expenditure under the DLMP, which is established as a linear programming problem. The bi‐level model is converted into single‐level programming through replacing the D‐DR models by Karush‐Kuhn‐Tucker conditions, in which the bi‐linear items of the complementary slackness are further linearized by introducing integer variables. Consequently, the intractable bi‐level transactive control model is equivalently reconstructed as a single‐level mixed‐integer linear programming problem that can be conveniently solved. Comprehensive numerical studies validate the effectiveness of the proposed model.

### Journal

"IET Generation, Transmission & Distribution"Wiley

Published: Oct 1, 2022

### References

Access the full text.


text:
# On the Enumeration of Certain Weighted Graphs

Research paper by Miklós Bóna, Hyeong-Kwan Ju, Ruriko Yoshida

Indexed on: 07 Jun '06Published on: 07 Jun '06Published in: Mathematics - Combinatorics

#### Abstract

We enumerate weighted graphs with a certain upper bound condition. We also compute the generating function of the numbers of these graphs, and prove that it is a rational function. In particular, we show that if the given graph is a bipartite graph, then its generating function is of the form $\frac{p(x)}{(1-x)^{m+1}}$, where $m$ is the number of vertices of the graph and $p(x)$ is a polynomial of degree at most $m$.


text:
### Far Eastern Mathematical Journal

To content of the issue

On the distribution of real algebraic numbers of equal height

Koleda D.V.

2018, issue 1, Ñ. 56-70

Abstract
In the paper we find the asymptotic number of algebraic numbers of fixed degree $n\ge 1$ and height H lying in an interval $I\subseteq\mathbb{R}$ as $H\to\infty$.

Keywords:
algebraic numbers, distribution of algebraic numbers, integer polynomials, generalized Farey sequences

#### References

[1] S.-J. Chern, J.D. Vaaler, “The distribution of values of Mahler’s measure”, J. Reine Angew. Math., 540, (2001), 1–47.
[2] D. Masser, J.D. Vaaler, “Counting algebraic numbers with large height I”, Diophantine Approximation, Dev. Math., 16, Springer, Vienna, 2008, 237–243.
[3] D. Masser, J.D. Vaaler, “Counting algebraic numbers with large height. II”, Trans. Amer. Math. Soc., 359:1, (2007), 427–445.
[4] R. Grizzard, J. Gunther, “Slicing the stars: counting algebraic numbers, integers, and units by degree and height”, Algebra Number Theory, 11:6, (2017), 1385–1436.
[5] H. Brown, K. Mahler, “A generalization of Farey sequences: Some exploration via the computer”, J. Number Theory, 3:3, (1971), 364–370.


text:
• ### Popular Now

• 13
• 16
• 27
• 9
• 9

#### Archived

This topic is now archived and is closed to further replies.

# How to read from a file??

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

## Recommended Posts

If i were to write a 10*10 map in Notepad and saved it as map.txt Let s = Sand Let r = Rock Let t = Tree this is what i think the map.txt should contain to make my map! s,s,s,s,s,s,s,s,s,s, s,s,s,r,s,s,s,s,s,s, s,s,s,s,s,s,s,t,t,t, s,s,t,s,s,s,s,s,s,s, s,s,s,s,s,s,s,r,s,s, s,s,s,s,s,s,s,s,s,s, s,s,s,r,r,s,s,s,s,s, s,s,s,s,r,s,s,s,s,s, s,s,s,s,r,s,s,s,s,s, s,s,s,s,s,s,s,s,s,s, My code to take it in would look something like for (int x=0, x<10, x++) { for (int y=0, y<10, y++) { tilemap[x][y]= ("the relevent bit of code to copy each value in to the right space in the tile map array"); } } i know this is a very simple way of doing a map but i want to start small....but cant figure out how to copy the relevant value from the .txt file to the tilemap array!! Does it matter that my lines in the file only go 20 characters across? How would i get it to go down to the new lines so it wont be feeding blanks into the array and also how to handle the commas between each letter. Is using letters a bad way to represent your tile, i noticed alot of people use numbers! Thanks Brian

##### Share on other sites
OK the following code is off the top of my head, so if there are any problems it should be easy to fix.

I''m assuming that your file has 2 bytes at the end of a line (CF + LL).

  void ReadFile(){ int x,y; FILE *fin; fin = fopen("map.txt","rb"); if( fin == NULL ) { // Error has occured } else { for (x=0, x<10, x++) { for (y=0, y<10, y++) { tilemap[x][y] = fgetc(fin); fgetc(fin); // Catch that comma } fgetc(fin); // Catch CF fgetc(fin); // Catch LF } fclose(fin); }}

As for the simple way of doing tiles, it''s not have a search on the web for a game called Kye, it uses text files for it''s maps, and a game I''m writing uses this technique as well.

Using letters gives you an extra 16 tiles (a-z) or 42 (a-z,A-Z) or even 52 (0-9,a-z,A-Z) compared to just using numbers (0-9), assuming that you are using one digit per tile. If you what to use more then you would have to write a piece of code that reads until a comma and then returns the number read.

Oh about the code above you might want to place an offset on the tiles so that a=0,b=1,c=2, etc this will help your tile rendering code a bit as well.

When I find my code in tons of trouble,
Friends and colleages come to me,
Speaking words of wisdom:
"Write in C."

##### Share on other sites
Why are you making a home-brew map engine for a game when there''s already plenty good ones out there? Search the web for "Mappy" - it''s a free program that lets you create maps and integrate it into a game. I highly reccomend it. It supports animated, isometric, and hexogonal tiles.

##### Share on other sites
you guys really don''t know what "self-satisfaction" means... a self-written working piece of code, now matter how simple, makes you happier and more satisfied than any alreadywrittensupermegaengine... that''s my opinion...

##### Share on other sites
What''s wrong with good ol'' binary?

##### Share on other sites
If you are using C++, you could alter your map slightly and it is very easy.
The map:
sssssssssssssrssssssssssssstttsstssssssssssssssrsssssssssssssssrrsssssssssrsssssssssrsssssssssssssss

Here is the code to load it:
  char map[10][10];int i,j;fstream in("map.txt",ios_base::in);for(i=0;i<10;i++) { for(j=0;j<10;j++) { in >> map[i][j]; }}in.close();

If you want your map to be int instead of char you can:
  int map[10][10];char temp;int i,j;fstream in("map.txt",ios_base::in);for(i=0;i<10;i++) { for(j=0;j<10;j++) { in >> temp; if(temp==''s'') { map[i][j]=1; } else if(temp=''r'') { map[i][j]=2; } else if(temp=''t'') { map[i][j]=3; } }}in.close();

---
Make it work.
Make it fast.

"Commmmpuuuuterrrr.." --Scotty Star Trek IV:The Voyage Home

##### Share on other sites
Or if you liked, I could post the source to a Tokenising library I wrote for things just like this.

You''d read the file into a char*[] array

And call my class CTokens.Tokenise(char*).

This then creates a list of tokens that you can scroll through. Useful in IRC and other type libraries

##### Share on other sites
Bye a book!! LOL!!

I own loads of books...been in college for last 4 years doin a Bs in Applied Computing...

Now my Head is fried...just 2 things i need before i can reach the next level and have my map displayed...

Get rid of that DirectX 7 error that keeps occuring because i''m using DirectX 8 SDK and that little bit of code to read the map in!!!!

##### Share on other sites
Bye a book!! LOL!!

I own loads of books...been in college for last 4 years doin a Bs in Applied Computing...

Now my Head is fried...just 2 things i need before i can reach the next level and have my map displayed...

Get rid of that DirectX 7 error that keeps occuring because i''m using DirectX 8 SDK and that little bit of code to read the map in!!!!

Then i can move on and start the game logic...been stuck here a while...so need to just get it out of the way!!!

Have a load of other Projects that i''m trying to get through as well as this.. i''ve little time to struggle with something that is quiet simple and obvious to others and i can be simply helped with!!

If you dont want to reply Pyabo then dont, everything is not as black and white as you''d se it!.
If you do not want to reply then dont! Thanks.

Why not use Mappy...well because would not be appreciated by my Lectures and that means i''d fail!!

"self-satisfaction" I''ve no time for satisfaction tryin to get true this cousrse!!

Thanks Steven and Captain Jester!!

How come you have no commas in you map... you dont need them then i take it :-D

Converting to ints what is the benefit!!

Thanks for all your help... will take alook at Kye aswell!


text:
# Research

## Applications

• Inversion for optical properties of biological tissues in quantitative optoacoustic tomography

• Statistical treatment of inverse problems constrained by stochastic models

• Accounting for model errors in inverse problems

• Bayesian optimal experimental design for inverse problems in acoustic scattering

• Inversion and control for CO2 sequestration with poroelastic models

• Goal-oriented inference for reservoir models with complex features including faults

• Joint seismic-electromagnetic inversion

• Inference of basal boundary conditions for ice sheet flow

• Inversion for material properties of cardiac tissue

• Inference, prediction and optimization under uncertainty for turbulent combustion

## Selected poster presentations

Did you publish an article or give an oral/poster presentation using hIPPYlib? Please let us know by creating an issue and we will reference your work on this page.


text:
# Measuring Arithmetic Intensity¶

Arithmetic intensity is a measure of floating-point operations (FLOPs) performed by a given code (or code section) relative to the amount of memory accesses (Bytes) that are required to support those operations. It is most often defined as a FLOP per Byte ratio (F/B). This application note provides a methodology for determining arithmetic intensity using Intel's Software Development Emulator Toolkit (SDE) and VTune Amplifier (VTune) tools. A NERSC tutorial on using VTune can be found here. This method can also be used to determine arithmetic intensity for use in the Roofline Performance Model.

Historically, processor manufacturers have provided counters for FLOPs and/or Bytes and profiling tools to support the F/B calculation. Some modern processors such as Intel's Haswell (used in Cori) do not provide counters for FLOPs. However, Intel's SDE can be used to count floating-point instructions in addition to core-level memory accesses, and VTune can be used to count data accesses to the uncore (off-chip DRAM DIMMs).

The SDE dynamic instruction tracing capability, and in particular the mix histogram tool, captures dynamic instructions executed, instruction length, instruction category and ISA extension grouping. Intel has developed a methodology for calculating FLOPs with SDE. In general the following uses the method "Instructions to Count Unmasked FLOP" from Intel.

This application note provides additional instruction on how to only capture traces around certain key segments of a code. This is critical for real applications as both SDE and VTune collect traces that can use large amounts of disk space if tracing is enabled for more than a few minutes. And maybe more importantly, post-processing the traces can take an intractable amount of time.

An example command line for SDE is:

$srun -n 4 -c 6 sde -ivb -d -iform 1 -omix my_mix.out -i -global_region -start_ssc_mark 111:repeat -stop_ssc_mark 222:repeat -- foo.exe where: • for Cori use -hsw for Haswell or -knl for KNL processors • -d specifies to only collect dynamic profile information • -iform 1 turns on compute ISA iform mix • -omix specifies the output file (and turns on -mix) • -i specifies that each process will have a unique file name based on process ID (needed for MPI) • -global_region will include any threads spawned by a process (needed for OpenMP) An example command line for VTune is:$ srun -n 4 amplxe-cl -start-paused -r my_vtune -collect memory-access -finalization-mode=none -trace-mpi -- foo.exe

SDE allows tracing to only occur around specified sections of code using __SSC_MARK macros. The -start_ssc_mark and -stop_ssc_mark flags tell SDE to only trace sections of code between these marks. In addition, VTune has calls to start and stop tracing. This is illustrated below for an example kernel from the STREAM benchmark. Note that both use a double underscore prefix which may not be obvious when viewed in the web browser.

// Code must be built with appropriate paths for VTune include file
// (ittnotify.h) and library (-littnotify)

#include <ittnotify.h>

__SSC_MARK(0x111); // start SDE tracing, note it uses 2 underscores
__itt_resume(); // start VTune, again use 2 underscores

for (k=0; k<NTIMES; k++) {
#pragma omp parallel for
for (j=0; j<STREAM_ARRAY_SIZE; j++)
a[j] = b[j]+scalar*c[j];
}

__itt_pause(); // stop VTune
__SSC_MARK(0x222); // stop SDE tracing

In addition to limiting the collection of traces to certain code segments or kernels, it is also desirable to use start and stop markers to limit the amount of data collected as SDE and VTune tracing analysis can generate a large volume of data if the total execution time is excessive. This may require trial and error to determine where in the code to enable tracing, and to limit the amount of time tracing is enabled. It's desirable that tracing is enabled for only a few minutes or less. To use VTune markers in Fortran codes, see this Intel article.

SDE will create a file for every process that is created by the application. For example, in an MPI code SDE will create a file for each MPI process (one per rank) and if the application contains threads (e.g. OpenMP) those will be encapsulated into the same file (-global_region enables this).

Example

All of the above is best illustrated with an example found here. This example uses a modified version of the STREAM benchmark (it also contains a directory with an example Jacobi Method code utilizing fortran bindings). The example can be accessed using git, e.g.:

$git clone https://bitbucket.org/dwdoerf/stream-ai-example.git$ cd stream-ai-example
$module load sde$ module load vtune
$make You may have to modify the Makefile to suit your needs. Once you've successfully built the executable, stream.exe, (an MPI+OpenMP code) you can use the example batch script stream-ai.sh (which may need to be modified to suit your target and submit a job which executes stream.exe in three modes: without instrumentation that can be used for accurate timing estimates, then under the control of SDE, and finally under the control of VTune.$ sbatch stream-ai.sh
< wait for job to finish, this may take a few to several minutes depending on demand>

When the job completes, SDE will have created several files, one for each rank, starting with sde_. VTune will have created one or more directories (one for each node used) starting with vtbw_.

SDE provides a wealth of information in each of its respective output files. For arithmetic intensity the floating-point instruction and data access instructions are of primary interest. You can use the links to the Intel documentation provided above to better understand these details, or you can use the script provided in the example to parse the output files. The script prints the instruction counts followed by a summary of total floating-point operations and total bytes.

Parsing SDE output

You want to pass the script all files generated by SDE (one per rank) on the command line. E.g.:

$./parse-sde.sh sde_2p16t* Search stanza is "EMIT_GLOBAL_DYNAMIC_STATS" elements_fp_single_1 = 0 elements_fp_single_2 = 0 elements_fp_single_4 = 0 elements_fp_single_8 = 0 elements_fp_single_16 = 0 elements_fp_double_1 = 2960 elements_fp_double_2 = 0 elements_fp_double_4 = 999999360 elements_fp_double_8 = 0 --->Total single-precision FLOPs = 0 --->Total double-precision FLOPs = 4000000400 --->Total FLOPs = 4000000400 mem-read-1 = 8618384 mem-read-2 = 1232 mem-read-4 = 137276433 mem-read-8 = 149329207 mem-read-16 = 1999998720 mem-read-32 = 0 mem-read-64 = 0 mem-write-1 = 264992 mem-write-2 = 560 mem-write-4 = 285974 mem-write-8 = 14508338 mem-write-16 = 0 mem-write-32 = 499999680 mem-write-64 = 0 --->Total Bytes read = 33752339756 --->Total Bytes written = 16117466472 --->Total Bytes = 49869806228 amplxe-cl stores its trace data in directories (one per node). The example script includes -finalization-mode=none as the finalize step is I/O intensive and can take a long time. It is best done on an external login node. (Please see the VTune page for more information about using VTune effectively. The following amplxe-cl command creates a summary report which is then redirected to another file. The parse-vtune.sh script is provided to extract the uncore counter data for all nodes and then print a summary of the total data traffic to the DDR memory. Note that each uncore count is a 64 byte cache line, which is reflected in the total bytes reports. Also note that you will need to run a summary report for each directory (one per node) created during data collection. In this example, only a single directory was created. Even though there is only a single summary file for this example, in the 2nd step of executing parse-vtune.sh a wildcard is used to illustrate that all summary files need to be specified on the command line for a multi-node result.$ amplxe-cl -report hw-events -group-by=package -r vtbw_2p16t_13568698.nid00619 -column=UNC_M_CAS_COUNT -format=csv -csv-delimiter=comma > vtbw_2p16t_13568698.summary
--> lots of VTune output ....
--> Repeat for each directory created during data collection, one per node
\$ ./parse-vtune2018.sh vtbw_2p16t*.summary
Search stanza is "Uncore"
UNC_M_CAS_COUNT.RD[UNIT0] = 0
UNC_M_CAS_COUNT.RD[UNIT1] = 0
UNC_M_CAS_COUNT.RD[UNIT2] = 127252047
UNC_M_CAS_COUNT.RD[UNIT3] = 126829175
UNC_M_CAS_COUNT.RD[UNIT4] = 0
UNC_M_CAS_COUNT.RD[UNIT5] = 0
UNC_M_CAS_COUNT.RD[UNIT6] = 126861782
UNC_M_CAS_COUNT.RD[UNIT7] = 127247700
UNC_M_CAS_COUNT.WR[UNIT0] = 0
UNC_M_CAS_COUNT.WR[UNIT1] = 0
UNC_M_CAS_COUNT.WR[UNIT2] = 62611982
UNC_M_CAS_COUNT.WR[UNIT3] = 62274525
UNC_M_CAS_COUNT.WR[UNIT4] = 0
UNC_M_CAS_COUNT.WR[UNIT5] = 0
UNC_M_CAS_COUNT.WR[UNIT6] = 62389886
UNC_M_CAS_COUNT.WR[UNIT7] = 62519044
--->Total Bytes written = 15986907968
--->Total Bytes = 48511113024

Arithmetic intensity (AI) can now be calculated. Nominally, it's the ratio of "Total FLOPs" as reported by SDE to "Total Bytes" as reported by VTune.

AI (DRAM) = 4000000400 / 48511113024 = 0.0825

Alternatively, it can be calculated using the "Total Bytes" as seen by the core L1 caches and reported by SDE.

AI (L1) = 4000000400 / 49869806228 = 0.0802

Since STREAM has very little reuse of data, the AI of the two is approximately the same. For real codes, the AI (L1) will most likely be significantly lower. AI (L1) divided by AI (DRAM) can be used as a "bandwidth bound" figure of merit, the closer to 1.0 the more bandwidth bound the application.

## Change Log¶

• June 9, 2018
• Brought up to date to reflect the latest system software installed at NERSC. In particular the example script is now compatible with the latest configuration of Slurm and the amplxe-cl arguments are compatible with VTune Amplifier 2018. In addition, the STREAM example and all associated scripts to automate the method is now available via git on BitBucket.
• May 18, 2016
• Updated the example with a new parse-vtune.sh file which supports parsing for the Knights Landing MCDRAM counter output of VTune. You need to use at least VTune version 2016 Update 3 to collect MCDRAM counters.
• March 23, 2016


text:
# Faking Xtion to convert depth and rgb to point cloud.

Hello all !

Sorry it might sounds like stupid question to some of you but I'm stuck on some 3D image problem.

I'd like to use a rosbag from here and I need to convert depth and rgb image to a point cloud. Quite the classical problem.

I tried couple of way to do it, but I have several problems in doing so :

• I found the image pipeline with depth_image_proc and use this launch file to use it. The thing is I need tons of information about the camera. I know the dataset I want to use was recorded by a Xtion Pro by Asus, is there any package or way to "fake" using a Xtion. One idea I had was just to publish the data in a node but I want to know if there is something better out there than doing this myself.

• Could I use openni2_launch without a camera. I mean is there any way for me to tell it that it's an Xtion and then link it to my deth and rgb image in the rosbag ?

• I though about doing a very basic conversion by creating a node that would use the depth image and the rgb and combined them together. I get I need to know information such as the focal of the camera and so and I can find that. However I'm not able to find any good tutorial on how to combine them, which formula to use ? I know it must sound like a stupid question but I can't figure it out for now :/.

• In the launch file with the link about there is this piece of code :

<node pkg="nodelet" type="nodelet" name="cloudify" args="load depth_image_proc/point_cloud_xyzrgb record_player_manager --no-bond"> <remap from="depth_registered/image_rect" to="camera/depth/image"/> <remap from="depth_registered/points" to="camera/depth_registered/points"/> <remap from="rgb/image_rect_color" to="$(arg cloud_input_ns)/image_rect_color"/> <remap from="rgb/camera_info" to="$(arg cloud_input_ns)/camera_info"/> </node>

Can someone explain to me what are depth_registered/image_rect and depth_registered/points ? I get the camera information and rgb image ones but I only have one depth image so why does it have two depth argument ?

Sorry if I'm not being very clear. Just ask for more detail if you need I'll be happy to give some.

Thanks, any help is appreciated !

edit retag close merge delete

depth_registered/image_rect should be the rectified 2d depth image, depth_registered/points is a 3d point cloud calculated with the intrinsic parameters No experience with it, but can you not just play the bag and then look at the node you want? http://wiki.ros.org/rosbag/Commandline

( 2014-11-02 19:05:35 -0500 )edit

So depth_registered/point is the point cloud at the end ? So the node would published on this topic ? I don't really get what you mean by "play with the bag" :P? I actually know what topic are published by the bag, my problem is more about using the image pipeline to have a point cloud at the end.

( 2014-11-05 19:24:06 -0500 )edit

Play a bag: http://wiki.ros.org/rosbag/Tutorials/...

The bag uses a non-standard message type though, so you would have to add that yourself ( http://wiki.ros.org/ROS/Tutorials 1.2.5).

( 2014-11-06 04:31:16 -0500 )edit

Maybe take a look at this afterwards: http://answers.ros.org/question/18832... Or check out the nodelet tutorial and maybe the other tutorial also. ROS is not an install and go system...

( 2014-11-06 04:32:24 -0500 )edit

I know it's not an install and go system. Sorry I misread you on your first message, I can actually already play the bag file. I already dug in the nodelet tutorial as well :|. Guess I'll do a node by hand that send camera data to simulate an Xtion, seems like the easiest. Thanks for your help

( 2014-11-21 04:26:08 -0500 )edit


text:
World's most popular travel blog for travel bloggers.

# [Solved]: CCS process for a drink dispenser with two different prices

, ,
Problem Detail:

A drink dispenser requires the user to insert a coin ($\bar c$), then press one of three buttons: $\bar d_{\text{tea}}$ requests a cup of tea $e_{\text{tea}}$, ditto for coffee, and $\bar r$ requests a refund (i.e. the machine gives back the coin: $\bar b$). This dispenser can be modeled by the following CCS process:

$$M \stackrel{\mathrm{def}}= c.(d_{\text{tea}}.\bar e_{\text{tea}}.M + d_{\text{coffee}}.\bar e_{\text{coffee}}.M + r.\bar b.M)$$

A civil war raises the price of coffee to two coins, while the price of tea remains one coin. We want a modified machine that delivers coffee only after two coins, and acquiesces to a refund after either one or two coins. How can we model the modified machine with a CCS process?

You can easily profit from warfare that way:

$$M \stackrel{\mathrm{def}} = c.( d_{\text{tea}}.\bar e_{\text{tea}}.M + r.\bar b.M + c.( d_{\text{coffee}}.\bar e_{\text{coffee}}.M + r.\bar b.\bar b.M ) )$$

note that you have to press refund to get a tea if you put too many coins. If you don't want that, you can adapt it (or maybe set up a (finite is enough) counter) :

$$M \stackrel{\mathrm{def}} = c.( d_{\text{tea}}.\bar e_{\text{tea}}.M + r.\bar b.M + c.( d_{\text{coffee}}.\bar e_{\text{coffee}}.M + d_{\text{tea}}.\bar b.\bar e_{\text{tea}}.M + r.\bar b.\bar b.M ) )$$


text:
# 錢德拉塞卡極限

${\displaystyle {\frac {\omega _{3}^{0}{\sqrt {3\pi }}}{2}}\left({\frac {\hbar c}{G}}\right)^{3/2}{\frac {1}{(\mu _{e}m_{H})^{2}}}.}$

## 參考資料

1. ^ p. 55, How A Supernova Explodes, Hans A. Bethe and Gerald Brown, pp. 51–62 in Formation And Evolution of Black Holes in the Galaxy: Selected Papers with Commentary, Hans Albrecht Bethe, Gerald Edward Brown, and Chang-Hwan Lee, River Edge, NJ: World Scientific: 2003. ISBN 981238250X.
2. ^ Mazzali, P. A.; K. Röpke, F. K.; Benetti, S.; Hillebrandt, W. A Common Explosion Mechanism for Type Ia Supernovae. Science. 2007, 315 (5813): 825–828. doi:10.1126/science.1136259.
3. ^ The Neutron Star and Black Hole Initial Mass Function, F. X. Timmes, S. E. Woosley, and Thomas A. Weaver, Astrophysical Journal 457 (February 1, 1996), pp. 834–843.
4. ^ The Highly Collapsed Configurations of a Stellar Mass, S. Chandrasekhar, Monthly Notices of the Royal Astronomical Society 91 (1931), 456–466.
5. ^ The Highly Collapsed Configurations of a Stellar Mass (second paper), S. Chandrasekhar, Monthly Notices of the Royal Astronomical Society, 95 (1935), pp. 207--225.
6. ^ On Stars, Their Evolution and Their Stability, Nobel Prize lecture, Subrahmanyan Chandrasekhar, December 8, 1983.
7. ^ Standards for Astronomical Catalogues, Version 2.0, section 3.2.2, web page, accessed 12-I-2007.
8. ^ White dwarfs in open clusters. VIII. NGC 2516: a test for the mass-radius and initial-final mass relations, D. Koester and D. Reimers, Astronomy and Astrophysics 313 (1996), pp. 810–814.
9. ^ An Empirical Initial-Final Mass Relation from Hot, Massive White Dwarfs in NGC 2168 (M35), Kurtis A. Williams, M. Bolte, and Detlev Koester, Astrophysical Journal 615, #1 (2004), pp. L49–L52; also arXiv astro-ph/0409447.
10. ^ How Massive Single Stars End Their Life, A. Heger, C. L. Fryer, S. E. Woosley, N. Langer, and D. H. Hartmann, Astrophysical Journal 591, #1 (2003), pp. 288–300.
11. ^ The Density of White Dwarf Stars, S. Chandrasekhar, Philosophical Magazine (7th series) 11 (1931), pp. 592–596.
12. ^ The Maximum Mass of Ideal White Dwarfs, S. Chandrasekhar, Astrophysical Journal 74 (1931), pp. 81–82.


text:
# Oulipo

The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:

Tout avait Pair normal, mais tout s’affirmait faux. Tout avait Fair normal, d’abord, puis surgissait l’inhumain, l’affolant. Il aurait voulu savoir où s’articulait l’association qui l’unissait au roman : stir son tapis, assaillant à tout instant son imagination, l’intuition d’un tabou, la vision d’un mal obscur, d’un quoi vacant, d’un non-dit : la vision, l’avision d’un oubli commandant tout, où s’abolissait la raison : tout avait l’air normal mais…

Perec would probably have scored high (or rather, low) in the following contest. People are asked to write a perhaps even meaningful text on some subject with as few occurrences of a given “word” as possible. Our task is to provide the jury with a program that counts these occurrences, in order to obtain a ranking of the competitors. These competitors often write very long texts with nonsense meaning; a sequence of 500,000 consecutive 'T's is not unusual. And they never use spaces.

So we want to quickly find out how often a word, i.e., a given string, occurs in a text. More formally: given the alphabet {'A', 'B', 'C', …, 'Z'} and two finite strings over that alphabet, a word W and a text T, count the number of occurrences of W in T. All the consecutive characters of W must exactly match consecutive characters of T. Occurrences may overlap.

Input

The first line of the input file contains a single number: the number of test cases to follow. Each test case has the following format:

One line with the word W, a string over {'A', 'B', 'C', …, 'Z'}, with 1 ≤ |W| ≤ 10,000 (here |W| denotes the length of the string W).
One line with the text T, a string over {'A', 'B', 'C', …, 'Z'}, with |W| ≤ |T| ≤ 1,000,000.

Output

For every test case in the input file, the output should contain a single number, on a single line: the number of occurrences of the word W in the text T.

Sample Input

3
BAPC
BAPC
AZA
AZAZAZA
VERDI
AVERDXIVYERDIAN

Sample Output

1
3
0

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
#define N 1000005
char S[N],T[N];
int nex[N],slen,tlen;
void getnext()
{
int i=-1,j=0;
nex[0]=-1;
while(j<tlen)
{
if(i==-1||T[i]==T[j]) nex[++j]=++i;
else i=nex[i];
}
}
int KMP_index()
{
int i=0,j=0;
while(i<slen&&j<tlen)
{
if(j==-1||S[i]==T[j]) i++,j++;
else j=nex[j];
}
if(j==tlen) return i-tlen;
return -1;
}
int KMP_count()
{
if(slen==1&&tlen==1)
{
if(S[0]==T[0]) return 1;
else return 0;
}
int i,j=0,ans=0;
for(i=0;i<slen;i++)
{
while(j>0&&S[i]!=T[j]) j=nex[j];
if(S[i]==T[j]) j++;
if(j==tlen)
{
ans++;
j=nex[j];
}
}
return ans;
}
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
cin>>T>>S;
slen=strlen(S);
tlen=strlen(T);
getnext();
printf("%d\n",KMP_count());
}
return 0;
}


text:
## Research Output

Now showing 1 - 2 of 2
• Publication
The Goursat problem for a generalized Helmholtz operator in the plane
(Springer, 2008-09)
We consider the Goursat problem in the plane for partial differential operators whose principal part is the pth power of the standard Laplace operator. The data is posed on a union of 2p distinct lines through the origin. We show that the solvability of this Goursat problem depends on Diophantine properties of the geometry of lines on which the data is posed.
256Scopus© Citations 5
• Publication
On the mixed Cauchy problem with data on singular conics
(OUP, 2008-08)
We consider a problem of mixed Cauchy type for certain holomorphic partial differential operators with the principal part Q2p(D) essentially being the (complex) Laplace operator to a power, Δp. We provide inital data on a singular conic divisor given by P = 0, where P is a homogeneous polynomial of degree 2p. We show that this problem is uniquely solvable if the polynomial P is elliptic, in a certain sense, with respect to the principal part Q2p(D).
196Scopus© Citations 4


text:
# Hubble Parameter

## Homework Statement

For a κ=0 universe with no cosmological constant, show that H(z)=H0(1+z)3/2

## Homework Equations

Friedmann equation: H2=$\frac{8*\pi*g}{3c^2}$-$\frac{κc^2}{r^2}$*$\frac{1}{a(t)^2}$

## The Attempt at a Solution

I know that R(z)=R0/(1+z) but I do not know where this comes from. Following this, I should be able to take a density ρ(z)=ρ(now)*(1+z)^3 and input it into the Friedman equation but I am not sure how to proceed

## Answers and Replies

Related Advanced Physics Homework Help News on Phys.org
cepheid
Staff Emeritus


text:
One way to think about a system like a flowing fluid is as a continuum. Inside every small box placed at some point in space there is some stuff, and the equations of motion for that stuff are Newton's Laws $F=ma$. In this view there is a 3D volume filled with stuff, and the properties of that stuff are described by some functions of space, for example density: $\rho(x,y,z)$. In modern Functional Analysis theory such a beast is actually a point in an infinite dimensional vector space (basically every function is a weighted infinite sum of  "basis functions" like a Fourier Series).

An alternative way to think about that same system is as a massive number of atoms. In this view the configuration of the system is something like $Q(t) = (\{q_{11}, q_{12}, q_{13}\} \ldots , \{q_{n1},q_{n2},q_{n3}\})(t)$ With the position of each atom described by 3 coordinates for a total of 3N coordinates (or 2N for a 2D problem for example). This is the perspective I'm going to take for the moment. We're going to need to figure out something about the geometry related to these 3N dimensional vectors $Q(t)$.

Suppose you're pretending that a fluid is flowing around on the surface of a sphere. Now there are only two coordinates needed to describe the position of the particle, but still they are flowing in 3D. Because it's a sphere, if we want to use 2 coordinates, we need more than one coordinate system to describe the whole sphere. Think of a coordinate system as a paper map of the earth where you measure x and y on the piece of paper. We can't put the whole earth on one piece of paper with unique positions for every point on the earth (what happens at the poles?), but we can do it on two pieces of paper. In Differential Geometry a region of space with a coordinate system for that region is called a "Chart" and a set of charts that covers the whole space is called an "Atlas".

Locally, in the region around any point, the sphere looks like a plane, globally, it's still a sphere. To describe the position of an atom on the surface of the sphere we'll need to keep track of which coordinate system each particle's coordinates refer to (which chart it's in).

Instead of thinking of $Q(t)$ as N points in 3 dimensional space, we can consider $Q(t)$ as one single point in a 3N dimensional space. The Lagrangian perspective on Classical Mechanics takes this viewpoint. In fact, since the Lagrangian depends on position and velocity, the Lagrangian depends on a single point in the tangent bundle of the 3N dimensional space.

Ok, wait, what the heck is a Tangent Bundle? Well, if you have some space like $R^3$ the euclidean volume space, then you can imagine at every point in this space you could put a vector that told you where a particle at that point was headed. The vector could go in any of the 3 directions. Now you've gone from a space that can have 3 coordinates, to a space with 6 coordinates (3 for position, and 3 for direction). This is the Tangent Bundle. In particular, you can only add vectors that are at the same point since the Tangent Space at a point is separate from the Tangent Space at other points.

The type of geometry we're talking about here is Differential Geometry and it's essential to modern physics especially General Relativity but even in Classical Mechanics Differential Geometry is important. (For a physicists perspective try the book by Bernard Schutz, or take a look at Jack Wisdom's MIT AI lab note, or the book by Sussman and Wisdom)

So we've described our entire fluid system theoretically as a single point in 3N dimensional space, and we have a function $L(Q,Q_t)$ which is the Lagrangian on the tangent bundle, now all we need to know is how that point Q moves through the tangent bundle manifold, because that will tell us the position and velocity of every particle for all of time... just what we needed.

To describe motion on a manifold we need the concept of a flow. Imagine we have a space like the surface of the sphere, and at every point we choose one of the vectors in the tangent space at that point (a velocity vector). Now we start a particle at some initial point $Q_0$ and we let it move according to the velocity vector field. At any time t the particle will have a position, and because of the position, it will have a velocity, and there will be a unique curve associated with the initial point (thanks to the existence/uniqueness theorems in ODE theory). We call this curve a flow on the manifold. The operator which takes an initial point and computes a one parameter curve from the vector field is called the exponential of the vector field. So if $x_0$ is the initial point then $\exp(\epsilon v)[x_0]$ is the curve that the vector field $v$ defines through the point $x_0$ with the parameter $\epsilon$ controlling how far along the curve we are.

A vector field defines a group action on the points of the manifold. If we're at a point x and we flow along getting to a point y, these points are both in the manifold, also for every flow field from x to y there is some flow that would return us from y to x. Since the set of points on the manifold is closed under the flow, and there is an inverse these are the main things we need to get a group.

Ok, that sets up the terminology. Next I'd like to figure out what the heck do we get from this whole mess when we want to describe how things change dynamically.

One Response leave one →
1. November 24, 2009

A comment here. If you try to read Math books about Differential Geometry, they will be extremely abstract. Fiber bundles will be described in terms of Mobius strips and things like that. This is because abstract mathematicians generally have no idea how useful this stuff is for making models in physics.

A Tangent Bundle is a kind of fiber bundle. Think of a fiber bundle as adding an abstract dimension at each location in space such as Temperature, or Pressure, or Density. These attributes are attributes of the particular point in space. They're not tangent directions (ie. they don't tell you how to flow from one point to another) but they do tell you something useful about space at the point. The Tangent Bundle is THE fiber bundle whose fibers are the directions in which we can travel in the manifold (vectors).


text:
# Flow¶

In the Flow panel a number of Routines can be combined to form an experiment. For instance, your study may have a Routine that presented initial instructions and waited for a key to be pressed, followed by a Routine that presented one trial which should be repeated 5 times with various different parameters set. All of this is achieved in the Flow panel. You can adjust the display size of the Flow panel (see View menu).

The Routines that the Flow will use should be generated first (although their contents can be added or altered at any time). To insert a Routine into the Flow click the appropriate button in the left of the Flow panel or use the Experiment menu. A dialog box will appear asking which of your Routines you wish to add. To select the location move the mouse to the section of the flow where you wish to add it and click on the black disk.

## Loops¶

Loops control the repetition of Routines and the choice of stimulus parameters for each. PsychoPy can generate the next trial based on the method of constants or using an adaptive staircase. To insert a loop use the button on the left of the Flow panel, or the item in the Experiment menu of the Builder. The start and end of a loop is set in the same way as the location of a Routine (see above). Loops can encompass one or more Routines and other loops (i.e. they can be nested).

As with components in Routines, the loop must be given a name, which must be unique and made up of only alpha-numeric characters (underscores are allowed). I would normally use a plural name, since the loop represents multiple repeats of something. For example, trials, blocks or epochs would be good names for your loops.

It is usually best to use trial information that is contained in an external file (.xlsx or .csv). When inserting a loop into the flow you can browse to find the file you wish to use for this. An example of this kind of file can be found in the Stroop demo (trialTypes.xlsx). The column names are turned into variables (in this case text, letterColor, corrAns and congruent), these can be used to define parameters in the loop by putting a $sign before them e.g.$text.

As the column names from the input file are used in this way they must have legal variable names i.e. they must be unique, have no punctuation or spaces (underscores are ok) and must not start with a digit.

The parameter Is trials exists because some loops are not there to indicate trials per se but a set of stimuli within a trial, or a set of blocks. In these cases we don’t want the data file to add an extra line with each pass around the loop. This parameter can be unchecked to improve (hopefully) your data file outputs. [Added in v1.81.00]

### Method of Constants¶

Selecting a loop type of random, sequential, or fullRandom will result in a method of constants experiment, whereby the types of trials that can occur are predetermined. That is, the trials cannot vary depending on how the subject has responded on a previous trial. In this case, a file must be provided that describes the parameters for the repeats. This should be an Excel 2007 (xlsx) file or a comma-separated-value (csv ) file in which columns refer to parameters that are needed to describe stimuli etc. and rows one for each type of trial. These can easily be generated from a spreadsheet package like Excel. (Note that csv files can also be generated using most text editors, as long as they allow you to save the file as “plain text”; other output formats will not work, including “rich text”.) The top row should be a row of headers: text labels describing the contents of the respective columns. (Headers must also not include spaces or other characters other than letters, numbers or underscores and must not be the same as any variable names used elsewhere in your experiment.) For example, a file containing the following table:

ori   text    corrAns
0     aaa     left
90    aaa     left
0     bbb     right
90    bbb     right

would represent 4 different conditions (or trial types, one per line). The header line describes the parameters in the 3 columns: ori, text and corrAns. It’s really useful to include a column called corrAns that shows what the correct key press is going to be for this trial (if there is one).

If the loop type is sequential then, on each iteration through the Routines, the next row will be selected in the order listed in the file. Under a random order, the next row will be selected at random (without replacement); it can only be selected again after all the other rows have also been selected. nReps determines how many repeats will be performed (for all conditions). The total number of trials will be the number of conditions (= number of rows in the file, not counting the header row) times the number of repetitions, nReps. With the fullRandom option, the entire list of trials including repetitions is used in random order, allowing the same item to appear potentially many times in a row, and to repeat without necessarily having done all of the other trials. For example, with 3 repetitions, a file of trial types like this:

letter
a
b
c

could result in the following possible sequences. sequential could only ever give one sequence with this order: [a b c a b c a b c]. random will give one of 216 different orders (= 3! * 3! * 3! = nReps * (nTrials!) ), for example: [b a c a b c c a b]. Here the letters are effectively in sets of (abc) (abc) (abc), and randomization is only done within each set, ensuring (for example) that there are at least two a’s before the subject sees a 3rd b. Finally, fullRandom will return one of 362,880 different orders (= 9! = (nReps * nTrials)! ), such as [b b c a a c c a b], which random never would. There are no longer mini-blocks or “sets of trials” within the longer run. This means that, by chance, it would also be possible to get a very un-random-looking sequence like [a a a b b b c c c].

It is possible to achieve any sequence you like, subject to any constraints that are logically possible. To do so, in the file you specify every trial in the desired order, and the for the loop select sequential order and nReps=1.

### Selecting a subset of conditions¶

In the standard Method of Constants you would use all the rows/conditions within your conditions file. However there are often times when you want to select a subset of your trials before randomising and repeating.

The parameter Select rows allows this. You can specify which rows you want to use by inserting values here:

• 0,2,5 gives the 1st, 3rd and 6th entry of a list - Python starts with index zero)

• $random(4)*10 gives 4 indices from 0 to 9 (so selects 4 out of 10 conditions) • 5:10 selects the 6th to 10th rows •$myIndices uses a variable that you’ve already created

Note in the last case that 5:8 isn’t valid syntax for a variable so you cannot do:

myIndices = 5:8

but you can do:

myIndices = slice(5,8) #python object to represent a slice
myIndices = "5:8" #a string that PsychoPy can then parse as a slice later
myIndices = "5:8:2" #as above but

Note that PsychoPy uses Python’s built-in slicing syntax (where the first index is zero and the last entry of a slice doesn’t get included). You might want to check the outputs of your selection in the Python shell (bottom of the Coder view) like this:

>>> range(100)[5:8] #slice 5:8 of a standard set of indices
[5, 6, 7]
>>> range(100)[5:10:2] #slice 5:8 of a standard set of indices
[5, 7, 9, 11, 13, 15, 17, 19]

Check that the conditions you wanted to select are the ones you intended!

### Staircase methods¶

The loop type staircase allows the implementation of adaptive methods. That is, aspects of a trial can depend on (or “adapt to”) how a subject has responded earlier in the study. This could be, for example, simple up-down staircases where an intensity value is varied trial-by-trial according to certain parameters, or a stop-signal paradigm to assess impulsivity. For this type of loop a ‘correct answer’ must be provided from something like a Keyboard Component. Various parameters for the staircase can be set to govern how many trials will be conducted and how many correct or incorrect answers make the staircase go up or down.

### Accessing loop parameters from components¶

The parameters from your loops are accessible to any component enclosed within that loop. The simplest (and default) way to address these variables is simply to call them by the name of the parameter, prepended with $to indicate that this is the name of a variable. For example, if your Flow contains a loop with the above table as its input trial types file then you could give one of your stimuli an orientation$ori which would depend on the current trial type being presented. Example scenarios:

1. You want to loop randomly over some conditions in a loop called trials. Your conditions are stored in a csv file with headings ‘ori’, ‘text’, ‘corrAns’ which you provide to this loop. You can then access these values from any component using $ori,$text, and $corrAns 2. You create a random loop called blocks and give it an Excel file with a single column called movieName listing filenames to be played. On each repeat you can access this with$movieName

3. You create a staircase loop called stairs. On each trial you can access the current value in the staircase with $thisStair Note When you set a component to use a parameter that will change (e.g on each repeat through the loop) you should remember to change the component parameter from constant to set every repeat or set every frame or it won’t have any effect! ### Reducing namespace clutter (advanced)¶ The downside of the above approach is that the names of trial parameters must be different between every loop, as well as not matching any of the predefined names in python, numpy and PsychoPy. For example, the stimulus called movie cannot use a parameter also called movie (so you need to call it movieName). An alternative method can be used without these restrictions. If you set the Builder preference unclutteredNamespace to True you can then access the variables by referring to parameter as an attribute of the singular name of the loop prepended with this. For example, if you have a loop called trials which has the above file attached to it, then you can access the stimulus ori with$thisTrial.ori. If you have a loop called blocks you could use \$thisBlock.corrAns.

Now, although the name of the loop must still be valid and unique, the names of the parameters of the file do not have the same requirements (they must still not contain spaces or punctuation characters).


text:
MathSciNet bibliographic data MR847727 17B35 (14M15 20G20 22E47) Ginsburg, V. \${\germ G}\$${\germ G}$-modules, Springer's representations and bivariant Chern classes. Adv. in Math. 61 (1986), no. 1, 1–48. Article

For users without a MathSciNet license , Relay Station allows linking from MR numbers in online mathematical literature directly to electronic journals and original articles. Subscribers receive the added value of full MathSciNet reviews.


text:
# How do you draw the graph of y=-1-cscx for 0<=x<2pi?

Apr 25, 2018

#### Explanation:

Think of it this way, csc(x) is an endless repeating funtion like that in black (I graphed it for you so you can see). When you are asked to shade a region or to find the region that is between $0$ and $2 \pi$ all

• First is check to see if the limits are included or not, in this case we have the $0$ which is included bcause it is the $x$ bigger than or equal to (whenever there is equal to it is included and has a solid line on the graph and means that point is considered a part of the bound). Notice the $2 \pi$ is not included and is therefore a dashed line.
• Then I'm assuming you know that you label the x-axis $0 , \pi , \frac{3 \pi}{2} \mathmr{and} 2 \pi$ which is just another way of looking at the same thing the unit circle shows. That is just one whole cycle of the function.

By the way if you weren't sure of the actual function how it looks you can just plot points and connect them. Just like $\sin \left(x\right)$ and $\cos \left(x\right)$ you should know $\csc \left(x\right)$ graph has the continuous curves.


text:
Heisenberg’s uncertainty principle

Heisenberg’s Uncertainty principle : “Simultaneous and exact determination of the position and momentum of a sub-atomic particle, like electron moving with high speed is impossible”.

If $\Delta$x and $\Delta$p represent the uncertainties in the position and momentum respectively. Then according to Heisenberg

$\Delta$x . $\Delta$p  $\geq$ $\frac{h}{4\pi}$ ………….. (1)

The product of uncertainties in position ($\Delta$x) and momentum ($\Delta$p) of an electron cannot be less than $\frac{h}{4\pi}$.  It can be equal or greater than $\frac{h}{4\pi}$.

Since momentum $=$ mass $\times$ velocity,  the equation (1) can be written as

$\Delta$$\times$ m ($\Delta$v) $\geq$ $\frac{h}{4\pi}$ $=$ $\Delta$$\times$ $\Delta$$\geq$  $\frac{h}{4\pi&space;m}$

If the position is determined accurately  $\Delta$x = 0 and $\Delta$v = $\alpha$. That means the inaccuracy in measuring the velocity is $\alpha$. If velocity is determined accurately $\Delta$v = 0 and $\Delta$x = $\alpha$.

Significance of Heisenberg’s Uncertainty principle :

• This principle rules out the existence of definite paths or trajectories of electrons and other similar particles.
• This principle is significant only for the motion of microscopic objects and is negligible for that of macroscopic objects.
• In dealing with milligram size or heavier objects, the associated uncertainties are hard of any real consequence.