IC for parametric ODE #1048
Replies: 3 comments 1 reply
-
Ok, I figured out 'Tensor' was just a tensorflow Tensor object... My first 3 input columns are my 3 parametric IC variables the 4th one is time. So I want to specify that My understanding is that 'boundary_func' should be minimized (return values as close to 0 as possible), so I set What I'm I doing wrong here? |
Beta Was this translation helpful? Give feedback.
-
I am not sure what problem you try to solve. |
Beta Was this translation helpful? Give feedback.
-
@lululxvi I'm trying to solve a system of ODEs, to solve the chemical evolution for 3 chemical elements (for this simple test). I have reaction rates at which elements convert into each other.
I can easily solve that with fixed initial conditions, but here I want to pass the initial conditions (initial abundances of my 3 elements) to the network to get the evolved abundances at a different time, aka. make it parametric.
and simply ignoring the initial conditions. But to my surprise, I found that the error was largest near t=0. So I wonder if it would help to set my initial conditions as This is what I tried, but got worse results with:
|
Beta Was this translation helpful? Give feedback.
-
Hi,
How can I set an initial condition that depends on the input?
I'm trying to add an IC to a parametric ODE, where my parametric y_input = y_output, at t=0.
From the FAQ (#485 (comment)) I thought I could use OperatorBC, but I can't figure out how to use it. Here's what I have tried.
Note: I have 3 parametric inputs and 3 matching outputs.
But this fails on the boundary_func on
np.abs(input[0:3] - output)
with:
"ValueError: Dimensions must be equal, but are 4 and 3 for '{{node sub_66}} = Sub[T=DT_FLOAT](strided_slice_121, dense_35/BiasAdd)' with input shapes: [?,4], [?,3]."
I was expecting input[:3] to be a np.array of 3 values, but it's this instead:
Tensor("strided_slice_119:0", shape=(4,), dtype=float32)
and output is
Tensor("strided_slice_120:0", shape=(3,), dtype=float32)
Any idea how to set this IC properly?
And also what are those Tensor variables??
Beta Was this translation helpful? Give feedback.
All reactions