Community Profile

Matthew Hunt

Last seen: Today Active since 2018

Content Feed

View by

Question

Can I get a better fit to data
I've written a code to find some parameters to a mathematical model but I can't seem to get a good fit to the experimental data....

13 hours ago | 0 answers | 0

0

Question

Use of fmincon with objective function as m-file
I am finding parameters for a model. I thought the best thing was to define the objective function that I wiah to minimise as f...

11 days ago | 2 answers | 0

2

Question

Can we get functions from the curve fitting toolbox?
I am using the curve fitting toolbox and I have some data that I want to create a function from. I am using a spline function to...

15 days ago | 2 answers | 0

2

Question

Solving PDEs with mixed derivatives
Suppose I have an equation of the form: Can I use pdepe to solve that equation as is, or do I have to do a co-ordinate tran...

24 days ago | 0 answers | 0

0

Implementing Crank Nicholson in spherical setting
Question resolved.

10 months ago | 0

| accepted

Question

Implementing Crank Nicholson in spherical setting
I am trying to solve the spherical diffusion equation using the Crank-Nicholson method. I think that I understand the method, I ...

11 months ago | 3 answers | 0

3

Question

Code doesn't terminate in the way that I want
I have a loop which changes the value of a vector at each iteration of the loop. I don't want the values in the loop to get grea...

11 months ago | 1 answer | 0

1

Question

My implemetation for Newton's method doesn't seem to be working
My goal is to solve the following set of nonlinear equations: for this I use the Newton method in the form: The code t...

1 year ago | 1 answer | 0

1

Question

I want to do a 1D integral of some 2D data
Suppose I have a function which is defined as some numerical data which is equally spaced and I wish to compute: How would I...

1 year ago | 2 answers | 0

2

Question

Speeding up pdepe calculation
I have a pdepe bit of code I want to speed up if I can. I have a (typically) 400x800 array as a source term, the code I'm curren...

2 years ago | 0 answers | 0

0

Question

Importing a two variable function into pdepe
Hi I want to solve a diffustion pde I understand how to do this if Q is a single variable function using interp1, but I do...

2 years ago | 1 answer | 0

1

Question

Empirical source terms with PDEPE
Suppose I'm solving an equation: ...

2 years ago | 1 answer | 0

1

Question

How do I include a user specified hessian function for fmincon?
I am working on an optimisation code and I have a Hessian function I wish fmincon to use. I'm currently having trouble trying to...

3 years ago | 1 answer | 0

1

Is it possible to store the intermediate values of fmincon?
So I had to do a lot of searching and turns out that this is possible without downloading code. The key was to use 'OutputFcn' i...

3 years ago | 0

| accepted

Question

Is it possible to store the intermediate values of fmincon?
If I'm runnning fmincon, and I want to see the values of the parameters at each iteration, is there a way to do this? The docum...

3 years ago | 5 answers | 0

5

Question

Defining a stopping criterion for fmincon
I am looking at an optimisation problem with the following objective function: ...

3 years ago | 1 answer | 0

1

Question

Objective function doesn't converge but jumps around
I have been trying to complete an optimisation problem. I am looking at radial heat diffusion on a cylinder. I want to tackle it...

3 years ago | 0 answers | 0

0

Question

Crank Nicholson method for cylindrical co-ordinates
I am trying to solve the heat equation in cylindrical co-ordinates using the Crank-Nicholson method, the basic equation along wi...

3 years ago | 0 answers | 0

0

Question

Converting anonymous function to a matrix
I have a function of the form: , which I want to evaluate. I could do this old school with a double loop but that would take t...

3 years ago | 1 answer | 0

1

Question

Diagonal matrices with spdiags
I'm working on a numerical solution to an equation and as part of this I have to solve a matrix solution. The system of equation...

3 years ago | 1 answer | 0

1

Question

Is there a way of removing these for loops to speed up my code?
I have the analytical solution to the following PDE: with boundary condition and and initial condition in the form of a Gr...

3 years ago | 1 answer | 0

1

Question

I have: Error using bsxfun Non-singleton dimensions of the two input arrays must match each other.
So I have some code which I want to get working and I don't understand the error which is being given to me which is: Error usin...

3 years ago | 2 answers | 0

2

Question

Interp1 returns NaN for a value
I have some data (x,f(x)) where 0<=x<=1 and I have N points. I wish to obtain f for an inteverval [a,b] which is well within the...

3 years ago | 1 answer | 1

1

Question

Tracking the size of a variable
Hi, I have a vector of length 200. When I run my program it somehow halfs in length, and I have no idea why. Is there a way of ...

4 years ago | 1 answer | 0

1

Not enough input arguments when doing global optinisation
I've seen what I need to do. The set up of the function is different to lsqcurvefit: I had to define the function as: fun = ...

4 years ago | 0

Question

Not enough input arguments when doing global optinisation
I am trying to use the global optimisation toolbox to find some parameters which will make a computed curve overlay some experim...

4 years ago | 1 answer | 0

1

Question

lsqcurvefit doesn't curve fit
I have a model which I want to paramtrise using lsqcurvefit. I have 10 parameters that I must find and I have 10 pieces of data ...

4 years ago | 2 answers | 0

2

Question

Error using lsqcurvefit (line 262) Function value and YDATA sizes are not equal.
I am using the following code: %Import data as time and voltage: load VoltageData.mat; load('OCP_Cathode.mat'); %Load the O...

4 years ago | 1 answer | 0

1

Question

Finding the multiple zeros within a prescribed interval
I wish to solve the nonlinar function: =0 within a prescribed interval, say (0,100] say, I'm aware of usi...

4 years ago | 1 answer | 0