I need to make a system of N differential equations with N functions dependant on symbolic matht or other variable + Border Conditions. and solve it.
What I tried to do:
% dimension. in principle N can be any big
N = 3;% matrix of coefficients. here I set it manually for simplicity
a = [1, 2, 3; 4, 5, 6; 7, 8, 9];% make a set of N variables
b = sym('x_%d', [N, 1]);for i = 1 : N eqns(i) = sum(a(i, :) * b(:)) == diff(b(i));end
But as far as I do not use syms manually like that:
syms t x_1(t) x_2(t) x_3(t)
MatLab doesn't know that my variable should depend on t and therefore diff(b(i)) = 0 always. I don't even know how to set the Border Conditions this way, because MatLab doesn't let me make a matrix of conditions conds, where I could index the number of condition and set t = 0 at the same time.
Is there a solution to this issue?
Best Answer