I understand that to create individual time or space dependent functions, I can do the following:
syms V1(z) V2(z) V3(z) ...
However, I do not know in advance how many of these symbolic functions/variables I will need to create. Instead, the number of space dependent functions I will need depends on the size of a 2D square matrix that is passed to my function. Therefore, I cannot hard code the functions like I have above.
An example of what I am trying to solve:
S1 = dsolve(diff(V1(x),2) == V1(x))
S1 = dsolve(diff(V2(x),2) == V2(x))
S1 = dsolve(diff(V3(x),2) == V3(x))
S1 = dsolve(diff(V4(x),2) == V4(x))
S1 = dsolve(diff(V5(x),2) == V5(x))
I don't use the ode solver because neither do I know the boundary conditions nor do my equations vary as a function of time. Additionally, I have already tried the following:
N = 5;
V = sym(zeros(1,N));
V(i) = sym(sprintf('V%d(x)', i));
S = dsolve(diff(V(1),2) == V(1))
However, I get this error:
Error using symengine (line 58) Could not extract differential variables to solve for. Use 'solve' or 'vpasolve' to compute the solutions of non-differential equations.
Note: I am trying to avoid vpasolve like the plague
Thanks in advance,