Answered
Why eigen vector looks different than the calculated one
Eigenvectors are only unique up to a multiplicative constant, and MATLAB's eigenvectors are normalized to be of norm 1: [1;-3]/...

2 years ago | 0

| accepted

Answered
Paramter optimization using fmincon
It seems that the model is not able to reproduce your measurement data. The curves look qualitatively different. clc; clear; ...

2 years ago | 0

| accepted

Answered
i make a code of shooting method for 3rd order differential equation but i dont get the accurate result
y20 = 2; sol = fsolve(@fun_shooting,y20); [X,Y] = fun_ode(sol); plot(X,Y(:,1)) function res = fun_shooting(y2) [X,Y] = ...

2 years ago | 1

| accepted

Answered
Non linear system by Newton-Raphson
x1 = 1; y1 = 1; P = [x1 ; y1]; F= @(x,y) [atan(y)-y.*x.^2 ; x.^2+y.^2-2*x]; JF = @(x,y) [-2.*x.*y (1/(1+y.^2))-(x.^(-2)) ;...

2 years ago | 2

Answered
need help getting this to run
Maybe initial_strain_index = find(colum1 == min(colum1),'first'); peak_stress_index = find(colum3 == max(colum3),'first'); in...

2 years ago | 0

Answered
How to visualise the 'output' of a Neumann boundary condition?
I think the example "Heat Transfer Problem on a Square" under https://uk.mathworks.com/help/pde/ug/pde.stationaryresults.eval...

2 years ago | 1

| accepted

Answered
Can PDE solver pdepe handle discontinous initial conditions?
Depends on the equation(s) you want to solve. If there is much diffusion in your equation(s), usually yes. Else usually no.

2 years ago | 1

Answered
one of the terms "Rho_net" on the RHS of an set is varying with time over the tspan. How do I implement the set of the ODEs such that the term updates at every time step?
If you insert the line size(dYdt(tspans(1),initial_conditions)) before the call to ode45, you will see that your function dYdt...

2 years ago | 0

| accepted

Answered
Newton Raphson gives answers divided by 0
Your linear systems in the course of the Newton iterations cannot be solved since the Jacobian is rank-deficient (it has only ra...

2 years ago | 1

Answered
I am wanting to delete these entries of vector x when x = 0. How do I do this. Matlab gives me an error right now saying index cannot exceed 38 but I don't know what's wrong.
Use x(x==0) = []; instead of for i = 1:56 if x(i) == 0 x(i) = [] end end The length of the x-vector wil...

2 years ago | 0

Answered
I am trying to create a while loop where a marker can't leave a box of x = -10 and y = 10, y = -10. Once the marker reaches x = 11 I want the loop to stop.
Put the k = k+1 at the end of the while-loop, not at the beginning. And if x(k) == -10, you only set x(k+1), but not y(k+1). Th...

2 years ago | 0

| accepted

Answered
solving for y in equation
a = 85.147; h = 55; v = 50; u = 25; f = @(x,y)x-sqrt(a^2+h^2)-(h-y).*cot(asin((h-y)/v))+(h-u)*cot(pi/4-asin((h-y)/v))+v*sin(...

2 years ago | 0

Answered
Iteration loop for a function to reach a certain value.
g=9.81; NU=2.52; k=.0293;%from book L=.025;%plate to cover spacing m sigma=5.6697e-8; epsilonp=0.95;%plate emittance epsil...

2 years ago | 0

| accepted

Answered
Why do I have a never ending loop ?
The initial condition at t = 0 seems to be T = 4 for all x in your code. But you must set boundary conditions for T at x = 0 an...

2 years ago | 0

| accepted

Answered
Multi objective optimization for genetic algorithm showing out of bound solutions.
If you plot x(:,2) against x(:,1), you will see that both respect the bounds you prescribed: figure(2) [x1,idx] = sort(x(:,1))...

2 years ago | 2

Answered
Please help to solve the error in evaluating a system of odes using ode45
Rho_net is an array of length 365, but it must be a single scalar value in ode_2. If you want to evaluate the array at time t g...

2 years ago | 1

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 3

Answered
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 years ago | 0

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 2

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

Load more