Hot answers tagged

13 votes
Accepted

Alternatives to Comsol Multiphysics

Not sure if you find the COMSOL Model Wizard somewhere else, maybe other commercial Multi-physics software but not in the open-source community. I had the same question a couple of years ago and I ...
user avatar
  • 246
8 votes
Accepted

Computational time not proportional to integration interval in ODE-solver?

Substantially edited, since the original poster changed his equation... In general, the MATLAB (and Octave) ODE solvers dynamically adjust the step size as needed to maintain an accurate solution. ...
user avatar
6 votes
Accepted

Finite difference method basic implementation on Octave

Summarizing and formulating the answer: (part of it was already given in the comments by user14717, Christian Clason, and Kirill) While performing numerical differentiation using finite differences, ...
user avatar
  • 8,352
4 votes
Accepted

Nice plot of f(x)

Using Python and mpmath: import matplotlib import mpmath f = lambda z: z**3-z+1 mpmath.cplot(f, points=100000) Easy peasy.... See here for the documentation on <...
user avatar
  • 6,066
4 votes

Alternatives to Comsol Multiphysics

You might also want to have a look at: Elmer https://www.csc.fi/web/elmer Kratos http://www.cimne.com/kratos/ OpenFoam http://www.openfoam.com/ CaeLinux http://caelinux.com/CMS/
user avatar
  • 141
4 votes
Accepted

BLAS libraries for Octave or Matlab, preferrably with GPU support?

Among open-source BLAS, as far as I know, OpenBLAS (http://www.openblas.net/) is the best option. The website has a DGEMM benchmark, comparing against MKL (see below) and the reference Fortran BLAS. ...
user avatar
3 votes

How can I extract the banded or block diagonal part of a sparse matrix in MATLAB?

(This answer is valid for both MATLAB and Octave, even though I mainly refer to MATLAB) There are two beasts to slay; but let's first understand the underlying data structure. MATLAB and Octave store ...
user avatar
3 votes

How to vectorize 2 nested for loop with one complex condition in the inner loop?

Another approach is to use the fact that true is equal to $1$ and false is equal to $0$. If both conditions in the ...
user avatar
3 votes
Accepted

Plot a multi-variable equation in (discontinuous) regions

First, you originally wrote that your equation is $\cos(K)=5 \text{ sinc}(5.12\sqrt{E})- \cos(5.12\sqrt{E})$, but you clearly meant $\cos(K)=5 \text{ sinc}(5.12\sqrt{E}) + \cos(5.12\sqrt{E})$ Second, ...
user avatar
  • 1,133
3 votes

BLAS libraries for Octave or Matlab, preferrably with GPU support?

MATLAB already comes with Intel MKL for its BLAS implementation. There's no reason to replace that. As for using GPUs, if you make your array a gpuArray (to do ...
user avatar
3 votes
Accepted

denoting a variable as a matrix using octave syms package

I don't think Octave's syms package supports this kind of matrix algebra operations, but you can do that in Mathematica. EDIT: and also in Sympy.
user avatar
3 votes
Accepted

Matlab struct vector

You can do something like this in Matlab: N = 1e4; c = []; c.x = [0 1]; c(1:N) = c;
user avatar
  • 3,673
2 votes

fmincg implementation in Python

I assume you didn't specify the fprime parameter. If you don't provide this param fmin_cg has to figure out its own solution ...
user avatar
2 votes

Is it possible to use Octave to learn MATLAB programming?

The best free language which has MATLAB-like syntax is Julia. It's also faster and has a more extensive package system (among other reasons why it's better...), but the linear algebra syntax is almost ...
user avatar
2 votes

eigs routine in octave

As per the submitted bug report, there was a bug in ARPACK < 3.1.5 regarding dneupd, the subroutine that "returns the ...
user avatar
  • 8,352
2 votes
Accepted

Plot 2D piecewise constant in matlab in a finite elements mesh

I use typically the following approach. The idea is to make a new mesh where every vertex is duplicated so that each triangle has its own copy. Then you can use standard trisurf command to the ...
user avatar
  • 1,876
2 votes
Accepted

How to vectorize 2 nested for loop with one complex condition in the inner loop?

rmid = 0.5*(r_int + r_ot); rlen = 0.5*(r_ot - r_int); cc = double(abs(circ - rmid) <= rlen);
user avatar
  • 547
2 votes

Minimizing vector norm without using symbolic packages

You shouldn't be using symbolic package for this task. Also your usage of ones is going to produce n-by-n matrix of ones - which is not what you intended. Given the ...
user avatar
2 votes

(Lack of) Availability of Finite-Difference library for simple 2D PDEs

It seems hard to write a general enough FD library thas has wide applicability, since FD methods are not as easy to write for general domains, unlike FEM which uses unstructured grids, for which there ...
user avatar
  • 2,983
1 vote
Accepted

Plotting two data sets in Octave

Use plot(x,[y1;y2]) but make sure that y2 is of the same size as y1, because in your example that isn't the case.
user avatar
  • 720
1 vote

GNU Octave: using 'parallel' with an array (apply function to each array member)

I can not reproduce the error. Here is the snippet I am using: ...
user avatar
1 vote

Rem function in Octave showing wrong result

$0.1$ is not exactly representable in double precision arithmetic, and it will be rounded. The double precision representation of $0.1$ is $\verb|00111111 10111001 10011001 10011001 10011001 10011001 ...
user avatar
1 vote

(Lack of) Availability of Finite-Difference library for simple 2D PDEs

I know this is a little bit late, but there's a third party library in Python which solve PDEs using FD, it is called findiff. Check it out.
user avatar
1 vote

surface: rows (Z) must be the same as length (Y) and columns (Z) must be the same as length (X) in octave

Double-check the documentation of mesh. temp3 must be a matrix of size length(temp1) x ...
user avatar
1 vote

denoting a variable as a matrix using octave syms package

You can define the elements of the matrix and then do the rest of the computations as intended. For instance: ...
user avatar
1 vote
Accepted

How to write in paper the equations given by splinefit?

I found the answer! Octave/MATLAB's function splinefit differs from polyfit in the sense that the polynomial in the former is ...
user avatar
  • 261
1 vote

Solving Time dependent Schrodinger equation using MATLAB ode45

Possibly this is what you want? ...
user avatar
  • 5,744
1 vote

Defining Cauchy principal value in MATLAB (or Scilab/Maple)?

You can do it in maple like this. First you need to specifiy the lower and upper limits. a, b, and ...
user avatar
  • 136

Only top scored, non community-wiki answers of a minimum length are eligible