# Tag Info

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 ...
• 246
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. ...
• 17.6k
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, ...
• 8,352
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 <...
• 6,066

### 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/
• 141
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. ...
• 181

### 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 ...
• 2,291

### 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 ...
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, ...
• 1,133

### 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 ...
• 11.6k
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.
• 8,696
Accepted

### Matlab struct vector

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

### 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 ...
• 121

### 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 ...
• 11.6k

### 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 ...
• 8,352
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 ...
• 1,876
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);
• 547

### 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 ...
• 2,291

### (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 ...
• 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.
• 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: ...
• 2,291
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 ...
• 2,291
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.
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 ...
• 8,696
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: ...
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 ...
• 261
1 vote

### Solving Time dependent Schrodinger equation using MATLAB ode45

Possibly this is what you want? ...
• 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 ...
• 136

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