Réponse apportée
How to solve a system of exponential equations?
Simply define your equations as function handles, not as symbolic expressions: f = @(a,b,c) [-1*((11.5*exp(0))+(11.3*exp(b*5))+...

plus de 2 ans il y a | 2

| A accepté

Réponse apportée
Solving the system of ODEs and algebraic Equation
As you can see, your algebraic equation does not seem to have a zero for your initial vector for the other variables. Further t...

plus de 2 ans il y a | 0

Réponse apportée
Plotting is not quie correct
Maybe for i = 1:lengthT for j = 1:length_L term1(i,j) = C2./(lambda(j)*T(i)); E(i,j)= C1./((lambda(j)^5)...

plus de 2 ans il y a | 0

Réponse apportée
keep getting an error message
x is a 2x4 matrix. So as soon as node1 or node2 in the lines % Calculate the cosine and sine of the element angle dx = x(node...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to plot the graph for the given RK 4th order step method
f=@(t,x)(13950-x)/18.75; x0=560; t0=0; t=15; h=1; X(1) = x0; T(1) = t0; for c=1:15 k1=h*f(t0,x0); k2=h*f(t0+(h/2),x0+...

plus de 2 ans il y a | 0

Réponse apportée
How can obtain the probability density function for a random discreate set of data and fit a custom distribution function ??
Use "histogram" to plot the empirical probability density function for your data and use "mle" to estimate n. https://uk.mathwo...

plus de 2 ans il y a | 1

Réponse apportée
How to create vector with elements which are matrices?
A cell array might help: M{1} = [3 5;9 12]; M{2} = [2 -9;0.6 -3.7]; M

plus de 2 ans il y a | 0

Réponse apportée
how to incorporate boundary conditions as constraints in fmincon optimization?
I think with the mixture of numerical, symbolic and optimization variables it is easier to set up the problem directly. x0 = [ ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Newtons Method but error message "Singular Matrix"
This is quite a tricky problem - even with the MATLAB solvers available. For given V and theta at t = 0, integrate until x beco...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Fsolve Recommending Algorithm I Already Specified
You overwrite the previously set options with this line options = optimoptions('fsolve', 'Display', 'none', 'TolFun', 1e-6, 'To...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
How can i use this vector in my ODE function?
Integrate from t=0 to t=10 and use u = 30. Restart the ode solver with the solution at t = 10 and integrate from t=10 to t = 20...

plus de 2 ans il y a | 0

Réponse apportée
Simulating a 1D Random Walk
% Step 2: Plot the entire trajectory for a single random walk N = 100; % Number of steps single_trajectory = simulateRandomWal...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
How to plot different length vectors against each other?
However the x vector has a length of 113 compared to 1849 for y because of the differences in timestep. Solve for x and y toget...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to interpolate 2 dimensions of a 4D array ?
% Generate artificial data in longitude and latitude (176 points resp. 239 % points) longdata = linspace(0,2,176); latdata = ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Error using linprog (line 369)
A_s and f_s are not specified in your code. But without running your code, I think your problem exceeds your available computer...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
95% confidence bounds from logistic curve (curve fitter) give different results to plotting via equation in script
It's not possible to just insert lower and upper bounds for the parameters into the model equation to get the curves for the con...

plus de 2 ans il y a | 0

Réponse apportée
how to calculate the drivative of discretized ODE
After the line sol = ode45(@(t,u) dODE(t, u, par, tau, M,D), tspan, u0,options); you can compute the derivatives of the soluti...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
There is an error when i run my 'subplot' command in MATLAB
Rename your script file "subplot.m" to something else. "subplot" is a reserved name in MATLAB.

plus de 2 ans il y a | 1

Réponse apportée
Please help for objectiveFunction command.
You don't supply k1, k2, c1 and c2 to the objective function. If these are the parameters to be optimized, you don't need to pa...

plus de 2 ans il y a | 1

Réponse apportée
1D HEAT CONDUCTION
In each time step, you have to solve the linear system of equations T(1,k+1) = Tleft T(i, k+1) - deltat/deltax^2*alpha* (T(i-...

plus de 2 ans il y a | 1

Réponse apportée
Finding a definite integral
x = linspace(0,1,101); u = [0.1600 0.1600 0.1599 0.1599 0.1597 0.1596 0.1594 0.1592 ... 0.1590 0.1...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Compute a function that has Double summation
All the series involved are geometric series for which the finite and infinite sums are known: sum_{i=1}^{i=n} q^i = q * (1-q^n...

plus de 2 ans il y a | 0

Réponse apportée
What does this mean: K12_global(1:3:6,1:3:6)?
Do you see what happens ? The new matrix K12 is formed of the elements (1,1),(1+3,1),(1,1+3) and (1+3,1+3) of the original mat...

plus de 2 ans il y a | 0

Réponse apportée
Unable to meet integration tolerances without reducing the step size below the smallest value allowed (1.136868e-13) at time t.
I had to add the line global alpha pD K g_T IFN at the beginning of your program to make the code work because the above globa...

plus de 2 ans il y a | 0

Réponse apportée
Numerical Differentiation using Finite Differences
h = 0.01; x = 0:h:2*pi; fx = sin(x); %df1 = (sin(x+h) - sin(h))/h; df1 = (sin(x+h) - sin(x))/h; df2 = (sin(x) - sin(x-h...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Efficiently evaluating ODE event that depends on only some variables
Use OutputFcn to check your condition after each successful time step. But I think it will be difficult to check for complanari...

plus de 2 ans il y a | 0

Réponse apportée
Finding real and imaginary part of an equation
U = 0:0.1:10; P = sqrt((((20*U.^2)-15) + sqrt((400*U.^4)+ (1080*U.^2) + 25 -600 - 450 - (1125./U.^2)))./((36*U.^2) + 30)); Pim...

plus de 2 ans il y a | 0

Réponse apportée
I have a code related to thermodynamic subject, i don't know how to run it in order to get the different plot out of it. for example plot (p,rho). plot of pressure vs density.
I think there is something wrong in the calculation of the compressibility factor. p = EOS(2.0,150) function p=EOS(rho,temp)...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
compute sums by accumulating in a for-loop
sum(xprime(1:100-l)) This is a scalar. sum(xprime(1:100-l)).*xprime(1+l:100) This is a vector of length 100-(1+l)+1. (sum(xp...

plus de 2 ans il y a | 0

Réponse apportée
Financial optimization of heston
Assuming that Price_SV returns a vector of the same size as P_data, your call would look somehow like fun =@(p)Price_SV(p(1), p...

plus de 2 ans il y a | 0

| A accepté

Charger plus