-
Notifications
You must be signed in to change notification settings - Fork 33
Description
Hello,
I am very sorry to bother you again. With your help last time, I have made new research progress. Thank you very much. However, when dealing with InterpContinuousModel, I encountered a problem that I could not solve.
Now in 'opinf.operators' I intend to use InterpContinuousModel, but when I obey ParametricContinuousModel format, the code went wrong.
rom= opinf.ParametricROM(
basis=opinf.basis.PODBasis(residual_energy=1e-6),
ddt_estimator=opinf.ddt.UniformFiniteDifferencer(t, "ord6"),
model=opinf.models.InterpContinuousModel(
operators = [
opinf.operators.InterpLinearOperator(),
opinf.operators.InterpInputOperator(),
opinf.operators.InterpConstantOperator(),
],
solver=opinf.lstsq.L2Solver(regularizer=1e-1),
),
)
rom.fit(parameters = K_rom_train,states = c_scaled_train_data,inputs = Cr_rom_train)
This is the same as before,
- The shape of K_rom_trainis (205), where 41 is a different scalar parameter,5 is a different buondary,41*5=205; All parameters are repeated 5 times (number of boundaries)
- The shape of c_scaled_train_data is (205, N, T), where 205 is the corresponding parameter and duplicate value, N is the number of points, and T is the number of time points.
- The shape of Cr_rom_train is (205, T), where 205 is the corresponding parameter and duplicate value, the input is a 1D vector (with boundary conditions on the left sides ), and T is the number of time points.
Among them, N=64*64, T=120;But when I design the model like this, there will be error alerts
Last time you said:
"In your case, you have 10 parameter values but 4 sets of inputs, so there are 40 total training trajectories. This means K_list_train should have 40 entries, H_list_train should be a (40, N, T) array (or a list of 40 (N, T) arrays), and Hr_train should be a (40, 2, T) array (or a list of 40 (2, T) arrays). It's okay that K_list_train will have repeated entries."
I follow the input format you said last time.But report an error
ERROR:root:(ValueError) `x` must be strictly increasing sequence. (raised after 43.568697 s)
ValueError: `x` must be strictly increasing sequence.
Does the ERROR mean that the parameter must be a strictly increased sequence before interpolation can be applied? But I need to make the parameters repeat, because I am not only different for the parameters, but also different for the input (boundary conditions). When no input is involved (boundary conditions), the parameters do not need to be repeated, no errors are reported. But now that I want to use Interp and include inputs (boundary conditions), which involve duplicate parameters, what can I do to avoid errors?
Thank you very much for your help before. I really appreciate your timely reply and look forward to receiving your reply, because I really can't solve this problem independently based on ERROR only.
Looking forward to receiving your reply!