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

2年以上 前 | 1

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

2年以上 前 | 1

| 採用済み

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 1

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

2年以上 前 | 0

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

2年以上 前 | 0

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

2年以上 前 | 0

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

2年以上 前 | 0

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

2年以上 前 | 0

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

2年以上 前 | 1

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

2年以上 前 | 0

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 0

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

2年以上 前 | 0

| 採用済み

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

2年以上 前 | 1

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

2年以上 前 | 0

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

2年以上 前 | 0

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

2年以上 前 | 0

| 採用済み

回答済み
Difficulties with symbolically integrating Paris law equation
% Numerically DEL_SIG = 180e6; a = 0.1e-3; ac = 28.6e-3; A = 4e-13; expression = @(x)1./(A*DEL_SIG^4*pi^2*x.^2); N = inte...

2年以上 前 | 0

| 採用済み

回答済み
triple nested integral with error "Arrays have incompatible sizes for this operation."
Please supply an executable code in order to test your code and reproduce the error. Usually, adding 'ArrayValued',true as an o...

2年以上 前 | 0

回答済み
Nested integrals spends quiet different time to calculate for different input values
Check whether the computations are reliable because of the big span of integration. mu1 = 100; sigma1 = 10; mu2 = 200; sigm...

2年以上 前 | 0

回答済み
Could anyone help me with my matlab bvp4c program?
The order of your functions in the dydy function handle is wrong. It should work now. %I am a Researcher, my problem is i t...

2年以上 前 | 1

| 採用済み

回答済み
How can I find the troughs of something without using the function findpeaks?
Use the "diff" function on the array "flow". A peak occurs between flow(i) and flow(i+2) if diff(i) > 0, but diff(i+1) < 0 (m...

2年以上 前 | 0

回答済み
Error Using Optimization with Integer Variables and Non-linear Constraints
Replace norm_h=optimvar('norm_h','Type','integer'); prob = optimproblem('ObjectiveSense','minimize'); prob.Constraints.cons1 ...

2年以上 前 | 0

回答済み
A naive question regarding MATLABs definition of parabolic/elliptical PDEs (pdepe)
https://en.wikipedia.org/wiki/Elliptic_partial_differential_equation Second-order linear partial differential equations (PDEs) ...

2年以上 前 | 0

| 採用済み

回答済み
How to find the point that resides on a contour that is closest to a known point?
format long Z = peaks(50)/10; surf(Z) obj = @(x,y)(x-16.35)^2+(y-0.05)^2; nonlcon = @(z)deal([],interp2(0:49,0:49,Z,z(1),z(2...

2年以上 前 | 1

回答済み
The standard implementation of ldl factorization in Matlab does not work correctly
From the documentation: [L,D] = ldl(A) factorizes full matrix A into a permuted lower triangular matrix L and a block ...

2年以上 前 | 0

| 採用済み

回答済み
How to optimize the run time in my optimization problem.
I don't see anything obviously wrong in your coding - except for the last term in MTE_i which should be (TotalProduct(6)-Exper...

2年以上 前 | 0

| 採用済み

さらに読み込む