Answered
Why did I get this error in my code "Array indices must be positive integers or logical values"?
clear; clc; M = 4.316e-3; %equivalent mass for PEH K = 9.894; %equivalent stiffness for PEH C = 0.0096; ...

3 years ago | 0

| accepted

Answered
Why Matlab could not solve a set of linear differential equations with initial conditions through dsolve?
The eigenvalues of a polynomial of degree 14 (=degree of ODEs * number of ODEs) are required to get an analytical solution for y...

3 years ago | 1

| accepted

Answered
How do I run an ODE on a function with multiple variables?
[T,Y] = ode45(@(t,y)eliminationODE(y(1),y(2),y(3),y(4),y(5),y(6),y(7),y(8),y(9),y(10),y(11),y(12),y(13)),[1 100], [0.4,0.016,dpo...

3 years ago | 0

Answered
Index in position 1 is invalid. Array indices must be positive integers or logical values.
dt = 1; d = 0.25; e = 1; t(1) = 0; H(1) = 6; n = 1; f = @(t,H)(-pi*d^2/(4*(-9.5883*H^5+110.5*H^4-340.17*H^3+124.71*H^2+202...

3 years ago | 0

| accepted

Answered
How do I create a matrix from another matrix excluding values?
Example = [ 5 0 2022 820 7 1 820; 5 1 2022 813 4 9 805; 5 2 2022 808 0 0 822; 5 3 2022 809 2 9 812; 5 4 ...

3 years ago | 0

Answered
solving 3 nonlinear equations including max function
a_old = 0.5; b_old = 0.25; c_old = -3.0; err = 1.0; itermax = 100; iter = 0; while err > 1e-6 && iter < itermax iter ...

3 years ago | 0

Answered
2D transient heat conduction in a rectangular plate
In the computation of the second-order derivatives in x and y direction, you don't use that the temperature at the boundaries is...

3 years ago | 0

| accepted

Answered
Moving boundary conditions (material regressions) for PDE
Your equation du/dt = k * d2u/dx2 + dr/dt * du/dx seems to be written in cartesian, not in cylindrical coordinates. The usua...

3 years ago | 0

Answered
Find the set of eigenvectors of a 4x4 matrix elements whose matrix elements have some VARIABLE PARAMETERS.
I set a = sqrt(750*B*N) in the below code. So for every combination of B and N, it gives you the eigenvalues (diagonal of D) and...

3 years ago | 1

Answered
optimization of a function with array of parameters using matlab solver ga
E_opt = optimvar('E_opt',7,'Lower',0,'Upper',+1); instead of E_opt(1)=optimvar('E_opt(1)','Lower',0,'Upper',+1); E_opt(2)=opt...

3 years ago | 0

Answered
My code is related to the 12-6 lennard jones potential . we have to find the density and the effect of cutoff radius on it. I am facing issue while running the code.
You can't plot one single value (density) against a matrix (cutoff). cutoff = [1 4 ; 3 -pi]; density = 2; plot(cutoff,density...

3 years ago | 0

Answered
solving nonlinear equation including max function
options = optimset('TolX',1e-10,'TolFun',1e-10); fun = @(x,y)[x - max(0.9*y,-1+0.9*x);y - max(2+0.9*x,2+0.9*x)] sol = fsolve(@...

3 years ago | 0

| accepted

Answered
Please help fix the syntax for my plot.
Example = [ 5 27 2022 820 827 785 820; 5 28 2022 813 824 801 805; 5 29 2022 808 835 804 822; 5 30 2022 809 835...

3 years ago | 0

Answered
How to solve given system of ODE and PDE
Discretize d^2/dx^2 (sigmaEffective/sigmaY)^m * rho_m and solve the resulting system of ordinary differential equations using OD...

3 years ago | 1

Answered
How to fit a defined function?
A simpler way for this problem, but I guess your "real" model is more complicated: x = [1 2 3 4 5]'; % x data y = [.8 4 10 18...

3 years ago | 0

Answered
I'm always getting an error in line 3 saying not enough input argument
See the example "Solve Nonstiff Equation" under https://de.mathworks.com/help/matlab/ref/ode45.html t0 = 0; tf = 20; x0 = ...

3 years ago | 0

Answered
Remove the loop from a sum of index expression
Here is a loop in disguise: n = 5; m = 10; M = randn( m, m ); J = randi( n, m, m ); V = arrayfun(@(i) sum( M( J == i ) ),1:...

3 years ago | 1

Answered
Quadratic assignment problem in matlab
https://de.mathworks.com/matlabcentral/fileexchange/53110-quadratic-assignment-problem-qap-using-ga-pso-and-fa

3 years ago | 0

Answered
Optimization - non-linear eqn. genetic algorithm
Your problem is linear - thus use linprog instead of ga: f = -[ 1 1 1 1]; A = [0.8 0.2 0 0;0 0 0.45 0.55;-0.8 -0.2 -0.45 -0.55...

3 years ago | 0

Answered
How to explain a difference in solutions of integrals between MATLAB and MAPLE?
https://www.wolframalpha.com/input?i=integration&assumption=%7B%22C%22%2C+%22integration%22%7D+-%3E+%7B%22Calculator%22%7D&assum...

3 years ago | 0

Answered
Maximize Linear Programming using linprog Problem is unbounded?
For M >= 4, choose x1 = 0, x2 = M/2 , x3 = M Then x = [x1,x2,x3] is feasible and the value of the objective is 3/2*M which can...

3 years ago | 0

Answered
how do I index within symfun matrix?
syms f(x) [1 2] f f(1) Therefore what it created was a single function that has an array result. f(1) is interpreted as apply...

3 years ago | 0

Answered
ODE45 Multiple Degrees of Freedom Problem
% This script produces a transient response of a 3DOF dynamic model of a % jacket platform clear all clc % Define global var...

3 years ago | 0

Answered
How to solve this multi equation using matlab program
According to your y-vector, you want to have -2*p1 + 2*p2 = 0 -1*p2 + 1*p3 = 0 3/2*p1+3/2*p2-3*p3 = 0 Insert p1 = p2 = p3 ...

3 years ago | 0

Answered
finding equation of motion using lagranges function
syms th thd g m l k L = m*l^2*thd^2/2 + m*g*l*cos(th); X = {th thd}; Q_i = {0}; Q_e = {0}; R = k*thd^2/2; par = {g m ...

3 years ago | 0

Answered
How to model 3 Degrees of Freedom at once
Define a solution vector y = (y1,y2,y3,y4,y5,y6) with y1 = y_a, y2 = y_a_dot, y3 = z_a, y4 = z_a_dot, y5 = Theta_a, y6 = Theta...

3 years ago | 0

Answered
I want to plot selected data from rows and columns
Plotting the second against the first column does not make much sense because the first column is the year and the second column...

3 years ago | 0

Answered
Python 3.11 Compatibility with MATLAB
https://de.mathworks.com/support/requirements/python-compatibility.html

3 years ago | 1

Answered
I need help integrating this function
The first argument to "integral" has to be a function or a function handle. Both does not seem to be the case in the call Q_tot...

3 years ago | 0

| accepted

Answered
How can i apply a value to a symbol given a solution to a system of equations.
syms h C3 C4 C5 eqn1 = h == C3 + C4 + C5; eqn2 = 0 == 3*C3 + 4*C4 + 5*C5; eqn3 = 0 == 6*C3 + 12*C4 + 20*C5; [C3 C4 C5] = s...

3 years ago | 0

| accepted

Load more