답변 있음
I'm receiving this error: "Incorrect number or types of inputs or outputs for function int." when trying to run the following code. I think because of the symbolic variables
syms a1 a2 a3 a4 theta dzdx = a1*pi*cos(.5*pi*(1-cos(theta))) + 2*a2*pi*cos(pi*(1-cos(theta))) + 3*a3*pi*cos(1.5*pi*(1-cos(the...

24일 전 | 0

| 수락됨

답변 있음
Assumptions are not being considered in symbolic math.
What is rank(A) ? If it's 8, your system of equations has a unique solution, and you can't assume anything about it.

25일 전 | 3

답변 있음
Need help to fit the data without error.
I assumed you start integration at x = 5.3571429. You will need to specify dr/dx and dtheta/dx in the y0-vector below. rData =...

25일 전 | 0

답변 있음
Do ODE solvers use location of root of event function in its solution even if integration isn't specified to stop?
You will have to tell the solver to return control to the calling program once the corner point is reached. From there, you can ...

25일 전 | 0

| 수락됨

답변 있음
How to debug this? Not getting into it. Need help
Use fit = lsqcurvefit(@(params, x) funr(params, x), initialGuess, rData(:,1).', rData(:,2).'); fit2 = lsqcurvefit(@(params, x)...

25일 전 | 0

답변 있음
role of flux f in bcfun of pdepe for systems of PDEs
This multiplication is nowhere performed within "pdepe". But if you look at the pdepe code below, the cases where q = 0 and q di...

25일 전 | 0

| 수락됨

답변 있음
Logit panel with Simulated Maximum Likelihood. Convergence question with fminunc
Your objective function depends on random values. This is not allowed for deterministic optimization as done by "fminunc". Conve...

26일 전 | 2

| 수락됨

답변 있음
It keeps giving me an error on line 4, saying I'm missing input arguments but I have everything defined?
Q = 9.4e-6; q = 2.4e-5; R=0.1; epsilon= 0.885e-12; F=@(z)(Q*q*z) .*((1-z)./(sqrt(z.^2+R.^2)))/(2*epsilon); z1 = 0.5; z2 =...

26일 전 | 0

| 수락됨

답변 있음
GA does not solve problems with integer and equality constraints
Your code from above works for me. Test it. Because you only have inequality constraints, you must set h = [] instead of h = z...

26일 전 | 0

| 수락됨

답변 있음
Solving equations using Newton-Raphson method for 7 equations with 7 variables
You have a linear system of equations. No Newton method is required in this case. But since a only has rank 2, no solution exis...

26일 전 | 0

답변 있음
Why am I getting the error "Too many output arguments"?
You don't initialize "error" in your code by giving it a value before you use it in the while loop. That's why MATLAB assumes e...

26일 전 | 1

답변 있음
I get an error using fminsearch and says Simulink model "model ex3" was called with incorrect number of arguments. I have attached a picture to show it.
Try calling fminsearch as [xSolution,fval] = fminsearch(@(x)model_ex3(x,par),x0) If this doesn't work, we need to know the inp...

26일 전 | 0

답변 있음
How to simplify infinite double matrix summation in Matlab.
Are you sure that the matrix potentials for A and R are meant elementwise ? beta = 1.5; A = [1 0;0 2]; R = [0 3; 1 1]; t = 1; ...

27일 전 | 2

답변 있음
How to convert the attached equations in Matlab?
I'm not sure if you mean m.^2.*f.^2./16.*r or m.^2.*f.^2./(16.*r) in your equations. I assumed that your equations.png is corr...

27일 전 | 0

| 수락됨

답변 있음
solvepde function MATLAB "c" term identification
https://uk.mathworks.com/help/pde/ug/c-coefficient-for-systems-for-specifycoefficients.html Chapter Definition of the c Tensor...

27일 전 | 0

답변 있음
How do I calculate the cross product of two vectors, when the first vector is an element of a N-array and the second vector is an element of an NxD matrix;
r1 = rand(30,3); r2 = rand(30,50,3); for i=1:30 for j=1:50 c(i,j,:)=cross(r1(i,:),squeeze(r2(i,j,:))); end ...

27일 전 | 1

답변 있음
How to apply loop on following case?
Make a function of the part of the code that you have to run through three times and call this function for IP_OPT, IS_OPT and R...

28일 전 | 0

답변 있음
Pdepe cylindrical coordinates with Neumann BC
You will have to use pl = P * (interp1(NP1(:,1), NP1(:,2), t, 'spline', 'extrap') - (cl/Kav)); ql = 1; %ignored by sol...

28일 전 | 0

| 수락됨

답변 있음
Find a weight matrix and bias which performs the following binary classification
Write your own hardlim function (see below) or license the Deep Learning Toolbox. N = -1+2*rand(10,5) S1 = my_hardlim(N) fu...

28일 전 | 0

답변 있음
PDE Model Boundary Conditions
If you output state.x and state.y in the function, you can see to which evaluation points state.u belongs.

29일 전 | 0

답변 있음
How to supply Hessian for interior-point in fmincon in the objective function and not a separate function
I didn't think until the end, but maybe this procedure also helps in your case: https://uk.mathworks.com/help/optim/ug/objectiv...

29일 전 | 1

답변 있음
optimising a parameter not directly involved in the objective function to be minimised
t_exp = ...; Cb_exp = ...; % experimental data KA =...; KV =...; p =...; D =...; Cs =...; mo =...; Ni =...; V =...;...

29일 전 | 1

답변 있음
Monte-Carlo Analysis of fmincon optimization is converging to infeasible point
I guess log((MC(1) - x(7)) becomes complex-valued because MC(1)-x(7) becomes negative. Complex-valued constraints have to be avo...

29일 전 | 0

| 수락됨

답변 있음
Solving system of coupled nonlinear discretized equations with fsolve using boundary conditions
Use "bvp4c". Additionally, I don't understand why you set F(z,1)=(N_H2O(z+1)-N_H2O(z-1))/(2*dz); F(z,2)=(N_H2(z+1)...

29일 전 | 0

| 수락됨

답변 있음
I want to solve the Lyapunov equation with matlab
You can also do it this way, but your system does not seem to have a solution: % Définition des matrices du système A = [0 1;0...

30일 전 | 0

답변 있음
When I test this code which is shown below. I got an error of " not enough input arguements". How can i solve this error?
ga will call your function "power_flow_cap" with one input argument. Your function has three inputs (capsz,ncap,capplc). I don'...

30일 전 | 0

| 수락됨

답변 있음
How to perform correct numerical integration of equations containing Bessel functions ?
I suspect you want exp(-zeta^2/(4*0.0277)) instead of exp(zeta^2/(4*0.0277)) in your integrand. And why do you add the same Bes...

30일 전 | 0

답변 있음
Trouble with fmincon - minimizing a vector
The appropriate objective is to minimize -sum(similiarityvalues.^2)

대략 1개월 전 | 1

| 수락됨

답변 있음
Get solution for a linked multi-stage BVP
How do I model this problem? By solving it as a multipoint boundary value problem: https://uk.mathworks.com/help/matlab/math/s...

대략 1개월 전 | 0

| 수락됨

답변 있음
Boundary Value Problem based on specific problem
x(0) = 0 gives C1 = 0, x'(0) = 0 gives C2 = 0. Thus the solution of your equation is x = 0 for all t.

대략 1개월 전 | 1

| 수락됨

더 보기