By an amended six count petition, dated April 17, 1978, the defendant was charged with being a delinquent by reason of allegedly having committed certain acts in violation of our General Statutes. After a hearing on four of those counts,1 the court found the defendant responsible for the acts committed in two of them: physical injury to Samuel Coney, in violation of General Statutes § 53a-61, and physical injury to Thomas Dagata, in violation of the same section. The defendant was adjudicated a delinquent with respect to these two counts,2 and from that adjudication he has appealed.3
*159From the evidence presented at the hearing, the court could have reasonably found the following: The defendant was born on May 21, 1963. At all times relevant to the charges in the petition, he was under sixteen years of age. On June 24, 1975, the defendant had been committed to the commissioner of children and youth services, as a result of an adjudication of delinquency, for an indefinite period not to exceed two years. On June 14, 1977, the defendant’s commitment was extended for an indefinite period not to exceed two years.4
On August 6,1977, the defendant was in residence at Allyn Cottage at Long Lane School.5 On that date, Samuel Coney, Jr., a youth service officer (YSO) at Long Lane, was on duty at Allyn Cottage. Part of Coney’s duties included the control and supervision of the inmates of Allyn Cottage.
At about 11:30 a.m., the defendant, along with other boys, was outside the cottage cleaning the yard. A dispute and altercation arose between the defendant and another youth. Coney, informed of this incident, directed the defendant to return to the isolation room.
*160On the way back to the isolation room, a discussion ensued between Coney and the defendant. Upon arriving at the isolation room, the defendant refused to go in, and commenced to direct obscenities at Coney. Thereupon, Coney decided to telephone for a security officer.
As Coney proceeded to telephone the security officer, the defendant ran past him to the outside of the building. Coney did not pursue him, but called the security officer. About twenty to thirty minutes later, the defendant voluntarily returned to the cottage, and was found by Coney in the isolation room.
Coney requested the defendant, who was smoking a cigarette, to give him the cigarette and directed him to remove his clothes, with the exception of his underwear.6 The defendant refused to do either.
Coney told the defendant that he was going to call the security officer, and directed one of the other inmates to make the call. The defendant threatened to burn down the cottage if Coney called the security officer, and deliberately put his cigarette to a sheet on the mattress in the room. Coney grabbed the arm of the hand holding the cigarette. The defendant, using one of his elbows, struck Coney in the mouth, and split the inside of his lip.
In his right hand, the defendant had a metal-like pipe object, similar to the leg of a chair or table. Coney succeeded in taking the object from the *161defendant and threw it out of the room into the hallway. Coney and the defendant struggled until other members of the staff came and assisted in subduing the defendant.
On October 25,1977, the defendant was an inmate of Long Lane’s diagnostic and security unit, a maximum security facility operated by the department of children and youth services. On that date, Thomas Dagata, a TSO, was assigned to, and on duty at, that unit. That morning, Dagata was giving instructions to another inmate about the inmate’s job assignment. Without request, solicitation or provocation, the defendant injected himself into the discussion and questioned the authority of Dagata to give the inmate instructions. The defendant became belligerent towards Dagata, refused to go to his room to cool off, as requested by Dagata, and threatened Dagata, calling him an obscene name.
As Dagata approached the defendant, the defendant started swinging his arms, attempting to punch Dagata. In an effort to restrain him, Dagata grabbed the defendant, and a struggle ensued. The defendant threw a punch, hitting Dagata in the left eye, resulting in a cut and swelling. Another staff member assisted Dagata in mechanically restraining the defendant and placing him into his room. The defendant shouted obscenities at the staff, kicked the door, and made loud noises. After he calmed down, the mechanical restraints were removed, and the defendant was brought to the kitchen for breakfast with the rest of the inmates. After breakfast, the defendant went to the lounge without further incident.
*162After considering all of the evidence at the hearing, the court was satisfied beyond a reasonable doubt that the defendant voluntarily, knowingly and intentionally committed the third degree assaults, in violation of General Statutes § 53a-61, against both Coney and Dagata. On several grounds, the defendant appeals his adjudication of delinquency.
I
The heart of the defendant’s appeal, as he claims in his brief, is that the conditions and circumstances of his confinement constitute a complete defense to the alleged assault of August 6, 1977, and rebut the element of intent. He specifically claims, first, that duress and/or necessity constitute(s) a defense to the assault of Coney on that date, and, on various grounds,7 he claims that the trial court erred in failing to conclude that the defense(s) of duress and/or necessity had been established.
The United States Supreme Court has recently noted that although “[mjodern cases have tended to blur the distinction between duress and necessity,” common law historically distinguished *163between the two defenses. United States v. Bailey, 444 U.S. 394, 409-10, 100 S. Ct. 624, 62 L. Ed. 2d 575 (1980). “Duress was said to excuse criminal conduct where the actor was under an unlawful threat of imminent death or serious bodily injury, which threat caused the actor to engage in conduct violating the literal terms of the criminal law. While the defense of duress covered the situation where the coercion had its source in the actions of other human beings, the defense of necessity, or choice of evils, traditionally covered the situation where physical forces beyond the actor’s control rendered illegal conduct the lesser of two evils.” United States v. Bailey, supra, 409-10.
In Connecticut, the defense of duress has been codified. General Statutes § 53a-14, entitled “Duress as defense,” states: “In any prosecution for an offense, it shall be a defense that the defendant engaged in the proscribed conduct because he was coerced by the use or threatened imminent use of physical force upon him or a third person, which force a person of reasonable firmness in his situation would have been unable to resist. The defense of duress as defined in this section shall not be available to a person who intentionally or recklessly places himself in a situation in which it is probable that he will be subjected to duress.”8 There appears *164to be no statutory definition in Connecticut for the defense of necessity.9
In his argument, the defendant relies heavily on cases where duress and/or necessity were discussed as defenses against the crime of escape. We initially note that the offenses for which the defendant was found responsible were not offenses involving escape but rather assaults in the third degree. The defendant points to no cases where the defense of necessity or duress was successful against the crime of assault.
*165More importantly, although it appears as if all parties at the hearing below treated the defenses of duress and necessity as one, neither defense will be successful, as the United States Supreme Court has held, “if there was a reasonable, legal alternative to violating the law, ‘a chance both to refuse to do the criminal act and also to avoid the threatened harm.’ ” United States v. Bailey, supra, 410, citing LaFave & Scott, Handbook on Criminal Law 379 (1972).10
Upon a review of all the circumstances of this case, even taking into consideration all of the defendant’s requested findings and corrected findings, and his claims of error, relating to the duress/ necessity claim, we cannot conclude that the defendant did not have a “ ‘chance both to refuse to do the criminal act and also to avoid the threatened harm.’ ” United States v. Bailey, supra. There is no indication that the defendant ever attempted to resort to administrative or judicial channels to remedy his *166allegedly coercive detention conditions; see United States v. Boomer, 571 F.2d 543 (10th Cir.), cert. denied, 436 U.S. 911, 98 S. Ct. 2250, 56 L. Ed. 2d 411 (1978); People v. Richards, 269 Cal. App. 2d 768, 75 Cal. Rptr. 597 (1969); or that the conditions of his confinement or situation were such so as to excuse such an attempt. Accordingly, we find no error.
n
The defendant next claims that the court erred in failing to conclude that he was the subject of an illegal confinement, which circumstance, the defendant contends, constitutes a defense to the assaults committed.11
In State v. Kyles, 169 Conn. 438, 363 A.2d 97 (1975), we considered whether, under our statutes, illegal confinement is a defense to the offense of escape or assault on a correctional officer.12 We *167held that it was not. We particularly noted the wording of our present statutes on assault and escape, which eliminated from our prior legislation any prerequisite that a person be “legally” confined. State v. Kyles, supra, 441.13 In concluding that these statutes did not deprive a defendant of due process under either the federal or our state constitution, we stated: “That no person should take the law into his own hands is so basic to our legal tradition that it needs no citation. The statutes attacked by the plaintiff operate to protect the basic concept that criminal cases ought to be decided by evidence in the courts of law and not by combat at the prison walls. They operate to protect the legal system, to promote order and safety of persons, and to deter a detainee from prolonging his sentence should he be convicted. . . . The defendant’s proper remedy for any illegal detention was by resort to the courts by means of a writ of habeas corpus. It is the court, not the defendant, which has the authority to decide *168whether the defendant was lawfully confined.” State v. Kyles, supra, 441. We hold that these same principles apply with equal force to juvenile detentions. Accordingly, since an illegal confinement is not a defense, in either a criminal or juvenile delinquent context, to the crimes of escape or assault on a detention officer, we do not find reversible error with respect to any of the claims made by the defendant based on this defense.
HI
The defendant also claims that the medical and psychological testimony adduced at the delinquency hearing mitigates or negates the element of intent to commit the assaults in question. He claims that the facts “wholly negate the element of intent with regard to the alleged assault of October 25, 1977, and substantially mitigate his intent with regard to the alleged assault of August 6, 1977.” He thus contends that the court erred in finding that at the time of both assaults in question, “the respondent was not suffering from an epileptic seizure, nor any mental disease or defect that caused respondent to be unable to act knowingly, intentionally and voluntarily and without the exercise of his free will.”
Testimony was taken at the hearing, and the court found that the defendant, although highly intelligent, suffers from a hyperactive syndrome14 and psychomotor epilepsy.15 Drs. Dorothy Lewis and *169Janice Quintal both testified on behalf of the defendant. Lewis noted that she first became familiar with the defendant shortly before December 8, 1976. She stated the defendant had experienced an episode in March of 1977 where he had a very severe nosebleed and was extremely emotionally npset, banging his head against a wall, and later having no memory of the event. During July to November, 1977, she testified that although she attempted to treat the defendant, he was primarily in the care of Quintal. In response to a question asked by the defendant’s counsel whether “given an observation of a staff member of [the defendant] ‘wildly flinging his arms,’ would that be consistent with the [defendant’s] symptoms,” Lewis answered: “In [the defendant’s] situation, it could be.”
Dr. Quintal claimed she first became associated with the defendant in late August, 1977. Although she did not give testimony with respect to his psychomotor epilepsy,16 she did testify with regard to his hyperactive behavior. In response to a question posed by the defendant’s counsel, she stated that from what she knew of the defendant’s medical and psychological problems, the defendant’s conduct on August 6,1977, and October 25,1977, was symptomatic of his problems.
We have repeatedly stated that our review of the conclusion of the trier of fact, whether it be a judge, a panel of judges, or a jury, is limited. See *170State v. Perez, 182 Conn. 603, 606, 438 A.2d 1149 (1981); State v. Chetcuti, 173 Conn. 165, 172, 377 A.2d 263 (1977); State v. DiBattista, 110 Conn. 549, 148 A.2d 664 (1930). Upon a verdict of guilty, we review the evidence in the light most favorable to sustaining the verdict. State v. Zdanis, 182 Conn. 388, 391, 438 A.2d 696 (1980), cert. denied, 450 U.S. 1003, 101 S. Ct. 1715, 68 L. Ed. 2d 207 (1981).
“[T]he credibility of expert witnesses is a matter to be determined by the trier of fact.” State v. Cofone, 164 Conn. 162, 165, 319 A.2d 381 (1972), citing Whewell v. Ives, 155 Conn. 602, 607, 236 A.2d 92 (1967). In its consideration of the testimony of an expert witness, the trial court might weigh, as it sees fit, the expert’s “expertise, his opportunity to observe the defendant and to form an opinion, and his thoroughness. It might consider also the reasonableness of his judgments about the underlying facts and of the conclusions which he drew from them.” State v. Perez, supra, 610.
Upon a review of the entire record before us, including the testimony of the two individuals assaulted, the two experts, and the defendant himself, and in light of the fact that the intent of the actor is a question for the trier of fact, whose conclusion should stand unless it is unreasonable; see State v. Holley, 174 Conn. 22, 26, 381 A.2d 539 (1977); we cannot say that the court erred in concluding that the defendant intentionally, knowingly, and purposefully committed the assaults in question.
We note that the defendant’s own testimony— given before the two experts testified—with regard to the assault of August 6, 1977, was strikingly *171detailed. This would militate against the claim that he was unconscious, or undergoing an epileptic seizure, at that time.
After the experts testified, and the court indicated its skepticism with regard to the “seizure” defense because of the defendant’s detailed recollection of the August 6, 1977 assault, the defendant took the stand again and testified with regard to the October 25, 1978 assault. With respect to this incident, the defendant stated: “I remember [Dagata] grabbing me and I started screaming. That’s all.” Although the question of the defendant’s state of mind at this time is a eloser one, since the trier is the judge of the credibility of witnesses; State v. Holley, supra, 28; and in view of the fact that there was no substantial evidence tending to show that the defendant was experiencing a seizure at this time, we cannot hold that the trial court’s conclusion was an unreasonable one.17
*172IV
The defendant makes two more claims of error: (1) “[t]he court erred in overruling respondent’s [i.e., defendant’s] claim of law that a facility of the department of children and youth services is a treatment facility whose inmates have a right to treatment as differentiated from the status of Department of Corrections inmates”; and (2) “[t]he court erred in overruling respondent’s claim that the conditions endured by respondent were so inhumane as to fall below even the standards of the Department of Corrections pertaining to the treatment of prison inmates.” In effect, the defendant, in both of these contentions, as well as in other claims of error raised in his brief, desired the court below to hold that the conditions and circumstances of his confinement were unconstitutional.
We find no error in the trial court’s rulings. As the trial court stated, the hearing below was not one initiated by a juvenile under a habeas corpus petition challenging the circumstances or conditions of his confinement; nor was it an action brought by a *173juvenile seeking declaratory or injunctive relief. Rather, the hearing was initiated by the state, under a delinquency petition, charging the defendant with committing certain acts in violation of our statutes. The circumstances or conditions of the defendant’s confinement were only relevant insofar as they related to these charges. The court gave the defendant ample opportunity to present evidence on those defenses. If the defendant wishes to challenge the alleged unlawful conditions and circumstances of his confinement, he has appropriate means available to him.
There is no error.
In this opinion the other judged concurred.
A hearing was held on the following four counts: (1) On or about August 6, 1977, in Middletown, Connecticut, he did, with intent, cause physical injury to one Samuel Coney, in violation of General Statutes § 53a-61; (2) On or about August 6, 1977, in Middletown, Connecticut, he did intentionally damage the property of the state of Connecticut located at Long Lane School, in violation of General Statutes § 53a-117; (3) On or about August 6, 1977, in Middletown, Connecticut, he did intentionally attempt to cause physical injury to one Samuel Coney by means of a dangerous instrument, to wit: a pipe, in violation of General Statutes § 53a-49; and (4) On October 25, 1977, in Middletown, Connecticut, he did, with intent, cause physical injury to one Thomas Dagata, in violation of General Statutes § 53a-61.
In In Re Winship, 397 U.S. 358, 358-59, 90 S. Ct. 1068, 25 L. Ed. 2d 368 (1970), the United States Supreme Court held that proof beyond a reasonable doubt is required during the adjudicatory stage when a juvenile is charged with an act that would constitute a crime if committed by an adult.
By way of disposition, the eourt dismissed the matter because the defendant was already committed to the commissioner of chil*159dren and youth services, and, under an earlier extension of his commitment, he would have reached his sixteenth birthday before the period of his extended commitment expired. The eourt stated in part: “[T]he best interest of the respondent does not require that he be recommitted to the commissioner nor under these circumstances do his needs require the further services of this court as a result of this delinquency adjudication.”
At the commitment hearing of June 24, 1975, and the extension of commitment hearing of June 14, 1977, the defendant and his parents were represented by separate public defenders. No appeals were taken from the judgments rendered.
Allyn Cottage is one of a number of residential buildings at Long Lane School. It contains an isolation room.
Upon being placed in the isolation room, the usual procedure is that a child must take off all of his clothing, with the exception of his underwear.
In his brief, the defendant challenges the finding of the trial court that at the time of his assault on Coney, the defendant “was not coerced by the use or threatened use of physical force upon him or a third person, which force or threatened force a person of reasonable firmness in his situation would have been unable to resist as provided in section 53a-14 of the General Statutes.” Along with this elaim, the defendant asks us to correct the finding by including facts not found by the trial court, and by striking certain facts as having been found without evidence. Included under this duress/ necessity elaim, also, are the defendant’s contentions that the trial court erred in holding inadmissible a certain judgment and a stipulation for judgment, and in excluding certain testimony of the defendant and Thomas Dagata.
Our definition of duress was modeled after that approved by the American Law Institute in its Model Penal Code. Section 2.09 of that code, entitled “Duress,” states in part:
“(1) It is an affirmative defense that the actor engaged in the conduct charged to constitute an offense because he was eoerced to do so by the use of, or a threat to use, unlawful force against his person or the person of another, which a person of reasonable firmness in his situation would have been unable to resist.
“(2) The defense provided by this Section is unavailable if the actor recklessly placed himself in a situation in which it was probable *164that he would be subjected to duress. The defense is also unavailable if he was negligent in placing himself in such a situation, whenever negligence suffices to establish culpability for the offense charged.”
Compare § 35.05 of the New York Penal Law, which provides in part:
“Unless otherwise limited by the ensuing provisions of this article defining justifiable use of physical force, conduct which would otherwise constitute an offense is justifiable and not criminal when: ... 2. Such conduct is necessary as an emergency measure to avoid an imminent public or private injury which is about to occur by reason of a situation occasioned or developed through no fault of the actor, and which is of such gravity that, according to ordinary standards of intelligence and morality, the desirability and urgency of avoiding such injury clearly outweigh the desirability of avoiding the injury sought to be prevented by the statute defining the offense in issue. The necessity and justifiability of such conduct may not rest upon considerations pertaining only to the morality and advisability of the statute, either in its general application or with respect to its application to a particular class of eases arising thereunder. Whenever evidence relating to the defense of justification under this subdivision is offered by the defendant, the court shall rule as a matter of law whether the claimed facts and circumstances would, if established, constitute a defense.” This statute, derived from § 3.02 of the Model Penal Code, has been said to authorize the “defense of justification—or necessity, as it sometimes is called— in a limited number of cases where conduct otherwise condemned is found necessary as an emergency measure to avoid an imminent public or private injury about to occur through no fault of the actor, and the impending injury is of such gravity that the desirability and urgency of avoiding the injury clearly outweigh the objectives of the statute condemning the conduct.” People v. Brown, 68 App. Div. 2d 503, 508-509, 417 N.Y.S.2d 966 (1979).
The United States Supreme Court also cites, inter alia, in support of its holding, both § 2.09 (1) of the Model Penal Code (actor must succumb to a force or threat that “a person of reasonable firmness in his situation would have been unable to resist”) and § 3.02 (1) (actor must believe that commission of crime is “necessary” to avoid a greater harm). See United States v. Bailey, 444 U.S. 394, 410 n.9, 100 S. Ct. 624, 62 L. Ed. 2d 575 (1980). See also People v. Lovercamp, 43 Cal. App. 3d 823, 831-32, 118 Cal. Rptr. 110 (1974) (in the context of escape, “a limited defense of necessity is available if the following conditions exist: (1) The prisoner is faced with a specific threat of death, forcible sexual attack or substantial bodily injury in the immediate future; (2) There is no time for a complaint to the authorities or there exists a history of futile complaints which make any result from such complaints illusory; (3) There is no time or opportunity to resort to the courts; (4) There is no evidence of force or violence used towards prison personnel or other 'innocent' persons in the escape; and (5) The prisoner immediately reports to the proper authorities when he has attained a position of safety from the immediate threat.”); annot., 69 A.L.R.3d 678.
Included in this claim are the alleged errors of the trial court in finding certain facts without evidence, in not finding certain facts supported by the evidence, in denying the defendant’s motion for disclosure and production, in holding inadmissible the petition for extension of commitment, and in excluding certain testimony of the defendant and Dagata. As with the defendant’s first claim, because of our disposition of this matter, we need not reach the specifics of any of these claims.
The two statutes involved were General Statutes §§ 53a-60 and 53a-169. General Statutes § 53a-60, as amended, provides in pertinent part: “See. 53a-60. assault in the second degree: class d felony, (a) A person is guilty of assault in the second degree when: . . . (5) he is committed to the commissioner of correction, or is a parolee from a correctional institution and with intent to cause physical injury to an employee of the department of correction or an employee or member of the board of parole, he causes physical injury to such employee or member. . . .”
General Statutes § 53a-l69, as amended, provides in pertinent part: “Sec. 53a-169. escape in the first degree [, from a correctional institution] : class c felony, (a) A person is guilty of escape in the first degree (1) if he escapes from a correctional institution . . . .”
State v. Kyles, 169 Conn. 438, 441 n.2, 363 A.2d 97 (1975), notes:
“Prior to their repeal by 1969 Public Acts, No. 828, § 214, effective October 1, 1971, §§ 53-155 and 53-160, read as follows:
‘[General Statutes] Sec. 53-155. escape prom correctional institution. Any person legally confined in any correctional institution, except The Connecticut State Farm for Women, who escapes or attempts to escape from such institution or from any other institution to which he has been transferred from such institution or from the custody of any person in whose charge he has been placed by the warden or superintendent of such institution shall bo imprisoned not more than ten years.’ (Emphasis supplied.)
‘[General Statutes] Sec. 53-160. escape or attempt to escape with violence. Any person legally confined in any correctional institution, who escapes or attempts to escape therefrom and, in the execution of such escape or attempt, offers any violence to the person of any officer of such institution or of any person attempting to prevent his escape therefrom, shall be imprisoned not more than ten years.’ (Emphasis1 supplied.)”
The trial court found: “Hyperactive syndrome is sometimes referred to as minimal brain dysfunction, [and] ... is a syndrome in which many children have difficulties at times of sitting still, concentrating and focusing their attention on a task.”
The trial court found that “[p]sychomotor epilepsy is a condition characterized by periodic abnormal brain waves. Clinically it’s characterized by alterations in behavior and awareness, and sometimes by periodic episodes of aggressiveness, there is impaired memory or *169no memory at all for a particular episode. It can also be characterized by the person doing things or saying things over which the person has little control.”
Dr. Janice Quintal stated: “I can’t testify to the psyehomotor epilepsy because I don’t think I would know a seizure, per se, when I saw one.”
Although it appears that the defendant never specifically raised the insanity defense, i.e., General Statutes § 53a-13, at the hearing below, in his brief he equates his defense of lack of intent to that of insanity. At the time of the hearing, General Statutes § 53a-13 provided: “insanity as defense. In any prosecution for an offense, it shall be a defense that the defendant, at the time of the proscribed conduct, as a result of mental disease or defect lacked substantial capacity either to appreciate the wrongfulness of his conduct or to conform his conduct to the requirements of law. ... As used in this section, the terms mental disease or defect do not include an abnormality manifested only by repeated criminal or otherwise antisocial conduct.”
We have stated that: “Until substantial evidence tending to prove insanity comes into the case, the state is entitled to rely on the presumption that all persons accused of crime are sane. . . . Whether there was substantial evidence of insanity so as to plaee that issue in the case depends on whether ‘there was evidence sufficient, if credited, to raise a reasonable doubt as to the sanity of the defendant at the time’ of the proscribed conduct.” State v. Boy, 173 Conn. 35, 42-43, 376 A.2d 391 (1977). “As soon as substantial evidence tending to prove insanity comes into the case, the presumption loses all *172operative effect. The state may then rebut this evidence if it desires or submit the issue to the court upon the evidence offered . . . . Whether a defendant has succeeded in putting sanity in issue is a question of law for the trial court.” State v. dossier, 175 Conn. 204, 209, 397 A.2d 110 (1978).
Although it is unclear whether the court was explicitly presented with the defense of insanity, the court did conclude that at the time of both assaults, the defendant “was not suffering from an epileptie seizure, nor any mental disease or defect that caused respondent to be unable to act knowingly, intentionally and voluntarily and without the exercise of his free will.” Even if we assume that an insanity defense is properly before us, in view of the episodic nature of the defendant’s seizures, and the lack of substantial evidence placing his sanity in doubt at the times in question, we find no reversible error on this ground.