Respondida
Adding 2D array to 3D array within loop
totalarray = rand(365,721,1440); newdata = rand(721,1440); squeeze(totalarray(1,:,:)) newdata for i = 1:365 totalarray(...

casi 3 años hace | 0

| aceptada

Respondida
the value i am calling for from a matrix isnt changing although index is changing
You forgot to reset e to 1 after the while-loop.

casi 3 años hace | 0

| aceptada

Respondida
Error of "Integrand output size does not match the input size."
As written, Oper.rho .* (v_induced ./ Oper.Vinf) .* 0.5 .* (Oper.Vinf^2 - (v_induced .^2)); and Oper.rho .* (v_slipstream ./ ...

casi 3 años hace | 1

Respondida
Not able to get real solution through syst solve
Always plot the functions before solving for common points and set initial values for the variables according to what you see in...

casi 3 años hace | 0

Respondida
Fixed bed adsorption using pore diffusion model
The "dq/dt" in equation 2 is the change of mass of q in the particle with respect to time. If you set q_in_particle = integral_...

casi 3 años hace | 0

| aceptada

Respondida
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...

casi 3 años hace | 1

| aceptada

Respondida
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...

casi 3 años hace | 0

Respondida
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...

casi 3 años hace | 0

| aceptada

Respondida
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; ...

casi 3 años hace | 1

| aceptada

Respondida
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...

casi 3 años hace | 0

Respondida
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 ...

casi 3 años hace | 1

| aceptada

Respondida
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? ...

casi 3 años hace | 0

Respondida
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_...

casi 3 años hace | 0

Respondida
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....

casi 3 años hace | 0

Respondida
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...

casi 3 años hace | 0

Respondida
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(:...

casi 3 años hace | 0

Respondida
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...

alrededor de 3 años hace | 0

| aceptada

Respondida
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...

alrededor de 3 años hace | 0

Respondida
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...

alrededor de 3 años hace | 0

Respondida
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' ...

alrededor de 3 años hace | 1

| aceptada

Respondida
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 ...

alrededor de 3 años hace | 1

| aceptada

Respondida
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...

alrededor de 3 años hace | 0

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

alrededor de 3 años hace | 1

Respondida
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...

alrededor de 3 años hace | 0

| aceptada

Respondida
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...

alrededor de 3 años hace | 3

| aceptada

Respondida
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 ...

alrededor de 3 años hace | 0

Respondida
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...

alrededor de 3 años hace | 2

| aceptada

Respondida
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...

alrededor de 3 años hace | 0

Respondida
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)

alrededor de 3 años hace | 1

| aceptada

Respondida
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 ...

alrededor de 3 años hace | 0

Cargar más