Beantwortet
Solve integral equation efficiently
nu = 1.04 * 10^(-6); %m2/s Aplus = 26; kappa = 0.41; z = 0.3; meanU = 4.3556e-04; fun = @(x) 2 ./ ( 1 + sqrt( 1 + 4 * kap...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
How to use a sparse Jacobian for a stiff ODE solver to avoid the error "array exceeds maximum array size preference"
Here is an example code how to create the sparsity pattern for a given (quite complicated) ODE function. Use the function "S_pa...

fast 3 Jahre vor | 0

Beantwortet
How to use "deval" or any other function non ode solver output
Y_exact_to_Y = interp1(T_exact,Y_exact,tout) where T_exact is the vector of time points corresponding to Y_exact. Further, you...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to Solve PDE numerically that gives boundary condition on function at one end and on slope of function at other end?
a = 1; p = 1; w = 1; r0 = 0.5; rstart = 0; rend = 1; nr = 50; zstart = 0; zend = 1; nz = 50; ...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
How can I solve the differential equation whose variables are y"(i), y"(i+1)?
Use dde23. But often, such dependencies of the ODE from the results of the last time step stem from a discretization of the dif...

fast 3 Jahre vor | 0

Beantwortet
Maximizing Batch Reactor Products in matlab
You get almost identical values for the optimal T, C_M and C_TEA for all x-values in between 17 and 45 as you can see after the ...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
Using a symsum inside a fsolve
If I understood correctly, I would have to run a Symsum "nested" inside the fsolve. Is that correct? How do I implement this? ...

fast 3 Jahre vor | 0

Beantwortet
Maximizing Batch Reactor Products in matlab
max_value = -Inf; T_array = linspace(338.15,368.15,10); C_M_array = linspace(1,100,10); C_TEA_array = linspace(1,200,10); C_...

fast 3 Jahre vor | 0

Beantwortet
How to Interpolate an entire data set
I think you interchanged latitude and longitude in your call. It should be Anew= F(-6.00,52.00); instead of Anew= F(52.00,-6....

fast 3 Jahre vor | 0

Beantwortet
Which triangulation Method is used for natural scattered interpolation?
Taken from https://uk.mathworks.com/help/matlab/ref/scatteredinterpolant.html Algorithms scatteredInterpolant uses a Delaunay...

fast 3 Jahre vor | 0

Beantwortet
Why is it detecting 2 centroids in 1 object?
Are you sure you included the correct image file ? I = load("labelstemp.mat"); I = I.labelstemp; size(I,1)*size(I,2) nnz(I(:...

fast 3 Jahre vor | 0

Beantwortet
Indexing nearest value to my coordinate
lon_data = rand(621,837); lat_data = rand(621,837); stations = rand(59,2); lon_indices = zeros(59, 1); lat_indices = zeros(5...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
HOW TO: Using each step result in subsequent step during integration via ODE
All variables needed to compute p(t) are part of the solution vector x which is input to "gearCH". So I don't see the problem to...

fast 3 Jahre vor | 0

Beantwortet
How to Solve PDE numerically that gives boundary condition on function at one end and on slope of function at other end?
This is the stationary 2d Laplace equation. It cannot be solved by a 1d-solver like pdepe. You will have to discretize the PDE...

fast 3 Jahre vor | 0

Beantwortet
Programming error with a model function
If your system of differential equations really reads y1' = y2' y2 = A/B * t * y1 it follows y2' = A/B * y1 + A/B * t * y1' ...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
Using of symprod fuction
Nv=[0 5 1 17 4 8 9]; Nb=[1 1 1 1 1 1 1]; Sb=[25 28 32 36 35 38 0]; n = numel(Nv); % Easy to follow Z = 0; for i = 1:n-1 ...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
Network adjacency matrix for connecting n node with probability p
clc; clear all n=10; p=0.4; adj_matrix = generate_adjacency_matrix(n, p) (nnz(adj_matrix(:))-n)/(n^2-n) function adj_matri...

fast 3 Jahre vor | 0

Beantwortet
Solving two exponential equations
syms T eqn = 5/19*(5021747384670633/8796093022208 - (191*exp(-609699130650934272/(622444614725399*T)))/10) ==... 5/27*(3...

fast 3 Jahre vor | 1

Beantwortet
System of PDE-ODE with multi point boundary conditions- How to can i solve it?
% Set physical parameters L = [160 10 25 10 160]*1e-6; % [m] MEA layer thicknesses kt = [1.6 0.27 0.3 0.27 1.6]; % [W/mK] Ther...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Plotting two non linear equations in same graph
t= linspace(0,1); y= linspace(0.5,1); [T, Y] = meshgrid(t, y); f1 = @(t,y)(y - ((t.^8 - 8*t.^7 + 36*t.^6 - 96*t.^5 + 146*t.^4...

fast 3 Jahre vor | 3

| akzeptiert

Beantwortet
Solve symbolic equation in order to get parameters of an equation
syms phi(t) p(t) syms R L K J V b phi0 p0 real eqn1 = diff(phi,t) == -R/L * phi - K/J * p + V; eqn2 = diff(p,t) == K/L * phi ...

fast 3 Jahre vor | 0

Beantwortet
Failing parameter estimation using fmincon. Objective function is undefined at initial point.
Before calling fmincon, add the line objective_function(p_initial) and see what your function returns. My guess is Inf or NaN...

fast 3 Jahre vor | 2

| akzeptiert

Beantwortet
Converting probability distribution plot into a histogram
Use https://uk.mathworks.com/help/stats/gprnd.html to compute random numbers from the Pareto Distribution if you know its para...

fast 3 Jahre vor | 0

Beantwortet
how to check if two symbolic fractions are the same?
syms x y z fraction1 = (x+y)/(x*y) + z; fraction2 = (x+y+x*y*z)/(x*y); isAlways(fraction1==fraction2)

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
Problem when using pdepe with time dependant and nonconsistent boundary conditions
If you specify the gradients of the solution variables as boundary conditions (as you do in your boundary function), you cannot ...

fast 3 Jahre vor | 0

Beantwortet
Computing expint(x), where x is an array, locks up for some x but not others that are very similar
The computation of the second column is even faster. I wonder how matlab evaluates expint(x) if x is a vector different from eva...

fast 3 Jahre vor | 0

Beantwortet
Error L2 is not defined
Since g does not depend on w and f does not depend on z, the equations are not coupled and you can do it in the following manner...

fast 3 Jahre vor | 0

Beantwortet
Problems in finding a set of global minima
L=1; L1=L/6; omega0 = 0; omegaR = 10; tR= (2*pi)/omegaR; te = 0.8; t1 = 0; t_i = te/50; gamma_i = 1; %alpha = (t_i^2)/...

fast 3 Jahre vor | 1

Beantwortet
NaN computed by model function, fitting cannot continue. Try using or tightening upper and lower bounds on coefficients.
a11 and a12 must be such that a11*C1 + a12*C2 > 0. Otherwise, the operation ^(n1-1) gives a complex result. The simplest exampl...

fast 3 Jahre vor | 0

Beantwortet
Skipping Iterations in a For Loop
FEM = [-16 16 -18 12 -6 6]; n = numel(FEM); for i = 1:n-3 FEM(i+1) + FEM(i) end FEM(end) + FEM(end-1)

fast 3 Jahre vor | 0

Mehr laden