With the new ODE command (matlab 2024a), I'd like to parametrize the ICs and make, for example, x0=[p(1); p(5)] and then compute SENSITIVITIES!
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hans
el 3 de Jun. de 2024
Comentada: Hans
el 4 de Jun. de 2024
Hi, I was pleased to see that the SUNDIAL routines now become available on a lower level with the new ODE command. I'd like to use CVODES for computation of a solution + parametric sensitivities. However, I need to make one (or more) of the ICs for x (say, x0) to be parameters instead of numerical values. Right now this is not possible.
Are you intending to make the IC a function handle, so that I can say
x0 = @(p) [p(1); p(5)]
where the dynamics are given by a non-linear state space model xdot = f(x,u,p) and x is the vector with state variables x_i, for example? Would be really nice to have this, since then I can perform my analysis. I have a work around now, but do not like this solution. My ultimate goal is to include automatic differentation for all Jacobi matrices, including the IC (!), and get a very accurate solution for the sensitivities in this way.
Thanks in advance for your help.
2 comentarios
John D'Errico
el 3 de Jun. de 2024
I think you misunerstand what Answers is. You seem to be talking to "us" as if we have some control over the behavior of MathWorks supplied code. (That is, you use the words "are you intending" in your question.) We don't write the code. In general, we are not even employees at TMW. Answers is not technical support. It is not a direct line to the people who have written the code you use.
Respuesta aceptada
Steven Lord
el 3 de Jun. de 2024
If I understand what you're asking, I think you could just modify the Examine Parameter Sensitivity example on the ode documentation page to use the value of the variable p as the InitialValue property rather than using [2 3].
If you want to do this analysis for many different parameter values, just change the value of the InitialValue property of F then call solve in a loop.
If you're asking if you can specify the InitialValue as something like a symbolic variable (syms n and use n in InitialValue), the answer is no, not with the ode object. There are some differential equation solver functions in Symbolic Math Toolbox.
If that's not what you're looking for, please describe your goal in a little more detail, perhaps with a small example of actual equations similar to what you're trying to solve.
Más respuestas (0)
Ver también
Categorías
Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!