Answered
Finding a nonlinear equation root
fun = @(x)cosh(x).*cos(x)+1; icount = 0; for i = 1:2:21 x0 = i*pi/2; icount = icount + 1; xroot(icount) = fzero(fun,x...

3 years ago | 0

Answered
Problen with optimization of two parameters, and with differential equations
All curves that stem from your model tend to sqrt(keq/(1+keq)). Since your measurement data tend to 0.5, my guess is that you ha...

3 years ago | 0

Answered
Problen with optimization of two parameters, and with differential equations
The parameters you want to fit are not independent. Since T remains constant, the complete expression k0*exp(-Ea/(8310*T))*cc*...

3 years ago | 0

Answered
How to use fmincon's constraintviolation option
Can you tell me what I'm doing wrong? You try to betray yourself that your problem has a solution. But it has none.

3 years ago | 1

| accepted

Answered
Solving Integral in matlab
syms s a=sym('1'); b=sym('71/100'); c=sym('53/100'); f = 1/((s+a^2)*(s+a)*(s+b)*(s+c)); F = a*b*c/2*int(f) limit(F-subs(F,...

3 years ago | 0

Answered
im looking for the error in the following code, please help
DalphaS = CaputoDerivative(S(1:n),alpha,dt); DalphaI = CaputoDerivative(I(1:n),alpha,dt); DalphaR = CaputoDerivative(R(1:n),al...

3 years ago | 0

Answered
Systems of Trigonometric Equation does not return any value
You get contradicting results for theta10. Thus your system is not consistent. format long AB = 105.58445229; CD = 16.557818...

3 years ago | 0

Answered
I couldn't match the index no., can anyone please help me to resolve this issue.
yita_mn has size 6x6, but your loop in which you access yita(i,j) runs for i = 1:16 and j = 1:16. And dy should be allocated as...

3 years ago | 0

Answered
Drawing a heatmap of the max value of a state variable against two parameters in the system
tspan = 0:0.01:100; y0 = [100000;0;0;1;0]; p = 0.001:0.001:0.01; eta = 0.001:0.001:0.02; for i = 1:numel(p) for j = 1:num...

3 years ago | 1

| accepted

Answered
volume of a packed bed reactor
One main error in your code is that you use variables that you define later on. Programming works sequentially: If you define a...

3 years ago | 0

| accepted

Answered
Finding random normally distributed number above zero
Maybe taking abs(randn()) will give you something useful. It's the folded normal distribution (which in this case equals the tru...

3 years ago | 0

Answered
Need to remake this optimize function to be efficient takes way to long currently
You can easily solve when det(m) = 0 in advance and insert the formula in your code. This will enhance speed enormously: syms p...

3 years ago | 1

Answered
numerical integration of array
lam = 0.5; nCk = @(n,kVec,z)arrayfun(@(k)nchoosek(n,k)*exp(-lam*k*z),kVec); integral(@(z) nCk(10,1:5,z),0,1,'ArrayValued',true...

3 years ago | 0

| accepted

Answered
ode45 how to write differential equation (within function) that incorporates itself at previous time stamp
This is a delay differential equation. Use dde23 to solve. What are the variables you solve for in the equation dIdt = V*S+ep...

3 years ago | 0

Answered
calculate integral of this function
F1 = double(int(dM_dH^2/cos(theta),x,0,Pi)) instead of F1= integral(@(x) (dM_dH).^2/cos(theta),0,Pi)

3 years ago | 0

| accepted

Answered
Seventh order differential equation
% Set model parameters l = 1; P = 1; Ga = 1; Eatilde = 1; ha = 1; E1tilde = 1; h1 = 1; E2tilde = 1; h2 = 1; xmesh = ...

3 years ago | 1

| accepted

Answered
Ode45 calling a matrix and an array in a function
Your arguments to q_dot are inverted: Use function q_dot = q_dotf(ts,q) instead of function q_dot = q_dotf(q,ts) And note t...

3 years ago | 0

| accepted

Answered
Stability analysis of a non-linear ODE system
syms Sci C Sr Sh R Cf Cp Ce E HR H Sp P k1 k2 k3 k4 k5 k6 k7 k8 k9 k10 k11 k12 k13 k14 k15 k16 p1 p2 p3 mu eta alpha theta CL F...

3 years ago | 1

Answered
How to solve the parameters of a diffusion model?
Make a code to determine the roots of your second equation. Make a code that evaluates the infinite sum to determine q_t from y...

3 years ago | 0

| accepted

Answered
The error is " Unrecognized function or variable 'Vmp' " on line 21, but i need to find the root of Vmp(which is -0.05). Can anyone help me with this??
A fixed point iteration for your function does not converge. Didn't you see this in your former question ? And if it worked, g ...

3 years ago | 0

Answered
Summing scattered data over a 2D grid
format long % Generate random coordinates and concentrations n = 100000; x = -0.5+rand(n,1); y = -0.5+rand(n,1); conc = 10*...

3 years ago | 1

| accepted

Answered
I need the maximum power to be -0.05 but my output is -3709.4691. Does anyone have any tips?
% Given values Voc = 0.5; % V T = 297; % K q = 1.6022e-19; % C kB = 1.3806e-23; % J/K a=q/(kB*T); % Define the function f...

3 years ago | 0

Answered
solve the mass spring system where the mass matrix depends explicitly on time
Setting y1' = y3 and y2' = y4, you arrive at the following code: M = @(t) [t 0; 0 t]; K = [2 1;5 8]; MM = @(t)[eye(2),zeros(2...

3 years ago | 0

| accepted

Answered
Write a matlab function for approximating the value of pi (certain equation)
You sum twice. And (2*n-1)^2*(2*n+1)^2 = (4*n^2-1)^2 Either use n = 20; p = 0; for k = 1:n p = p + 1/(4*k^2-1)^2; e...

3 years ago | 1

| accepted

Answered
How to calculate and plot ndefinite triple integral?
s = 0.1; a = 0:5:360; a = a*pi/180; fun = @(x,y,z,p) x.*z./(x.^2+y.^2+z.^2).*exp(-0.5*(x.^2+y.^2+z.^2)).*exp(1i*x*(s*sin(p)/s...

3 years ago | 0

| accepted

Answered
How to solve the system of inequalities with MATLAB
syms kv real s=solve( (9000000000*kv^3)/3222118333 + (750000*kv)/2181529<0,kv,'ReturnConditions',true)

3 years ago | 0

Answered
Trapezoidal quadrature weights from nodes
Both quadrature weights are 0.5, aren't they ? 1/(x1-x0) * integral_{x=x0}^{x=x1} f(x) dx ~ 0.5*f(x0) + 0.5*f(x1)

3 years ago | 0

Answered
How to solve systems of ode in matlab?
Your code should somehow look like this. Fill in the details. nx = 11; ny = 11; Lx = 0.1; Ly = 0.1; dx = Lx/(nx-1); dy = L...

3 years ago | 0

| accepted

Answered
I need to get the hysteresis loop from the memristor and cantilever equations and I have the following code.
As you can see from your code, variable "amp2" is undefined.

3 years ago | 0

Answered
Insufficient number of outputs from right hand side of equal sign to satisfy assignment. Error in test14>@(x)[g1(x);g2(x);g3(x)] (line 49) nonlcon = @(x) [g1(x); g2(x); g3(x)
nonlcon has two output arguments, not only one as set in your code: nonlcon = @(x) [g1(x); g2(x); g3(x)]; It will be easiest t...

3 years ago | 0

Load more