回答済み
Solving the differential equation by the Runge-Kutta method (ode45)
[t, y] = ode45(@odefun2,[0 3],[1,0]); plot(t,y(:,1)) function dfdt = odefun2(x,y) w = 2e16; r0 = 30e-6; c = 3e8; ...

2年以上 前 | 0

| 採用済み

回答済み
Breaking down a numerical integration into two parts
I1 = dx/2 * f(x0) + dx * sum_{i=1}^{n-1} f(xi) + dx/2 * f(xn) I2 = dx/2 * f(xn) + dx * sum_{i=n+1}^{n+m-1} f(xi) + dx/2 * f...

2年以上 前 | 1

| 採用済み

回答済み
simple x.y plot
Use y = (4*(x.^2)*log(6))+(5*(x.^2)) ./ sqrt (cos(x).^2) +1 instead of y = (4*(x^2)*log(6))+(5*(x^2)) / sqrt (cos(x).^2) +1...

2年以上 前 | 0

回答済み
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...

2年以上 前 | 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.

2年以上 前 | 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 =...

2年以上 前 | 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 ...

2年以上 前 | 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)...

2年以上 前 | 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...

2年以上 前 | 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...

2年以上 前 | 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 =...

2年以上 前 | 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...

2年以上 前 | 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...

2年以上 前 | 0

回答済み
Using lsqnonneg to determine if there exists a solution to a (generally) under-determined linear system, but error is too large to be convincing.
If you are convinced that there should exist a "true" solution for your system, extract a matrix of size (10x10) that is non-sin...

2年以上 前 | 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...

2年以上 前 | 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...

2年以上 前 | 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; ...

2年以上 前 | 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...

2年以上 前 | 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...

2年以上 前 | 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 ...

2年以上 前 | 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...

2年以上 前 | 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...

2年以上 前 | 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...

2年以上 前 | 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.

2年以上 前 | 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...

2年以上 前 | 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 =...;...

2年以上 前 | 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...

2年以上 前 | 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)...

2年以上 前 | 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...

2年以上 前 | 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'...

2年以上 前 | 0

| 採用済み

さらに読み込む