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

Answered
How can I solve the following PDE?
MATLAB allows you to integrate backwards in time simply by defininig tspan starting with T and ending with 0. And why do you sa...

3 years ago | 0

Answered
Attempting to solve 2 unknown functions using matrix method
Now you have to solve a linear system A*T = B. If k becomes temperature-dependent, your matrix A becomes dependent on T and you...

3 years ago | 0

| accepted

Answered
I'm trying to compare a cell array to a single vector.
DestinationData = {'ATL','DAL','FFT','JBU','SWA';... 'EWR','UAL','FFT','JBU','NKS';... 'PHL','AAL','FFT','JBU','SWA';....

3 years ago | 0

Answered
1D Finite volume scheme for river flow
Take a look at https://www.clawpack.org/gallery/pyclaw/gallery/sill.html https://www.clawpack.org/riemann/Shallow_water_Rieman...

3 years ago | 0

| accepted

Answered
Function behaves unexpectedly on array inputs. To improve performance, properly vectorize your function to return an output with the same size and shape as the input arguments
f4 = @(x,y) (x.^2-1).^2+(y.^2)-(3*y)+1; instead of f4 = @(x,y) (x.^2-1)^2+(y.^2)-(3*y)+1;

3 years ago | 0

| accepted

Answered
Integration using BVP4C
close all clc p=1; P1=2; P2=2; b1=0.00021; b2=0.000058; S1=0.005; S2=580000; G1=2; m2=20; R1=997.1; R2=3; C1=1; R3...

3 years ago | 0

| accepted

Load more