Respondida
Why are complex values obtained for the below function (x) in the if condition?
Maybe you mean clc close all clear all a = 280; b = 580; c = 0.35; d =1.71E5; e = 7; f = 1+(3.5*(a/b)); g = d/(1+(0.00...

más de 2 años hace | 1

Respondida
me sale un error en la linea 67: " M(i,j)=buenos(val,3);" y el mensaje es: "Index in position 1 exceeds array bounds (must not exceed 120)"
Add the commands Ni*Nj size(buenos,1) after this line: %% Create output variable buenos = reshape([raw{:}],size(raw)); If ...

más de 2 años hace | 0

Respondida
Solving PDE and ODE coupled system with varying boundary conditions?
If you want to change a boundary condition, use a second function "fun" and call ode15s with the solution obtained so far and th...

más de 2 años hace | 0

| aceptada

Respondida
2 second order differential equations with boundary conditions using bvp4c
Almost the same code as in the preceeding problem: % Parameters alpha = 0.001; gamma = 100; epsilon = 1; delta_v = 0.1; a=...

más de 2 años hace | 1

Respondida
Fitting two curves with shared parameters to two datasets
clc close all clear all set(0,'defaulttextinterpreter','latex') set(0,'defaultAxesTickLabelInterpreter','latex'); set(0,'de...

más de 2 años hace | 0

| aceptada

Respondida
ODE15s Unable to meet integration tolerances without reducing the step size below the smallest value allowed
If you store P for 1:Nx and m for Nx+1:2*Nx, you should also return dPdt for 1:Nx and dmdt for Nx+1:2*Nx. But you return dPdt fo...

más de 2 años hace | 1

Respondida
Why is my multi-objective optimization with gamultobj (NSGA-II) not working?
Extract your optimization parameters at the time when the integrator returns NaN values. Are they reasonable ? If you think they...

más de 2 años hace | 0

| aceptada

Respondida
Interior-point and sequential quadratic programming give me the same answer. Is there an error with my code?
I just saw in your code that you don't pass the options structure to fmincon. Thus in both calls, the same solver is used. Use ...

más de 2 años hace | 0

| aceptada

Respondida
How to calculate first and second derivative for concentration?
It seems the concentrations are solutions of differential equations, thus something like dy/dt = f(y,t). So you can see that af...

más de 2 años hace | 0

Respondida
How can I get a loop within a loop to return a value as a matrix?
Maybe you mean B = -0.388; C = -0.026; P = 1.2; T = 305:5:550; R = 8.314; V9 = mvolume9(B,C,P,T,R); disp(V9) function ...

más de 2 años hace | 0

Respondida
Need Help With Function Creation and Integration
I'll assume that all variables except y0 are scalars and defined somewhere before in your code. In this case, use ua = integra...

más de 2 años hace | 0

Respondida
Solving a second order nonlinear differential equation with this boundary condition: y'(0) = 0, y(1) =1
The shooting method can be used for any combination of boundary conditions at x=0 and x=1. In your case, you have to estimate y...

más de 2 años hace | 0

| aceptada

Respondida
1D Heat equation in Matlab with variable heat Flux at one side
You are doing numerics here. The maximum difference is 1e-13, I think this is acceptable: pdepeSolverTest() function pdepeSo...

más de 2 años hace | 0

| aceptada

Respondida
Why am i getting blank plots
The solution for all four solution variables is NaN (see above) - most probably caused by the use of "log" in "theta_lm1" and "t...

más de 2 años hace | 0

Respondida
quadgk problems “Output of the function must be the same size as the input.”
Your functions cannot be vectorized for the below setup because they will be called with vectors for r, r_hat and theta of diffe...

más de 2 años hace | 0

Respondida
How do i fix my newtons method code?
fx and df are not function handles in your code. So you must use "subs" to evaluate them at a certain x-value. And setting x0 =...

más de 2 años hace | 2

Respondida
Symbolic function Gaussian Beam
w0 and z0 are function handles. You can't use them like variables in your definitions. Further, E is a complex-valued function....

más de 2 años hace | 0

Respondida
How to extrapolate the first 5 points
p = load("points.mat"); px = p.points(:,1); py = p.points(:,2); [~,idx] = sort(px); px = px(idx); py = py(idx); plot(px,py...

más de 2 años hace | 0

Respondida
How to perform recursive integration
syms a b x t positive syms F0 f(x) = b/a*(x/a)^(b-1)*exp(-(x/a)^b); F0(t) = 1; F1(t) = int(f(x)*F0(t-x),x,0,t) F2(t,x) = f(...

más de 2 años hace | 0

Respondida
Quadratic Objective with two Quadratic Constraints
What about function [y,yeq,grady,gradyeq] = quadconstr(x,B,C) y = []; yeq(1) = x.'*B*x - 1; yeq(2) = x.'*C*x - 1; i...

más de 2 años hace | 1

Respondida
Using Optimizing Nonlinear Functions to find mutiple variations
xdata=[125 127 129 131 133 135 137 139 141 143 145]; ydata=[0.002 0.003 0.009 0.025 0.053 0.089 0.104 0.09 0.07 0.041 0.017]; ...

más de 2 años hace | 0

| aceptada

Respondida
matlab code for 2nd order differential equation with boundary conditions
You have a boundary value problem, not an initial value problem. ode45 is not suited in this case. Use bvp4c or bvp5c instead. ...

más de 2 años hace | 0

Respondida
Matlab code: deflection of simply supported beam using ode45
Hi, my code keeps returning a function for a cantilever beam rather than a simply supported. How do I fix this?? By using bvp4c...

más de 2 años hace | 0

Respondida
Solving a system of ordinary differential equations
It's just the starting phase where you observe a linear profile (see below). tspan = [0 60000]; %timespan y0 = [0.0675 0.0075...

más de 2 años hace | 0

Respondida
nonlinear constraint game theory
By the way: What do you mean by "nonlinear constraint game theory" ? Your constraints are all linear. % Define the objective fu...

más de 2 años hace | 1

Respondida
Solution of nonlinear ordinary differential equation of second order
I suggest you integrate the equation y" = A (x^4) twice with respect to x and adjust the two free constants from the integrati...

más de 2 años hace | 1

Respondida
The output of solve(eqn, x) is still an equation instead of number
Use G2 = double(solve(subs(equation1))) instead of G2=solve(equation1,G2)

más de 2 años hace | 1

Respondida
Finding column index for matching values in a matrix
poschannel = [1 3 -5;0 3 4;-1 1 9]; rows_with_1 = arrayfun(@(i)any(poschannel(i,:)==1),1:size(poschannel,1)) or shorter rows_...

más de 2 años hace | 0

| aceptada

Respondida
Help with fmincon Optimization for a Function Involving Matrices in MATLAB
y = 3; if y > 1 & y < 5 obj = @(p)0.5*p(1)*p(2)+0.34*p(3); nonlcon = @(p) deal([],p(4)-p(1)*p(2)*p(3)); A = [0 0...

más de 2 años hace | 0

| aceptada

Respondida
Energy method with Hermite cubic function (2 essential condition)
m and nv are inputs to the function "ex_enerHermite". Where do you set these values and where do you call the function ?

más de 2 años hace | 0

| aceptada

Cargar más