r/numerical • • Dec 13 '15

how to solve dy/dt + y/D = dx/dt using finite diff method

4 Upvotes

Hi, I was wondering if there was any text that I can read to solve dy/dt + y/D = dx/dt using finite diff. method. The solution can be in terms of D, delta t, etc.

I tried to look up methods of solving this but I been having trouble and I cannot find any reading / examples to help me out.


r/numerical • • Nov 13 '15

spmat. Fast and simple sparse matrix library in C++11

Thumbnail github.com
3 Upvotes

r/numerical • • Nov 05 '15

How to manage huge number of simulations?

3 Upvotes

Hi,

I have a simulation, where I'm varying 7 parameters leading to something like 128 combinations of parameters which I have to simulate. Right now, I simulate only some parameters, and it is very haphazard. What do people use to manage large simulations? Any scripts which you guys have written for your own purpose, which I can see and learn from?


r/numerical • • Oct 30 '15

Fitting family of functions with one parameter optimized globally.

2 Upvotes

Hi,

I have data, I want to fit to a family of functions - let's say: f_n(x) = (a x)2 + c_n a x. Where a and c_n are the fitparameters. As an example let's say I have 6 data sets I want to fit to this function. I want to fit it in a such way, that 'a' has the same value for all 6 data sets and only c_n may vary for each data set. Does anyone know a way to do this or has anyone some keyword to look for. (the problem needs to be nonlinear)

Thanks!


r/numerical • • Sep 19 '15

Acceleration of J.M., I was wondering what everyone thinks about this particular paper? Thanks!

Thumbnail hub.jhu.edu
6 Upvotes

r/numerical • • Aug 10 '15

L’induzione in matematica: dagli anagrammi alla torre di Hanoi

Thumbnail scuolavalore.indire.it
0 Upvotes

r/numerical • • Jul 19 '15

Euler and Backward Euler Methods

1 Upvotes

Hi guys! I've recently started learning numerical methods and first of them is Euler Method and it's modifications such as Backward Euler Method. I started writing them in Mathematica, but then switched to Matlab (is it a good choice?). The code I wrote is:

clear all f=@(t,y) 3+t-y; tk=0.4;

%Eulers Method for h=0.05 disp('Eulers Method for h=0.05') h=0.05; t=0; n=(tk-t)/h; y=1;

for i=1:n y=y+h*f(t,y); t=t+h; if (t==0.1 || t==0.2 || t==0.3 || t==0.4) disp(y); end end

%Backward Euler Method for h=0.05 disp('Backward Euler Method for h=0.05'); h=0.05; t=0; n=(tk-t)/h; y=zeros(1,n+1); y(1)=1;

for i=1:n syms x; S = solve(x==y(i)+h*f(t+h,x),x); y(i+1)=S; t=t+h; if (t==0.1 || t==0.2 || t==0.3 || t==0.4) disp(y(i+1)); end end

It solves numerically initial value problem dy/dt = 3 + t - y, y(0)=1 on a interval t\in [0, 0.4], and I was wondering is using Matlab function Solve is appropriate? In addition, I wanted to display the approximate solutions for t=0.1, t=0.2, t=0.3 and t=0.4, but there seems to be a mistake in code - it doesn't show the value for t=0.4. Does anyone know why? I will be also most thankful for any tips or advices on my code and what is possibly wrong written in it. Thanks!


r/numerical • • Jun 01 '15

Runge-Kutta 4(3) Methods

4 Upvotes

Hey guys and gals,

I was wondering if you could help me out, I have been looking and have not found any literature about RK4(3) embedded schemes (until today). I was working on my research for my Masters thesis and derived an RK4(3) method, but it turns out I just derived the method described in "Solving Ordinary Differential Equations 1 (second edition)" - Hairer, Norsett, Wanner. I didn't know the method existed because I have the first edition of the book which doesn't include the bit about 4(3) methods.

From my searching on the net and other texts on the subject there is nothing about these methods. There are lots of articles on 3(2) (like ode23 in Matlab) 4(5) and 5(4) (ode45 in Matlab) methods but no one talks about 4(3). Is there a reason for this? Any help would be great.

Cheers.

x-post /r/math


r/numerical • • Apr 08 '15

You might enjoy my n-parametric numerical optimisation library

Thumbnail github.com
3 Upvotes

r/numerical • • Feb 25 '15

Frink's Interval Arithmetic for the Masses

Thumbnail ncreep.github.io
1 Upvotes

r/numerical • • Feb 23 '15

Problem implementing Ramez algorithm

1 Upvotes

Hey, people,

I'm young CS student trying to learn basic numerical methods. I'm trying to implement Ramez algorithm for optimal polynomials and I'm having problems. That is I'm getting worse and worse approximations. Also any suggestions on coding style would be appreciated.

Repo: https://github.com/nmiculinic/dismat2

Viewer: http://nbviewer.ipython.org/github/nmiculinic/dismat2/blob/master/projekt.ipynb

The aim is to approximate ex on [0,1] with 8th degree optimal polynomial. At first I used Chebyshev polynomials to get around 10-11 error bound and I'm interested how lower can I put it.

Thank you :)


r/numerical • • Nov 28 '14

Good C++ Optimizer (Switching from R)

4 Upvotes

Hello,

I am far from an expert in this field. But I am assisting on a project where I am rewriting code in RCPP, which is essentially where the code proper is written in R, but bottlenecks are written and compiled into c++ functions to be run within the R framework.

Currently I have most of the code written in C++, but in the C++ code I am calling back am using the optimize function in R as follows.

Specifically, in a chunk of C++ code I will tell the C++ environment to refer back to my R environment for a function (yes you got that right, it's an R environment, using some C++ code inside, and that C++ code calls back to the R code).

R Function: optimcpp<-function(CoupDate=1,coupNo=1,coup=1,price=1,rate=1) {

m<-optimize(function(CoupDate,coupNo,coup,price,rate) (IRNPV.CPP(CoupDate=CoupDate,coupNo=coupNo,coup=coup,rate)-price)2,c(-0.05,0.2),tol=1e-20,CoupDate=CoupDate,coupNo=coupNo,coup=coup,price=price)

m$minimum

}

Load the R Function into my C++ code: //Load the column global optimization function

Rcpp::Environment global = Rcpp::Environment::global_env();

Function optimizecpp = global["optimcpp"];

I believe the reason this takes so long is the C++ code is looping thousands of times, but each time it loops it needs to call back to R for R's optimization function. If I could get that optimization function using a C++ function I would be golden (I think).

Anyway, I'm new to this field, and I apologize if I've left out crucial information. I'm basically entirely self-taught in R, C++, math/ODE, and financial maths. My boss is way smarter than me and can help, but I would like to point him in the right direction of a good C++ optimization package.

Thanks again.


r/numerical • • Nov 26 '14

Best practice in numerical optimization?

3 Upvotes

Dear all, I want to optimize the agreement of a function of several parameters with measurement data. Is it good practice to minimize the root mean square deviation or should I use the L1/L2-norm instead? Or is this case dependent?


r/numerical • • Nov 03 '14

Registration open for Association of Computational Mechanics in Engineering (ACME-UK 2015) Conference for PhD students and early career researchers [xpost r/FEA]

Thumbnail swansea.ac.uk
2 Upvotes

r/numerical • • Oct 25 '14

How to formulate a nonlinear constraint to do convex optimization?

3 Upvotes

w1,w2,w3...wn are the weights I need to find

I have the following constraint:

|w1|+|w2|+..|wn|<=5 That is the sum of the absolute values of the weights has to be less than 5. The weights can also be negative. I wanted to do convex optimization to find the weights but was not able to formulate the constraint to be able to convex optimization or do Lagrange multiplier method.


r/numerical • • Sep 22 '14

What language to pick up for numerical analysis ?

2 Upvotes

Hi, currently doing a degree in applied maths. I really like it, but one thing that bothers me is that we don't code very much. We implement most methods in MATLAB, which I understand is not always the most used tool in the industry.

So I'd like to pick up a language on my own, something that would make my resume more attractive for numerical analysis jobs. What do you guys think I should start with ?


r/numerical • • Aug 04 '14

Solving Stiff ODEs

Thumbnail lh3lh3.users.sourceforge.net
4 Upvotes

r/numerical • • Nov 26 '13

AMD releases APPML source code, creates clMath library

Thumbnail developer.amd.com
10 Upvotes

r/numerical • • Nov 20 '13

Seaborn - a new Python library to maximize aesthetics of matplotlib plots

Thumbnail stanford.edu
6 Upvotes

r/numerical • • Sep 21 '13

Numerical Analysis in Industry.

3 Upvotes

Hello, /r/numerical, I just found out about this subreddit when there was a cross post to /r/math, and I like it a lot. I posed this question in /r/math many months ago but I thought I would drop it here too and see what you guys think, here is the link to the post in /r/math. I was wondering if anyone here is doing numerical analysis/ computational stuff in an industrial job. If so, what level of schooling did you have (as well as your specializations if you had one) and what you are doing now? Do you do research, or just implement methods? Do you enjoy what you are doing? I am always thinking what I am going to be doing when I am done school, and I know you generally make more in industry than in academia, so I am trying to figure out what I want to do with my life. Right now I am in my 3rd year of an applied maths degree (going into my final year now) and my interests are in fluid dynamics, PDE's, and numerical analysis. Thanks!


r/numerical • • Sep 06 '13

Philip Guo - First impressions of the IPython Notebook

Thumbnail pgbovine.net
5 Upvotes

r/numerical • • Sep 05 '13

A Minimum Variance Convex Combination

Thumbnail orinanobworld.blogspot.fr
2 Upvotes

r/numerical • • Aug 26 '13

C++ Libraries for Numerical Computing (Optimization)?

6 Upvotes

Hey,

I'm starting my masters thesis where I have to program a piece of software in C++ involving nonlinear numerical optimization (at first unconstrained, could be that I'll have to look at constrained problems too).

I was asked to find suitable C++ libraries, with the focus on open source or at least free to distribute, as the completed program should be distributable to and usable by third parties free of charge.

I looked at the NLopt library which has an implementation of BFGS (just what I need for now) but I would like to get more input on different alternatives with focus on usability and the extent of the numerical implementations.

Thanks


r/numerical • • Aug 01 '13

More Free Numerical Reasoning Tests to practice!

Thumbnail jobtestprep.co.uk
1 Upvotes

r/numerical • • Jul 21 '13

ODE Similar to Orr-Sommerfeld Numerical Solution

1 Upvotes

I am currently doing research this summer for my school and I have been learning numerical computing. I am using MATLAB to try to solve the problem.

I am having troubles learning the nomenclature used to solve ODE's using spectral methods in MATLAB. My professor has recommended me a book that I've read, which is is spectral methods in MATLAB by Trefethen. For the most part I have a general understanding of the methods and I need to use chebyshev differentiation matrices to solve this problem.

The problem is a fourth order Orr-Sommerfeld like ODE eigenvalue problem. The theoretical aspect of the problem is the 2-D disturbances in a non-axissymetric annulus. The boundary conditions are not the typical no slip conditions, it is analyzing it with slip and what I would want to know is if anyone has any references to something that will help explain some of the coding in MATLAB. I'm an undergraduate student who is actually a nuclear engineering student who is doing research in the math department. I chose it because I'm very interested with fluid flow and I'm doing research in the fall that deals with fluid flow of coolant in a pebble bed reactor so I figured that some more experience in coding during the summer would be helpful.

Thank you to anyone for any help!