help-octave
[Top][All Lists]

## Re: ode45 issue: dimension mismatch

 From: Tweety Subject: Re: ode45 issue: dimension mismatch Date: Wed, 7 Feb 2018 08:22:44 +0100 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

```Hello, sorry for the confusion. Yes, what I meant was

dx/dt = M*(x^m)*(1-x)^n

>From my original post it became clear that M, m and n are constants.
When I let octave run on below code, I now get

warning: dx: some elements of return values are undefined.
error: ode45 [...] dimension mismatch

Still do not understand, t has been defined globally and in my thinking
x is supposed to be the outcome of ode45? If I define x = zeros(101,1)
within the function as seen in some examples on the internet, I get a
message on nonconformant arguments (op1 is 101x1, op2 is 101,1).

The dimensions of which variables must match?

Thanks,
Jan

clear; clc;
t = linspace(0,400,101);
x0 = [0, 0];
function f = dx(x,t)
M = 2.933e-5;
m = 0.158;
n = 1.26;
dx = M*(x.^m)*(1-x).^n;
endfunction
[t,x] = ode45(@dx, t, x0);

Am 07.02.2018 um 06:15 schrieb Svetlana Tkachenko:
> I am having difficulty parsing `dx = M*x^m(1-x)^n;`. What does it mean? I'd
> add more brackets for clarity.
>

```