Solid State Physics - Octave (programming) help

In summary, the speaker is struggling with programming in Octave for a course in Solid State Physics. They were given an initial code to modify, specifically changing a one basis lattice to a two basis lattice. Despite attempting to modify the code, they have not been successful and are seeking assistance from other sources such as tutorials and online forums.
  • #1
insynC
68
0
I'm currently undertaking a course in Solid State Physics and my professor has asked us to undertake some work in the free software 'Octave'. I have not had any programming experience in my life and I am feeling very much out of my depth.

The lecturer gave us an initial file with the relevant code in it and we had to modify certain parameters and see how that affected the output.

The one that is giving me grief is turning the one basis lattice into a two basis lattice.

The original code to create the lattice was "c=c+atom(x.-n*a,w)", where x essentially represents the x-axis and c the y axis. w is a variable to determine the type of atom in each basis, a is the lattice constant and n is related to the number of atoms in the crystal. The question says "Put two identical atoms in each cell, n_at(x; w=16)+n_at(x-1/3;w=16)"

So my attempt was to replace the above code with: "c=c+atom(x.-n*a,w)+atom(x.-n*a-1/3,w)"

But to no avail. I'm not sure what I'm doing wrong, but if anyone could give me a push or perhaps suggest somewhere where I can find help on this (the Octave website wasn't much use) I'd be greatly appreciative.
 
Physics news on Phys.org
  • #2
It might help to try looking at some tutorials on Octave programming. These will give you an idea of the syntax and how to structure your code. Additionally, it's always useful to ask questions like this on sites such as Stack Overflow or Reddit, where you can get help from other experienced programmers.
 

1. What is Solid State Physics?

Solid State Physics is a branch of physics that deals with the study of properties and behavior of solid materials, such as metals, semiconductors, and insulators. It involves understanding the physical and chemical properties of atoms and molecules, as well as their interactions and arrangements in solid materials.

2. What is Octave programming?

Octave is an open-source programming language designed for numerical computations and data analysis. It is similar to MATLAB and is often used in scientific and engineering applications for its powerful mathematical functions and data visualization capabilities.

3. How can Octave programming help in Solid State Physics?

Octave programming can help in Solid State Physics by allowing scientists to perform complex numerical calculations and simulations that would be difficult or time-consuming to do by hand. It also enables them to analyze and visualize large amounts of data, making it a valuable tool for research and experimentation in this field.

4. Do I need to have prior programming knowledge to use Octave for Solid State Physics?

While having some programming experience can be helpful, it is not necessary to have prior programming knowledge to use Octave for Solid State Physics. The language is designed to be user-friendly and has a syntax that is similar to other programming languages, making it relatively easy to learn.

5. Where can I find resources for learning Octave for Solid State Physics?

There are many online resources available for learning Octave, including tutorials, documentation, and forums. Some universities also offer courses or workshops on using Octave for scientific computing. Additionally, there are books and online courses specifically focused on using Octave for Solid State Physics.

Similar threads

  • Advanced Physics Homework Help
Replies
11
Views
2K
  • Advanced Physics Homework Help
Replies
7
Views
994
  • Advanced Physics Homework Help
Replies
3
Views
1K
  • Advanced Physics Homework Help
Replies
6
Views
1K
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
7
Views
2K
  • Advanced Physics Homework Help
Replies
5
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
7K
  • Advanced Physics Homework Help
Replies
1
Views
2K
Replies
1
Views
41
Back
Top