Answered
odeEvent doesn't terminate the integration process?
The functions you can prescribe as "value" should be continous. Using logicals leads to step functions that are not appropriate ...

4 years ago | 0

Answered
Giving a rectangular pulse in ode45
I can't evaluate the equations and initial conditions you use. This is what the solver returns - slight over-and undershooting. ...

4 years ago | 0

| accepted

Answered
Giving a rectangular pulse in ode45
time=linspace(0,20,300); is wrong. You must concatenate the t-vectors returned from ode45 in the three calls in the same way ...

4 years ago | 0

Answered
Calculating roots of an equation in Matlab.
Change syms theta a to syms theta

4 years ago | 0

Answered
how can i create Bernoulli random variable of a given probability
p = 0.2; n = 20000; A = binornd(ones(n,1),p) p_num = sum(A)/n B = 1 - A one_minus_p_num = sum(B)/n

4 years ago | 0

| accepted

Answered
Optimization: Reuse calculations from objective function in nonlinear constraints function
https://de.mathworks.com/help/optim/ug/objective-and-nonlinear-constraints-in-the-same-function.html

4 years ago | 2

| accepted

Answered
How apply the conformal mapping? (circle to rectangular)
https://de.mathworks.com/matlabcentral/fileexchange/67117-rectangular-conformal-map

4 years ago | 1

Answered
I'm having trouble plotting the temperature field for a thin plate with border temperatures known.
Write a function function T = Temp(x,y) T = ...; end in which you calculate the value of the infinite sum for x-y coordin...

4 years ago | 1

Answered
simultaneously, fitting two functions with two databases
I think you will have to work on the representation of f1 and f2 without the imaginary unit: c10 = 3.0; c210 = 1.0; c220 = -1...

4 years ago | 0

| accepted

Answered
Intersection of two curves
Do you see a point of intersection ? I don't. N = [1 2 3 4 5 6]; P = [1.48982012272225e-09 1.20413388047633e-08 4.174352140114...

4 years ago | 0

Answered
Error using SumOperator with Optimization Variables
nTasks = 3; nRess = 2; maxPT = 50; x = optimvar('x',nTasks,nRess,maxPT,'Type', 'integer','LowerBound',0,'UpperBound',1); Con...

4 years ago | 0

| accepted

Answered
plot based on if and else condition
MATLAB does not accept "double inequalities". Thus instead of if a < b < c you will have to use if a < b && b < c Further, ...

4 years ago | 0

Answered
Is ode45 always calculate the entire function even if she has been asked only for specific values?
I mean, will it do the full calculation in the background and return only 3 points? Yes, it will do the full calculation in the...

4 years ago | 1

| accepted

Answered
Constrained dynamic optimization with fmincon
J is minimized in the objective function. The constraint T(x(t_final)) = 0 is set in the function "nonlcon" of fmincon. u (and...

4 years ago | 0

| accepted

Answered
Where/How exactly do I create an ODE Event Location Function?
if option == 1 % Choosing Straight Run Vs = 10 * (1852 / 3600); % [m/s]-S...

4 years ago | 1

| accepted

Answered
How to solve a system of equations using the iteration by assuming the values of the unknowns and check them later. If the error is large return to change the assumed values.
Unknowns are epsilon_ri and zi. Equations are sigma_Ti = 0 and psi_i = psi_i_given. Two equations in two unknowns. Use MATLAB...

4 years ago | 0

| accepted

Answered
Using fmincon but converging to an infeasible point because the size of the current step is less than the value of the step size tolerance but constraints are not satisfied to
Works for me. T = 1000; %K R = 8.314; %kJ/kmol.K P = 300; %kpa in reformer Po = 100; %kpa standard conditions mair = ...

4 years ago | 0

Answered
Create the program to return the orthogonal basis and orthonormal basis
As far as I can see, you only return the orthonormal basis from the Gram Schmidt process in the matrix Q. And saving the norms ...

4 years ago | 1

| accepted

Answered
Computing temperature of a fluid inside a cylinder using PDEPE
For comparison: R0 = .1; R1 = .15; % radii in meters t0 = 0; t1 = 1e4; % time limits wallConductivity = 150; wallDensity =...

4 years ago | 0

Answered
Fitting experimental data with experimental references
w = [Yls,Yhs,Y3]\Yt if Yls, Yhs, Y3 and Yt are column vectors of the same size.

4 years ago | 0

| accepted

Answered
How to determine an y value at a specific x value?
sm1 = v1.*N.*L1.*R./(4.*W1.*(L1./C).^2) gives W1 = v1.*N.*L1.*R./(4.*sm1.*(L1./C).^2)

4 years ago | 0

Answered
isqnonlin: compute part of objective function outside of matlab
Then call "lsqnonlin" as p0 = ...; % initial guess for the vector of material parameters sol = lsqnonlin(@(p)fun(p,y),p0) a...

4 years ago | 0

| accepted

Answered
Using function handles in a ODE function
x, L, M, V, xlow, xhigh are not given. function y = acceleromet(x) wdwdx = @(t) -6*(x(1)*t.^3 + x(2)*t.^2 + x(3)*t + x(4))*(3*...

4 years ago | 0

| accepted

Answered
finite difference method evaluation
As you can see from the two equations you wrote down, each equation gives two new unknowns. Thus in the end, you have N equatio...

4 years ago | 0

Answered
Infinite sum with Bessel's function
n = 60; sstep = 1; a_k = J0ROOTS(n,sstep); r = (0:0.01:1).'; t = 0:0.1:1; S = zeros(numel(r),numel(t)); for i = 1:numel(t)...

4 years ago | 3

| accepted

Answered
Use matlab to write code to calculate fluid dynamic problem
https://www.engineersedge.com/fluid_flow/pressure_drop/pressure_drop.htm

4 years ago | 0

Answered
"Index in position 2 exceeds array bounds (must not exceed 1)"
P, E and K are (4x1) arrays. In the loop assignment L(m,t) = P(m,t)+E(m,t)-E(m,t-1)+K(m,t)-K(m,t-1); you treat the arrays as ...

4 years ago | 0

| accepted

Answered
How to use vector value in equation?
You mean d0 = fun1(g0,a) ?

4 years ago | 0

| accepted

Answered
Solve system for Roots of Bessel Function
This is a very empirical code for your problem. Success is not guaranteed in all cases. T = 10; B = 1; K = 0.5; fun = @(a,b)...

4 years ago | 0

| accepted

Answered
Computing temperature of a fluid inside a cylinder using PDEPE
Therefore, it can be considered that , Tdot = -2*h*(T-Tw)/(rho*cp*R0) where T is the the fluid temperature inside the cylinder a...

4 years ago | 0

Load more