Answered
How to plot duffing equation?( Frequency amplitude)
Give values to the parameters of the equation, rewrite the equation as a system of two first-order equations and use ode45 to so...

3 years ago | 0

Answered
Complex equation in MATLAB (control engineering)
Seems there are several solutions. Use [w_D T_t] = vpasolve(eqns,[w T],[1 1]) instead of [w_D T_t] = vpasolve(eqns,[w T]) ...

3 years ago | 1

Answered
Iterations until condition is met
ER = 50; gamma = 1.4; M = 1:0.00001:10; expr = (1./M) .* ((2/(gamma+1))*(1+((gamma-1)/2)*(M.^2))).^((gamma+1)./(2*gamma-2)) -...

3 years ago | 1

| accepted

Answered
how can I solve the problem Bellow with a three coupled PDEs , knowing that thoses equations represent the energy heat balance of a thermal energy storage system?
Choose a grid in x and r direction. Replace the spatial derivatives by finite difference approximations in the grid points. Inco...

3 years ago | 0

| accepted

Answered
optimization problem with interdependent variables
Use "fmincon". The primary optimization variable is k. Specify the lower bound for k to be 0 in the variable "lb". The object...

3 years ago | 0

| accepted

Answered
Detecting an error in Muller method.
The argument of the root in the calculation of x2 must become negative. Or simply start with complex values for x1,x2 and/or x...

3 years ago | 0

| accepted

Answered
Stability analysis of a non-linear ODE system
You won't succeed in this generality. To determine the eigenvalues, MATLAB had to solve for the roots of a polynomial of degree ...

3 years ago | 0

| accepted

Answered
error when trying to run fit function
Seems you gave your script the name "mpower.m". This conflicts with the built-in MATLAB function with the same name. Rename ...

3 years ago | 0

Answered
How to repeat a vector over and over?
a = rand(1,1023); a = repmat(a,1,ceil(50000/1023)); a = a(1:50000)

3 years ago | 1

Answered
Plotting a summation with two variables
t = linspace(0,0.1,100); x = linspace(0,1,100).'; n = 1000; f = @(t) sum(6./(pi+6*(0:n)*pi).*sin(x.*(0:n)).*exp(-(pi/6+(0:n)*...

3 years ago | 0

| accepted

Answered
How can I perform a summation of a freqz function
syms z k F = @(a) symsum(z^(-k),k,0,a); F(2)

3 years ago | 0

| accepted

Answered
using lsqnonlin with constraints
% A=2*(c(1)+c(2))==u this is the constraint i want to use Then optimize with one parameter c(1) and insert c(2) = u/2 - c(1) f...

3 years ago | 0

| accepted

Answered
Finding the truncation error in an infinite sequence
How can I speed up the calculation by determining the dynamic level where error can be reduced to the barest minimum? You mean ...

3 years ago | 1

Answered
Euler's Method with multiple step sizes
%%% Define the interval [a,b] and initial condition a = 0; b = 0.5; y0 = 1; %%% Find the approximated solution using Euler's...

3 years ago | 0

| accepted

Answered
How Do I Plot 24 equally distanced points (from 0<t<5, inclusive) that agree with an exact solution to an IVP? (RK4/Runge Katta Method)
Use scatter([t 5/24 10/24 15/24 20/24 25/24 30/24 35/24 40/24 45/24 50/24 55/24 60/24 65/24 70/24 75/24 80/24 85/24 90/24 95/24...

3 years ago | 0

| accepted

Answered
How to solve multiple independent equations stored in one variable
for i = 1:numel(b) for j = 1:numel(M0) eq = x^2 - (tunnel.A(i)./Aster(j)*x).^2+2 == 0; tunnelM = solve(eq, x, "...

3 years ago | 0

| accepted

Answered
Matrix problem n*n
n = 3; A = reshape(1:n^2,n,n).'

3 years ago | 0

| accepted

Answered
Not enough input arguments in lsqcurvefit function
x0 = 0 not x0 = [0 0] since k seems to be a scalar as you treat it in "calcor". Further I guess k= lsqcurvefit(@calcor,x0,...

3 years ago | 1

Answered
optim.problemdef.OptimizationProblem/solve SOLVE requires a non-empty initial point structure to solve a nonlinear problem.
My advice is: Do what the error message tells you to do and supply an initial point structure to make MATLAB happy. initial.e =...

3 years ago | 0

Answered
how to remove error form BVP4C code
The odes you want to solve cannot be defined in two separate ODE functions. If you want to solve two differential equations sim...

3 years ago | 0

| accepted

Answered
fplot showing different curve to plot
plot(p_a,Q) instead of plot(Q,p_a): M = 100; p_b = 2; Q = @(p_a) M./(p_a + p_b); hold on fplot(Q, [0 35]) ylim([0 ...

3 years ago | 0

| accepted

Answered
Numerical solution to a larger equation.
What is the zero of your choice ? fun = @(lamda2)sinh(5.9605e-08*(((1.1259e+15*lamda2^2 + 7.5126e+15)^2)^(1/2) + 7.5126e+15)^(1...

3 years ago | 0

Answered
What is wrong with my code, my equation is vdv/dy=-G*M/(y+R)^2 ?
syms G M R y v(y) Dv = diff(v,y); eqn = diff(v,y,2) == -G*M/(y+R)^2; cond = [v(0)==100,Dv(0)==0]; sol = dsolve(eqn,cond) Gn...

3 years ago | 0

Answered
How to compare elements of two vectors in MATLAB ?
A = [1 2; 3 4]; B = [1 4; 3 5]; sum(A(:)~=B(:))

3 years ago | 0

| accepted

Answered
Problem with time steps in Runge-Kutte method
vx(i+1) = vx(i) + (1/6)*(K1(2)+2*K2(2)+2*K3(2)+K4(2))*h; vy(i+1) = vy(i) + (1/6)*(K1(4)+2*K2(4)+2*K3(4)+K4(4)...

3 years ago | 1

Answered
Travelling salesman problem - Dimension of arrays issue
To concatenate the three vectors, sqrt((Min_Dist(:,2)-SortedCoordinates(i,2)).^2+(Min_Dist(:,3)-SortedCoordinates(i,3)).^2) C...

3 years ago | 0

| accepted

Answered
How to compute the double integral over dx and dy?
dx = 0.1; x = -0.5:dx:0.5; dy = 0.1; y = -0.5:dx:0.5; N = length(x); a = randn(N,N); b = randn(N,N); F = (a-b).^2; % Use...

3 years ago | 0

Answered
find equilirium point with all parameter known
I don't know if this solves your problem, but of course you have to reverse the order of the commands here: if (hdot(4)<0) ...

3 years ago | 0

Answered
Curve fitting the data series
The function you define as fitting function tends to Rdc + R1 + R2 + R3 + R4 + R5 as f tends to infinity very fast. In contrast...

3 years ago | 0

Answered
Using fsolve for a set of complex equations
If you want to define K_step*X_step-F_step as a function handle, you will have to define all expressions involving components of...

3 years ago | 0

Load more