-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Hi,
I appreciate the speed of your package but sometimes the package does not provide derivatives (jacobian in my case) while other packages do. This unfortunately prevents me from using it in my work.
Here are two MWEs representative of the issues I encounter:
using FastDifferentiation
𝐗 = make_variables(:𝐗, 31)
𝐘 = make_variables(:𝐘, 9)
eqs = FastDifferentiation.Node[ (((((-((exp((-(𝐘[1]) * (𝐘[3] + (𝐘[8] * 𝐗[30])))) * -(𝐘[1]))) * (1 / 𝐗[11])) * 𝐘[8]) * (𝐗[24] ^ -(𝐘[1]))) * (𝐗[27] ^ 𝐘[1])) * (𝐗[8] * (1 - 𝐘[1])))
(-(𝐘[8]) * (((exp((-(𝐘[1]) * (𝐘[3] + (𝐘[8] * 𝐗[30])))) * -(𝐘[1])) * ((𝐗[24] ^ (1 - 𝐘[1])) * (𝐗[27] ^ 𝐘[1]))) + (𝐗[27] * -(((1 - 𝐘[7]) * exp(-((𝐘[3] + (𝐘[8] * 𝐗[30])))))))))
0
((-((exp((-(𝐘[1]) * (𝐘[3] + (𝐘[8] * 𝐗[30])))) * -(𝐘[1]))) * 𝐘[8]) * ((𝐗[27] ^ 𝐘[1]) * (𝐗[24] ^ (1 - 𝐘[1])))) ]
jacobian(eqs,𝐘)
sparse_jacobian(eqs,𝐘)
eqs = Node[ (((((-((exp((-(𝐘[1]) * (𝐘[3] + (𝐘[8] * 𝐗[30])))) * -(𝐘[1]))) * (1 / 𝐗[11])) * 𝐘[8]) * (𝐗[24] ^ -(𝐘[1]))) * (𝐗[27] ^ 𝐘[1])) * (𝐗[8] * (1 - 𝐘[1])))
((((((-(exp((-(𝐘[1]) * (𝐘[3] + (𝐘[8] * 𝐗[30]))))) * -(𝐘[1])) * (1 / (((𝐗[23] * 𝐗[20]) * 𝐗[3]) * 𝐗[1]))) * 𝐘[8]) * (𝐗[24] ^ (1 - 𝐘[1]))) * (𝐗[27] ^ 𝐘[1])) * ((𝐘[2] * 𝐗[8]) * (1 - 𝐘[1])))
(-(𝐘[8]) * (((exp((-(𝐘[1]) * (𝐘[3] + (𝐘[8] * 𝐗[30])))) * -(𝐘[1])) * ((𝐗[24] ^ (1 - 𝐘[1])) * (𝐗[27] ^ 𝐘[1]))) + (𝐗[27] * -(((1 - 𝐘[7]) * exp(-((𝐘[3] + (𝐘[8] * 𝐗[30])))))))))
((-((exp((-(𝐘[1]) * (𝐘[3] + (𝐘[8] * 𝐗[30])))) * -(𝐘[1]))) * 𝐘[8]) * ((𝐗[27] ^ 𝐘[1]) * (𝐗[24] ^ (1 - 𝐘[1]))))]
jacobian(eqs,𝐘)
sparse_jacobian(eqs,𝐘)They error with variations of: ERROR: AssertionError: Should only be one path from root ... using FastDifferentiation v0.4.4
I understand you can go equation by equation but that undoes the speed gains from collecting subexpressions.
Any help would be much appreciated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels