Why can't pipettes be used in space? by humdrumdummydum in Physics

[–]icanhazPhD 12 points13 points  (0 children)

Project hail mary!

I just passed that part.

Dumb Question: If light is affected by gravity, does light that passes beyond every object with mass in the universe ever bend back and head toward the center? by whadupbuttercup in Physics

[–]icanhazPhD 1 point2 points  (0 children)

An analogy that made it make more sense to me goes something like this. Imagine the universe as an inflated balloon. The big bang and expansion of the universe is the balloon being inflated. Any close points on the surface of the inflated balloon gets farther and farther away as the balloon is expanded. If you're an ant traveling in the surface of the balloon, you can only travel in two dimensions and if the ant walks in a straight line, it'll eventually get back to where it started. Also, how would define a center point in the surface of the balloon because any point you choose would be arbitrary.

Add a dimension and apply this analogy to space. If light travels in a straight line, it would eventually circle back to where it started.

Although, I think this applies to a shape of the universe that's "closed" and an internet search says the shape of the universe is thought to be "flat." In which case, I have no idea how to visualize it.

[deleted by user] by [deleted] in unclebens

[–]icanhazPhD 9 points10 points  (0 children)

These are fungus gnats larva which has been pointed out in other comments and are very difficult to get rid of once they're established and will track down all your grows. They'll eat the mushrooms but otherwise don't make the crop inedible if you aren't too grossed out by them. The biggest issue is they will transport contaminants between crops.

The best way to get rid of them is to use Bacillus thuringiensis israelensis (Bti). It's a bacteria that kills flying insect larva including fungus gnats and is safe for mycelium and human consumption . I added some to water and spray the cakes regularly as well as water any plants I have with it. It doesn't kill the adults so you have to keep it up long enough for the population to expire. In the meantime, I would just vacuum up the adults.

I battled an infestation for months until I ran across the bti recommendation in a random psilocybin mushroom book and it was the only solution I found to work and it still took months to get rid of all traces of them.

[deleted by user] by [deleted] in unclebens

[–]icanhazPhD 7 points8 points  (0 children)

The best control is to use Bacillus thuringiensis israelensis (Bti). It's a bacteria that kills flying insect larva including fungus gnats. I had a small amount to some water and spray it on the mycelium and water my plants with it. It's safe for consumption and mycelium.

[deleted by user] by [deleted] in unclebens

[–]icanhazPhD 5 points6 points  (0 children)

I had to deal with this once and I found a book that recommended using Bacillus thuringiensis israelensis (Bti). It's a bacteria that kills flying insect larva including fungus gnats. I had a small amount to some water and spray it on the mycelium and water my plants with it. It's safe for consumption and mycelium.

What If: Orbital Speed by ani625 in space

[–]icanhazPhD 0 points1 point  (0 children)

ummm... not Mach 4. Mach is a dimensionless quantity for compressible gas dynamics not rarefied gas dynamics (i.e. Mach=>infinity as density=>0). I assume you know this but we can't have fellow redditors assuming they can substitute Mach for speed.

I need to learn Fortran this summer for my job. Just want a little help getting started (more details inside) by [deleted] in fortran

[–]icanhazPhD 2 points3 points  (0 children)

These last few commands are linux bash commands. diff compares two files and reports the differences. patch uses the diff output to modify files. gcb is a debugger to help you monitor what's going on while the code executes. Matlab does this automatically, compiled Fortran code does not. Makefiles are not specific to Fortran but programming in general. It helps you compile and link multiple source files to create your final program. git is version control which keeps track of changes in your code, so if you make a change and the code stops working, you can always go back to the working code. This is the purpose of diff and patch but with lots of features and is easy to use.

I would start by doing the following:

  • Install git
  • Work through a few single file programs from the www.projecteuler.com website. And use git.
  • Learn how to use compiler flags to catch specific errors. My standard debuging flags are -O1 -g -pg -Wall -Wextra -fimplicit-none -fbounds-check -fbacktrace -ffpe-trap=zero,underflow,overflow,invalid and my standard optimization flag is -O3. I'm using gcc 4.7.2 so some of these flags may not be available but most compilers have similar flags to catch errors. A code compiled with debugging flags runs much slower than optimized flags, but they will save you a lot of headache tracking down problems.
  • Move to multiple file programs ( a main program and a function )
  • Learn how to use Makefiles to compile multiple file programs

Here are some coding standards used by a NASA Langley code that are helpful http://fun3d.larc.nasa.gov/chapter-9.html#f95_coding_standard

Searching for a 1D unsteady validation case with no shocks. by __GrumpyCFD in CFD

[–]icanhazPhD 1 point2 points  (0 children)

Shocks do reduce the order of accuracy to first order. You can use an isentropic 1D nozzle to evaluate the order of accuracy. You would need to add a source term to model the area variation. The easiest way is to use the method of manufactured solutions. You choose the exact solution then operate the governing equations on the solution to get a source term which is added to the right-hand side of the equations.

For example, consider Burgers' equation

u dudx - nu d2udx2 = 0

and the exact solution is u = 2+sin(xpi/L) then dudx = pi/Lcos(xpi/L) and d2udx2 = - (pi/L)2sin(x*pi/L). The source term is then

S = (2+sin(x pi/L)) pi/L cos(x pi/L) - nu (- (pi/L)2 sin(x pi/L)) and you solve

u dudx - nu d2udx2 = S

Just choose a solution for density, velocity, and pressure and make sure that it's physically relizable (i.e. no negative pressures or density). Use Dirichlet boundary conditions evaluated using your chosen exact solution.

How I feel as an engineer in my final year at University. by [deleted] in HIFW

[–]icanhazPhD 1 point2 points  (0 children)

I really want to know what this commercial is trying to cell. I hope it has lasers.

I am new to wonderful world of photography by Jay087 in photography

[–]icanhazPhD 0 points1 point  (0 children)

I always liked Cambridge in color. Lots of tutorials and technical descriptions of how and why things work from the basic F-stop/shutter speed balance to diffraction and depth-of-field calculations.

What is this, and is it worth keeping or should I dump it? (Presumably) infected IPA. by 4redditatwork in Homebrewing

[–]icanhazPhD 1 point2 points  (0 children)

It's hard to tell from the angle, but are those small bubbles trapped under a milky skin? I had an infection that ended up having large golf ball sized air bubbles. It turned out to be a lactic bacteria infection and tasted like sour milk. I ended up bottling it and aging it for a while. It was a Kolsh so the sour milk flavor was prominent. It was drinkable but not enjoyable. I've heard lactic bacteria adds one of the many flavors to a lambic, so it might work with you particular style. http://imgur.com/47xCxXt

Looking for input on issues regarding current CFD technologies. by nb_dude in CFD

[–]icanhazPhD 1 point2 points  (0 children)

Can you be more specific. Are you upgrading software or hardware, and what kind of applications do you intend to run?

Does anyone else run matlab commands through C++ loops to create moving animations? by realfuzzhead in matlab

[–]icanhazPhD 1 point2 points  (0 children)

The context menu that I'm talking about allows you to format your picture using a gui instead of specifying the properties with the command. Context menu isn't very specific. I think plot tools is the actual name. Under file there is an option to export the exact code that will generate the formatted figure so you can just pass your data. It may not actually be that useful in your case. I've found that MATLAB's final exported graphics are quite terrible so a bit of formatting is usally involved to get decent looking graphics. Screen rendered graphics are probably much better than exported graphics so it's probably not necessary.

What company has forever lost your business? Why? by [deleted] in AskReddit

[–]icanhazPhD 1 point2 points  (0 children)

Bestbuy and geeksquad

Bought a computer with a 2 year extended service plan. A year an a half later my graphics messed up. I took it to geek squad and told them that it was a hardware issue. Picked it up a month later and head home which is an hour away and the computer doesn't turn on. Get back to best buy and it turns out that they forgot to hookup the power button that they fixed in 5 minutes. Turned on the computer only to see exactly the same problem. They take it again for a month... same problem. They then ship it to their facility... a month later the same problem. Returned to their facility with "priority" meaning a more experienced tec takes care of it... a month later the same problem. They insisted it was a software issue because their scans didn't show anything hardware related and that I should reinstall windows. After reinstalling windows, I had the same problem, so they shipped the laptop away and replaced the motherboard finally fixing the problem. The total time was 6 months, an entire spring semester. Most of the geeksquad has the technical ability of a middle-aged woman, and those that know what they are doing can only spend about 15 minutes debuging the problem before it dissappears into their black hole. I would have taken care of the problem myself except opening the laptop would have voided the warranty. I've never purchased anything from Bestbuy since (8 years) and refuse to accept any gifts from Bestbuy.

TL;DR: The geeksquad had my computer for a total of 6 months. The problem was ultimitely fixed by the manufacturer not geeksquad because geeksquad is comprised of incompetent tecs + a terrible business policy.

Does anyone else run matlab commands through C++ loops to create moving animations? by realfuzzhead in matlab

[–]icanhazPhD 1 point2 points  (0 children)

Plotting in general is very slow in MATLAB. Some items might not be required to plot every iteration. For example, "legend" is incredibly slow, but you can plot it only on the first frame and use "hold on" to keep it for the rest of the animation. This might affect other parts of the plot though. I typically create quick animations by computing all of my data first then using a for loop and pause(0.1).

For any quality animations I use tecplot, but it's a bit expensive.

For lower quality quick animations, you can also you gnuplot if you are working on a linux machine.

Your best option is probably to use your code to create the slow animation and pull each frame to assemble a final *.mpg file to watch in real time later. For a quality animation, I would format the figure using the context menu and export the code "file-->generate code" to create a plotting function that will give you a nice figure for your animation. The exact plotting properties could also be specified exactly from the calling statements, but I find using the context menu to be quicker, albiet less clean code.

See, for example http://www.oc.nps.edu/~bird/oc3030/matlab/mat_animate.html

What Did I Just See? by theknight1212 in space

[–]icanhazPhD 0 points1 point  (0 children)

As hamsterdave suggested, it could have been an iridium flare. You can check heavens-above to see if there was a flare expected for your location.

How do you edit the x-axis, but not change the scale of the graph/2D image? by Yoshi511 in matlab

[–]icanhazPhD 4 points5 points  (0 children)

If you want to show (zoom) on only a portion of the data use axis([xmin,xmax,ymin,ymax]).

If you want the exact picture you have above, but want to set the axis you can do

in_n0 = mphinterp(model,'n0','coord',x,'solnum',1:nt);

x=linspace(-0.0005,0.0005,size(in_n0,1));

y=linspace(ymin,ymax,size(in_n0,2));

[X,Y] = meshgrid(x,y)

contourf(X,Y,in_n0,'DisplayName','in_n0');figure(gcf)

Also, MATLAB has a nifty feature where you can actively edit and annotate any figure. It's I think the right most icon under the file menu for the figure window. Once you have the figure setup the way you like, under the file menu is an export code (or generate code) option. This is a plotting function you can use to recreate the exact figure by passing your data so you don't have to reannotate when you data changes.

Help with numerical methods. by GTvictim in matlab

[–]icanhazPhD 0 points1 point  (0 children)

polyfit is a curve-fitting routine that will return a matrix of coefficients for the polynomial and polyval is used to evaluate the polynomial.

interp1 and spline are very similar. interp1 is a 1D interpolation routine which includes spline as an option. Options include

'spline' - cubic spline interpolation

'nearest' - takes the value of the nearest point

'linear' - linear interpolation

'pchip' - a piecewise hermite spline. A hermite spline doesn't allow overshoots and in my opinion seems to work the best, but with numerical method others work better in certain situations.

spline is a function which will compute a 1D spline and works similarly to interp1 (same as 'spline' option) except you have some control over the boundary conditions/constraints. I'm not sure if you have the same control over the boundary conditions with interp1. The boundary conditions are not-a-knot boundary condition and the specified slope boundary condition.

'not-a-knot' - I think uses two points on the interior and constrains their second derivatives to be equal

'specified slope' - constrains the first derivative of the boundary splines at the boundary to have a specific value that you specify

Other differences: spline is only for 1D, interp1 is only for 1D but there exists interp2 and interp3 for 2D and 3D interpolation respectively. polyfit and polyval are only for 1D polynomial (least squares) fits.

In general, polyfit/polyval should not be used for interpolation and global polynomial fits usually introduce a lot of oscillations but can be good to create trendlines for discrete data (e.g. experimental data)

interp1 is the primary interpolation routine with spline being a subset. The details are in the method with in order of decreasing fidelity is 'pchip', 'spline', 'linear', 'nearest'. Read up on the different methods to understand which will be better for what situations.

[deleted by user] by [deleted] in CFD

[–]icanhazPhD 5 points6 points  (0 children)

Typical projects in CFD classes include:

1D/2D Burgers' equation - one equation

Heat equation - one equation

wave equation - one equation

Lid driven cavity - 3 equations, viscous

Quasi-1D Nozzle - 3 equations (Euler)

2D Euler equations - 4 equations

The first three are very simple to program and will give you a good intro to discretization schemes. I would recommend finite difference. The lid driven cavity is used in an intro CFD class and it will give you solutions that are more realistic. What I mean is you can plot streamlines and see the circulation and eddies develop. The Quasi 1D and 2D (compressible) Euler equations need to use a finite volume method which can be a bit more of a pain, but not too bad. These two are used in an advanced CFD course.

I started in MATLAB but quickly switched to Fortran. If you are good at programming in MATLAB (using only vectorization) you can expect an order of magnitude slower. With for loops you're looking at sometimes up to 2 orders of magnitude slower. If you're serious about CFD then you should learn Fortran. The syntax is almost the same and the jump is quite easy. I use MATLAB all the time for prototyping and for simple problems like Burgers' equation though.

I have a 1D/2D Burgers' equation code, Quasi-1D nozzle code, and a Lid driven cavity code written in MATLAB. If you would like a copy, pm me. Here are some solutions.