Beantwortet
How to set lower bound lb as a function of optimization variable.
Use function "nonlcon" to define nonlinear equality and inequality constraints. If v(i) depends linearly on the solution variab...

mehr als 2 Jahre vor | 2

Beantwortet
When using 'quadprog' how do I limit certain solutions so that they can only become whole numbers?
https://uk.mathworks.com/matlabcentral/answers/660423-can-i-solve-mixed-integer-quadratic-programming-miqp-problems-in-matlab-us...

mehr als 2 Jahre vor | 0

Beantwortet
Synthax for equation in script
r0 = 3; r1 = 4; delta = linspace(-r0,r0,31).'; k = linspace(-r1,r1,31).'; 0.5*sqrt((delta+k.^2).^2+4*k.^2)

mehr als 2 Jahre vor | 0

Beantwortet
Equal arc discretization method code
warning("off") syms t t1 t2 % Parameters R2 = 12; %outer radius (between this radius and R1 is constant arc increment) b = 2...

mehr als 2 Jahre vor | 0

Beantwortet
A quatity is being solved by a self consistent integration
format long syms x A = 2000; a = 500; b = 1000; Z = 0; for i=1:20 f = x^4*((A^2+Z^2)/(A^2+4*(x^2+a^2)))^4 / (sqrt(x^2+...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How can I write the term \sum_{q=1}^{m} b_{pq}(t)g_q(y_q(t-\tau_{q}(t))) to produce the same graph
I don't know exactly what you are asking for, but if it's about solving Equation 1, you will have to use a solver for delay diff...

mehr als 2 Jahre vor | 0

Beantwortet
Non linear fitting with 3 independent variables
M = load("Data.mat"); fun = @(A,B,C,E)(A - B*M.IL - C*M.a).*exp(-E*M.Vf); f = @(A,B,C,E) fun(A,B,C,E) - M.K; A0 = 13.5*13.2; ...

mehr als 2 Jahre vor | 2

Beantwortet
Finite Difference Method - Central Difference Method for Groundwater Flow Problem
It would help if you included the mathematical description of your problem in order to compare with your coding (equation(s) to ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to return a vector output when a vector input is given to a function_handle representing a constant function?
This works in both cases: % Usual Case syms x; syms t; u = symfun(x^2,x); u_x = diff(u,x); u_x = matlabFunction(u_x); u_...

mehr als 2 Jahre vor | 0

Beantwortet
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
Only a single number can be saved in an array element. But you try to save a vector ([a b(i) c 0 0 0 0 0 d(i)]) in a single e...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Runge Kutta 4th Order Method for an Equation
Write a function function dy = f(t,y) that accepts t and a vector y of length 2*n with y = [c_1;...;c_n,cbar_1;...;cbar_n] ...

mehr als 2 Jahre vor | 1

Beantwortet
How can I calculate the integral of Legendre function P(n,theta) ?
The Legendre function is a numerical, not a symbolic function in MATLAB. Further, it's define for -1 < x < 1. So integration f...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
Plotting discrete Klein - Gordon equation (DKG) with friction in DNA
acceleration(1) = acceleration(numBases) = 0 for every value of i in your loop. From the equation initialVelocities = initia...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Trying to solve system of PDE by spacial discretization. Errors are coming frequent . what am i doing wrong ?
Technically, your code works now. But you get NaN values for some dydt's. The reason might be that you start with a complete 0 v...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
I need help with an error I get
Define F before you call "funcao_forca". It's not set in your code. Maybe you mean F = funcao_forca(t,f); because f is a give...

mehr als 2 Jahre vor | 1

Beantwortet
Error in untitled22>solveHeatEquation1D (line 32) U(N+2,n+1) = beta(t); Error in untitled22 (line 11) [t, x, U] = solveHeatEquation1D(T, a, b,mu, u0,alpha, N, M);
a = 0; b = 1; % spatial interval T = 0.4; % end time mu = 0.5; % conductivity alpha = 1; ...

mehr als 2 Jahre vor | 0

Beantwortet
Why does the code always return "-ve" values?
When I run the main, it returns me all negative values though I have given only two negative values. Why not ? The objective is...

mehr als 2 Jahre vor | 0

Beantwortet
gradient descent optimization doesnt work in code?
My guess is that either "Energyconsumption" depends discontinuously on waypointTimes, that epsilon in the compuation of the grad...

mehr als 2 Jahre vor | 0

Beantwortet
Do you need to initiate symbolic variables in a script if you will be calling for a function using those symbolic variables?
You need to define all variables in the calling program that are not being explicitly passed from the function, but that you hav...

mehr als 2 Jahre vor | 0

Beantwortet
Vector with symbolic variable
Works for me. psi = sym('psi',[8 1]); t = 1:1000; psi(t(5))

mehr als 2 Jahre vor | 0

Beantwortet
4.2 Whiteboard Coordinate System Error for Function
This arithmetic operation is not defined in MATLAB: 2\*pi

mehr als 2 Jahre vor | 1

Beantwortet
Error: File: untitled5 Line: 19 Column: 1 Function definitions in a script must appear at the end of the file. Move all statements after the "f" function definition to before
Your interval of integration is complex-valued. I used nested functions to make the parameter g visible in your "f". And I ass...

mehr als 2 Jahre vor | 0

Beantwortet
Error using fmincon and integral2: taking integral variables theta and p as an array while performing computation
Take care that you pass k, c and d1 as values, not as function handles to your objective function. Thus (as in all your questio...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Create "n" non-lineal equations in a loop and solved by Fsolve
n=; pi=; p0=; pn=; Ag=; k1=; k2=; k3=; k4=; factor=(p0-pn)/n; for i=1:n-1 x0(i)=p0-factor*i; end x0(n)=0; ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Boundary conditions in pdepe for 1D parabolic velocity profile
The problem set up below is rho*cp*u_z*dT/dz = 1/r * d/dr (r*k*dT/dr) + Q T(z=0,r) = -40 dT/dr = 0 at r = 0 -k*dT/dr = h*(T-...

mehr als 2 Jahre vor | 0

Beantwortet
Error using fmincon and integral: taking integral variable as an array while performing computation
[q] = optimizeParameters();% Call optimizeParameters to define the objective function q options = optimset('PlotFcns', @optimpl...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Using Computational Fluid Dynamics CFD in Matlab
Are you sure that these problems are really meant to be solved with "full CFD" ? MATLAB does not have a CFD tool - you will hav...

mehr als 2 Jahre vor | 1

Beantwortet
Three y axis with one x axis
https://uk.mathworks.com/matlabcentral/answers/459385-multiple-y-axes-on-single-x-axis

mehr als 2 Jahre vor | 0

Beantwortet
Can not solve system of differential equations with ode45 taking into account continuity equation
Where do you specify the equations for p1L and p1R ? In your vector of time derivatives [dPdt(t, y(3)); dCdt1(t, y(4), y(1)); ...

mehr als 2 Jahre vor | 0

Beantwortet
Error: using fmincon: FMINCON requires all values returned by functions to be of data type double.
As you can see above, your function returns a symbolic NaN, but it must return a numerical defined value. To change the output ...

mehr als 2 Jahre vor | 0

| akzeptiert

Mehr laden