Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
How to solve this system equation?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I am trying to solve the following system. I've tried with some functions but vpasolve is the only I found out that doesn't return an error, but returns empty variables....
How can I solve this?
L = 50e-6 : 10e-6 : 200e-6;
T = 0 : 1 : 100;
dndT = 2e-4;
dLdT = 6e-6;
syms m dlambdadT
eq1 = dlambdadT == (2 .* L/m) * dndT;
eq2 = dlambdadT == (2*n/m) * dLdT;
[sol_m, sol_dlambdadT] = vpasolve([(2 .* L/m) * dndT == dlambdadT,...
dlambdadT == (2*n/m) * dLdT],[m, dlambdadT],'random',true);
Thanks in advance!
2 Kommentare
John D'Errico
am 5 Jan. 2021
I fear that you may be confused. Certainly, you have posted a confusing question. The variable names you have chosen might indicate that you think you are trying to solve a system of ordinary DIFFERENTIAL equations. Yet nothing you have tried to use is an ODE solver.
To try to guess what you intend is nearly impossible for me.
You defined a vector T, but then you never use T as a variable.
You defined a vector L, that spans a range of numbers. You do use L later on, but not in any way that makes sense to MATLAB.
Then you define two constants, that have names that look like you think they are derivatives.
Then we see m and dlambdadT, as symbolic variables. Ok.
Two equations, named eq1 and eq2, that you don't use, but then it appears as it you try to pass the same things into vpasolve.
So, are you trying to solve this pair of equations, parametrically, as a function of L? That part seems trivial, at least at a glance. In fact, you can do it with pencil and paper. Since both equations are equal to dlambdadT, then set the right hand sides equal to each other, eliminating dlambdadT. You can recover it trivially later on.
So that leaves us with:
(2 .* L/m) * dndT == (2*n/m) * dLdT
L is known. m is an unknown. dLdT is known. But that leaves us with n. Where in the name of god and little green apples did you ever tell us what n is? You have told us dndT. Is that another hint that you think you are solving a differential equation?
Oh, yes, since we are not told the value, I have read elsewhere that n=42 is the answer to all questions.
Seriously, what you have posted as a question makes no sense at all, becasue we cannot infer what problem you really want to solve from code that is itself non-sensical and invalid.
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!